{"shim":"<script>\n// focusing a box or scrolling to something inside the phone never moves the website page around it\n(function(){try{var f=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(o){try{return f.call(this,{preventScroll:true})}catch(e){return f.call(this)}};\nElement.prototype.scrollIntoView=function(o){try{var r=this.getBoundingClientRect(),c=(o&&o.block==='center')?innerHeight/2-r.height/2:0;window.scrollBy(0,r.top-c)}catch(e){}};\ndocument.addEventListener('DOMContentLoaded',function(){[].forEach.call(document.querySelectorAll('[autofocus]'),function(e){e.removeAttribute('autofocus')})})}catch(e){}})();\n</script><script>\n(function(){function mem(){var m={},o={getItem:function(k){return Object.prototype.hasOwnProperty.call(m,k)?m[k]:null},setItem:function(k,v){m[k]=String(v)},removeItem:function(k){delete m[k]},clear:function(){m={}},key:function(i){return Object.keys(m)[i]||null}};Object.defineProperty(o,'length',{get:function(){return Object.keys(m).length}});return o}\n['localStorage','sessionStorage'].forEach(function(n){try{var t='__dbk';window[n].setItem(t,t);window[n].removeItem(t)}catch(e){try{Object.defineProperty(window,n,{value:mem(),configurable:true})}catch(x){}}})})();\nwindow.__dbkPath='/@@PAGE@@';window.__dbkPacked=true;\n// the sample is a picture of a phone: no notch or home-bar spacing, whatever the real phone viewing it reports\n['top','left','right'].forEach(function(k){document.documentElement.style.setProperty('--dbk-safe-'+k,'0px')});\n// a home-bar strip at the bottom, like a real iPhone, so the capture bar clears the phone's rounded corners\ndocument.documentElement.style.setProperty('--dbk-safe-bottom','22px');\n// pop-ups size themselves from the phone screen's real height (Safari on iPhone can measure a screen inside a frame as tiny, which cut pop-ups off)\n(function(){var H=document.documentElement,FE=null;try{FE=window.frameElement}catch(e){}\n// the app treats the phone as its whole screen, like on a real phone: it never measures the shrunk-down frame on the website (that read as a keyboard covering the bottom and pushed pop-ups up)\ntry{Object.defineProperty(window,'frameElement',{get:function(){return null},configurable:true})}catch(e){}\nfunction fit(){try{var fe=FE,h=(fe&&fe.clientHeight)||innerHeight;if(!h)return;var z=parseFloat(getComputedStyle(H).zoom)||1;H.style.setProperty('--dbk-vh',(h/100/z)+'px')}catch(e){}}fit();addEventListener('DOMContentLoaded',fit);addEventListener('load',fit);addEventListener('resize',fit);setTimeout(fit,600)})();\naddEventListener('load',function(){try{parent.postMessage({dbkReady:'@@PAGE@@'},'*')}catch(e){}});\n(function(){\n  function go(u){try{parent.dbkSampleGo(String(u))}catch(e){try{parent.postMessage({dbkGo:String(u)},'*')}catch(x){}}}\n  window.dbkNav=go;window.dbkGo=function(u){go(u)};\n  window.__dbkLoc={set href(u){go(u)},get href(){return location.href},replace:go,assign:go,reload:function(){go('@@PAGE@@'+(location.hash||''))}};\n  var h='@@HASH@@';if(h){try{location.hash=h}catch(e){}}\n  window.addEventListener('click',function(e){\n    if(e.defaultPrevented)return;\n    var a=e.target&&e.target.closest&&e.target.closest('a[href]');if(!a)return;\n    var href=a.getAttribute('href')||'';\n    if(!href||/^(javascript:|mailto:|tel:|sms:)/i.test(href))return;\n    e.preventDefault();\n    if(/^https?:/i.test(href)){try{window.open(href,'_blank','noopener')}catch(x){}return}\n    if(href.charAt(0)==='#'){if(location.hash!==href)location.hash=href;else window.dispatchEvent(new HashChangeEvent('hashchange'));return}\n    go(href);\n  });\n})();\n</script>","pages":{"index.html":"<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<!--@shim-->\n<!--@js:sample-seed.js-->\n\n    <meta name=\"apple-mobile-web-app-title\" content=\"2daysbook\">\n    <meta charset=\"UTF-8\">\n\n    <meta name=\"color-scheme\" content=\"light\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, viewport-fit=cover\">\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"apple-mobile-web-app-status-bar-style\" content=\"black-translucent\">\n    <meta name=\"mobile-web-app-capable\" content=\"yes\">\n    <meta name=\"theme-color\" content=\"#2f3a2c\">\n    <title>2daysbook</title>\n\n    <!--@js:sample-config.js-->\n<!--@js:entitlements.js-->\n<!--@js:modules.js-->\n    <!--@js:dbk-merge.js-->\n    <!--@js:dbk-split.js-->\n    <!--@js:dbk-moon.js-->\n    <!--@js:daybook-theme.js-->\n    <!--@js:dbk-look.js-->\n<!--@css:dbk-app-fonts.css-->\n<!--@css:shared.css-->\n<!--@js:shared.js-->\n<!--@js:dbk-sharing.js-->\n    \n    <style>\n        * { margin: 0; padding: 0; box-sizing: border-box; }\n        input, select, textarea { max-width: 100%; box-sizing: border-box; }\n\n        body {\n            background: var(--lh-bg) !important;\n            color: var(--lh-text);\n            font-family: var(--lh-font, 'Philosopher', Georgia, serif);\n            font-weight: 500;\n            min-height: calc(100 * var(--dbk-vh, 1vh));\n            line-height: 1.6;\n        }\n\n        .container { max-width: 860px; margin: 0 auto; padding: 76px 24px 110px; width: 100%; overflow-x: hidden; }\n/* Sync Status */\n\n        \n        .sync-status {\n            width: 12px;\n            height: 12px;\n            border-radius: 50%;\n            background: #666;\n            position: absolute;\n            right: 24px;\n            transition: background 0.3s;\n        }\n        .sync-status.synced {\n            background: var(--lh-accent);\n            animation: pulse 2s infinite;\n        }\n        .sync-status.connecting {\n            background: #999;\n            animation: pulse 1s infinite;\n        }\n        .sync-status.error {\n            background: var(--lh-secondary);\n        }\n        \n        @keyframes pulse {\n            0%, 100% { opacity: 1; }\n            50% { opacity: 0.5; }\n        }\n/* Container mobile overrides */\n\n        \n        @media (max-width: 768px) {\n            .container {\n                padding: 72px 16px 60px;\n            }\n/* Weather: current temp + hi/lo inline */\n            \n            .home-widget-pill:not(.moon) .widget-pill-text {\n                flex-direction: row;\n                align-items: baseline;\n                gap: 4px;\n            }\n        }\n        @media (max-width: 480px) {\n            .container {\n                padding: 68px 16px 56px;\n            }\n        }\n/* Header */\n        \n\n        .strip-widgets {\n            display: flex;\n            gap: 8px;\n        }\n        .home-widget-pill {\n            flex: 1;\n            display: flex;\n            align-items: center;\n            justify-content: center;\n            gap: 10px;\n            background: rgba(var(--lh-accent-rgb),0.06);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.12);\n            border-radius: 30px;\n            padding: 8px 13px;\n            cursor: pointer;\n            transition: background 0.2s, border-color 0.2s;\n        }\n        .home-widget-pill:hover {\n            background: rgba(var(--lh-accent-rgb),0.1);\n            border-color: rgba(var(--lh-accent-rgb),0.22);\n        }\n        .home-widget-pill.moon {\n            background: rgba(var(--lh-secondary-rgb),0.06);\n            border-color: rgba(var(--lh-secondary-rgb),0.12);\n        }\n        .home-widget-pill.moon:hover {\n            background: rgba(var(--lh-secondary-rgb),0.1);\n            border-color: rgba(var(--lh-secondary-rgb),0.22);\n        }\n        .widget-pill-text {\n            display: flex;\n            flex-direction: column;\n            line-height: 1.25;\n            min-width: 0;\n        }\n        .widget-pill-text span:first-child {\n            font-size: 0.82rem;\n            color: rgba(var(--lh-text-rgb),0.6);\n        }\n        .weather-range-inline {\n            font-size: 0.68rem;\n            color: rgba(var(--lh-text-rgb),0.32);\n            letter-spacing: 0.03em;\n            margin-left: 5px;\n        }\n        .home-widget-pill.moon .widget-pill-text span:first-child {\n            font-size: 0.82rem;\n            font-family: var(--lh-heading-font, var(--lh-font));\n            font-style: italic;\n            color: rgba(var(--lh-secondary-rgb),0.65);\n        }\n/* keep old .home-widget so JS references don't break */\n        \n        .home-widget { display: flex; align-items: center; gap: 7px; }\n        .header-photo-container {\n            width: 78px; height: 78px; flex-shrink: 0;\n            border-radius: 50%; overflow: hidden; position: relative;\n            border: 2px solid rgba(var(--lh-accent-rgb),0.3);\n            background: linear-gradient(145deg, var(--lh-accent) 0%, var(--lh-bg-darker) 100%);\n            transition: border-color 0.2s, box-shadow 0.2s;\n        }\n        .header-photo-inner { width: 100%; height: 100%; position: relative; overflow: hidden; }\n        .header-photo-draggable { position: absolute; cursor: default; }\n        .header-photo-draggable.editing { cursor: move; }\n        .header-photo-draggable img { display: block; pointer-events: none; }\n        .photo-placeholder {\n            position: absolute; top: 0; left: 0; width: 100%; height: 100%;\n            display: flex; align-items: center; justify-content: center;\n            color: rgba(var(--lh-text-rgb),0.2); font-size: 1.5rem;\n            cursor: pointer;\n        }\n/* Only show upload btn when no photo exists (placeholder visible) */\n        \n/* Subtle edit hint icon - always visible on photo */\n        \n        \n/* Photo edit overlay */\n        \n        \n/* Edit mode ring */\n        \n        \n        .header-photo-container.edit-mode {\n            border-color: rgba(var(--lh-accent-rgb),0.8);\n            box-shadow: 0 0 0 2px rgba(var(--lh-accent-rgb),0.3);\n        }\n        .home-greeting {\n            font-family: var(--lh-heading-font, 'Playfair Display', Georgia, serif) !important;\n            font-size: 1.75rem; font-weight: 700;\n            color: var(--lh-text);\n            margin: 0 0 3px; line-height: 1.2;\n        }\n        .home-names {\n            color: var(--lh-accent);\n            font-family: var(--lh-heading-font, 'Playfair Display', Georgia, serif) !important;\n            font-size: 1.5rem;\n            font-weight: 700;\n            margin: 0;\n            padding-left: 8px;\n            letter-spacing: 0;\n        }\n        .home-date {\n            color: rgba(var(--lh-accent-rgb),0.5);\n            font-size: 1.05rem;\n            letter-spacing: 0.03em;\n        }\n        .home-widget {\n            display: flex;\n            align-items: center;\n            gap: 7px;\n            color: rgba(var(--lh-accent-rgb),0.7);\n            font-size: 0.75rem;\n        }\n        .widget-svg-icon {\n            width: 22px; height: 22px;\n            flex-shrink: 0;\n            display: flex; align-items: center; justify-content: center;\n        }\n        .widget-svg-icon svg {\n            width: 100%; height: 100%;\n        }\n        .home-widget .widget-detail {\n            opacity: 0.6;\n            font-size: 0.6rem;\n            text-transform: uppercase;\n            letter-spacing: 0.04em;\n        }\n/* pill widget-detail */\n        \n        .widget-pill-text .widget-detail {\n            font-size: 0.6rem;\n            color: rgba(var(--lh-text-rgb),0.28);\n            text-transform: uppercase;\n            letter-spacing: 0.05em;\n            display: block;\n        }\n        .home-widget-pill.moon .widget-pill-text .widget-detail {\n            color: rgba(var(--lh-secondary-rgb),0.35);\n            letter-spacing: 0.06em;\n            font-size: 0.58rem;\n        }\n        .home-widget.moon {\n            color: rgba(var(--lh-secondary-rgb),0.65);\n            font-size: 0.72rem;\n        }\n        .moon-text {\n            display: flex; flex-direction: column;\n            line-height: 1.3;\n        }\n        .moon-text .widget-detail {\n            display: block;\n        }\n        .home-intention {\n            color: rgba(var(--lh-secondary-rgb),0.58);\n            font-size: 0.82rem;\n            font-style: italic;\n            margin: 0;\n            line-height: 1.55;\n            border: none;\n            padding: 0;\n        }\n/* Photo flanked row — time | photo | date */\n\n        \n/* Reminder Section - Floating Focus */\n\n        \n/* Desktop: Bold Asymmetric Hero */\n\n        \n        @media (min-width: 769px) {\n/* Top zone: photo + greeting left, intention right */\n            \n/* Photo left */\n            \n            .photo-wrapper {\n                order: -1;\n                flex-shrink: 0;\n                display: flex;\n                align-items: center;\n                margin: 0;\n                padding-left: 52px;\n            }\n            .header-photo-container {\n                width: 80px; height: 80px;\n            }\n/* Info splits greeting | intention */\n            \n/* Left: greeting + name */\n            \n            .home-greeting {\n                font-size: 2.1rem;\n                display: block;\n                margin-bottom: 2px;\n                line-height: 1.1;\n                white-space: nowrap;\n            }\n            .home-names {\n                display: block;\n                font-family: var(--lh-heading-font, 'Playfair Display', Georgia, serif) !important;\n                font-size: 1.5rem;\n                font-weight: 700;\n                color: rgba(var(--lh-accent-rgb),0.65);\n                padding-left: 4px;\n                margin-top: 2px;\n            }\n/* Right: intention */\n            \n            .home-intention {\n                font-size: 1.15rem;\n                margin: 0;\n                padding: 28px 40px 28px 44px;\n                margin-left: 40px;\n                border-left: 1px solid rgba(var(--lh-accent-rgb),0.1);\n                text-align: left;\n                max-width: none;\n                line-height: 1.7;\n                display: flex;\n                flex-direction: column;\n                justify-content: center;\n                flex: 1;\n            }\n            .home-intention::before {\n                content: \"today's intention\";\n                display: block;\n                font-size: 0.5rem;\n                text-transform: uppercase;\n                letter-spacing: 0.22em;\n                color: rgba(var(--lh-accent-rgb),0.3);\n                font-style: normal;\n                margin-bottom: 8px;\n            }\n/* Strip: full-width bottom bar */\n            \n            .strip-widgets {\n                display: contents;\n            }\n/* Weather goes left-aligned in col 1 */\n            \n            .home-widget-pill:not(.moon) {\n                grid-column: 1;\n                grid-row: 1;\n                justify-self: start;\n            }\n/* Moon goes right-aligned in col 3 */\n            \n            .home-widget-pill.moon {\n                grid-column: 3;\n                grid-row: 1;\n                justify-self: end;\n            }\n            .home-date {\n                font-size: 1.05rem;\n                white-space: nowrap;\n            }\n            .home-widget-pill {\n                padding: 0;\n                gap: 10px;\n                flex: 0 0 auto;\n                background: none !important;\n                border: none !important;\n                border-radius: 0;\n            }\n            .home-widget-pill:hover {\n                background: none !important;\n            }\n            .widget-pill-text span:first-child {\n                font-size: 1.05rem;\n            }\n            .home-widget-pill.moon .widget-pill-text span:first-child {\n                font-size: 1rem;\n            }\n            .widget-svg-icon {\n                width: 26px; height: 26px;\n            }\n            .widget-pill-text .widget-detail {\n                font-size: 0.72rem;\n            }\n/* weather range inline on desktop */\n            \n            .widget-pill-text {\n                flex-direction: row;\n                align-items: center;\n                gap: 6px;\n            }\n            .widget-pill-text .widget-detail {\n                font-size: 0.88rem;\n                text-transform: none;\n                letter-spacing: 0;\n                color: rgba(var(--lh-text-rgb),0.32);\n            }\n            .home-widget-pill.moon .widget-pill-text .widget-detail {\n                font-size: 0.65rem;\n                text-transform: uppercase;\n                letter-spacing: 0.06em;\n                color: rgba(var(--lh-secondary-rgb),0.35);\n            }\n/* Moon pill: keep stacked vertically on desktop */\n            \n            .home-widget-pill.moon .widget-pill-text {\n                flex-direction: column;\n                align-items: flex-start;\n                gap: 2px;\n            }\n        }\n/* Add Contact Modal */\n        \n\n/* Left accent bar */\n        \n        .reminder-title {\n            font-size: 1.1rem; color: var(--lh-text); font-weight: 500;\n            margin-bottom: 4px; line-height: 1.35; overflow-wrap: break-word;\n            padding-left: 2px;\n        }\n        .reminder-due { font-size: 0.8rem; color: var(--lh-secondary); font-weight: 500; }\n        .reminder-badge {\n            font-size: 0.55rem;\n            text-transform: uppercase;\n            letter-spacing: 0.2em;\n            color: rgba(var(--lh-accent-rgb),0.4);\n            background: rgba(var(--lh-accent-rgb),0.08);\n            padding: 3px 8px;\n        }\n        .reminder-links { display: flex; gap: 10px; margin-top: 12px; padding-left: 2px; }\n        .reminder-links:empty { display: none; }\n        .reminder-link {\n            background: rgba(var(--lh-accent-rgb),0.12);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.3);\n            color: var(--lh-accent);\n            padding: 6px 14px;\n            text-decoration: none;\n            font-size: 0.78rem;\n            font-weight: 500;\n            font-family: inherit;\n            transition: all 0.2s ease;\n            white-space: nowrap;\n        }\n        .reminder-link:hover {\n            background: rgba(var(--lh-accent-rgb),0.2);\n            border-color: var(--lh-accent);\n        }\n/* Action row - inside card */\n\n        \n        .reminder-count {\n            font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.15em;\n            color: rgba(var(--lh-text-rgb),0.25); margin-left: 4px;\n        }\n/* ===== ENHANCED ADD EVENT MODAL ===== */\n        \n        .form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }\n        .form-row-2 .form-group { margin-bottom: 0; }\n        .allday-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }\n        .allday-toggle {\n            width: 30px; height: 16px; min-width: 30px;\n            background: rgba(var(--lh-accent-rgb),0.1);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.2); border-radius: 8px;\n            cursor: pointer; position: relative; flex-shrink: 0;\n            transition: background 0.2s, border-color 0.2s;\n            padding: 0; box-sizing: border-box;\n        }\n        .allday-toggle::after {\n            content: ''; position: absolute; top: 2px; left: 2px;\n            width: 10px; height: 10px; border-radius: 50%;\n            background: rgba(var(--lh-accent-rgb),0.4); transition: left 0.2s, background 0.2s;\n        }\n        .allday-toggle.on { background: rgba(var(--lh-accent-rgb),0.25); border-color: rgba(var(--lh-accent-rgb),0.6); }\n        .allday-toggle.on::after { left: 16px; background: var(--lh-accent); }\n        .allday-label { font-size: 0.75rem; color: rgba(var(--lh-text-rgb),0.45); cursor: pointer; user-select: none; }\n        .color-picker-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n        .color-dot-btn {\n            width: 22px; height: 22px; min-width: 22px; min-height: 22px;\n            border-radius: 50%; border: 2px solid transparent;\n            cursor: pointer; transition: transform 0.15s, border-color 0.15s;\n            flex-shrink: 0; padding: 0; box-sizing: border-box;\n        }\n        .color-dot-btn:hover { transform: scale(1.15); }\n        .color-dot-btn.selected { border-color: var(--lh-text); transform: scale(1.2); }\n        .color-dot-none {\n            width: 22px; height: 22px; min-width: 22px; min-height: 22px;\n            border-radius: 50%; border: 1.5px solid rgba(var(--lh-text-rgb),0.2);\n            cursor: pointer; display: flex; align-items: center; justify-content: center;\n            font-size: 0.7rem; line-height: 1; color: rgba(var(--lh-text-rgb),0.3);\n            flex-shrink: 0; transition: border-color 0.15s; padding: 0; box-sizing: border-box;\n        }\n        .color-dot-none.selected, .color-dot-none:hover { border-color: rgba(var(--lh-text-rgb),0.5); color: rgba(var(--lh-text-rgb),0.5); }\n        .multi-date-entry {\n            background: rgba(var(--lh-accent-rgb),0.05); border: 1px solid rgba(var(--lh-accent-rgb),0.12);\n            padding: 10px 12px; margin-bottom: 6px;\n        }\n        .multi-date-entry-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }\n        .multi-date-label { font-size: 0.78rem; color: var(--lh-text); font-weight: 500; }\n        .multi-date-remove {\n            background: none; border: none; cursor: pointer; color: rgba(var(--lh-secondary-rgb),0.5);\n            font-size: 0.9rem; padding: 0; line-height: 1; transition: color 0.2s;\n        }\n        .multi-date-remove:hover { color: var(--lh-secondary); }\n        .multi-date-times { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }\n        .multi-date-times label { font-size: 0.65rem; color: rgba(var(--lh-text-rgb),0.35); text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 4px; }\n        .multi-date-times input[type=time] {\n            width: 100%; background: var(--lh-bg-darker);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.2); color: var(--lh-text);\n            padding: 7px 10px; font-size: 0.82rem; font-family: inherit;\n        }\n        .event-item[data-color=\"rose\"]     { border-left-color: #e8b4b8; }\n        .event-item[data-color=\"sage\"]     { border-left-color: #a3b899; }\n        .event-item[data-color=\"teal\"]     { border-left-color: #7ab8b0; }\n        .event-item[data-color=\"gold\"]     { border-left-color: #c9a96e; }\n        .event-item[data-color=\"lavender\"] { border-left-color: #b4a8c9; }\n        .event-item[data-color=\"slate\"]    { border-left-color: #8a9bb0; }\n        .event-location { font-size: 0.72rem; color: rgba(var(--lh-text-rgb),0.4); margin-top: 2px; }\n/* ===== END ENHANCED ADD EVENT MODAL ===== */\n/* ===== ACTION CARD TABS ===== */\n        \n\n        \n/* ===== CALENDAR COLLAPSE ===== */\n\n        \n        .calendar-summary-preview {\n            font-size: 0.8rem; color: var(--lh-text-muted);\n            white-space: nowrap; overflow: hidden; text-overflow: ellipsis;\n            min-width: 0;\n        }\n        .calendar-summary-preview.empty { color: var(--lh-text-faint); font-style: italic; }\n        .calendar-full-view {\n            overflow: hidden; max-height: 0;\n            transition: max-height 0.3s ease;\n        }\n        .calendar-full-view.expanded { max-height: 2000px; }\n        .calendar-full-view .calendar-header { padding-top: 16px; }\n/* ===== END LAYOUT CHANGES ===== */\n/* Navigation */\n        \n\n        \n/* Section Cards */\n\n        \n        .section {\n            background: var(--lh-bg-darker);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.3);\n            padding: 22px; margin-bottom: 20px;\n            overflow-x: hidden;\n        }\n        .section-title {\n            font-size: 0.75rem; font-weight: 500;\n            letter-spacing: 0.2em; text-transform: uppercase;\n            color: var(--lh-accent); margin-bottom: 16px;\n            transition: color 0.2s;\n        }\n        .dual-section { cursor: pointer; }\n        .dual-section .collapsible-content { cursor: default; }\n        .dual-section:hover .section-title { color: var(--lh-secondary); }\n        .dual-section:hover .expand-icon { color: var(--lh-secondary); }\n/* Calendar */\n\n        \n        .calendar-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }\n        .calendar-nav { display: flex; align-items: center; gap: 8px; }\n        .calendar-nav button {\n            background: transparent; border: 1px solid var(--lh-accent-border);\n            color: var(--lh-accent); padding: 5px 10px; cursor: pointer;\n            font-size: 0.75rem; font-family: inherit; transition: all 0.2s;\n        }\n        .calendar-nav button:hover { background: var(--lh-secondary-muted); border-color: var(--lh-secondary-border); color: var(--lh-secondary); }\n        .calendar-title { color: var(--lh-text); font-size: 0.9rem; letter-spacing: 0.08em; }\n        .calendar-view-toggle { display: flex; gap: 0; }\n        .view-toggle-btn {\n            background: transparent; border: 1px solid var(--lh-accent-muted);\n            border-right: none;\n            color: rgba(var(--lh-accent-rgb),0.5); padding: 5px 10px; cursor: pointer;\n            font-size: 0.68rem; font-family: inherit; transition: all 0.2s;\n        }\n        .view-toggle-btn:last-child { border-right: 1px solid var(--lh-accent-muted); }\n        .view-toggle-btn:hover { color: var(--lh-secondary); border-color: var(--lh-secondary-border); }\n        .view-toggle-btn.active { background: var(--lh-accent-muted); border-color: var(--lh-accent-border); color: var(--lh-accent); }\n        .view-toggle-btn.add-event-inline {\n            margin-right: 6px;\n            border-right: 1px solid var(--lh-accent-muted);\n        }\n/* Page Nav Pills */\n/* Month Grid */\n        \n        \n        .calendar-grid {\n            display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px;\n        }\n        .calendar-day-header {\n            background: var(--lh-accent-muted); padding: 8px 4px;\n            text-align: center; font-size: 0.7rem; color: var(--lh-accent);\n            text-transform: uppercase; letter-spacing: 0.1em;\n        }\n        .calendar-month-day {\n            background: var(--lh-bg-darker); padding: 8px;\n            min-height: 70px; cursor: pointer; transition: all 0.2s;\n            border: 1px solid transparent;\n        }\n        .calendar-month-day:hover { background: var(--lh-bg-darker); border-color: var(--lh-accent-border); }\n        .calendar-month-day.today { background: var(--lh-accent-muted); border-color: var(--lh-accent); }\n        .calendar-month-day.other-month { opacity: 0.4; }\n        .calendar-month-day .day-number {\n            font-size: 0.9rem; color: var(--lh-text); margin-bottom: 4px;\n         font-weight: 600;}\n        .calendar-month-day.today .day-number { color: var(--lh-accent); font-weight: 700; }\n        .calendar-month-day .day-count {\n            font-size: 0.7rem; color: var(--lh-secondary); \n        }\n        .calendar-month-day .day-dot {\n            width: 6px; height: 6px; background: var(--lh-accent); border-radius: 50%;\n            display: inline-block; margin-right: 3px;\n        }\n/* List view days (2-day and week) */\n        \n        \n/* List view styles (2-day and week) */\n        \n        \n        .week-day {\n            background: var(--lh-bg-darker); padding: 12px 14px;\n            border: 1px solid var(--lh-accent-muted); margin-bottom: 6px;\n        }\n        .week-day.today { border-color: var(--lh-accent); background: var(--lh-accent-muted); }\n        .week-day-header {\n            display: flex; justify-content: space-between; align-items: center;\n            margin-bottom: 8px; padding-bottom: 6px;\n            border-bottom: 1px solid var(--lh-accent-muted);\n        }\n        .week-day-rel {\n            font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.18em;\n            color: var(--lh-secondary); font-weight: 600; line-height: 1;\n        }\n        .week-day-name { color: var(--lh-text); font-size: 0.85rem; font-weight: 600; }\n        .week-day-date { color: rgba(var(--lh-accent-rgb),0.5); font-size: 0.75rem; }\n        .event-item {\n            display: flex; justify-content: space-between; align-items: flex-start;\n            background: rgba(var(--lh-accent-rgb),0.1); padding: 8px 12px;\n            margin-bottom: 4px; border-left: 2px solid var(--lh-accent);\n        }\n        .event-title { color: var(--lh-text); font-size: 0.82rem; margin-bottom: 2px; font-weight: 500; overflow-wrap: break-word; word-break: break-word; }\n        .event-note { color: rgba(var(--lh-text-rgb),0.45); font-size: 0.75rem; font-style: italic; }\n/* Event check-off heart */\n\n        \n        .event-check {\n            background: transparent; border: none;\n            cursor: pointer; margin-right: 10px; margin-top: 1px;\n            flex-shrink: 0; padding: 0;\n            font-size: 1rem; line-height: 1;\n            transition: transform 0.2s ease;\n            min-height: auto; min-width: auto;\n        }\n        .event-check::after { content: '♡'; color: rgba(var(--lh-secondary-rgb),0.4); }\n        .event-check:hover::after { color: rgba(var(--lh-secondary-rgb),0.7); }\n        .event-check.checked::after { content: '\\2665\\FE0E'; color: var(--lh-secondary); }\n        .event-check.checked:hover::after { color: var(--lh-secondary); }\n        .event-check.checked { transform: scale(1.1); }\n        .event-item.done { opacity: 0.45; }\n        .event-item.done .event-title { text-decoration: line-through; }\n        .event-item.done .event-note { text-decoration: line-through; }\n/* Event Action Buttons */\n        \n        \n        .event-actions {\n            display: flex;\n            gap: 6px;\n            flex-shrink: 0;\n        }\n        .event-edit-btn, .event-delete-btn {\n            padding: 6px 12px;\n            font-size: 0.75rem;\n            border: 1px solid;\n            background: transparent;\n            cursor: pointer;\n            font-family: inherit;\n            transition: all 0.2s ease;\n            font-weight: 500;\n        }\n        .event-edit-btn {\n            color: var(--lh-accent);\n            border-color: var(--lh-accent);\n        }\n        .event-edit-btn:hover {\n            background: rgba(var(--lh-accent-rgb),0.2);\n        }\n        .event-delete-btn {\n            color: var(--lh-secondary);\n            border-color: var(--lh-secondary);\n        }\n        .event-delete-btn:hover {\n            background: rgba(var(--lh-secondary-rgb),0.2);\n        }\n        \n        .empty-state { color: rgba(var(--lh-text-rgb),0.4); font-size: 0.85rem; font-style: italic; padding: 8px 0; }\n/* Day Detail Modal */\n        \n        \n        .day-modal-overlay {\n            position: fixed; top: 0; left: 0; right: 0; bottom: 0;\n            background: rgba(0, 0, 0, 0.7); z-index: 2000;\n            display: none; align-items: center; justify-content: center;\n            padding: 64px 12px 12px;\n        }\n        .day-modal-overlay.visible { display: flex; }\n/* Add Event Modal */\n        \n        \n        .modal-overlay {\n            position: fixed; top: 0; left: 0; right: 0; bottom: 0;\n            background: rgba(0, 0, 0, 0.7); z-index: 2000;\n            display: none; align-items: center; justify-content: center;\n            padding: 64px 12px 12px;\n        }\n        .modal-overlay.visible { display: flex; }\n        .modal {\n            background: var(--lh-bg); border: 1px solid var(--lh-accent-border);\n            width: 100%; max-width: 480px; max-height: calc(85 * var(--dbk-vh, 1vh));\n            overflow-y: auto; overflow-x: hidden; border-radius: 4px;\n        }\n        .modal-header {\n            display: flex; justify-content: space-between; align-items: center;\n            padding: 14px 18px;\n            border-bottom: 1px solid var(--lh-accent-muted);\n        }\n        .modal-title { font-size: 1.05rem; color: var(--lh-text); font-weight: 600; }\n        .modal-close {\n            background: transparent; border: none; color: var(--lh-secondary);\n            font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;\n        }\n        .modal-close:hover { color: var(--lh-text); }\n        .modal-body { padding: 16px 18px; }\n        \n        .day-modal {\n            background: var(--lh-bg); border: 1px solid var(--lh-accent-border);\n            width: 100%; max-width: 440px; max-height: calc(80 * var(--dbk-vh, 1vh));\n            overflow-y: auto; overflow-x: hidden; padding: 18px;\n        }\n        .day-modal-header {\n            display: flex; justify-content: space-between; align-items: center;\n            margin-bottom: 14px; padding-bottom: 10px;\n            border-bottom: 1px solid var(--lh-accent-muted);\n        }\n        .day-modal-title { font-size: 1rem; color: var(--lh-text); }\n        .day-modal-close {\n            background: transparent; border: none; color: var(--lh-secondary);\n            font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;\n        }\n        .day-modal-close:hover { color: var(--lh-text); }\n        .day-modal-events { margin-bottom: 20px; }\n        .day-modal-event {\n            background: var(--lh-bg-darker); padding: 14px;\n            margin-bottom: 10px; border-left: 2px solid var(--lh-accent);\n        }\n        .day-modal-event-header {\n            display: flex; justify-content: space-between; align-items: flex-start;\n            margin-bottom: 6px;\n        }\n        .day-modal-event-title { color: var(--lh-text); font-size: 0.95rem; overflow-wrap: break-word; word-break: break-word; }\n        .day-modal-event-actions { display: flex; gap: 8px; }\n        .day-modal-event-actions button {\n            background: transparent; border: none; cursor: pointer;\n            font-size: 0.75rem; padding: 2px 6px; transition: color 0.2s;\n        }\n        .day-modal-edit { color: rgba(var(--lh-accent-rgb),0.6); }\n        .day-modal-edit:hover { color: var(--lh-accent); }\n        .day-modal-delete { color: rgba(var(--lh-secondary-rgb),0.5); }\n        .day-modal-delete:hover { color: var(--lh-secondary); }\n        .day-modal-event-time { font-size: 0.8rem; color: var(--lh-secondary); margin-bottom: 4px; }\n        .day-modal-event-note { font-size: 0.82rem; color: rgba(var(--lh-text-rgb),0.55); font-style: italic; margin-top: 3px; }\n        .day-modal-event-meta { font-size: 0.78rem; color: rgba(var(--lh-secondary-rgb),0.7); margin-bottom: 3px; }\n        .day-modal-event-location { font-size: 0.75rem; color: rgba(var(--lh-text-rgb),0.4); margin-top: 3px; }\n        .day-modal-event-location::before { content: '\\2316  '; }\n        .day-modal-event-url { display:inline-block; font-size:0.72rem; color:rgba(var(--lh-accent-rgb),0.6); text-decoration:none; margin-top:4px; border-bottom:1px solid rgba(var(--lh-accent-rgb),0.25); }\n        .day-modal-event-url:hover { color:var(--lh-accent); }\n        .day-modal-event[data-color=\"rose\"]     { border-left-color: #e8b4b8; }\n        .day-modal-event[data-color=\"sage\"]     { border-left-color: #a3b899; }\n        .day-modal-event[data-color=\"teal\"]     { border-left-color: #7ab8b0; }\n        .day-modal-event[data-color=\"gold\"]     { border-left-color: #c9a96e; }\n        .day-modal-event[data-color=\"lavender\"] { border-left-color: #b4a8c9; }\n        .day-modal-event[data-color=\"slate\"]    { border-left-color: #8a9bb0; }\n        .day-modal-empty { color: rgba(var(--lh-text-rgb),0.4); font-style: italic; padding: 20px 0; text-align: center; }\n        .day-modal-add {\n            width: 100%; background: transparent;\n            border: 1px solid var(--lh-accent-border); color: var(--lh-accent);\n            padding: 12px; cursor: pointer; font-size: 0.85rem;\n            font-family: inherit; transition: all 0.2s;\n        }\n        .day-modal-add:hover { background: var(--lh-accent-muted); border-color: var(--lh-accent); }\n/* Edit form in modal */\n        \n        \n        .day-modal-form { display: none; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--lh-accent-muted); }\n        .day-modal-form.visible { display: block; }\n        .day-modal-form input, .day-modal-form textarea {\n            width: 100%; background: var(--lh-bg-darker);\n            border: 1px solid var(--lh-accent-muted); color: var(--lh-text);\n            padding: 10px 12px; font-size: 0.9rem; font-family: inherit;\n            margin-bottom: 10px;\n        }\n        .day-modal-form input:focus, .day-modal-form textarea:focus {\n            outline: none; border-color: var(--lh-accent-border);\n        }\n        .day-modal-form-row { display: flex; gap: 10px; }\n        .day-modal-form-row input { flex: 1; }\n        .day-modal-form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }\n/* Reminder Management Modal */\n        \n        \n        .reminder-modal-overlay {\n            position: fixed; top: 0; left: 0; right: 0; bottom: 0;\n            background: rgba(0, 0, 0, 0.7); z-index: 2000;\n            display: none; align-items: center; justify-content: center;\n            padding: 64px 12px 12px;\n        }\n        .reminder-modal-overlay.visible { display: flex; }\n        .reminder-modal {\n            background: var(--lh-bg); border: 1px solid var(--lh-accent-border);\n            width: 100%; max-width: 480px; max-height: calc(85 * var(--dbk-vh, 1vh));\n            overflow-y: auto; overflow-x: hidden; padding: 18px;\n        }\n        .reminder-modal-header {\n            display: flex; justify-content: space-between; align-items: center;\n            margin-bottom: 14px; padding-bottom: 10px;\n            border-bottom: 1px solid var(--lh-accent-muted);\n        }\n        .reminder-modal-title { font-size: 1rem; color: var(--lh-text); }\n        .reminder-modal-close {\n            background: transparent; border: none; color: var(--lh-secondary);\n            font-size: 1.5rem; cursor: pointer; padding: 0; line-height: 1;\n        }\n        .reminder-modal-close:hover { color: var(--lh-text); }\n        .reminder-list { margin-bottom: 20px; }\n        .reminder-list-item {\n            border-bottom: 1px solid rgba(var(--lh-accent-rgb),0.1);\n            overflow-wrap: break-word;\n            word-break: break-word;\n        }\n        .reminder-list-item:last-child { border-bottom: none; }\n        .reminder-list-item.overdue .reminder-list-row { border-left: 2px solid rgba(var(--lh-secondary-rgb),0.6); }\n        .reminder-list-row {\n            display: flex; align-items: center; gap: 10px;\n            padding: 11px 4px;\n            cursor: pointer;\n            border-left: 2px solid transparent;\n            transition: border-color 0.2s;\n            user-select: none;\n        }\n        .reminder-list-row:hover { border-left-color: rgba(var(--lh-accent-rgb),0.35); }\n        .reminder-list-item.open .reminder-list-row { border-left-color: rgba(var(--lh-accent-rgb),0.55); }\n        .reminder-list-chevron {\n            color: rgba(var(--lh-accent-rgb),0.3); font-size: 0.6rem;\n            transition: transform 0.2s; flex-shrink: 0; width: 10px;\n        }\n        .reminder-list-item.open .reminder-list-chevron { transform: rotate(90deg); color: rgba(var(--lh-accent-rgb),0.7); }\n        .reminder-list-title { color: var(--lh-text); font-size: 0.9rem; flex: 1; min-width: 0; overflow-wrap: break-word; }\n        .reminder-list-due {\n            font-size: 0.68rem; color: rgba(var(--lh-text-rgb),0.35);\n            white-space: nowrap; flex-shrink: 0;\n            padding: 2px 7px; border-radius: 20px;\n            background: rgba(var(--lh-accent-rgb),0.07);\n        }\n        .reminder-list-item.overdue .reminder-list-due {\n            color: rgba(var(--lh-secondary-rgb),0.7); background: rgba(var(--lh-secondary-rgb),0.08);\n        }\n        .reminder-list-details {\n            display: none; padding: 0 4px 12px 22px;\n        }\n        .reminder-list-item.open .reminder-list-details { display: block; }\n        .reminder-list-meta {\n            font-size: 0.75rem; color: rgba(var(--lh-text-rgb),0.4);\n            display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 8px;\n        }\n        .reminder-list-actions { display: flex; gap: 8px; margin-top: 8px; }\n        .reminder-list-actions button {\n            background: transparent; border: 1px solid; cursor: pointer;\n            font-size: 0.72rem; padding: 4px 12px; border-radius: 6px;\n            font-family: inherit; transition: all 0.15s;\n        }\n        .reminder-edit-btn { color: rgba(var(--lh-accent-rgb),0.6); border-color: rgba(var(--lh-accent-rgb),0.2); }\n        .reminder-edit-btn:hover { color: var(--lh-accent); border-color: rgba(var(--lh-accent-rgb),0.5); background: rgba(var(--lh-accent-rgb),0.08); }\n        .reminder-delete-btn { color: rgba(var(--lh-secondary-rgb),0.5); border-color: rgba(var(--lh-secondary-rgb),0.15); }\n        .reminder-delete-btn:hover { color: var(--lh-secondary); border-color: rgba(var(--lh-secondary-rgb),0.4); background: rgba(var(--lh-secondary-rgb),0.07); }\n        .reminder-empty { \n            color: rgba(var(--lh-text-rgb),0.4); font-style: italic; \n            text-align: center; padding: 20px 0; \n        }\n        \n        .form-group { margin-bottom: 12px; }\n        .form-group label { display: block; font-size: 0.7rem; color: var(--lh-accent); margin-bottom: 4px; text-transform: uppercase; letter-spacing: 0.1em; }\n        .form-group input, .form-group select, .form-group textarea {\n            width: 100%; max-width: 100%; background: var(--lh-bg-darker);\n            border: 1px solid var(--lh-accent-muted); color: var(--lh-text);\n            padding: 8px 10px; font-size: 0.85rem; font-family: inherit;\n        }\n        .form-group input:focus, .form-group select:focus, .form-group textarea:focus {\n            outline: none; border-color: var(--lh-accent-border);\n        }\n        .form-actions { display: flex; gap: 10px; justify-content: flex-end; }\n        .cancel-btn {\n            background: transparent !important;\n            border: 1px solid rgba(var(--lh-accent-rgb),0.3) !important;\n            color: rgba(var(--lh-text-rgb),0.6) !important;\n        }\n        .cancel-btn:hover {\n            background: var(--lh-secondary-muted) !important;\n            border-color: var(--lh-secondary-border) !important;\n            color: var(--lh-secondary) !important;\n        }\n        .btn {\n            background: var(--lh-accent); border: none; color: var(--lh-text);\n            padding: 8px 16px; cursor: pointer; font-size: 0.82rem;\n            font-family: inherit; transition: background 0.2s;\n        }\n        .btn:hover { background: var(--lh-accent-hover); }\n        .repeat-mode { display: none; }\n/* Dual Section Row */\n\n        \n        .dual-section-row {\n            display: grid;\n            grid-template-columns: 1fr 1fr;\n            gap: 14px;\n            margin-bottom: 14px;\n        }\n        .dual-section-row .dual-section {\n            margin-bottom: 0;\n            align-self: start;\n        }\n\n/* Grocery */\n\n        \n        .grocery-item {\n            display: flex; align-items: center; flex-direction: row-reverse;\n            padding: 10px 14px;\n            background: rgba(var(--lh-bg-rgb),0.3);\n            border: 1px solid var(--lh-accent-muted);\n            margin-bottom: 6px;\n            gap: 12px;\n            transition: all 0.2s ease;\n        }\n        .grocery-item:hover {\n            background: rgba(var(--lh-bg-rgb),0.5);\n            border-color: rgba(var(--lh-accent-rgb),0.3);\n        }\n        .grocery-item.done span {\n            text-decoration: line-through;\n            color: var(--lh-text-faint, rgba(var(--lh-text-rgb),0.35));\n        }\n        .grocery-item.fading {\n            opacity: 0;\n            transform: translateX(-20px);\n        }\n        .grocery-item:last-of-type { margin-bottom: 0; }\n        .grocery-item input[type=\"checkbox\"] {\n            width: 18px; height: 18px;\n            accent-color: var(--lh-accent);\n            cursor: pointer;\n            flex-shrink: 0;\n        }\n        .grocery-item span {\n            flex: 1;\n            color: var(--lh-text);\n            font-size: 0.88rem;\n            line-height: 1.4;\n        }\n        .cancel-contact-btn {\n            background: transparent; border: 1px solid rgba(var(--lh-secondary-rgb),0.3);\n            color: var(--lh-secondary); padding: 10px 16px; cursor: pointer;\n            font-size: 0.85rem; font-family: inherit; transition: all 0.2s; border-radius: 20px;\n        }\n        .cancel-contact-btn:hover { border-color: rgba(var(--lh-secondary-rgb),0.5); }\n\n        \n\n\n        .collapsible-content { max-height: 0; overflow: hidden; transition: max-height 0.15s ease-out; }\n        .collapsible-content.expanded { max-height: none; }\n\n        .contact {\n            background: var(--lh-bg-darker); padding: 14px;\n            margin-bottom: 8px; border-left: 2px solid var(--lh-accent);\n        }\n\n\n\n/* Responsive */\n\n        \n        @media (max-width: 600px) {\n            .reminder-links { flex-direction: row; flex-wrap: wrap; }\n\n            .calendar-header { flex-direction: row; flex-wrap: wrap; align-items: center; }\n            .calendar-nav { flex: 1; }\n            .calendar-view-toggle { width: 100%; order: 2; }\n            .view-toggle-btn { flex: 1; text-align: center; }\n/* Section cards */\n\n            \n            .section { padding: 20px; margin-bottom: 14px; }\n/* Reminder section */\n\n            \n            .reminder-title { font-size: 1.15rem; }\n            .reminder-link { padding: 6px 12px; font-size: 0.75rem; }\n/* Action row wraps on mobile */\n            \n            \n/* Calendar month grid - tighter on mobile */\n\n            \n            .calendar-month-day { padding: 5px; min-height: 52px; }\n            .calendar-month-day .day-number { font-size: 0.8rem; }\n            .calendar-month-day .day-count { font-size: 0.6rem; }\n            .calendar-month-day .day-dot { width: 4px; height: 4px; }\n            .calendar-day-header { padding: 6px 2px; font-size: 0.6rem; }\n            .calendar-nav button { padding: 8px 10px; font-size: 0.75rem; }\n            .calendar-title { font-size: 0.9rem; }\n/* Week/two-day view */\n\n            \n            .week-day { padding: 12px; }\n            .week-day-name { font-size: 0.85rem; }\n            .week-day-date { font-size: 0.8rem; }\n            .event-item { padding: 8px 10px; flex-wrap: wrap; gap: 6px; }\n            .event-title { font-size: 0.85rem; }\n            .event-actions { gap: 4px; }\n            .event-edit-btn, .event-delete-btn { padding: 6px 8px; font-size: 0.7rem; }\n/* Modals - slightly smaller on mobile */\n\n            \n            .modal { max-width: 92%; border-radius: 8px; max-height: calc(75 * var(--dbk-vh, 1vh)); }\n            .modal-header { padding: 10px 14px; }\n            .modal-body { padding: 10px 14px; max-height: calc(60 * var(--dbk-vh, 1vh)); overflow-y: auto; }\n            .modal-title { font-size: 0.95rem; }\n            .day-modal { padding: 12px; max-width: 92%; max-height: calc(75 * var(--dbk-vh, 1vh)); }\n            .day-modal-overlay, .modal-overlay, .reminder-modal-overlay { padding: 70px 14px 14px; }\n            .reminder-modal { padding: 12px; max-width: 92%; max-height: calc(75 * var(--dbk-vh, 1vh)); }\n            .form-group { margin-bottom: 10px; }\n            .form-group input, .form-group select, .form-group textarea { padding: 7px 10px; font-size: 0.82rem; }\n            .form-group label { font-size: 0.65rem; margin-bottom: 3px; }\n/* Grocery */\n\n            \n            .dual-section-row { grid-template-columns: 1fr; }\n            .grocery-item { padding: 8px 12px; }\n            .grocery-item span { font-size: 0.82rem; }\n/* All form inputs constrained */\n            \n            \n            .form-group input, .form-group select, .form-group textarea { max-width: 100%; }\n            .modal-body { overflow-x: hidden; }\n/* Edit reminder popup */\n            \n            \n            .edit-reminder-modal { max-width: 100%; }\n            .edit-reminder-overlay { padding: 60px 8px 8px; }\n/* Center calendar nav */\n\n            \n            .calendar-nav { justify-content: center; width: 100%; }\n            .calendar-view-toggle { justify-content: center; }\n\n            \n            .contact { padding: 12px; }\n\n\n/* Elemental divider */\n/* Home header - mobile layout */\n\n            \n            .home-intention {\n                font-size: 0.82rem;\n                margin-top: 6px;\n            }\n            .home-greeting { font-size: 1.75rem; }\n            .home-names { font-size: 1.5rem; }\n            .header-photo-container { width: 70px; height: 70px; }\n            .strip-widgets { gap: 7px; }\n            .home-widget-pill { padding: 7px 11px; gap: 8px; }\n            .widget-pill-text span:first-child { font-size: 0.76rem; }\n            .home-widget-pill.moon .widget-pill-text span:first-child { font-size: 0.76rem; }\n            .widget-svg-icon { width: 20px; height: 20px; }\n            .widget-pill-text .widget-detail { font-size: 0.56rem; }\n            .home-date { font-size: 1.0rem; }\n/* Toast - respect safe area */\n            \n            \n            .toast-container { \n                bottom: max(16px, var(--dbk-safe-bottom, env(safe-area-inset-bottom))); \n                width: calc(100% - 32px);\n                max-width: none;\n            }\n            .toast { font-size: 0.82rem; padding: 10px 16px; }\n/* Inline confirm */\n            \n            \n        }\n/* Extra small screens */\n        \n        @media (max-width: 380px) {\n            .section { padding: 16px; }\n            .reminder-title { font-size: 1rem; }\n            .calendar-month-day { padding: 3px; min-height: 44px; }\n            .calendar-month-day .day-number { font-size: 0.75rem; }\n            .home-greeting { font-size: 1.65rem; }\n            .home-names { font-size: 0.78rem; }\n            .home-intention { font-size: 0.78rem; margin-top: 5px; }\n            .header-photo-container { width: 64px; height: 64px; }\n            .home-widget-pill { padding: 6px 10px; gap: 7px; }\n            .widget-pill-text span:first-child { font-size: 0.7rem; }\n            .widget-pill-text .widget-detail { display: none; }\n            .widget-svg-icon { width: 18px; height: 18px; }\n            .home-date { font-size: 0.95rem; letter-spacing: 0.03em; }\n            .event-item { flex-direction: column; align-items: flex-start; }\n            .event-actions { align-self: flex-end; }\n/* Add input grocery */\n            \n            \n        }\n/* ===== APP-LIKE BEHAVIOR ===== */\n\nhtml {\n    overflow-x: hidden;\n    overflow-y: scroll;\n    -webkit-text-size-adjust: 100%;\n    min-height: 100%;\n    scroll-behavior: smooth;\n    background: var(--lh-bg) !important;\n    color-scheme: only light;\n}\n\n* {\n    -webkit-tap-highlight-color: transparent;\n}\n\nbody {\n    -webkit-font-smoothing: antialiased;\n    -moz-osx-font-smoothing: grayscale;\n    -webkit-overflow-scrolling: touch;\n    min-height: 100%;\n    min-height: calc(100 * var(--dbk-vh, 1dvh));\n}\n/* Prevent pull-to-refresh on mobile */\n\n/* No text select on interactive elements */\n\nbutton, .btn, select, .tab, .view-toggle-btn, .hub-nav-btn, label {\n    -webkit-user-select: none;\n    user-select: none;\n}\n/* Smooth touch scrolling for scrollable containers */\n\n.scrollable, .container {-webkit-overflow-scrolling: touch;\n}\n/* Better touch targets - minimum 44px for standalone interactive elements */\n\n.add-event-btn, .reminder-btn, .grocery-item, .view-toggle-btn {\n    min-height: 44px;\n}\nbutton, .btn, select, input[type=\"checkbox\"] {\n    min-height: 36px;\n}\n.allday-toggle, .hh-dp-nav-btn, .hh-dp-clear, .hh-dp-day, .hh-dp-ym-btn {\n    min-height: 0 !important;\n}\n/* Safe area insets for notched phones */\n\n.container {padding-left: max(16px, var(--dbk-safe-left, env(safe-area-inset-left)));\n    padding-right: max(16px, var(--dbk-safe-right, env(safe-area-inset-right)));\n    padding-bottom: max(40px, var(--dbk-safe-bottom, env(safe-area-inset-bottom)));\n}\n/* Active states for touch feedback */\n\nbutton:active, .btn:active {\n    opacity: 0.7;\n    transition: opacity 0.05s;\n}\n/* Smoother page transitions feel */\n\n.section, .card, [class*=\"card\"], [class*=\"section\"] {\n    transform: translateZ(0);\n    will-change: auto;\n}\n/* Input focus styles - more app-like */\n\ninput:focus, textarea:focus, select:focus {\n    outline: none;\n}\n/* Disable long-press context menu on interactive elements (mobile) */\n/* ===== END APP-LIKE BEHAVIOR ===== */\n/* ===== UNIFIED NAV BAR (consolidated) ===== */\n/* ===== NAV OVERRIDE - GOLD STANDARD ===== */\n\nbutton, .btn, a,\n\n        \n\n/* ===== END NAV OVERRIDE ===== */\n/* ===== MOBILE OPTIMIZATION ===== */\n/* Prevent iOS auto-zoom on input focus */\n\n        \n        \n        \n        @media screen and (max-width: 768px) {\n            input, textarea, select {\n                font-size: 16px !important;\n            }\n        }\n/* ===== EDIT REMINDER POPUP ===== */\n        \n        .edit-reminder-overlay {\n            position: fixed; top: 0; left: 0; right: 0; bottom: 0;\n            background: rgba(0, 0, 0, 0.8); z-index: 3000;\n            display: none; align-items: center; justify-content: center;\n            padding: 64px 12px 12px;\n        }\n        .edit-reminder-overlay.visible { display: flex; }\n        .edit-reminder-modal {\n            background: var(--lh-bg); border: 1px solid var(--lh-accent-border);\n            width: 100%; max-width: 440px; max-height: calc(80 * var(--dbk-vh, 1vh));\n            overflow-y: auto; overflow-x: hidden; border-radius: 4px;\n        }\n/* ===== TOAST NOTIFICATIONS ===== */\n\n        \n        .toast-container {\n            position: fixed;\n            bottom: 24px;\n            left: 50%;\n            transform: translateX(-50%);\n            z-index: 10000;\n            display: flex;\n            flex-direction: column;\n            align-items: center;\n            gap: 8px;\n            pointer-events: none;\n        }\n        .toast {\n            background: rgba(var(--lh-bg-rgb), 0.95);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.4);\n            color: var(--lh-text);\n            padding: 12px 20px;\n            font-size: 0.85rem;\n            font-family: inherit;\n            backdrop-filter: blur(8px);\n            -webkit-backdrop-filter: blur(8px);\n            opacity: 0;\n            transform: translateY(12px);\n            transition: all 0.3s ease;\n            pointer-events: auto;\n            display: flex;\n            align-items: center;\n            gap: 12px;\n            max-width: calc(90 * var(--dbk-vw, 1vw));\n        }\n        .toast.visible {\n            opacity: 1;\n            transform: translateY(0);\n        }\n        .toast-undo {\n            background: transparent;\n            border: 1px solid rgba(var(--lh-accent-rgb),0.5);\n            color: var(--lh-accent);\n            padding: 4px 12px;\n            font-size: 0.8rem;\n            font-family: inherit;\n            cursor: pointer;\n            transition: all 0.2s;\n            white-space: nowrap;\n        }\n        .toast-undo:hover {\n            background: rgba(var(--lh-accent-rgb),0.2);\n        }\n/* ===== END MOBILE OPTIMIZATION ===== */\n\n        \n/* ===== END MOBILE OPTIMIZATION ===== */\n/* ===== PAGE SETTINGS DRAWER ===== */\n/* ===== END PAGE SETTINGS DRAWER ===== */\n/* ===== TODAY'S 3 THINGS — Style A ===== */\n        \n\n        \n        .three-things-slots { display: flex; flex-direction: column; }\n        .thing-slot {\n            display: flex; align-items: center; gap: 12px;\n            padding: 10px 0;\n            border-bottom: 1px solid rgba(var(--lh-accent-rgb),0.07);\n            cursor: pointer;\n        }\n        .thing-slot:first-child { border-top: 1px solid rgba(var(--lh-accent-rgb),0.07); }\n        .thing-num {\n            font-size: 0.65rem; color: rgba(var(--lh-accent-rgb),0.4);\n            font-weight: 600; width: 14px; flex-shrink: 0;\n            letter-spacing: 0.05em; text-align: right;\n        }\n        .thing-slot.done .thing-num { color: rgba(232,180,184,0.35); }\n        .thing-check {\n            width: 16px; height: 16px; border-radius: 50%;\n            border: 1.5px solid rgba(var(--lh-accent-rgb),0.25);\n            flex-shrink: 0; display: flex; align-items: center;\n            justify-content: center; transition: all 0.2s;\n        }\n        .thing-slot.done .thing-check {\n            background: var(--lh-secondary);\n            border-color: var(--lh-secondary);\n        }\n        .thing-check-mark { display: none; color: var(--lh-bg-darker); font-size: 0.55rem; font-weight: 700; }\n        .thing-slot.done .thing-check-mark { display: block; }\n        .thing-text {\n            flex: 1; color: var(--lh-text); font-size: 0.88rem; line-height: 1.4;\n        }\n        .thing-text.empty { color: var(--lh-text-faint); font-style: italic; }\n        .thing-slot.done .thing-text { text-decoration: line-through; color: rgba(var(--lh-text-rgb),0.3); }\n        .thing-edit-input {\n            flex: 1; background: transparent; border: none;\n            color: var(--lh-text); font-size: 0.88rem;\n            font-family: inherit; outline: none; padding: 0; min-width: 0;\n        }\n/* ===== QUICK CAPTURE ===== */\n/* ===== STICKY CAPTURE BAR ===== */\n\n        \n        \n        .capture-sticky-bar {\n            position: fixed; bottom: 0; left: 0; right: 0;\n            background: rgba(var(--lh-bg-rgb),0.97);\n            backdrop-filter: blur(12px);\n            -webkit-backdrop-filter: blur(12px);\n            border-top: 1px solid rgba(var(--lh-accent-rgb),0.15);\n            padding: 10px 16px calc(10px + var(--dbk-safe-bottom, env(safe-area-inset-bottom)));\n            z-index: 900;\n            transition: transform 0.25s ease;\n        }\n        .capture-sticky-bar.hidden { transform: translateY(100%); }\n        .capture-bar-row {\n            display: flex; align-items: center; gap: 8px;\n            max-width: 680px; margin: 0 auto;\n        }\n        .capture-bar-input {\n            flex: 1; min-width: 0;\n            background: rgba(var(--lh-accent-rgb),0.06);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.18);\n            border-radius: 8px;\n            padding: 10px 14px;\n            color: var(--lh-text); font-family: inherit;\n            font-size: 0.85rem;\n        }\n        .capture-bar-input::placeholder { color: rgba(var(--lh-text-rgb),0.25); font-style: italic; }\n        .capture-bar-input:focus { outline: none; border-color: rgba(var(--lh-accent-rgb),0.4); background: rgba(var(--lh-accent-rgb),0.1); }\n        .capture-bar-send {\n            background: var(--lh-accent); border: none; color: var(--lh-bg-darker);\n            width: 36px; height: 36px; border-radius: 8px;\n            font-size: 1rem; cursor: pointer; flex-shrink: 0;\n            display: flex; align-items: center; justify-content: center;\n            transition: background 0.2s;\n        }\n        .capture-bar-send:hover { opacity: 0.85; }\n        .capture-inbox-btn {\n            position: relative; background: none;\n            border: 1px solid rgba(var(--lh-accent-rgb),0.2);\n            border-radius: 12px; padding: 4px 10px; cursor: pointer;\n            color: rgba(var(--lh-accent-rgb),0.5); font-size: 0.58rem;\n            font-family: inherit; letter-spacing: 0.08em;\n            text-transform: uppercase; white-space: nowrap;\n            margin-left: auto;\n            transition: all 0.2s;\n        }\n        .capture-inbox-btn:hover { border-color: rgba(var(--lh-accent-rgb),0.4); color: rgba(var(--lh-accent-rgb),0.8); }\n        .capture-inbox-badge {\n            position: absolute; top: -5px; right: -6px;\n            background: var(--lh-secondary); color: var(--lh-bg-darker);\n            font-size: 0.5rem; font-weight: 700;\n            width: 16px; height: 16px; border-radius: 50%;\n            display: flex; align-items: center; justify-content: center;\n        }\n        .capture-inbox-badge:empty { display: none; }\n/* Inbox Modal */\n        \n        .inbox-modal-overlay {\n            display: none; position: fixed; inset: 0;\n            background: rgba(0,0,0,0.6); z-index: 9500;\n            align-items: center; justify-content: center;\n            padding: 24px;\n        }\n        .inbox-modal-overlay.visible { display: flex; }\n        .inbox-modal {\n            background: var(--lh-bg-darker);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.18);\n            border-radius: 14px;\n            width: 100%; max-width: 520px;\n            max-height: calc(80 * var(--dbk-vh, 1vh)); overflow-y: auto;\n            padding: 0;\n            -webkit-overflow-scrolling: touch;\n        }\n        .inbox-modal-header {\n            display: flex; flex-direction: column; gap: 10px;\n            padding: 18px 20px 14px;\n            border-bottom: 1px solid rgba(var(--lh-accent-rgb),0.1);\n            position: sticky; top: 0;\n            background: var(--lh-bg-darker);\n            z-index: 2;\n        }\n        .inbox-header-top {\n            display: flex; align-items: center; justify-content: space-between;\n        }\n        .inbox-modal-title {\n            font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.18em;\n            color: var(--lh-accent); font-weight: 500;\n        }\n        .inbox-header-actions { display: flex; align-items: center; gap: 8px; }\n        .inbox-count {\n            font-size: 0.6rem; color: rgba(var(--lh-text-rgb),0.25);\n            letter-spacing: 0.06em;\n        }\n        .inbox-clear-btn {\n            background: none; border: 1px solid rgba(var(--lh-secondary-rgb),0.15);\n            border-radius: 6px; padding: 3px 10px; font-size: 0.55rem;\n            text-transform: uppercase; letter-spacing: 0.08em;\n            color: rgba(var(--lh-secondary-rgb),0.4); cursor: pointer;\n            font-family: inherit; transition: all 0.15s;\n        }\n        .inbox-clear-btn:hover { color: var(--lh-secondary); border-color: rgba(var(--lh-secondary-rgb),0.4); }\n        .inbox-modal-close {\n            background: none; border: none; color: rgba(var(--lh-text-rgb),0.35);\n            font-size: 1.1rem; cursor: pointer; padding: 4px 8px; line-height: 1;\n        }\n        .inbox-modal-close:hover { color: rgba(var(--lh-text-rgb),0.7); }\n        .inbox-search-row { display: flex; gap: 6px; align-items: center; }\n        .inbox-search {\n            flex: 1; background: rgba(var(--lh-accent-rgb),0.06);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.12);\n            border-radius: 6px; padding: 7px 10px;\n            color: var(--lh-text); font-family: inherit; font-size: 0.78rem;\n        }\n        .inbox-search::placeholder { color: rgba(var(--lh-text-rgb),0.2); font-style: italic; }\n        .inbox-search:focus { outline: none; border-color: rgba(var(--lh-accent-rgb),0.35); }\n        .inbox-capture-row {\n            display: flex; gap: 6px; align-items: center;\n            padding: 10px 20px; border-bottom: 1px solid rgba(var(--lh-accent-rgb),0.06);\n        }\n        .inbox-capture-input {\n            flex: 1; background: rgba(var(--lh-accent-rgb),0.06);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.15);\n            border-radius: 6px; padding: 8px 12px;\n            color: var(--lh-text); font-family: inherit; font-size: 0.82rem;\n        }\n        .inbox-capture-input::placeholder { color: rgba(var(--lh-text-rgb),0.2); font-style: italic; }\n        .inbox-capture-input:focus { outline: none; border-color: rgba(var(--lh-accent-rgb),0.35); }\n        .inbox-capture-send {\n            background: var(--lh-accent); border: none; color: var(--lh-bg-darker);\n            width: 32px; height: 32px; border-radius: 6px;\n            font-size: 0.9rem; cursor: pointer; flex-shrink: 0;\n            display: flex; align-items: center; justify-content: center;\n        }\n        .inbox-modal-body { padding: 0; }\n        .inbox-item {\n            padding: 12px 16px;\n            border-bottom: 1px solid rgba(var(--lh-accent-rgb),0.06);\n        }\n        .inbox-item:last-child { border-bottom: none; }\n        .inbox-item-row1 {\n            display: flex; align-items: baseline; gap: 8px;\n        }\n        .inbox-item-text {\n            font-size: 0.88rem; color: var(--lh-text); line-height: 1.4;\n            flex: 1; min-width: 0; overflow-wrap: break-word;\n        }\n        .inbox-item-meta {\n            font-size: 0.6rem; color: rgba(var(--lh-text-rgb),0.2);\n            white-space: nowrap; flex-shrink: 0;\n        }\n        .inbox-item-tag {\n            font-size: 0.48rem; text-transform: uppercase; letter-spacing: 0.1em;\n            color: var(--lh-accent); opacity: 0.6;\n            padding: 1px 6px; border-radius: 6px;\n            background: rgba(var(--lh-accent-rgb),0.08);\n            flex-shrink: 0; white-space: nowrap;\n        }\n        .inbox-item-row2 {\n            display: flex; align-items: center; gap: 4px; margin-top: 6px; flex-wrap: wrap;\n        }\n        .inbox-edit-area {\n            width: 100%; background: rgba(var(--lh-accent-rgb),0.06);\n            border: 1px solid rgba(var(--lh-accent-rgb),0.25);\n            border-radius: 6px; padding: 8px 10px;\n            color: var(--lh-text); font-family: inherit; font-size: 0.88rem;\n            resize: vertical; min-height: 40px; line-height: 1.45;\n        }\n        .inbox-edit-area:focus { outline: none; border-color: rgba(var(--lh-accent-rgb),0.45); }\n        .inbox-edit-actions { display: flex; gap: 6px; margin-top: 6px; }\n        .inbox-edit-save, .inbox-edit-cancel {\n            padding: 4px 12px; font-size: 0.6rem; border-radius: 5px;\n            text-transform: uppercase; letter-spacing: 0.08em;\n            cursor: pointer; font-family: inherit; transition: all 0.15s;\n        }\n        .inbox-edit-save { background: var(--lh-accent); border: none; color: var(--lh-bg-darker); font-weight: 600; }\n        .inbox-edit-save:hover { filter: brightness(1.1); }\n        .inbox-edit-cancel { background: none; border: 1px solid rgba(var(--lh-text-rgb),0.1); color: rgba(var(--lh-text-rgb),0.35); }\n        .inbox-edit-cancel:hover { border-color: rgba(var(--lh-text-rgb),0.2); color: rgba(var(--lh-text-rgb),0.5); }\n        .inbox-empty {\n            text-align: center; padding: 40px 20px;\n            color: rgba(var(--lh-text-rgb),0.25); font-style: italic;\n            font-size: 0.88rem;\n        }\n\n        @media (max-width: 600px) {\n            .capture-sticky-bar { padding: 8px 12px calc(8px + var(--dbk-safe-bottom, env(safe-area-inset-bottom))); }\n            .capture-bar-input { padding: 9px 12px; font-size: 0.82rem; }\n            .capture-bar-send { width: 34px; height: 34px; }\n            .inbox-modal { max-height: calc(85 * var(--dbk-vh, 1vh)); }\n        }\n/* ===== END CAPTURE BAR ===== */\n/* ===== 2daysbook date picker ===== */\n        \n\n        \n        .hh-datepicker { position: relative; display: block; }\n        .hh-dp-trigger {\n            display: flex; align-items: center; justify-content: space-between;\n            width: 100%; padding: 8px 12px;\n            background: var(--lh-bg-darker);\n            border: 1px solid var(--lh-accent-border, rgba(var(--lh-accent-rgb),0.25));\n            color: var(--lh-text);\n            font-family: var(--lh-font, 'Philosopher', Georgia, serif);\n            font-size: 0.88rem; cursor: pointer;\n            transition: border-color 0.2s; text-align: left; min-height: 36px;\n        }\n        .hh-dp-trigger:hover { border-color: var(--lh-accent); }\n        .hh-dp-trigger.open { border-color: var(--lh-accent); }\n        .hh-dp-label { flex: 1; }\n        .hh-dp-label.placeholder { color: var(--lh-text-faint, rgba(var(--lh-text-rgb),0.3)); font-style: italic; font-size: 0.82rem; }\n        .hh-dp-chevron { color: var(--lh-accent-text, rgba(var(--lh-accent-rgb),0.5)); font-size: 0.7rem; flex-shrink: 0; margin-left: 8px; transition: transform 0.2s; }\n        .hh-dp-trigger.open .hh-dp-chevron { transform: rotate(180deg); }\n/* Floating calendar popover */\n\n        \n        .hh-dp-popover {\n            position: fixed; z-index: 99999;\n            background: var(--lh-bg-darker);\n            border: 1px solid var(--lh-accent-border, rgba(var(--lh-accent-rgb),0.3));\n            box-shadow: 0 8px 32px rgba(0,0,0,0.5);\n            padding: 10px 12px; width: 220px;\n            display: none; user-select: none;\n        }\n        .hh-dp-popover.open { display: block; }\n        .hh-dp-nav {\n            display: flex; align-items: center; justify-content: space-between;\n            margin-bottom: 8px;\n        }\n        .hh-dp-nav-btn {\n            background: none; border: none; cursor: pointer;\n            color: var(--lh-accent); font-size: 1rem;\n            padding: 4px 8px; line-height: 1;\n            transition: color 0.2s; font-family: inherit;\n        }\n        .hh-dp-nav-btn:hover { color: var(--lh-secondary); }\n        .hh-dp-month-label {\n            font-size: 0.78rem; text-transform: uppercase;\n            letter-spacing: 0.15em; color: var(--lh-text);\n            font-weight: 600; cursor: pointer;\n        }\n        .hh-dp-month-label:hover { color: var(--lh-accent); }\n        .hh-dp-weekdays {\n            display: grid; grid-template-columns: repeat(7, 1fr);\n            margin-bottom: 6px;\n        }\n        .hh-dp-wd {\n            text-align: center; font-size: 0.55rem;\n            text-transform: uppercase; letter-spacing: 0.05em;\n            color: var(--lh-accent-text, rgba(var(--lh-accent-rgb),0.5));\n            padding-bottom: 4px;\n        }\n        .hh-dp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }\n        .hh-dp-day {\n            aspect-ratio: 1; display: flex; align-items: center; justify-content: center;\n            font-size: 0.72rem; cursor: pointer; border-radius: 50%;\n            color: var(--lh-text-muted, rgba(var(--lh-text-rgb),0.6));\n            transition: background 0.15s, color 0.15s;\n        }\n        .hh-dp-day:hover { background: var(--lh-accent-muted, rgba(var(--lh-accent-rgb),0.15)); color: var(--lh-text); }\n        .hh-dp-day.other-month { color: rgba(var(--lh-text-rgb), 0.4); }   /* days of the months either side: faded (data-dbk-keep, so the readability check leaves them faded; it made them brighter than the month's own days, Kasey Oct 23) */\n        .hh-dp-day.today { color: var(--lh-accent); font-weight: 700; }\n        .hh-dp-day.selected {\n            background: var(--lh-secondary) !important;\n            color: var(--lh-bg-darker) !important; font-weight: 700;\n        }\n        .hh-dp-day.empty { cursor: default; }\n/* Year/month selector grid */\n\n        \n        .hh-dp-ym-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }\n        .hh-dp-ym-btn {\n            padding: 7px 4px; text-align: center; cursor: pointer;\n            font-size: 0.78rem; font-family: inherit;\n            background: none; border: 1px solid transparent;\n            color: var(--lh-text-muted, rgba(var(--lh-text-rgb),0.6));\n            transition: all 0.15s;\n        }\n        .hh-dp-ym-btn:hover { border-color: var(--lh-accent-border); color: var(--lh-text); }\n        .hh-dp-ym-btn.current { border-color: var(--lh-accent-border); color: var(--lh-accent); }\n        .hh-dp-clear {\n            margin-top: 10px; width: 100%; background: none;\n            border: none; border-top: 1px solid var(--lh-accent-muted);\n            padding: 8px 0 0; cursor: pointer; font-family: inherit;\n            font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.15em;\n            color: var(--lh-text-faint); text-align: center; display: block;\n            transition: color 0.2s;\n        }\n        .hh-dp-clear:hover { color: var(--lh-secondary); }\n/* ===== END DATE PICKER ===== */\n/* phone dark-mode override removed: 2daysbook sets its own colors */\n        \n\n        </style>\n\n<style>.section{border-radius:20px !important;border:1px solid rgba(var(--lh-accent-rgb),0.13) !important;box-shadow:0 4px 20px rgba(0,0,0,0.18) !important}.dual-section-row .dual-section{border-radius:16px !important}@media(min-width:601px){.container{padding-top:96px !important;padding-bottom:100px !important}.home-widget-pill{padding:10px 16px !important;gap:12px !important}.widget-pill-text span:first-child{font-size:.9rem !important}.widget-svg-icon{width:26px !important;height:26px !important}.reminder-title{font-size:1.2rem !important;margin-bottom:8px !important}.reminder-links{margin-top:16px !important}.section{padding:28px !important;margin-bottom:18px !important}.section-title{margin-bottom:20px !important}.thing-slot{padding:13px 14px !important;margin-bottom:8px !important}.grocery-item{padding:11px 16px !important;margin-bottom:8px !important}.contact{padding:16px !important;margin-bottom:10px !important}.dual-section-row{gap:16px !important;margin-bottom:18px !important}}.reminder-badge{border-radius:20px !important}.thing-slot{border-radius:12px !important;padding:10px 12px !important;background:rgba(var(--lh-bg-rgb),0.3) !important;border-bottom:none !important;margin-bottom:6px !important;transition:background .2s !important}.thing-slot:first-child{border-top:none !important}.thing-slot:hover{background:rgba(var(--lh-bg-rgb),0.5) !important}.view-toggle-btn{border-radius:20px !important;border:1px solid var(--lh-accent-muted) !important;margin:0 2px !important}.view-toggle-btn:first-child{border-radius:20px !important}.view-toggle-btn:last-child{border-radius:20px !important}.view-toggle-btn.add-event-inline{border-radius:20px !important;border-right:1px solid var(--lh-accent-muted) !important}.calendar-nav button{border-radius:20px !important}.event-item{border-radius:10px !important;border-left:3px solid var(--lh-accent) !important}.week-day{border-radius:14px !important;border:1px solid var(--lh-accent-muted) !important}.week-day.today{border-radius:14px !important}.calendar-month-day{border-radius:10px !important}.grocery-item{border-radius:12px !important;border:1px solid rgba(var(--lh-accent-rgb),0.08) !important}.contact{border-radius:14px !important;border-left:2px solid var(--lh-accent) !important;border:1px solid rgba(var(--lh-accent-rgb),0.09) !important;border-left:2px solid var(--lh-accent) !important}.btn{border-radius:20px !important}.cancel-btn{border-radius:20px !important}.event-edit-btn,.event-delete-btn{border-radius:20px !important}.modal{border-radius:20px !important}.day-modal{border-radius:20px !important}.reminder-modal{border-radius:20px !important}.edit-reminder-modal{border-radius:20px !important}.modal-header{border-radius:20px 20px 0 0 !important}.reminder-list-item{border-radius:12px !important;border-left:3px solid var(--lh-accent) !important}.reminder-list-item.overdue{border-left:3px solid var(--lh-secondary) !important}.form-group input,.form-group select,.form-group textarea,.reminder-form-row input,.reminder-form-row select,.reminder-form-row textarea,.day-modal-form input,.day-modal-form textarea{border-radius:10px !important}.toast{border-radius:20px !important;padding:12px 20px !important}.toast-undo{border-radius:20px !important}.hh-dp-trigger{border-radius:10px !important}.hh-dp-popover{border-radius:14px !important}.hh-dp-day{border-radius:50% !important}@media(max-width:600px){.section,.current-reminder{border-radius:16px !important}.dual-section-row .dual-section{border-radius:14px !important}.thing-slot{padding:9px 10px !important;border-radius:10px !important;margin-bottom:5px !important}.calendar-summary-preview{white-space:normal !important;overflow:visible !important;text-overflow:unset !important}.calendar-view-toggle{width:100% !important;display:flex !important;overflow-x:auto !important;-webkit-overflow-scrolling:touch !important;gap:4px !important}.view-toggle-btn{flex-shrink:0 !important;padding:6px 12px !important;font-size:.65rem !important}.event-item{border-radius:10px !important;padding:8px 10px !important;flex-wrap:wrap !important;gap:6px !important}.week-day{border-radius:12px !important;padding:12px !important}.event-edit-btn,.event-delete-btn{padding:5px 10px !important;font-size:.68rem !important}.grocery-item{border-radius:10px !important;padding:8px 12px !important}@media(max-width:380px){}.contact{border-radius:12px !important;padding:12px !important}.dual-section-row{gap:10px !important}.modal,.day-modal,.reminder-modal,.edit-reminder-modal{border-radius:20px 20px 0 0 !important;position:fixed !important;bottom:0 !important;left:0 !important;right:0 !important;max-width:100% !important;max-height:calc(90 * var(--dbk-vh, 1vh)) !important;margin:0 !important}.modal-overlay,.day-modal-overlay,.reminder-modal-overlay,.edit-reminder-overlay{align-items:flex-end !important;padding:0 !important}.modal-header{border-radius:20px 20px 0 0 !important}.form-group input,.form-group select,.form-group textarea{padding:10px 14px !important;border-radius:10px !important;font-size:16px !important}.toast{width:calc(calc(100 * var(--dbk-vw, 1vw)) - 32px) !important;max-width:none !important;border-radius:16px !important}}@media(min-width:769px){.home-widget-pill .widget-pill-text span:first-child{font-size:1.05rem !important}.home-widget-pill.moon .widget-pill-text span:first-child{font-size:.85rem !important}.widget-svg-icon{width:26px !important;height:26px !important}.widget-pill-text .widget-detail{font-size:.85rem !important}.home-widget-pill.moon .widget-pill-text .widget-detail{font-size:.68rem !important}.home-date{font-size:1.05rem !important}#weatherWidget{order:1 !important}#moonWidget{order:3 !important}}</style>\n<style>.lh-password-screen{display:flex;align-items:center;justify-content:center;min-height:calc(100 * var(--dbk-vh, 1vh));position:fixed;top:0;left:0;right:0;bottom:0;background:linear-gradient(135deg,var(--lh-bg) 0,var(--lh-bg-darker) 100%);z-index:10000}.lh-password-box{background:var(--lh-bg-darker);padding:50px;border-radius:20px;box-shadow:0 10px 40px rgba(var(--lh-accent-rgb),0.2);text-align:center;max-width:400px;width:90%;border:3px solid var(--lh-accent)}.lh-password-box h1{font-family:var(--lh-heading-font);color:var(--lh-accent);font-size:2.2em;margin-bottom:12px;font-weight:700;letter-spacing:1px}.lh-password-box p{color:rgba(var(--lh-text-rgb),0.5);margin-bottom:28px;font-size:1em}.lh-password-input{width:100%;padding:14px;border:2px solid rgba(var(--lh-accent-rgb),0.3);border-radius:10px;font-size:1.05em;font-family:var(--lh-font);margin-bottom:10px;transition:border-color .3s;background:var(--lh-bg);color:var(--lh-text);box-sizing:border-box}.lh-password-input:focus{outline:0;border-color:var(--lh-accent)}.lh-password-btn{width:100%;padding:14px;background:var(--lh-accent);color:var(--lh-bg-darker);border:0;border-radius:10px;font-size:1.05em;font-weight:600;font-family:var(--lh-font);cursor:pointer;transition:opacity .2s}.lh-password-btn:hover{opacity:.85}.lh-password-error{display:none;color:var(--lh-secondary);margin-top:14px;font-size:.88em}</style>\n<!-- HH_BUILD_2026_06_10 -->\n<!--@css:daybook-theme.css--><!--@css:sample-theme.css-->\n<style>\n/* Today, redesigned: four bands (greeting, Today's Three, today's calendar with a due reminder\n   as its first line, grocery list). Up next lives only on the Habits page; the big Reminder band is gone. */\n/* a reminder that's due sits at the top of today's calendar */\nhtml[data-dbk]:not(#z) .hc-rem { display: grid; grid-template-columns: 78px minmax(0,1fr) auto; align-items: center; column-gap: 10px; padding: 10px 2px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.18); text-align: left; }\nhtml[data-dbk=\"p2\"]:not(#z) .hc-rem { border-bottom-color: rgba(230,234,239,0.16); }\nhtml[data-dbk]:not(#z) .hc-rem-l { font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.06em; color: var(--lh-secondary); }\nhtml[data-dbk]:not(#z):not(#y) .hc-rem-main { all: unset; cursor: pointer; min-width: 0; text-align: left !important; justify-self: start !important; }\nhtml[data-dbk]:not(#z):not(#y) .hc-rem-main * { text-align: left !important; }\nhtml[data-dbk]:not(#z) .hc-rem-name { display: block; font-family: var(--dbk-serif); font-size: 1.05rem; color: var(--dbk-green); }\nhtml[data-dbk=\"p2\"]:not(#z) .hc-rem-name { color: #e6eaef; }\nhtml[data-dbk]:not(#z) .hc-rem-when { display: block; font-family: var(--dbk-serif); font-style: italic; font-size: 0.86rem; opacity: 0.7; }\nhtml[data-dbk]:not(#z) .hc-rem-when.late { color: var(--lh-secondary); opacity: 1; }\nhtml[data-dbk]:not(#z) .hc-rem .hm-link { white-space: nowrap; }\n/* cooking heads-ups from Meals (meal-cookplan.js): the same row as the reminder; a ticked one dims and offers Undo */\nhtml[data-dbk]:not(#z) .hc-cook.is-done .hc-rem-name { text-decoration: line-through; opacity: 0.5; }\nhtml[data-dbk]:not(#z) .hc-cook.is-done .hc-rem-when { opacity: 0.45; }\nhtml[data-dbk]:not(#z) .hc-cook .hc-cook-undo { font-family: var(--dbk-caps); letter-spacing: 0.06em; font-size: 0.82rem; opacity: 0.7; }\nhtml[data-dbk].dbk-rem-in-cal:not(#z) [data-sortkey=\"reminders\"] { display: none !important; }\n</style>\n</head>\n<body>\n\n<div class=\"lh-password-screen\" id=\"passwordScreen\" style=\"display:none;\">\n    <div class=\"lh-password-box\">\n        <h1 data-hh-name=\"app\">2daysbook</h1>\n        <p>Enter your password to continue</p>\n        <input type=\"password\" class=\"lh-password-input\" id=\"loginPassword\" placeholder=\"Password\" autocomplete=\"current-password\" onkeydown=\"if(event.key==='Enter')checkLogin()\">\n        <button class=\"lh-password-btn\" onclick=\"checkLogin()\">Unlock</button>\n        <p class=\"lh-password-error\" id=\"loginError\">Incorrect password. Try again.</p>\n    </div>\n</div>\n\n    <div class=\"toast-container\" id=\"toastContainer\"></div>\n\n<nav class=\"top-nav\"><div class=\"nav-container\"><div class=\"nav-links\"></div></div></nav>\n<script>window.dbkEarlyNav&&window.dbkEarlyNav();</script>\n<!--@js:firebase-helpers.js-->\n\n\n    <div class=\"container\">\n        \n        <main class=\"hm\">\n          <section class=\"hm-band hm-pink\">\n            <div class=\"photo-wrapper\" id=\"photoWrapper\" style=\"position:relative;\">\n                <div class=\"header-photo-container\" id=\"photoContainer\" onclick=\"handlePhotoContainerClick(event)\" style=\"cursor:pointer;\">\n                    <div class=\"header-photo-inner\" id=\"photoInner\">\n                        <div class=\"header-photo-draggable\" id=\"photoDraggable\" style=\"display: none;\">\n                            <img id=\"headerPhoto\">\n                        </div>\n                    </div>\n                    <div id=\"photoPlaceholder\" class=\"photo-placeholder\" onclick=\"document.getElementById('photoUpload').click()\">\n                        <span style=\"font-size: 2rem; opacity: 0.3;\">+</span>\n                    </div>\n                    <input type=\"file\" id=\"photoUpload\" accept=\"image/*\" style=\"display: none;\">\n                </div>\n                </div>\n            <h2 class=\"hm-greet\"><span class=\"home-greeting\" id=\"homeGreeting\">Good morning,</span> <span class=\"home-names\" id=\"homeNames\"></span></h2>\n            <div class=\"hm-date\"><span class=\"home-date\" id=\"homeDate\"></span></div>\n            <div class=\"strip-widgets hm-conds\">\n              <span class=\"hm-cond\" id=\"weatherWidget\"><span class=\"hm-cond-icon\" id=\"weatherIcon\"></span><span id=\"weatherTemp\">--°</span><span class=\"hm-dim\" id=\"weatherRange\"></span></span>\n              <span class=\"hm-cond\" id=\"moonWidget\"><span class=\"hm-cond-icon\" id=\"moonIcon\"></span><span id=\"moonPhase\">--</span><span class=\"hm-dim\" id=\"moonIllum\"></span></span>\n            </div>\n            <p class=\"home-intention hm-intention\" id=\"homeIntention\"></p>\n          </section>\n\n          <div data-sortkey=\"three\">\n          <section class=\"hm-band hm-cream\" id=\"panelToday\">\n            <h3 class=\"hm-h dbk-three-h\">Today's Three</h3>\n            <ol class=\"hm-list three-things-slots\" id=\"threeThingsSlots\">\n              <li class=\"hm-thing\" id=\"thing-0\" onclick=\"thingSlotClick(0,event)\"><span class=\"hm-num\">i.</span><span class=\"thing-check hm-box\"><span class=\"thing-check-mark\">&#x2713;</span></span><span class=\"thing-text empty\" id=\"thing-text-0\"></span><button type=\"button\" class=\"thing-x\" aria-label=\"Remove this one\" onclick=\"event.stopPropagation();thingClearOne(0)\">&times;</button></li>\n              <li class=\"hm-thing\" id=\"thing-1\" onclick=\"thingSlotClick(1,event)\"><span class=\"hm-num\">ii.</span><span class=\"thing-check hm-box\"><span class=\"thing-check-mark\">&#x2713;</span></span><span class=\"thing-text empty\" id=\"thing-text-1\"></span><button type=\"button\" class=\"thing-x\" aria-label=\"Remove this one\" onclick=\"event.stopPropagation();thingClearOne(1)\">&times;</button></li>\n              <li class=\"hm-thing\" id=\"thing-2\" onclick=\"thingSlotClick(2,event)\"><span class=\"hm-num\">iii.</span><span class=\"thing-check hm-box\"><span class=\"thing-check-mark\">&#x2713;</span></span><span class=\"thing-text empty\" id=\"thing-text-2\"></span><button type=\"button\" class=\"thing-x\" aria-label=\"Remove this one\" onclick=\"event.stopPropagation();thingClearOne(2)\">&times;</button></li>\n            </ol>\n            <div class=\"hm-center\"><button class=\"hm-link\" onclick=\"threeThingsClear()\">Clear the list</button> <span class=\"hm-sep\">·</span> <button class=\"hm-link\" id=\"dbkLaterToggle\" type=\"button\" aria-expanded=\"false\" aria-controls=\"dbkLaterBody\">Back Burner</button></div>\n            <div id=\"threeThingsCeleb\" class=\"hm-celeb\" style=\"display:none;\">All three done.</div>\n            <div class=\"dbk-later\" id=\"dbkLaterBody\" hidden>\n              <ul class=\"dbk-later-list\" id=\"dbkLaterList\"></ul>\n              <div class=\"dbk-later-addrow\">\n                <button type=\"button\" class=\"dbk-later-plus\" id=\"dbkLaterPlus\" aria-label=\"Add to back burner\">+</button>\n                <form class=\"dbk-later-form\" id=\"dbkLaterForm\" hidden autocomplete=\"off\">\n                  <input type=\"text\" id=\"dbkLaterInput\" aria-label=\"Add to back burner\" placeholder=\"Add to the back burner\" enterkeyhint=\"done\">\n                  <button type=\"submit\" class=\"dbk-later-go\" id=\"dbkLaterAdd\" aria-label=\"Add\">+</button>\n                  <button type=\"button\" class=\"dbk-later-close\" id=\"dbkLaterClose\" aria-label=\"Close\">&times;</button>\n                </form>\n              </div>\n            </div>\n          </section>\n          </div>\n          <div data-sortkey=\"reminders\">\n          <section class=\"hm-band hm-dark\" id=\"currentReminder\">\n            <div id=\"panelReminder\">\n              <h3 class=\"hm-h\">Reminder</h3>\n              <div class=\"hm-rem-title\"><span class=\"reminder-title\" id=\"reminderTitle\">Loading reminders...</span></div>\n              <div class=\"hm-rem-desc\" id=\"reminderDescription\"></div>\n              <div class=\"hm-rem-meta\"><span class=\"reminder-due\" id=\"reminderDue\"></span><span class=\"reminder-count\" id=\"reminderCount\" style=\"display:none;\"></span> <a id=\"reminderLinkBtn\" href=\"#\" target=\"_blank\" class=\"hm-link\" style=\"display:none;\">Open link</a></div>\n              <div class=\"reminder-links\" id=\"reminderLinks\"></div>\n              <div class=\"hm-actions\">\n                <button class=\"hm-btn hm-btn-solid\" onclick=\"markCurrentReminderDone()\">Done</button>\n                <button class=\"hm-btn\" onclick=\"openReminderModal()\">All reminders</button>\n              </div>\n            </div>\n          </section>\n          </div>\n\n          <div data-sortkey=\"calendar\">\n          <section class=\"hm-band hm-sage\" id=\"calendarSection\">\n            <h3 class=\"hm-h\">This Week</h3>\n            <div class=\"hm-week\" id=\"hmWeek\"></div>\n            <div class=\"hm-events\" id=\"hmEvents\"></div>\n            <div class=\"hm-week-today\" id=\"calendarSummary\"><span class=\"calendar-summary-preview\" id=\"calendarSummaryText\"></span></div>\n            <div class=\"hm-center\"><button class=\"hm-link\" onclick=\"dbkAddEvent()\">Add an event</button> <span class=\"hm-sep\">·</span> <button class=\"hm-link\" id=\"calendarExpandBtn\" onclick=\"toggleCalendarExpand()\">Full calendar</button></div>\n            <div class=\"calendar-full-view\" id=\"calendarFullView\">\n                <div class=\"calendar-header\">\n                    <div class=\"calendar-nav\">\n                        <button onclick=\"calendarPrevious()\">&#x2190;</button>\n                        <span class=\"calendar-title\" id=\"calendarTitle\">Loading...</span>\n                        <button onclick=\"calendarNext()\">&#x2192;</button>\n                    </div>\n                    <div class=\"calendar-view-toggle\">\n                        <button class=\"view-toggle-btn add-event-inline\" onclick=\"calendarShowAddForm()\">+ Add</button>\n                        <button class=\"view-toggle-btn active\" data-view=\"twoday\" onclick=\"calendarChangeView('twoday')\">2 Day</button>\n                        <button class=\"view-toggle-btn\" data-view=\"week\" onclick=\"calendarChangeView('week')\">Week</button>\n                        <button class=\"view-toggle-btn\" data-view=\"month\" onclick=\"calendarChangeView('month')\">Month</button>\n                    </div>\n                </div>\n                <div id=\"calendarContainer\"></div>\n            </div>\n          </section>\n          <div class=\"modal-overlay\" id=\"addEventModalOverlay\" onclick=\"closeAddEventModal(event)\">\n            <div class=\"modal\" style=\"max-width:480px;max-height:calc(90 * var(--dbk-vh, 1vh));overflow:visible;\">\n                <div class=\"modal-header\">\n                    <div class=\"modal-title\" id=\"addEventModalTitle\">Add Event</div>\n                    <button class=\"modal-close\" onclick=\"calendarHideAddForm()\">&times;</button>\n                </div>\n                <div class=\"modal-body\" style=\"max-height:calc(calc(85 * var(--dbk-vh, 1vh)) - 60px);overflow-y:auto;\">\n                    <form onsubmit=\"calendarAddEvent(event)\">\n                        <div class=\"form-group\">\n                            <label>Title</label>\n                            <input type=\"text\" id=\"calendarEventTitle\" required placeholder=\"e.g., Doctor appointment\">\n                        </div>\n                        <div class=\"form-group\">\n                            <label>Color Label</label>\n                            <div class=\"color-picker-row\">\n                                <button type=\"button\" class=\"color-dot-none selected\" id=\"colorNone\" onclick=\"selectEventColor(null)\">&#x2715;</button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#e8b4b8;\" data-color=\"rose\"     onclick=\"selectEventColor('rose')\"     title=\"Rose\"></button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#a3b899;\" data-color=\"sage\"     onclick=\"selectEventColor('sage')\"     title=\"Sage\"></button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#7ab8b0;\" data-color=\"teal\"     onclick=\"selectEventColor('teal')\"     title=\"Teal\"></button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#c9a96e;\" data-color=\"gold\"     onclick=\"selectEventColor('gold')\"     title=\"Gold\"></button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#b4a8c9;\" data-color=\"lavender\" onclick=\"selectEventColor('lavender')\" title=\"Lavender\"></button>\n                                <button type=\"button\" class=\"color-dot-btn\" style=\"background:#8a9bb0;\" data-color=\"slate\"    onclick=\"selectEventColor('slate')\"    title=\"Slate\"></button>\n                            </div>\n                            <input type=\"hidden\" id=\"calendarEventColor\">\n                        </div>\n                        <div class=\"form-group\">\n                            <label>Date Type</label>\n                            <select id=\"calendarRepeatMode\" onchange=\"toggleRepeatOptions()\">\n                                <option value=\"single\">Single date</option>\n                                <option value=\"multiple\">Multiple specific dates</option>\n                                <option value=\"range\">Date range</option>\n                                <option value=\"recurring\">Recurring</option>\n                            </select>\n                        </div>\n\n                        <div id=\"singleDateMode\" style=\"display:block;\">\n                            <div class=\"form-group\">\n                                <div class=\"hh-datepicker\" data-dp-id=\"calendarEventDate\">\n                                    <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">Select date</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                    <input type=\"hidden\" id=\"calendarEventDate\">\n                                </div>\n                            </div>\n                            <div class=\"allday-row\">\n                                <button type=\"button\" class=\"allday-toggle\" id=\"allDayToggle\" onclick=\"toggleAllDay()\"></button>\n                                <span class=\"allday-label\" onclick=\"toggleAllDay()\">All day</span>\n                            </div>\n                            <div id=\"singleTimeFields\" class=\"form-row-2\">\n                                <div class=\"form-group\"><label>Start Time</label><input type=\"time\" id=\"calendarEventTime\"></div>\n                                <div class=\"form-group\"><label>End Time</label><input type=\"time\" id=\"calendarEventEndTime\"></div>\n                            </div>\n                        </div>\n\n                        <div class=\"form-group repeat-mode\" id=\"multipleDateMode\" style=\"display:none;\">\n                            <div style=\"display:flex;gap:8px;margin-bottom:10px;\">\n                                <div class=\"hh-datepicker\" style=\"flex:1;min-width:0;\" data-dp-id=\"multipleDateInput\">\n                                    <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">Pick a date to add</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                    <input type=\"hidden\" id=\"multipleDateInput\">\n                                </div>\n                                <button type=\"button\" class=\"btn\" onclick=\"addSelectedDate()\" style=\"padding:8px 16px;flex-shrink:0;\">+ Add</button>\n                            </div>\n                            <div id=\"selectedDatesList\"><div style=\"color:rgba(var(--lh-text-rgb),0.25);font-size:0.8rem;font-style:italic;padding:4px 0;\">No dates added yet</div></div>\n                        </div>\n\n                        <div class=\"form-group repeat-mode\" id=\"rangeMode\" style=\"display:none;\">\n                            <div class=\"form-row-2\">\n                                <div class=\"form-group\"><label>Start Date</label>\n                                    <div class=\"hh-datepicker\" data-dp-id=\"calendarRangeStartDate\">\n                                        <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">Start</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                        <input type=\"hidden\" id=\"calendarRangeStartDate\">\n                                    </div>\n                                </div>\n                                <div class=\"form-group\"><label>End Date</label>\n                                    <div class=\"hh-datepicker\" data-dp-id=\"calendarEventEndDate\">\n                                        <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">End</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                        <input type=\"hidden\" id=\"calendarEventEndDate\">\n                                    </div>\n                                </div>\n                            </div>\n                            <div class=\"form-row-2\" style=\"margin-top:10px;\">\n                                <div class=\"form-group\"><label>Start Time</label><input type=\"time\" id=\"calendarRangeStartTime\"></div>\n                                <div class=\"form-group\"><label>End Time</label><input type=\"time\" id=\"calendarRangeEndTime\"></div>\n                            </div>\n                        </div>\n\n                        <div class=\"form-group repeat-mode\" id=\"recurringMode\" style=\"display:none;\">\n                            <div class=\"form-group\"><label>First Occurrence</label>\n                                <div class=\"hh-datepicker\" data-dp-id=\"calendarRecurStart\">\n                                    <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">Start date</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                    <input type=\"hidden\" id=\"calendarRecurStart\">\n                                </div>\n                            </div>\n                            <div class=\"form-row-2\">\n                                <div class=\"form-group\"><label>Repeats</label>\n                                    <select id=\"calendarRecurFreq\">\n                                        <option value=\"daily\">Daily</option>\n                                        <option value=\"weekly\" selected>Weekly</option>\n                                        <option value=\"biweekly\">Every 2 weeks</option>\n                                        <option value=\"monthly\">Monthly</option>\n                                        <option value=\"yearly\">Yearly</option>\n                                    </select>\n                                </div>\n                                <div class=\"form-group\"><label>Until (optional)</label>\n                                    <div class=\"hh-datepicker\" data-dp-id=\"calendarRecurEnd\">\n                                        <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\"><span class=\"hh-dp-label placeholder\">No end</span><span class=\"hh-dp-chevron\">&#x25BE;</span></button>\n                                        <input type=\"hidden\" id=\"calendarRecurEnd\">\n                                    </div>\n                                </div>\n                            </div>\n                            <div class=\"allday-row\">\n                                <button type=\"button\" class=\"allday-toggle\" id=\"recurAllDayToggle\" onclick=\"toggleRecurAllDay()\"></button>\n                                <span class=\"allday-label\" onclick=\"toggleRecurAllDay()\">All day</span>\n                            </div>\n                            <div id=\"recurTimeFields\" class=\"form-row-2\">\n                                <div class=\"form-group\"><label>Start Time</label><input type=\"time\" id=\"calendarRecurTime\"></div>\n                                <div class=\"form-group\"><label>End Time</label><input type=\"time\" id=\"calendarRecurEndTime\"></div>\n                            </div>\n                        </div>\n\n                        <div class=\"form-group\"><label>Location</label>\n                            <input type=\"text\" id=\"calendarEventLocation\" placeholder=\"Address or place name\">\n                        </div>\n                        <div class=\"form-group\"><label>Link</label>\n                            <input type=\"url\" id=\"calendarEventUrl\" placeholder=\"Zoom, Meet or a map link\">\n                        </div>\n                        <div class=\"form-group\"><label>Notes</label>\n                            <textarea id=\"calendarEventNote\" rows=\"2\" placeholder=\"Any details...\"></textarea>\n                        </div>\n\n                        <div class=\"form-actions\">\n                            <button type=\"button\" class=\"btn cancel-btn\" onclick=\"calendarHideAddForm()\">Cancel</button>\n                            <button type=\"submit\" class=\"btn\">Save Event</button>\n                        </div>\n                    </form>\n                </div>\n            </div>\n        </div>\n          </div>\n\n          <div data-sortkey=\"grocery\">\n          <section class=\"hm-band hm-pink\">\n            <h3 class=\"hm-h\">Grocery List</h3>\n            <div class=\"collapsible-content hm-open\" id=\"groceryContent\">\n              <div id=\"groceryList\" class=\"hm-groc\"></div>\n              <div class=\"hm-add\"><input type=\"text\" id=\"groceryInput\" placeholder=\"Add an item\" onkeypress=\"if(event.key==='Enter') addGrocery()\"><button class=\"hm-btn\" onclick=\"addGrocery()\">Add</button></div>\n            </div>\n            <span id=\"groceryIcon\" hidden></span>\n          </section>\n          </div>\n          <div id=\"sections-end-anchor\"></div>\n        </main>\n\n        \n\n    </div>\n\n    <div class=\"day-modal-overlay\" id=\"dayModalOverlay\" onclick=\"closeDayModal(event)\">\n        <div class=\"day-modal\">\n            <div class=\"day-modal-header\">\n                <div class=\"day-modal-title\" id=\"dayModalTitle\">Monday, January 6</div>\n                <button class=\"day-modal-close\" onclick=\"closeDayModal()\">&times;</button>\n            </div>\n            <div class=\"day-modal-events\" id=\"dayModalEvents\"></div>\n            <button class=\"day-modal-add\" onclick=\"showDayModalForm()\">+ Add Event</button>\n            <div class=\"day-modal-form\" id=\"dayModalForm\">\n                <input type=\"text\" id=\"dayModalEventTitle\" placeholder=\"Event title\" style=\"margin-bottom:10px;\">\n                <div style=\"display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:8px;\">\n                    <div><label style=\"font-size:0.65rem;color:rgba(var(--lh-text-rgb),0.35);text-transform:uppercase;letter-spacing:0.1em;display:block;margin-bottom:4px;\">Start</label><input type=\"time\" id=\"dayModalEventTime\"></div>\n                    <div><label style=\"font-size:0.65rem;color:rgba(var(--lh-text-rgb),0.35);text-transform:uppercase;letter-spacing:0.1em;display:block;margin-bottom:4px;\">End</label><input type=\"time\" id=\"dayModalEventEndTime\"></div>\n                </div>\n                <input type=\"text\" id=\"dayModalEventLocation\" placeholder=\"Location (optional)\" style=\"margin-bottom:8px;\">\n                <input type=\"url\"  id=\"dayModalEventUrl\"      placeholder=\"Link (optional)\"     style=\"margin-bottom:8px;\">\n                <textarea id=\"dayModalEventNote\" placeholder=\"Notes (optional)\" rows=\"2\"></textarea>\n                <input type=\"hidden\" id=\"dayModalEditId\">\n                <div class=\"day-modal-form-actions\">\n                    <button class=\"cancel-contact-btn\" onclick=\"hideDayModalForm()\">Cancel</button>\n                    <button class=\"btn\" onclick=\"saveDayModalEvent()\">Save</button>\n                </div>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"reminder-modal-overlay\" id=\"reminderModalOverlay\" onclick=\"closeReminderModal(event)\">\n        <div class=\"reminder-modal\">\n            <div class=\"reminder-modal-header\">\n                <div class=\"reminder-modal-title\">Reminders</div>\n                <button class=\"reminder-modal-close\" onclick=\"closeReminderModal()\">&times;</button>\n            </div>\n\n            <div class=\"dbk-rem-addrow\">\n                <button type=\"button\" id=\"reminderFormToggle\" onclick=\"openAddReminderPopup();closeReminderModal();\"><span id=\"reminderFormToggleLabel\">Add a reminder</span></button>\n            </div>\n\n            <div style=\"display:flex;align-items:center;gap:10px;margin-bottom:10px;padding-top:4px;\">\n                <input type=\"text\" id=\"reminderSearch\" placeholder=\"Search reminders...\"\n                    oninput=\"filterReminderList()\"\n                    style=\"flex:1;background:rgba(var(--lh-accent-rgb), 0.06);border:1px solid rgba(var(--lh-accent-rgb), 0.15);\n                    color:var(--lh-text);padding:8px 12px;font-size:0.82rem;font-family:inherit;\">\n                <span id=\"reminderModalCount\" style=\"font-size:0.65rem;text-transform:uppercase;letter-spacing:0.12em;color:rgba(var(--lh-text-rgb), 0.25);white-space:nowrap;flex-shrink:0;\"></span>\n            </div>\n            <div class=\"dbk-seg\" id=\"dbkRemKinds\" role=\"group\" aria-label=\"Show\" hidden></div>\n            <div class=\"reminder-list\" id=\"reminderModalList\"></div>\n        </div>\n    </div>\n\n    <div class=\"edit-reminder-overlay\" id=\"addReminderOverlay\" onclick=\"closeAddReminderPopup(event)\">\n        <div class=\"edit-reminder-modal\">\n            <div class=\"modal-header\">\n                <div class=\"modal-title\">Add Reminder</div>\n                <button class=\"modal-close\" onclick=\"closeAddReminderPopup()\">&times;</button>\n            </div>\n            <div class=\"modal-body\">\n                <div class=\"form-group\">\n                    <label>Title</label>\n                    <input type=\"text\" id=\"addReminderTitle\" placeholder=\"e.g., Renew car registration\">\n                </div>\n                <div style=\"display:flex;gap:10px;\">\n                    <div class=\"form-group\" style=\"flex:1;\" id=\"addReminderDateGroup\">\n                        <label>Notify Date</label>\n                        <div class=\"hh-datepicker\" data-dp-id=\"addReminderDate\">\n                            <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\">\n                                <span class=\"hh-dp-label placeholder\">Select date</span>\n                                <span class=\"hh-dp-chevron\">▾</span>\n                            </button>\n                            <input type=\"hidden\" id=\"addReminderDate\">\n                        </div>\n                    </div>\n                    <div class=\"form-group\" style=\"flex:1;\">\n                        <label>Frequency</label>\n                        <select id=\"addReminderFrequency\" onchange=\"toggleAddReminderWeeklyDay()\">\n                            <option value=\"once\">One-time</option>\n                            <option value=\"weekly\">Weekly</option>\n                            <option value=\"monthly\">Monthly</option>\n                            <option value=\"quarterly\">Every 3 months</option>\n                            <option value=\"twice\">Every 6 months</option>\n                            <option value=\"yearly\">Yearly</option>\n                        </select>\n                    </div>\n                    <div class=\"form-group\" style=\"flex:1;display:none;\" id=\"addWeeklyDayRow\">\n                        <label>Day of Week</label>\n                        <select id=\"addReminderDayOfWeek\">\n                            <option value=\"0\">Sunday</option>\n                            <option value=\"1\">Monday</option>\n                            <option value=\"2\">Tuesday</option>\n                            <option value=\"3\">Wednesday</option>\n                            <option value=\"4\">Thursday</option>\n                            <option value=\"5\">Friday</option>\n                            <option value=\"6\">Saturday</option>\n                        </select>\n                    </div>\n                </div>\n                <div class=\"form-group\">\n                    <label>Description (optional)</label>\n                    <textarea id=\"addReminderDesc\" rows=\"2\" placeholder=\"Any notes or details...\"></textarea>\n                </div>\n                <div class=\"form-group\">\n                    <label>Phone (optional)</label>\n                    <input type=\"tel\" id=\"addReminderPhone\" placeholder=\"555-0100\" autocomplete=\"off\">\n                </div>\n                <div class=\"form-group\">\n                    <label>Email (optional)</label>\n                    <input type=\"email\" id=\"addReminderEmail\" placeholder=\"name@example.com\" autocomplete=\"off\">\n                </div>\n                <div class=\"form-group\">\n                    <label>Link (optional)</label>\n                    <input type=\"url\" id=\"addReminderLink\" placeholder=\"https://...\" autocomplete=\"off\">\n                </div>\n                <div class=\"form-actions\">\n                    <button class=\"cancel-btn btn\" onclick=\"closeAddReminderPopup()\">Cancel</button>\n                    <button class=\"btn\" onclick=\"saveAddReminderPopup()\">Save</button>\n                </div>\n            </div>\n        </div>\n    </div>\n\n    <div class=\"edit-reminder-overlay\" id=\"editReminderOverlay\" onclick=\"closeEditReminderModal(event)\">\n        <div class=\"edit-reminder-modal\">\n            <div class=\"modal-header\">\n                <div class=\"modal-title\">Edit reminder</div>\n                <button class=\"modal-close\" onclick=\"closeEditReminderModal()\">&times;</button>\n            </div>\n            <div class=\"modal-body\">\n                <div class=\"form-group\">\n                    <label>Title</label>\n                    <input type=\"text\" id=\"editReminderTitle\">\n                </div>\n                <div style=\"display:flex;gap:10px;\">\n                    <div class=\"form-group\" style=\"flex:1;\" id=\"editReminderDateGroup\">\n                        <label>Notify Date</label>\n                        <div class=\"hh-datepicker\" data-dp-id=\"editReminderDate\">\n                            <button type=\"button\" class=\"hh-dp-trigger\" onclick=\"hhDpOpen(this)\">\n                                <span class=\"hh-dp-label placeholder\">Select date</span>\n                                <span class=\"hh-dp-chevron\">▾</span>\n                            </button>\n                            <input type=\"hidden\" id=\"editReminderDate\">\n                        </div>\n                    </div>\n                    <div class=\"form-group\" style=\"flex:1;\">\n                        <label>Frequency</label>\n                        <select id=\"editReminderFrequency\" onchange=\"toggleEditWeeklyDay()\">\n                            <option value=\"once\">One-time</option>\n                            <option value=\"weekly\">Weekly</option>\n                            <option value=\"monthly\">Monthly</option>\n                            <option value=\"quarterly\">Every 3 months</option>\n                            <option value=\"twice\">Every 6 months</option>\n                            <option value=\"yearly\">Yearly</option>\n                        </select>\n                    </div>\n                    <div class=\"form-group\" style=\"flex:1;display:none;\" id=\"editWeeklyDayRow\">\n                        <label>Day of Week</label>\n                        <select id=\"editReminderDayOfWeek\">\n                            <option value=\"0\">Sunday</option>\n                            <option value=\"1\">Monday</option>\n                            <option value=\"2\">Tuesday</option>\n                            <option value=\"3\">Wednesday</option>\n                            <option value=\"4\">Thursday</option>\n                            <option value=\"5\">Friday</option>\n                            <option value=\"6\">Saturday</option>\n                        </select>\n                    </div>\n                </div>\n                <div class=\"form-group\">\n                    <label>Description (optional)</label>\n                    <textarea id=\"editReminderDesc\" rows=\"2\"></textarea>\n                </div>\n                <div class=\"form-group\">\n                    <label>Phone (optional)</label>\n                    <input type=\"tel\" id=\"editReminderPhone\" placeholder=\"555-0100\" autocomplete=\"off\">\n                </div>\n                <div class=\"form-group\">\n                    <label>Email (optional)</label>\n                    <input type=\"email\" id=\"editReminderEmail\" placeholder=\"name@example.com\" autocomplete=\"off\">\n                </div>\n                <div class=\"form-group\">\n                    <label>Link (optional)</label>\n                    <input type=\"url\" id=\"editReminderLink\" placeholder=\"https://...\" autocomplete=\"off\">\n                </div>\n                <input type=\"hidden\" id=\"editReminderId\">\n                <div class=\"form-actions\">\n                    <button type=\"button\" class=\"dbk-rem-delbtn\" onclick=\"dbkDeleteEditedReminder()\">Delete</button>\n                    <button class=\"btn\" onclick=\"saveEditedReminder()\">Save</button>\n                </div>\n            </div>\n        </div>\n    </div>\n\n\n<!--\n═══════════════════════════════════════════════════════════════\n2daysbook — Firebase setup\n═══════════════════════════════════════════════════════════════\n\nPlace near end of <body>, before page-specific scripts that\nneed Firebase. Ships with empty config. Customer fills in\ntheir credentials during setup.\n\nPages check window.firebaseReady before any Firestore calls.\nIf config is empty, everything silently degrades to\nlocalStorage-only mode.\n═══════════════════════════════════════════════════════════════\n-->\n\n    \n\n\n\n\n\n\n\n\n\n\n\n\n    <div class=\"capture-sticky-bar\" id=\"captureBar\">\n        <div class=\"capture-bar-row\">\n            <input class=\"capture-bar-input\" id=\"captureInput\"\n                placeholder=\"capture a thought...\"\n                onkeypress=\"if(event.key==='Enter') captureThought(false)\">\n            <button class=\"capture-bar-send\" onclick=\"captureThought(false)\" title=\"Capture\">↵</button>\n            <button class=\"capture-inbox-btn\" id=\"inboxBtn\" onclick=\"openInbox()\">\n                inbox<span class=\"capture-inbox-badge\" id=\"inboxBadge\"></span>\n            </button>\n        </div>\n    </div>\n\n    <div class=\"inbox-modal-overlay\" id=\"inboxOverlay\" onclick=\"if(event.target===this)closeInbox()\">\n        <div class=\"inbox-modal\" id=\"inboxModal\">\n            <div class=\"inbox-modal-header\">\n                <div class=\"inbox-header-top\">\n                    <span class=\"inbox-modal-title\">Inbox</span>\n                    <div class=\"inbox-header-actions\">\n                        <span class=\"inbox-count\" id=\"inboxCount\"></span>\n                        <button type=\"button\" class=\"inbox-clear-btn\" id=\"inboxClearBtn\" onclick=\"clearAllThoughts()\" style=\"display:none;\">Clear all</button>\n                        <button type=\"button\" class=\"inbox-modal-close\" onclick=\"closeInbox()\" aria-label=\"Close\">&times;</button>\n                    </div>\n                </div>\n            </div>\n            <div class=\"inbox-capture-row\">\n                <input class=\"inbox-capture-input\" id=\"inboxCaptureInput\"\n                    placeholder=\"Add a note\" aria-label=\"Add a note\" enterkeyhint=\"send\" autocomplete=\"off\"\n                    onkeydown=\"if(event.key==='Enter'){event.preventDefault();captureThought(true);}\">\n                <button type=\"button\" class=\"inbox-capture-send\" onclick=\"captureThought(true)\" title=\"Add\" aria-label=\"Add\">+</button>\n            </div>\n            <div class=\"inbox-modal-body\" id=\"inboxBody\"></div>\n            <div class=\"inbox-search-row\" style=\"display:none\">\n                <input class=\"inbox-search\" id=\"inboxSearchInput\" type=\"search\" placeholder=\"Search notes\" aria-label=\"Search notes\" autocomplete=\"off\" enterkeyhint=\"search\" oninput=\"onInboxSearch(this.value)\">\n            </div>\n        </div>\n    </div>\n\n\n<!--@js:grocery-words.js-->\n<!--@js:grocery-aisle.js-->\n<!--@js:known-titles.js-->\n<!--@js:inbox-words.js-->\n<!--@js:inbox-suggest.js-->\n<!--@js:dashboard.js-->\n<!--@js:dbk-places.js-->\n<!--@js:work-spaces.js-->\n<!--@js:meal-notes.js-->\n<!--@js:meal-cookplan.js-->\n<!--@js:dbk-welcome.js-->\n<!--@js:gate.js-->\n</body>\n</html>\n"},"assets":{"sample-seed.js":"/* 2daysbook sample for the website phone: Nora & Ben, from the app's own sample household (public/demo-data.js),\n   dated from today. Made-up data only; written to this browser, nothing is sent anywhere. */\n(function(){var SEED=\"nora-v20\";var L,S;try{L=window.localStorage;S=window.sessionStorage}catch(e){return}function ymd(d){return d.getFullYear()+\"-\"+(\"0\"+(d.getMonth()+1)).slice(-2)+\"-\"+(\"0\"+d.getDate()).slice(-2)}function set(k,v){try{L.setItem(k,typeof v===\"string\"?v:JSON.stringify(v))}catch(e){}}var SHOT={};try{SHOT=JSON.parse(S.getItem(\"dbkSampleShot\")||\"{}\")||{}}catch(e){}if(SHOT.seed)SEED=SEED+\":\"+SHOT.seed;function base(){set(\"myPersonRole\",SHOT.role||\"person1\");set(\"dbkRoleUid\",\"demo_\"+(SHOT.role||\"person1\"));set(\"setupComplete\",\"true\");set(\"htSetupComplete\",\"true\");set(\"showPartner2\",\"true\");set(\"userNames\",{name1:\"Nora\",name2:\"Ben\"});set(\"appName\",\"2daysBook\");set(\"dbkWelcomeSeen_person1\",\"1\");set(\"dbkWelcomeSeen_person2\",\"1\");[\"person1\",\"person2\"].forEach(function(p){try{if(!L.getItem(\"dbkLook_\"+p))set(\"dbkLook_\"+p,{t:\"2timelines\",h:\"playfair\",b:\"lora\",fam:\"p1\"})}catch(e){}});try{L.removeItem(\"firebaseConfig\");L.removeItem(\"dbkCrmLinked\")}catch(e){}}try{var realFetch=window.fetch&&window.fetch.bind(window);if(realFetch&&!window._dbkFetchWrapped){window._dbkFetchWrapped=true;window.fetch=function(u,o){if(typeof u===\"string\"&&u.indexOf(\"api.open-meteo.com\")>=0){var t=ymd(new Date);var canned={current:{temperature_2m:64,weather_code:2,apparent_temperature:63,relative_humidity_2m:58,wind_speed_10m:6,precipitation:0},daily:{temperature_2m_max:[71],temperature_2m_min:[49],uv_index_max:[4.1],precipitation_probability_max:[10],sunrise:[t+\"T07:31\"],sunset:[t+\"T18:58\"]}};var fake=function(){return new Response(JSON.stringify(canned),{headers:{\"Content-Type\":\"application/json\"}})};return Promise.resolve(fake())}return realFetch(u,o)}}}catch(e){}try{var nwsFetch=window.fetch;if(nwsFetch&&!window._dbkNwsWrapped){window._dbkNwsWrapped=true;window.fetch=function(u,o){var s=typeof u===\"string\"?u:(u&&u.url)||\"\";if(s.indexOf(\"api.weather.gov\")>=0||s.indexOf(\"ncep.noaa.gov\")>=0){var N=\"https://api.weather.gov\",j=function(x,st){return Promise.resolve(new Response(JSON.stringify(x),{status:st||200,headers:{\"Content-Type\":\"application/geo+json\"}}))};if(s.indexOf(\"/points/\")>=0)return j({properties:{forecastHourly:N+\"/gridpoints/GSP/sample/forecast/hourly\",forecast:N+\"/gridpoints/GSP/sample/forecast\",observationStations:N+\"/gridpoints/GSP/sample/stations\",timeZone:\"America/New_York\",relativeLocation:{properties:{city:\"Asheville\",state:\"NC\"}}}});if(s.indexOf(\"/forecast/hourly\")>=0){var per=[],h0=new Date();h0.setMinutes(0,0,0);var T=[64,65,66,67,68,69,70,71,70,68,65,62,59,57,55,53,52,51,50,49,49,50,53,57];for(var i=0;i<24;i++){var t=new Date(h0.getTime()+i*36e5),hr=t.getHours(),day=hr>=7&&hr<19;var off=-t.getTimezoneOffset(),sg=off>=0?\"+\":\"-\",ao=Math.abs(off);var iso=t.getFullYear()+\"-\"+(\"0\"+(t.getMonth()+1)).slice(-2)+\"-\"+(\"0\"+t.getDate()).slice(-2)+\"T\"+(\"0\"+hr).slice(-2)+\":00:00\"+sg+(\"0\"+Math.floor(ao/60)).slice(-2)+\":\"+(\"0\"+ao%60).slice(-2);per.push({startTime:iso,temperature:T[i],temperatureUnit:\"F\",isDaytime:day,icon:N+\"/icons/land/\"+(day?\"day\":\"night\")+\"/sct?size=small\",shortForecast:day?\"Partly Sunny\":\"Partly Cloudy\",probabilityOfPrecipitation:{value:10},relativeHumidity:{value:58},windSpeed:\"6 mph\"})}return j({properties:{periods:per}})}if(s.indexOf(\"/forecast\")>=0)return j({properties:{periods:[{isDaytime:true,temperature:71,probabilityOfPrecipitation:{value:10},shortForecast:\"Partly Sunny\"},{isDaytime:false,temperature:49,probabilityOfPrecipitation:{value:5},shortForecast:\"Partly Cloudy\"}]}});if(s.indexOf(\"/stations\")>=0||s.indexOf(\"/alerts\")>=0)return j({features:[]});return j({},404)}return nwsFetch.apply(this,arguments)}}}catch(e){}var seeded=false;try{seeded=S.getItem(\"dbkSample\")===SEED}catch(e){}if(seeded){base();return}try{var keep=/^(site:|tl:)/;for(var i=L.length-1;i>=0;i--){var key=L.key(i);if(key&&!keep.test(key))L.removeItem(key)}}catch(e){}\n/* 2daysbook sample household for the live preview (demo.html). Never shipped to a buyer: tools/build.mjs leaves\n   this file and demo.html out of every build.\n   Builds about six months of believable, imperfect daily use for a made-up couple, Nora and Ben, all dated from\n   today so it always looks current, and writes it to this browser's storage (the same keys the app uses when it\n   has no online storage). Nothing is fetched or sent anywhere.\n   Some parts only keep recent history on their own (habit and routine checks, the meal plan), so those go back\n   as far as the app keeps them (about three months, two for routine checks). */\n/* The app's own starter recipes (the five a new copy starts with, as the Meals page saves them), so planned meals match its recipe book. */\nwindow.DEMO_RECIPES = [{\"id\":\"r_bonus_1_pee9a4\",\"name\":\"Breakfast Burritos (Freezer-Friendly)\",\"type\":\"Breakfast\",\"types\":[\"Breakfast\"],\"protein\":21,\"calories\":335,\"fiber\":2,\"prepTime\":15,\"ingredients\":[\"3 eggs, scrambled\",\"3 oz chicken sausage or turkey sausage, diced\",\"1/4 cup sautéed spinach\",\"1/4 cup sautéed onion + bell pepper\",\"2 tbsp shredded cheese\",\"2 large whole wheat tortillas\",\"Hot sauce\"],\"steps\":[\"Cook sausage in skillet 3-4 min. Add onion + peppers, cook 2 min. Add spinach, wilt.\",\"Scramble eggs in same pan with the veggies and sausage.\",\"Divide between 2 tortillas, add cheese and hot sauce.\",\"Roll tightly burrito-style. Wrap each in foil for freezer.\",\"FREEZE: Up to 3 months. REHEAT: Remove foil, wrap in damp paper towel, microwave 2 min, flip, 1 more min.\"],\"prepped\":null,\"tip\":\"Make a batch of 6-8 on prep day and freeze. The ultimate grab-and-go savory breakfast. Macros are per burrito. Eggs provide choline, which supports memory and brain function, and the veggie combo adds fiber to keep blood sugar steady all morning.\",\"portion\":\"21g protein - 335 cal\",\"portions\":[\"21g protein\",\"335 cal\",\"2g fiber\",\"15 min\",\"per burrito\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_5_u6w3b5\",\"name\":\"Chicken Burrito Bowl\",\"type\":\"Lunch\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":45,\"calories\":560,\"fiber\":9,\"prepTime\":15,\"ingredients\":[\"5 oz chicken breast\",\"1/2 tsp cumin\",\"1/2 tsp chili powder\",\"1/2 tsp garlic powder\",\"Salt, pepper\",\"1 tsp olive oil\",\"1/2 cup cooked brown rice\",\"1/2 cup black beans\",\"1/4 cup corn\",\"2 tbsp crumbled feta\",\"Squeeze of lime\",\"Hot sauce\"],\"steps\":[\"Season chicken breast with cumin, chili powder, garlic powder, salt, and pepper.\",\"Heat olive oil in a skillet over medium-high. Cook chicken 5-6 min per side until cooked through (165°F). Let rest 3 min, then slice or cube.\",\"While chicken cooks, warm rice, beans, and corn.\",\"Assemble bowl: rice on the bottom, chicken, beans, and corn on top. Add feta and a big squeeze of lime.\",\"Hot sauce to taste.\"],\"prepped\":{\"ingredients\":[\"5 oz prepped chicken (grilled or rotisserie)\",\"1/2 cup cooked brown rice\",\"1/2 cup black beans\",\"1/4 cup corn\",\"2 tbsp crumbled feta\",\"Squeeze of lime\",\"Hot sauce\"],\"steps\":[\"Reheat chicken, rice, beans, and corn.\",\"Assemble bowl. Top with feta and a big squeeze of lime.\",\"Hot sauce to taste.\"]},\"tip\":\"Endlessly customizable. Swap feta for cheddar, add salsa or sour cream, throw in avocado. Black beans and brown rice together form a complete protein, and the beans deliver fiber that supports heart health and steady energy.\",\"portion\":\"45g protein - 560 cal\",\"portions\":[\"45g protein\",\"560 cal\",\"9g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_11_1wkr32\",\"name\":\"Creamy Tuscan Chicken\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":58,\"calories\":510,\"fiber\":4,\"prepTime\":30,\"ingredients\":[\"6 oz chicken breast, sliced thin\",\"1/4 cup sun-dried tomatoes, chopped\",\"2 cloves garlic, minced\",\"1/3 cup cottage cheese (blended smooth)\",\"2 tbsp parmesan\",\"1 cup baby spinach\",\"1 tbsp butter\",\"1/2 tsp oregano\",\"1/4 tsp crushed red pepper\",\"Salt, pepper\",\"Fresh basil\"],\"steps\":[\"Melt butter in skillet over medium heat. Add garlic, oregano, red pepper. Sauté 1 min.\",\"Add sliced chicken, season with salt and pepper. Sear each side until golden and cooked through.\",\"Remove chicken, set aside.\",\"In same pan, add blended cottage cheese, sun-dried tomatoes, and parmesan. Stir until creamy and warmed through.\",\"Add spinach, stir until just wilted. Return chicken to the pan, coat in sauce.\",\"Top with fresh basil. Serve over rice, pasta, or with crusty bread.\"],\"prepped\":null,\"tip\":\"The cottage cheese blends into a creamy sauce without heavy cream, delivering casein protein that digests slowly and keeps you satisfied for hours. Sun-dried tomatoes add lycopene, a powerful antioxidant for heart and skin health.\",\"portion\":\"58g protein - 510 cal\",\"portions\":[\"58g protein\",\"510 cal\",\"4g fiber\",\"30 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_14_y6bnxi\",\"name\":\"Turkey Bolognese Baked Ziti\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":36,\"calories\":490,\"fiber\":4,\"prepTime\":40,\"ingredients\":[\"6 oz ground turkey (93% lean)\",\"4 oz ziti or penne\",\"1 cup marinara sauce\",\"1/4 cup ricotta\",\"1/4 cup shredded mozzarella\",\"1 tbsp parmesan\",\"2 cloves garlic, minced\",\"1 tsp olive oil\",\"1/2 tsp Italian seasoning\",\"1/4 tsp red pepper flakes\",\"1 cup baby spinach\",\"Salt, pepper\"],\"steps\":[\"Cook pasta 2 min short of package time (it finishes in the oven). Drain.\",\"Heat olive oil in skillet. Brown turkey with garlic, Italian seasoning, red pepper flakes. Add marinara, simmer 5 min. Stir in spinach until wilted.\",\"Mix pasta into the sauce. Transfer to a baking dish.\",\"Dollop ricotta on top, scatter mozzarella and parmesan.\",\"Bake 375°F for 15-20 min until bubbly and golden. Let rest 5 min.\"],\"prepped\":null,\"tip\":\"This recipe makes 2 generous servings. Macros shown are per serving. Make a big batch, portion into containers, reheat all week. It's actually better the next day. Turkey is one of the leanest proteins available and rich in B vitamins for energy. The three-cheese topping makes it feel indulgent.\",\"portion\":\"36g protein - 490 cal\",\"portions\":[\"36g protein\",\"490 cal\",\"4g fiber\",\"40 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_18_za5t8x\",\"name\":\"Crock Pot Honey Garlic Chicken\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":50,\"calories\":540,\"fiber\":1,\"prepTime\":0,\"ingredients\":[\"6 oz chicken breast or thighs\",\"1.5 tbsp honey\",\"1 tbsp low-sodium soy sauce\",\"1 tbsp ketchup\",\"1 clove garlic, minced\",\"1 tsp sesame oil\",\"1/2 tsp sriracha\",\"1 tsp cornstarch + 1 tbsp water (slurry)\",\"Sesame seeds\",\"Green onions\",\"--- SERVE WITH ---\",\"1/2 cup steamed rice\",\"1 cup steamed broccoli\"],\"steps\":[\"Whisk honey, soy sauce, ketchup, garlic, sesame oil, sriracha in crock pot.\",\"Add chicken, coat in sauce.\",\"Cook LOW 3-4 hours or HIGH 1.5-2.5 hours. Chicken thighs can go LOW 4-6 hours, but breasts dry out past 4.\",\"Remove chicken. Whisk cornstarch slurry into sauce, cook HIGH 10 min to thicken.\",\"Shred or slice chicken, return to thickened sauce, toss to coat.\",\"Serve over rice with broccoli. Top with sesame seeds and green onions.\",\"BATCH TIP: Scale up to 1.5 lbs chicken for 4+ servings of easy meal prep.\"],\"prepped\":null,\"tip\":\"The sauce caramelizes into a sticky, glossy glaze that rivals takeout. Ingredients listed make 1 serving. Garlic contains allicin, which supports immune function and cardiovascular health.\",\"portion\":\"50g protein - 540 cal\",\"portions\":[\"50g protein\",\"540 cal\",\"1g fiber\",\"4-6 hrs crock\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Asian\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"}];\n(function () {\n  'use strict';\n\n  // ---------- helpers ----------\n  var seed = 201;  // picked so the last week of habits looks like a typical week\n  function rnd() { seed |= 0; seed = seed + 0x6D2B79F5 | 0; var t = Math.imul(seed ^ seed >>> 15, 1 | seed); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n  function chance(p) { return rnd() < p; }\n  function pick(a) { return a[Math.floor(rnd() * a.length)]; }\n  function int(a, b) { return a + Math.floor(rnd() * (b - a + 1)); }\n  function money(a, b) { return Math.round((a + rnd() * (b - a)) * 100) / 100; }\n  function shuffle(a) { a = a.slice(); for (var i = a.length - 1; i > 0; i--) { var j = Math.floor(rnd() * (i + 1)); var t = a[i]; a[i] = a[j]; a[j] = t; } return a; }\n  var T0 = new Date(); T0.setHours(0, 0, 0, 0);\n  function day(n) { var d = new Date(T0); d.setDate(d.getDate() + n); return d; }\n  function ymd(d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); }\n  function dk(n) { return ymd(day(n)); }\n  function iso(n, h, m) { var d = day(n); d.setHours(h || 12, m || 0, 0, 0); return d.toISOString(); }\n  function ym(d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2); }\n  function daysIn(y, m) { return new Date(y, m + 1, 0).getDate(); }\n  var uidN = 0;\n  function uid(p) { uidN++; return (p || 'd') + '_' + (1700000000000 + uidN * 7919).toString(36) + uidN; }\n  // the day offset (from today) of the next/previous given weekday\n  function nextDow(dow, from) { var n = from || 0; while (day(n).getDay() !== dow) n++; return n; }\n\n  var out = {};\n  function put(k, v) { out[k] = typeof v === 'string' ? v : JSON.stringify(v); }\n\n  // ---------- the household ----------\n  put('userNames', { name1: 'Nora', name2: 'Ben' });\n  put('weekStart', '0');\n  put('showPartner2', 'true');\n  put('showKids', 'false');\n  put('kidProfiles', []);\n  put('challengeSet', 'couple');\n  put('mealplan_pantry_staples', 'olive oil, rice, garlic, onions, salt, pasta, canned tomatoes, eggs, butter, flour');\n  put('htSetupComplete', '1');\n  put('userLocation', { lat: 35.5951, lon: -82.5515, name: 'Asheville, NC' });   // weather on Today (the website phone's made-up weather is Asheville too)\n\n  // ---------- calendar ----------\n  var events = [];\n  function ev(title, n, time, extra) {\n    events.push(Object.assign({ id: uid('lh'), title: title, date: dk(n), time: time || null, endTime: null, allDay: !time, note: null, location: null, url: null, color: null,\n      isMultiDay: false, eventGroup: null, repeatMode: 'single', recurring: null }, extra || {}));\n  }\n  function range(title, from, to, time, extra) {\n    var grp = uid('g');\n    for (var n = from; n <= to; n++) ev(title, n, time, Object.assign({ isMultiDay: true, eventGroup: grp, repeatMode: 'range', allDay: false }, extra || {}));\n  }\n  function repeat(title, startN, endN, step, time, extra, freq, monthly) {\n    var grp = uid('g'), rec = { freq: freq || (step === 7 ? 'weekly' : step === 14 ? 'biweekly' : 'daily'), endDate: (extra && extra._end) || null };\n    var x = Object.assign({}, extra || {}); delete x._end;\n    if (monthly) {\n      var d0 = day(startN);\n      for (var k = 0; ; k++) {\n        var d = new Date(d0.getFullYear(), d0.getMonth() + k, Math.min(d0.getDate(), daysIn(d0.getFullYear(), d0.getMonth() + k)));\n        var n2 = Math.round((d - T0) / 86400000); if (n2 > endN) break;\n        ev(title, n2, time, Object.assign({ isMultiDay: true, eventGroup: grp, repeatMode: 'recurring', recurring: { freq: 'monthly', endDate: null } }, x));\n      }\n      return;\n    }\n    for (var n = startN; n <= endN; n += step) ev(title, n, time, Object.assign({ isMultiDay: true, eventGroup: grp, repeatMode: 'recurring', recurring: rec }, x));\n  }\n  // repeating\n  repeat('Rec soccer (Ben)', nextDow(2, -150), 70, 7, '19:00', { location: 'Westside Park fields', color: 'teal' });\n  repeat('Date night', nextDow(5, -172), 56, 14, '18:30', { color: 'rose' });\n  repeat('Book club at Priya’s', -158, 70, 0, '19:00', { color: 'lavender', note: 'Bring wine or dessert' }, 'monthly', true);\n  repeat('Pack & ship orders', nextDow(1, -176), 70, 7, '09:00', { space: 'work', color: 'gold' });\n  repeat('Saturday farmers market booth', nextDow(6, -126), -22, 7, '07:30', { space: 'work', color: 'gold', location: 'Main St. lot', _end: dk(-22) });\n  repeat('Yoga', nextDow(3, -90), 70, 7, '18:00', { color: 'sage' });\n  // past one-offs\n  ev('Dentist (Nora)', -141, '08:30', { location: 'Brightside Dental' });\n  ev('Dinner at Mom & Dad’s', -119, '17:30');\n  ev('Photo shoot: spring napkins', -101, '10:00', { space: 'work' });\n  ev('Juniper’s checkup', -95, '10:00', { location: 'Riverside Vet', note: 'Ask about the itchy paw' });\n  ev('Lena’s birthday party', -77, '14:00', { location: 'Lena & Marco’s' });\n  ev('Haircut', -61, '16:15');\n  ev('Oil change', -46, '08:00');\n  ev('Ben’s physical', -25, '09:15', { location: 'Dr. Okafor' });\n  ev('Call with Dana: custom baby quilt', -20, '15:00', { space: 'work' });\n  ev('Fabric pickup at Mill Supply', -6, '11:00', { space: 'work' });\n  ev('Coffee with Jess', -3, '10:00', { location: 'Little Bird Café' });\n  range('Priya & Tom’s wedding', -33, -31, null, { color: 'rose', location: 'Lake Hollis Lodge' });\n  range('Riverside Makers Market', -12, -11, '08:00', { space: 'work', color: 'gold' });\n  ev('Savannah trip', -150, null, { isMultiDay: true, eventGroup: 'g_sav', repeatMode: 'range', allDay: false });\n  ev('Savannah trip', -149, null, { isMultiDay: true, eventGroup: 'g_sav', repeatMode: 'range', allDay: false });\n  ev('Savannah trip', -148, null, { isMultiDay: true, eventGroup: 'g_sav', repeatMode: 'range', allDay: false });\n  // today and coming up\n  ev('Fabric delivery window', 0, '13:00', { space: 'work', url: 'https://www.ups.com/track' });\n  ev('Pick up dry cleaning', 0, '17:15');\n  ev('Dentist (Ben)', 4, '08:00', { location: 'Brightside Dental' });\n  ev('Holiday market application due', 6, null, { space: 'work', url: 'https://example.org/holiday-market' });\n  ev('Juniper’s grooming', 9, '13:00');\n  ev('Brunch with the Parkers', 11, '11:00', { location: 'The Copper Kettle' });\n  ev('Call with Dana: quilt delivery', 13, '16:00', { space: 'work', url: 'https://zoom.us/j/5550123456' });\n  ev('Car inspection', 16, '08:30');\n  range('Harvest Makers Fair', 20, 21, '09:00', { space: 'work', color: 'gold' });\n  ev('Concert with Sam & Ali', 24, '20:00', { location: 'The Orpheum' });\n  range('Highlands long weekend', 34, 37, null, { color: 'teal' });\n  ev('Ben’s mom’s birthday dinner', 42, '18:00');\n  put('calendarEvents', events);\n\n  // ---------- reminders ----------\n  function md(n) { var d = day(n); return { month: d.getMonth() + 1, day: d.getDate() }; }\n  function occ(dayOfMonth, monthsBack) { var d = new Date(T0.getFullYear(), T0.getMonth() - monthsBack, Math.min(dayOfMonth, daysIn(T0.getFullYear(), T0.getMonth() - monthsBack))); return ymd(d); }\n  function rem(o) { return Object.assign({ id: uid('r'), description: null, link: null, phone: null, email: null, lastDone: null, snoozedUntil: null }, o); }\n  var today = T0.getDate();\n  var reminders = [\n    rem({ title: 'Pay rent', frequency: 'monthly', notifyDate: { month: 1, day: 1 }, lastDoneFor: occ(1, today >= 1 ? 0 : 1), lastDone: iso(-today + 1, 9) }),\n    // the power bill is a few days overdue this month (done last month, not yet this month)\n    rem({ id: 'bill-b3', fromFinance: true, note: 'From Finance > Bills', title: 'Pay Power', frequency: 'monthly', notifyDate: { month: 1, day: Math.max(1, Math.min(today - 3, 26)) }, lastDoneFor: occ(Math.max(1, Math.min(today - 3, 26)), 1), lastDone: iso(-34, 19), description: 'Usually comes out of Joint checking', autoDesc: 'Usually comes out of Joint checking' }),\n    rem({ title: 'Pay the credit card', frequency: 'monthly', notifyDate: { month: 1, day: 15 }, lastDoneFor: occ(15, today >= 15 ? 0 : 1), lastDone: iso(-5, 20), link: 'https://www.capitalone.com' }),\n    rem({ title: 'Phone bill', frequency: 'monthly', notifyDate: { month: 1, day: 21 }, lastDoneFor: occ(21, today >= 21 ? 0 : 1), lastDone: iso(-28, 8) }),\n    rem({ title: 'Car insurance', frequency: 'monthly', notifyDate: { month: 1, day: 28 }, lastDoneFor: occ(28, 1), lastDone: iso(-21, 8) }),\n    rem({ title: 'Take out trash & recycling', frequency: 'weekly', dayOfWeek: 4, lastDone: iso(-((T0.getDay() - 4 + 7) % 7) - 7, 21) }),\n    rem({ title: 'Water the plants', frequency: 'weekly', dayOfWeek: 0, lastDone: iso(-T0.getDay(), 10) }),\n    rem({ title: 'Quarterly estimated taxes', frequency: 'quarterly', notifyDate: md(27), space: 'work', description: 'Shop income: IRS Direct Pay', link: 'https://www.irs.gov/payments/direct-pay' }),\n    rem({ title: 'Renew Etsy shop ads budget', frequency: 'monthly', notifyDate: { month: 1, day: Math.min(28, today + 2) }, lastDoneFor: occ(Math.min(28, today + 2), 1), space: 'work', link: 'https://www.etsy.com/your/shops/me/advertising' }),\n    rem({ title: 'Send Dana the final invoice', frequency: 'once', notifyDate: dk(2), space: 'work' }),\n    rem({ title: 'Order more mailers & tissue', frequency: 'once', notifyDate: dk(-2), space: 'work' }),\n    rem({ title: 'Schedule Juniper’s vaccines', frequency: 'once', notifyDate: dk(-4), phone: '555-0148', description: 'Riverside Vet' }),\n    rem({ title: 'Return library books', frequency: 'once', notifyDate: dk(1) }),\n    rem({ title: 'RSVP to Ali’s 40th', frequency: 'once', notifyDate: dk(5) }),\n    rem({ title: 'Renew Nora’s passport', frequency: 'once', notifyDate: dk(38), link: 'https://travel.state.gov' }),\n    rem({ title: 'Car registration', frequency: 'yearly', notifyDate: md(64), lastDone: iso(-301, 12) }),\n    rem({ title: 'Anniversary', frequency: 'yearly', notifyDate: md(53), description: 'Book Bistro Lune' }),\n    rem({ title: 'Ben’s mom’s birthday card', frequency: 'yearly', notifyDate: md(36) }),\n    rem({ title: 'Replace furnace filter', frequency: 'twice', notifyDate: md(18), lastDone: iso(-165, 11) })\n  ];\n  put('lifeReminders', reminders);\n\n  // ---------- Today's Three, Back Burner, inbox ----------\n  var todayStr = T0.toDateString();\n  put('threeThings_person1', { date: todayStr, items: [{ text: 'Finish binding the Dana quilt', done: false }, { text: 'Email Mill Supply about the backorder', done: true }, { text: 'Book Juniper’s grooming', done: false }] });\n  put('threeThings_person2', { date: todayStr, items: [{ text: 'Return library books', done: true }, { text: 'Call about the car inspection', done: false }, { text: 'Plan the Highlands hikes', done: false }] });\n  function later(text, n, done) { return { id: 1700000000000 + int(1, 9e8), text: text, completed: !!done, createdAt: iso(n, 20) }; }\n  put('futureTodos_person1', [later('Repaint the studio door', -120), later('Try the scrappy star pattern', -88), later('Start a shop newsletter', -60), later('Sort the fabric scraps bin', -41, true), later('Frame the Savannah photos', -15)]);\n  put('futureTodos_person2', [later('Fix the squeaky gate', -140), later('Learn to make sourdough', -97), later('Clean out the garage', -52), later('Research new running shoes', -30, true)]);\n  function note(text, minsAgo, tag) { var t = Date.now() - minsAgo * 60000; return { id: t, text: text, tag: tag || null, createdAt: new Date(t).toISOString() }; }\n  put('capturedThoughts_person1', [\n    note('that thing Ana said about wholesale', 60 * 52), note('Watch The Diplomat', 60 * 30, null), note('Try Kumo Ramen on 5th', 60 * 20),\n    note('Pay the water bill', 60 * 8, 'task'), note('reel idea: binding a quilt in 60 seconds', 60 * 5, 'idea'), note('batting, thread, rotary blades', 90, 'buy'), note('Vet Thursday at 10am', 25)\n  ]);\n  put('capturedThoughts_person2', [note('oat milk, eggs, coffee beans', 60 * 3, 'buy'), note('Book the Smoky Mountains cabin for spring', 60 * 26), note('Read The Wager', 60 * 70)]);\n\n  // ---------- groceries ----------\n  var g = ['Oat milk', 'Eggs', 'Bananas', 'Spinach', 'Chicken thighs', 'Shredded parmesan', 'Tortillas', 'Greek yogurt', 'Coffee beans', 'Lemons', 'Dog treats', 'Paper towels', 'Avocados', 'Sourdough bread'];\n  put('groceries', g.map(function (t, i) { return { id: 1700000001000 + i, text: t, completed: i === 3 || i === 8 || i === 11 }; }));\n\n  // ---------- habits ----------\n  function lines(n) {\n    var cols = Math.max(3, Math.ceil(Math.sqrt(n))), rows = Math.ceil(n / cols), L = [], r, c, i;\n    for (r = 0; r < rows; r++) { var row = []; for (c = 0; c < cols; c++) if (r * cols + c < n) row.push(r * cols + c); if (row.length === cols) L.push(row); }\n    for (c = 0; c < cols; c++) { var col = []; for (r = 0; r < rows; r++) if (r * cols + c < n) col.push(r * cols + c); if (col.length === rows) L.push(col); }\n    if (rows === cols && n === rows * cols) { var d1 = [], d2 = []; for (i = 0; i < rows; i++) { d1.push(i * cols + i); d2.push(i * cols + (cols - 1 - i)); } L.push(d1, d2); }\n    return L;\n  }\n  function habitsFor(who, list, odds) {\n    put(who + 'CustomHabits', list);\n    var log = {}, card = {}, L = lines(list.length);\n    for (var n = -89; n <= -1; n++) {\n      if (chance(0.07)) continue;                       // a day the app wasn't opened\n      var d = day(n), weekend = d.getDay() === 0 || d.getDay() === 6, h = shuffle(list), done = [];\n      list.forEach(function (name, i) {\n        var p = odds[i];\n        if (typeof p === 'function') p = p(n);\n        if (weekend) p *= 0.85;\n        if (chance(p)) done.push(name);\n      });\n      log[dk(n)] = done;\n      var b = L.filter(function (line) { return line.every(function (ix) { return done.indexOf(h[ix]) !== -1; }); }).length;\n      card[dk(n)] = { h: h, b: b };\n    }\n    // today: a few checked so far, no line finished yet\n    var th = shuffle(list), state, tries = 0;\n    do { state = th.map(function () { return chance(0.4); }); tries++; } while (L.some(function (line) { return line.every(function (ix) { return state[ix]; }); }) && tries < 50);\n    log[dk(0)] = th.filter(function (x, i) { return state[i]; });\n    card[dk(0)] = { h: th, b: 0 };\n    put('habitLog_' + who, log);\n    put('habitCard_' + who, card);\n    put('bingoState_' + who, { habits: th, state: state, date: todayStr });\n    put('bingoDate_' + who, todayStr);\n    put('prevBingoCount_' + who, { date: todayStr, lines: [] });\n  }\n  var ramp = function (a, b) { return function (n) { return a + (b - a) * (n + 89) / 89; }; };\n  habitsFor('person1', ['Morning pages', 'Walk Juniper', 'Drink 8 glasses of water', 'Stretch 10 minutes', 'Read before bed', 'No phone first 30 min', 'Cook dinner at home', 'Sew for 30 minutes', 'In bed by 10:30'],\n    [ramp(0.25, 0.7), 0.92, 0.55, 0.45, 0.72, ramp(0.5, 0.12), 0.78, 0.62, 0.48]);\n  habitsFor('person2', ['Run or bike', 'Strength training', 'Drink 8 glasses of water', 'Floss', 'Read 20 pages', 'Meditate 5 minutes', 'No screens after 10', 'Call a friend or family', 'Take vitamins'],\n    [0.6, 0.45, 0.7, ramp(0.2, 0.55), 0.5, ramp(0.55, 0.15), 0.35, 0.3, 0.85]);\n\n  // routine (checks are kept for 60 days)\n  function routine(who, steps) {\n    var list = steps.map(function (s, i) { return { id: 'r' + who.slice(-1) + 'x' + i, title: s[0], time: s[1], days: s[2] || [0, 1, 2, 3, 4, 5, 6], notes: s[3] || '' }; });\n    put('routine_' + who, list);\n    var doneMap = {};\n    for (var n = -58; n <= 0; n++) {\n      var dow = day(n).getDay(), ids = [];\n      list.forEach(function (s) { if (s.days.indexOf(dow) !== -1 && (n < 0 ? chance(0.74) : (s.time && s.time < '12:00' && chance(0.8)))) ids.push(s.id); });\n      if (ids.length) doneMap[dk(n)] = ids;\n    }\n    put('routineDone_' + who, doneMap);\n  }\n  routine('person1', [['Coffee + morning pages', '06:45'], ['Walk Juniper', '07:15', null, 'The long loop on weekends'], ['Check Etsy orders', '08:30', [1, 2, 3, 4, 5]], ['Sewing block', '13:00', [1, 2, 3, 4]], ['Tidy the studio', '17:00', [5]], ['Tea + book, no screens', '21:30']]);\n  routine('person2', [['Gym', '06:00', [1, 3, 5]], ['Run', '06:30', [2, 4]], ['Vitamins + breakfast', '07:15'], ['Pack lunch', '07:30', [1, 2, 3, 4, 5]], ['Sunday meal prep', '16:00', [0], 'Rice, roast veg, chicken for the week'], ['Dishes + reset the kitchen', '20:30']]);\n\n  put('resources_person1', {\n    'Sleep': [{ title: 'Sleep hygiene basics', link: 'https://www.sleepfoundation.org/sleep-hygiene', note: 'Cool room, same wake-up time' }, { title: 'Wind-down playlist', link: null, note: 'The one on the kitchen speaker' }],\n    'Sewing': [{ title: 'Quarter-inch seam tips', link: null, note: 'Ask Marie at Mill Supply' }, { title: 'Binding by machine', link: 'https://www.youtube.com/results?search_query=machine+quilt+binding', note: null }],\n    'Morning pages': [{ title: 'Three pages, longhand', link: null, note: 'Doesn’t have to be good' }]\n  });\n  put('resources_person2', {\n    'Running': [{ title: 'Couch to 10K plan', link: 'https://www.nhs.uk/live-well/exercise/running-and-aerobic-exercises/', note: 'Week 7 now' }],\n    'Strength': [{ title: 'Three-day full body routine', link: null, note: 'Squat, press, row, deadlift' }]\n  });\n  // monthly challenge: the household has been at it about six months\n  var start = new Date(T0.getFullYear(), T0.getMonth() - 6, 1);\n  put('couple_start_date', ymd(start));\n  put('dreams_monthlyChallenge', { month: 'M6', index: 3, next: 4, completed: false, notes: '' });\n  put('lh_skipped_challenges', []);\n\n  // ---------- lists ----------\n  function item(o, n) { var id = 1700000002000 + (uidN++); return Object.assign({ id: id, firebaseId: 'item_' + id, title: '', details: '', notes: '', achieved: false, dateAdded: iso(n == null ? -int(5, 170) : n, 12) }, o); }\n  put('dreams_restaurants', [\n    item({ title: 'Lucia’s Trattoria', priceRange: '$$$', restaurantTypes: ['dinner'], occasion: 'date-night', priority: 'high', details: 'Handmade pasta, book ahead' }),\n    item({ title: 'Blue Plate Diner', priceRange: '$', restaurantTypes: ['breakfast', 'lunch'], occasion: '', details: 'Jess says the hash browns are unreal' }),\n    item({ title: 'Pho 88', priceRange: '$', restaurantTypes: ['lunch', 'dinner'], occasion: '' }),\n    item({ title: 'Ember & Oak', priceRange: '$$$$', restaurantTypes: ['dinner'], occasion: 'special', details: 'Tasting menu. Anniversary?' }),\n    item({ title: 'The Biscuit Barn', priceRange: '$', restaurantTypes: ['breakfast', 'brunch'], occasion: '', priority: 'soon' }),\n    item({ title: 'Saffron House', priceRange: '$$', restaurantTypes: ['dinner'], occasion: 'friends' }),\n    item({ title: 'Smoke Ring BBQ', priceRange: '$$', restaurantTypes: ['lunch', 'dinner'], occasion: 'friends' }),\n    item({ title: 'Night Owl Bakery', priceRange: '$', restaurantTypes: ['bakery', 'dessert'], occasion: '' }),\n    item({ title: 'Kumo Ramen', priceRange: '$$', restaurantTypes: ['dinner'], occasion: '', priority: 'soon', details: 'New place on 5th' }, -6),\n    item({ title: 'Little Bird Café', priceRange: '$', restaurantTypes: ['cafe', 'breakfast'], occasion: '' })\n  ]);\n  put('dreams_our-restaurants', [\n    item({ title: 'Casa Verde Taqueria', priceRange: '$', restaurantTypes: ['dinner'], rating: '5', notes: 'Get the al pastor and ask for the green salsa.' }),\n    item({ title: 'The Copper Kettle', priceRange: '$$', restaurantTypes: ['brunch'], rating: '4', notes: 'Long wait after 10 on Sundays.' }),\n    item({ title: 'Marigold Thai', priceRange: '$$', restaurantTypes: ['dinner'], rating: '5', notes: 'Khao soi. Medium is plenty hot.' }),\n    item({ title: 'Harbor Oyster Co.', priceRange: '$$$', restaurantTypes: ['dinner'], occasion: 'date-night', rating: '4', notes: 'Pricey, worth it for a big night.' }),\n    item({ title: 'Uncle Joe’s Pizza', priceRange: '$', restaurantTypes: ['dinner'], rating: '4' }),\n    item({ title: 'Bistro Lune', priceRange: '$$$', restaurantTypes: ['dinner'], occasion: 'special', rating: '5', notes: 'Our anniversary spot.' })\n  ]);\n  put('dreams_places', [\n    item({ title: 'Lantern festival at the botanical garden', placeTypes: ['festival', 'nature'], priority: 'high', details: 'Only runs a few weeks' }),\n    item({ title: 'Riverside Flea Market', placeTypes: ['market', 'shopping'] }),\n    item({ title: 'Science museum after-dark night', placeTypes: ['museum', 'entertainment'] }),\n    item({ title: 'Cedar Falls trail', placeTypes: ['nature', 'park'], details: '4 miles, bring Juniper' }),\n    item({ title: 'Old Town bookshop crawl', placeTypes: ['bookstore', 'historic'] }),\n    item({ title: 'Glass-blowing class', placeTypes: ['entertainment'], priority: 'soon' })\n  ]);\n  put('dreams_our-places', [\n    item({ title: 'Lake Hollis State Park', placeTypes: ['nature', 'park'], rating: '5', notes: 'Kayak rental by the north lot.' }),\n    item({ title: 'Antique mall on Route 9', placeTypes: ['shopping'], rating: '4', notes: 'Booth 41 has old quilts.' }),\n    item({ title: 'The planetarium', placeTypes: ['museum'], rating: '4' })\n  ]);\n  function sm(t, m, gs, s, extra) { return item(Object.assign({ title: t, mediaTypes: [m], genres: gs, streaming: [s] }, extra || {})); }\n  put('dreams_shows-movies', [\n    sm('Severance', 'tv-show', ['drama', 'sci-fi'], 'apple', { priority: 'high' }), sm('Slow Horses', 'tv-show', ['thriller', 'drama'], 'apple'), sm('The Bear', 'tv-show', ['comedy', 'drama'], 'hulu'),\n    sm('Abbott Elementary', 'tv-show', ['comedy'], 'hulu'), sm('Past Lives', 'movie', ['romance', 'drama'], 'prime'), sm('Dune: Part Two', 'movie', ['sci-fi', 'action'], 'hbo'),\n    sm('Knives Out', 'movie', ['comedy', 'thriller'], 'netflix'), sm('Hereditary', 'movie', ['horror'], 'prime', { details: 'Ben’s pick. Nora is not sure.' }), sm('Shōgun', 'limited-series', ['drama'], 'hulu'),\n    sm('The Great British Baking Show', 'tv-show', ['reality'], 'netflix'), sm('The Diplomat', 'tv-show', ['drama', 'thriller'], 'netflix')\n  ]);\n  put('dreams_our-shows-movies', [\n    sm('Ted Lasso', 'tv-show', ['comedy'], 'apple', { rating: '5', notes: 'Rewatch when we need cheering up.' }), sm('Everything Everywhere All at Once', 'movie', ['sci-fi', 'comedy'], 'prime', { rating: '5' }),\n    sm('Only Murders in the Building', 'tv-show', ['comedy'], 'hulu', { rating: '4' }), sm('Oppenheimer', 'movie', ['drama'], 'prime', { rating: '4', notes: 'Long. Worth it.' }),\n    sm('Schitt’s Creek', 'tv-show', ['comedy'], 'netflix', { rating: '5' }), sm('The Holdovers', 'movie', ['comedy', 'drama'], 'prime', { rating: '4' })\n  ]);\n  put('dreams_reading', [\n    item({ title: 'Tomorrow, and Tomorrow, and Tomorrow', author: 'Gabrielle Zevin', priority: 'high', bookGenre: 'fiction', pages: 416 }),\n    item({ title: 'Lessons in Chemistry', author: 'Bonnie Garmus', priority: 'soon', bookGenre: 'fiction', pages: 400 }),\n    item({ title: 'Braiding Sweetgrass', author: 'Robin Wall Kimmerer', priority: 'soon', bookGenre: 'nonfiction', pages: 408 }),\n    item({ title: 'The Thursday Murder Club', author: 'Richard Osman', priority: '', bookGenre: 'mystery', pages: 382 }),\n    item({ title: 'Fourth Wing', author: 'Rebecca Yarros', priority: '', bookGenre: 'fantasy', pages: 517 }),\n    item({ title: 'Small Things Like These', author: 'Claire Keegan', priority: '', bookGenre: 'fiction', pages: 128 }),\n    item({ title: 'The Wager', author: 'David Grann', priority: '', bookGenre: 'history', pages: 352 }, -1),\n    item({ title: 'Project Hail Mary', author: 'Andy Weir', achieved: true, rating: '5', notes: 'Amaze. Couldn’t put it down.' }),\n    item({ title: 'Atomic Habits', author: 'James Clear', achieved: true, rating: '4' }),\n    item({ title: 'Demon Copperhead', author: 'Barbara Kingsolver', achieved: true, rating: '4', notes: 'Heavy but beautiful.' })\n  ]);\n  var trip = { start: dk(34), days: [\n    { id: 'td1', title: 'Arrival day', stops: [{ id: 'ts1', name: 'Drive up, lunch in Black Mountain', time: '12:30', notes: '', link: '' }, { id: 'ts2', name: 'Check in', time: '16:00', notes: '', link: '' }, { id: 'ts3', name: 'Dinner at Curate', time: '19:30', notes: 'Reservation under Nora', link: '' }] },\n    { id: 'td2', title: '', stops: [{ id: 'ts4', name: 'Blue Ridge Parkway: Craggy Gardens hike', time: '09:00', notes: 'Bring layers', link: '' }, { id: 'ts5', name: 'River Arts District', time: '14:00', notes: 'Look for fabric shops', link: '' }] },\n    { id: 'td3', title: 'Rest day', stops: [{ id: 'ts6', name: 'Slow breakfast', time: '', notes: '', link: '' }, { id: 'ts7', name: 'Biltmore gardens', time: '13:00', notes: '', link: 'https://www.biltmore.com' }] },\n    { id: 'td4', title: 'Travel home', stops: [] }],\n    ideas: [{ id: 'ti1', name: 'Sierra Nevada brewery' }, { id: 'ti2', name: 'Malaprop’s Bookstore' }, { id: 'ti3', name: 'Waterfall near Brevard' }],\n    stays: [{ id: 'th1', name: 'Cottage outside Highlands', when: '3 nights', notes: 'Dog friendly, Juniper comes', link: '' }],\n    packing: [{ id: 'tp1', text: 'Hiking boots', done: true }, { id: 'tp2', text: 'Rain jackets', done: false }, { id: 'tp3', text: 'Juniper’s bed + food', done: false }, { id: 'tp4', text: 'Camera', done: true }, { id: 'tp5', text: 'Snacks for the drive', done: false }],\n    notes: 'Leave by 9 on Friday to beat traffic.' };\n  put('dreams_travel', [\n    item({ title: 'Highlands long weekend', bestTime: 'fall', priority: 'high', trip: trip }),\n    item({ title: 'Portland, Maine', bestTime: 'summer', details: 'Lobster rolls and lighthouses' }),\n    item({ title: 'Kyoto', bestTime: 'spring', details: 'Cherry blossom season, someday' }),\n    item({ title: 'Tybee Island', bestTime: 'summer' })\n  ]);\n  put('dreams_our-travel', [\n    item({ title: 'Savannah', rating: '5', notes: 'Forsyth Park picnic was the best part.', trip: { start: dk(-150), days: [\n      { id: 'sv1', title: 'Arrival day', stops: [{ id: 'svs1', name: 'Check in near Forsyth Park', time: '15:00', notes: '', link: '' }, { id: 'svs2', name: 'Dinner at The Olde Pink House', time: '19:00', notes: '', link: '' }] },\n      { id: 'sv2', title: '', stops: [{ id: 'svs3', name: 'Walking tour of the squares', time: '10:00', notes: '', link: '' }, { id: 'svs4', name: 'Leopold’s ice cream', time: '15:00', notes: 'Worth the line', link: '' }] },\n      { id: 'sv3', title: 'Travel home', stops: [{ id: 'svs5', name: 'Brunch, then drive', time: '10:30', notes: '', link: '' }] }],\n      ideas: [], stays: [{ id: 'svh', name: 'Inn on Jones St.', when: '2 nights', notes: '', link: '' }], packing: [], notes: '' } }),\n    item({ title: 'Chicago', rating: '4', notes: 'Architecture boat tour, deep dish once was enough.' }),\n    item({ title: 'Smoky Mountains cabin', rating: '5', notes: 'Go back in the spring.' })\n  ]);\n  put('dreams_person1-wishlist', [\n    item({ title: 'Walking foot for the sewing machine', link: 'https://www.bernina.com', priority: 'high' }),\n    item({ title: 'Linen apron', link: 'https://www.etsy.com' }),\n    item({ title: 'Ceramic pour-over set' }),\n    item({ title: 'Wool rug for the studio', details: 'Something warm, 5×7' }),\n    item({ title: 'Dutch oven', achieved: true, givenOn: dk(-62), notes: 'From Ben' }),\n    item({ title: 'Hiking boots', achieved: true, givenOn: dk(-30) })\n  ]);\n  put('dreams_person2-wishlist', [\n    item({ title: 'GPS running watch', priority: 'high', link: 'https://www.garmin.com' }),\n    item({ title: 'Noise-cancelling headphones' }),\n    item({ title: 'Pizza steel' }),\n    item({ title: 'Rumours on vinyl' }),\n    item({ title: 'Cast iron skillet', achieved: true, givenOn: dk(-80) })\n  ]);\n\n  // ---------- lists they made themselves (Lists > + New list), and a pinned one (Nov 2) ----------\n  function clDef(key, title, n) { return { id: 1700000003000 + n, firebaseId: 'list_' + key.slice(3), title: title, key: key, dateAdded: iso(-n, 20) }; }\n  put('dreams_custom-lists', [clDef('cl-gifts-nb1', 'Gift ideas', 120), clDef('cl-house-nb2', 'House projects', 96), clDef('cl-dates-nb3', 'Date night ideas', 41)]);\n  put('dreams_cl-gifts-nb1', [\n    item({ title: 'Mom: the cozy robe from Target', details: 'Size M, the oatmeal one', dateAdded: iso(-30) }),\n    item({ title: 'Lena: pottery class gift card', dateAdded: iso(-22) }),\n    item({ title: 'Ben’s dad: smoker thermometer', link: 'https://www.thermoworks.com', dateAdded: iso(-15) }),\n    item({ title: 'Jess: the candle she liked at the market', dateAdded: iso(-9) }),\n    item({ title: 'Secret Santa at book club ($25)', dateAdded: iso(-2) }),\n    item({ title: 'Priya: wedding frame', achieved: true, dateAdded: iso(-60) }),\n    item({ title: 'Marco: hot sauce sampler', achieved: true, dateAdded: iso(-48) })\n  ]);\n  put('dreams_cl-house-nb2', [\n    item({ title: 'Swap the bathroom light fixture', details: 'Ben has the new one in the garage', dateAdded: iso(-70) }),\n    item({ title: 'Shelves over the studio desk', dateAdded: iso(-52) }),\n    item({ title: 'Reseal the deck before winter', dateAdded: iso(-18) }),\n    item({ title: 'Frame the Savannah prints', dateAdded: iso(-11) }),\n    item({ title: 'New weatherstripping, back door', achieved: true, dateAdded: iso(-40) }),\n    item({ title: 'Paint the hallway', achieved: true, dateAdded: iso(-90) })\n  ]);\n  put('dreams_cl-dates-nb3', [\n    item({ title: 'Candle-making class', details: 'Thursdays at the Makers Loft', dateAdded: iso(-35) }),\n    item({ title: 'Sunset picnic at Lookout Point', dateAdded: iso(-27) }),\n    item({ title: 'Cook a new cuisine together: Ethiopian', dateAdded: iso(-14) }),\n    item({ title: 'Trivia night at Bluebird Taproom', achieved: true, dateAdded: iso(-21) })\n  ]);\n  put('listPins', ['cl-gifts-nb1']);\n\n  // ---------- meals ----------\n  var B = window.DEMO_RECIPES || [];\n  var CUSTOM = [\n    { name: 'Ben’s Sunday Chili', type: 'Dinner', protein: 42, calories: 560, fiber: 11, prepTime: 25, cuisineTags: ['American'],\n      ingredients: ['1 lb ground beef', '1 can kidney beans', '1 can black beans', '1 can crushed tomatoes', '1 onion, diced', '2 tbsp chili powder', '1 tsp cumin', 'Shredded cheddar to top'],\n      steps: ['Brown the beef with the onion.', 'Add spices and cook 1 minute.', 'Add tomatoes and beans; simmer 30 minutes.', 'Top with cheddar.'], tip: 'Better the next day. Freezes well.' },\n    { name: 'Sheet Pan Gnocchi with Sausage & Peppers', type: 'Dinner', protein: 28, calories: 620, fiber: 5, prepTime: 10, cuisineTags: ['Italian'],\n      ingredients: ['1 package shelf-stable gnocchi', '4 chicken sausages, sliced', '2 bell peppers', '1 red onion', '2 tbsp olive oil', 'Parmesan'],\n      steps: ['Heat oven to 425°F.', 'Toss everything with oil, salt and pepper on a sheet pan.', 'Roast 25 minutes, stirring once.', 'Finish with parmesan.'], tip: 'The weeknight lifesaver.' },\n    { name: 'Black Bean Tacos', type: 'Dinner', protein: 18, calories: 480, fiber: 14, prepTime: 15, cuisineTags: ['Mexican'],\n      ingredients: ['2 cans black beans', '8 corn tortillas', '1 avocado', 'Pickled onions', 'Cotija', 'Lime'],\n      steps: ['Warm the beans with cumin and garlic; mash a little.', 'Char the tortillas.', 'Fill and top with avocado, onions and cotija.'], tip: '' },\n    { name: 'Grandma Ruth’s Chicken & Dumplings', type: 'Dinner', protein: 38, calories: 610, fiber: 3, prepTime: 30, cuisineTags: ['Southern'],\n      ingredients: ['1 rotisserie chicken, shredded', '6 cups chicken broth', '2 carrots', '2 celery stalks', '2 cups flour', '1 cup milk', '4 tbsp butter'],\n      steps: ['Simmer broth with carrots and celery.', 'Mix flour, milk and melted butter into a soft dough.', 'Drop spoonfuls into the simmering broth; cover 15 minutes.', 'Stir in the chicken.'], tip: 'A cold-night dinner.' },\n    { name: 'Overnight Oats', type: 'Breakfast', protein: 20, calories: 390, fiber: 8, prepTime: 5, cuisineTags: [],\n      ingredients: ['1/2 cup oats', '1/2 cup milk', '1/2 cup Greek yogurt', '1 tbsp chia seeds', 'Berries'], steps: ['Stir everything in a jar.', 'Refrigerate overnight.'], tip: '' }\n  ].map(function (r, i) {\n    return Object.assign({ id: 'r_custom_' + i + '_demo', types: [r.type], prepped: null, portion: r.protein + 'g protein - ' + r.calories + ' cal',\n      portions: [r.protein + 'g protein', r.calories + ' cal', r.fiber + 'g fiber', r.prepTime + ' min'], color: 'var(--lh-accent)', favorite: false, timesUsed: 0, source: 'custom' }, r);\n  });\n  var ALL = CUSTOM.concat(B);\n  function byType(t) { return ALL.filter(function (r) { return (r.types || [r.type]).indexOf(t) !== -1; }); }\n  var DIN = byType('Dinner'), BRK = byType('Breakfast'), LUN = byType('Lunch'), DES = byType('Dessert'), SNK = byType('Snack');\n  // the household's go-tos come up more often\n  var GO = ['Ben’s Sunday Chili', 'Sheet Pan Gnocchi with Sausage & Peppers', 'Black Bean Tacos', 'Crock Pot Honey Garlic Chicken', 'Creamy Tuscan Chicken', 'Turkey Bolognese Baked Ziti', 'Chicken Burrito Bowl'];\n  function dinner() { if (chance(0.45)) { var nm = pick(GO); return DIN.filter(function (r) { return r.name === nm; })[0] || pick(DIN); } return pick(DIN); }\n  function copy(r) { return JSON.parse(JSON.stringify(r)); }\n  var sched = {}, out2 = {}, used = {};\n  function blank() { return { breakfast: null, lunch: null, dinner: null, dessert: null, snack: [] }; }\n  for (var n = -85; n <= 6; n++) {\n    var dayObj = { person1: blank(), person2: blank() }, k = dk(n), any = false;\n    var r = rnd();\n    if (n === 0 || (n > 0 && r < 0.72) || (n < 0 && r < 0.8)) {\n      var dn = dinner(); dayObj.person1.dinner = copy(dn); dayObj.person2.dinner = copy(dn); used[dn.name] = (used[dn.name] || 0) + 1; any = true;\n    } else if (n < 0 && r < 0.9) {\n      dayObj.skippedSlots = { person1: ['dinner'], person2: ['dinner'] }; out2[k + '_person1'] = 1; out2[k + '_person2'] = 1; any = true;\n    }\n    if (chance(n >= 0 ? 0.5 : 0.3)) { var bk = pick(BRK); dayObj.person1.breakfast = copy(bk); if (chance(0.6)) dayObj.person2.breakfast = copy(bk); any = true; }\n    if (chance(0.25)) { dayObj.person1.lunch = copy(pick(LUN)); any = true; }\n    if (chance(0.3)) { dayObj.person2.lunch = copy(pick(LUN)); any = true; }\n    if (DES.length && chance(0.1)) { var ds = pick(DES); dayObj.person1.dessert = copy(ds); dayObj.person2.dessert = copy(ds); any = true; }\n    if (SNK.length && chance(0.12)) { dayObj.person1.snack = [copy(pick(SNK))]; any = true; }\n    if (any) sched[k] = dayObj;\n  }\n  put('mealplan_schedule', sched);\n  put('mealplan_schedule_version', '2');\n  put('mealEatingOut', out2);\n  // favourites are kept per person (the hearts on each recipe card and the Favourites chip read these);\n  // Nora and Ben share most go-tos, with one or two of their own\n  ALL.forEach(function (r) {\n    r.timesUsed = used[r.name] || 0;\n    var go = GO.indexOf(r.name), on = go !== -1 && r.timesUsed > 2;\n    r.favoritePerson1 = on && go !== 0; r.favoritePerson2 = on && go !== 6; r.favorite = !!(r.favoritePerson1 || r.favoritePerson2);\n  });\n  put('mealplan_recipes', ALL);\n  put('mealplan_recipe_version', '11');\n  // journal: stars on many dinners, a note now and then; older days written in by hand\n  var NOTES = ['Doubled the garlic. Good call.', 'Too salty, use less broth next time.', 'Ben made it. Kitchen was a disaster, worth it.', 'Leftovers for lunch tomorrow.', 'Juniper stole a piece of chicken.',\n    'Ate late after soccer.', 'Would make again for company.', 'Kind of bland. Needs lemon.', 'Perfect cold-night dinner.', 'Grilled instead of baked.'];\n  var MEAL_NOTES = ['Used thighs instead of breasts. Juicier, and the leftovers held up well for lunch the next day. Would add more garlic next time and maybe a squeeze of lemon at the end.',\n    'Ate late, felt fine by bedtime.', 'Halved the chili flakes for Ben. Still had a kick.', 'Big hit. Made extra so there was some for the freezer, which was a good call because the next two weeks were busy.',\n    'Needed more salt than the recipe says.'];\n  var TYPED = ['Leftover chili', 'Takeout from Marigold Thai', 'Grilled cheese and tomato soup', 'Pizza night', 'Salads, too hot to cook', 'Breakfast for dinner', 'Tacos at Casa Verde', 'Pasta with whatever was in the fridge'];\n  ['person1', 'person2'].forEach(function (p) {\n    for (var n = -180; n <= -1; n++) {\n      var k = dk(n), sd = sched[k];\n      if (n >= -85) {\n        if (sd && sd[p] && sd[p].dinner && chance(p === 'person1' ? 0.5 : 0.35)) put('journal_rating_' + k + '_dinner_' + p, String(pick([5, 5, 4, 4, 4, 3, 3, 2])));\n        if (sd && sd[p] && sd[p].breakfast && chance(0.2)) put('journal_rating_' + k + '_breakfast_' + p, String(pick([5, 4, 4, 3])));\n        if (chance(p === 'person1' ? 0.16 : 0.08)) put('journal_' + k + '_' + p, pick(NOTES));\n        // how they felt: noted after about half of Nora's dinners and a third of Ben's, with a few real tendencies\n        // (rich, creamy dinners sit heavy; the sheet-pan Mediterranean one feels good) so the journal has patterns\n        var dn2 = sd && sd[p] && sd[p].dinner;\n        // now and then a few words about the dinner itself (\"Anything else about it\"), picked by the day (not the\n        // random numbers) so the rest of the sample stays the same; one or two land in the last week\n        var mn = dn2 && (-n) % 5 === (p === 'person1' ? 2 : 4) ? MEAL_NOTES[Math.floor(-n / 5) % MEAL_NOTES.length] : '';\n        if (dn2 && chance(p === 'person1' ? 0.55 : 0.35)) {\n          var txt = (dn2.name + ' ' + (dn2.ingredients || []).join(' ')).toLowerCase(), tg = [];\n          if (/cream|alfredo|gnocchi|sausage|cheese/.test(txt)) { if (chance(0.75)) tg.push(pick(['heavy', 'bloated', 'tired'])); }\n          else if (/mediterranean|salmon|greek|lemon|bowl/.test(txt)) { if (chance(0.75)) tg.push(pick(['energized', 'light', 'energized'])); if (chance(0.5)) tg.push('satisfied'); }\n          else { if (chance(0.5)) tg.push('satisfied'); else if (chance(0.25)) tg.push(pick(['tired', 'hungry', 'energized'])); }\n          if (tg.length || mn) put('journal_feel_' + k + '_dinner_' + p, JSON.stringify({ tags: tg, note: mn }));\n          var dt2 = [];\n          if (/jalape|chipotle|chili|taco|spicy/.test(txt) && chance(0.6)) dt2.push('sleptbadly'); else if (chance(0.3)) dt2.push(pick(['sleptwell', 'sleptwell', 'sleptbadly']));\n          if (chance(0.35)) dt2.push(pick(['goodenergy', 'goodmood', 'lowenergy']));\n          if (dt2.length) put('journal_feel_' + k + '_day_' + p, JSON.stringify({ tags: dt2, note: '' }));\n        } else if (mn) put('journal_feel_' + k + '_dinner_' + p, JSON.stringify({ tags: [], note: mn }));\n      } else if (chance(p === 'person1' ? 0.35 : 0.2)) {\n        put('journal_meals_' + k + '_' + p, pick(TYPED));\n        if (chance(0.25)) put('journal_' + k + '_' + p, pick(NOTES));\n      }\n    }\n  });\n\n  // ---------- money (read by the Money page and Work's \"This month\" in this preview) ----------\n  var docs = {}, curM = ym(T0);\n  function txRow(m, d, desc, amount, cat, extra) { return Object.assign({ id: uid('t'), date: m + '-' + ('0' + d).slice(-2), desc: desc, amount: Math.round(amount * 100) / 100, cat: cat, source: 'simplefin' }, extra || {}); }\n  // Nov 2 (Kasey: \"fill out the sample even more\"): money back to January of last year, so Month | Year has a whole\n  // last year and \"Compared with last year\". The last seven months are drawn first, with the same numbers as before;\n  // the older ones after, from a seed of their own, so nothing else in the sample changes.\n  var BACK = Math.max(13, 12 + T0.getMonth());\n  function cyc(a, b) { return a[b % a.length]; }\n  function monthRows(back) {\n    var md0 = new Date(T0.getFullYear(), T0.getMonth() - back, 15), m = ym(md0), dim = daysIn(md0.getFullYear(), md0.getMonth()), last = back === 0 ? T0.getDate() : dim, rows = [];\n    var add = function (d, desc, amt, cat, extra) { d = Math.min(d, dim); if (d <= last) rows.push(txRow(m, d, desc, amt, cat, Object.assign(back === 0 && d === last && amt < 0 ? { pending: true } : {}, extra || {}))); };\n    var season = md0.getMonth(), cold = season >= 10 || season <= 2, hot = season >= 5 && season <= 8;\n    var pay = back >= 10 ? 2196.4 : 2284.16;   // (a raise ten months ago)\n    add(1, 'Payroll, Riverbend Physical Therapy', pay, 'income'); add(15, 'Payroll, Riverbend Physical Therapy', pay, 'income');\n    add(1, 'Rent, Maple Court Apartments', -1650, 'housing');\n    add(5, 'Duke Energy', -(cold ? money(138, 176) : hot ? money(152, 198) : money(86, 112)), 'utilities');\n    add(12, 'Spectrum Internet', -74.99, 'utilities'); add(21, 'Verizon Wireless', -112.4, 'utilities');\n    add(12, 'Netflix', -15.49, 'subscriptions'); add(3, 'Spotify', -11.99, 'subscriptions'); add(18, 'iCloud storage', -2.99, 'subscriptions');\n    add(28, 'Geico', -128, 'transport'); add(7, 'Planet Fitness', -24.99, 'health');\n    // a few more that come round every month, the way the bank writes them (Money > Bills > Subscriptions finds them)\n    add(22, 'Hulu 877-824-4858 CA', -17.99, 'subscriptions'); add(14, 'DISNEY PLUS 888-905-7888 CA', back <= 2 ? -15.99 : -13.99, 'subscriptions');\n    if (back <= 3) add(9, 'Audible*' + ['R72KD9LT3', 'M4QX81ZP2', 'T9HB30KC7', 'Q2LW55DN8'][back], -14.95, 'subscriptions');\n    [3, 9, 16, 23, 29].forEach(function (d, i) { if (i < 4 || chance(0.5)) add(d + int(0, 1), pick(['Kroger', 'Kroger', 'Trader Joe’s', 'Aldi', 'Costco']), -money(48, i === 2 ? 210 : 135), 'groceries'); });\n    var dining = ['Casa Verde Taqueria', 'Marigold Thai', 'Little Bird Café', 'Uncle Joe’s Pizza', 'Starbucks', 'Chipotle', 'The Copper Kettle', 'Panera Bread'];\n    for (var j = 0, nd = int(4, 8); j < nd; j++) add(int(1, dim), pick(dining), -money(6.5, 64), 'dining');\n    if (chance(0.5)) add(int(5, 26), 'Harbor Oyster Co.', -money(118, 164), 'dining');\n    add(int(2, 8), pick(['Shell', 'Speedway']), -money(38, 52), 'transport'); add(int(15, 24), pick(['Shell', 'Speedway', 'QuikTrip']), -money(36, 50), 'transport');\n    add(int(4, 12), 'Target', -money(32, 96), 'shopping'); add(int(13, 27), 'Amazon', -money(14, 72), 'shopping'); if (chance(0.4)) add(int(1, 28), 'TJ Maxx', -money(25, 60), 'shopping');\n    add(int(5, 20), 'Chewy', -money(42, 58), 'family'); if (back === 3) add(10, 'Riverside Vet', -186.5, 'family'); if (back === 15) add(12, 'Riverside Vet', -142, 'family');\n    if (chance(0.5)) add(int(2, 26), 'CVS Pharmacy', -money(9, 34), 'health');\n    if (chance(0.6)) add(int(8, 27), pick(['AMC Theatres', 'Ticketmaster', 'Mini golf']), -money(22, 88), 'fun');\n    if (back === 5) { add(Math.max(1, Math.min(dim, day(-150).getDate())), 'Inn on Jones St., Savannah', -412.6, 'fun'); add(Math.max(1, Math.min(dim, day(-149).getDate())), 'The Olde Pink House', -138.2, 'dining'); }\n    add(20, 'Capital One payment, thank you', -1100, 'transfer'); add(20, 'Transfer to savings', -300, 'transfer');\n    // the shop\n    var busy = back <= 1 ? 1.25 : back > 6 && season >= 10 ? 1.45 : back >= 5 ? 0.8 : 1;   // (last year's holidays were busy)\n    [2, 9, 16, 23, 30].forEach(function (d) { add(d, 'Etsy payout', money(140, 520) * busy, 'business'); });\n    if (chance(0.6)) add(int(3, 25), 'Custom quilt, deposit', 450, 'business');\n    add(6, 'Shopify plan', -39, 'business'); add(16, 'Canva Pro', -14.99, 'subscriptions', { acct: 'a3' }); add(int(8, 14), 'Mill Supply, fabric', -money(96, 240), 'business');\n    add(int(4, 28), 'Pirate Ship, shipping labels', -money(48, 122), 'business'); add(int(4, 28), 'Etsy fees', -money(22, 58), 'business');\n    if (back === 0 && T0.getDate() >= 12) add(12, 'Riverside Makers Market booth', -85, 'business');\n    if (chance(0.3)) add(int(10, 25), 'Farmers market sales (cash)', money(80, 210), 'business', { source: 'manual' });\n    // fuller Money (Oct 22): each payment from its own account, both sides of a move between their own accounts, Ben's\n    // card, two loans, a quarterly and a yearly bill, a monthly city charge that isn't a bill yet, and a few local places\n    // to sort. Fixed amounts (no random numbers), so everything else in the sample stays the same.\n    add(20, 'Transfer from checking', 300, 'transfer', { acct: 'a2' }); add(21, 'CAPITAL ONE PAYMENT RECEIVED', 1100, 'transfer', { acct: 'a4' });\n    add(24, 'DISCOVER E-PAYMENT', -cyc([420, 380, 460, 400, 450, 425, 440], back), 'transfer'); add(25, 'INTERNET PAYMENT - THANK YOU', cyc([420, 380, 460, 400, 450, 425, 440], back), 'transfer', { acct: 'a5' });\n    add(17, 'TOYOTA FINANCIAL SVCS PMT', -389, 'debt'); add(26, 'NELNET STUDENT LOAN PMT', -212, 'debt');\n    add(9, 'CITY OF RIVERBEND SANITATION', -32.5, 'utilities');\n    // investing: $200 a month to the brokerage account (both sides), a quarterly dividend there, Ben's Roth IRA $150 a month\n    add(3, 'TRANSFER TO FIDELITY BROKERAGE', -200, 'transfer'); add(4, 'ELECTRONIC FUNDS TRANSFER RECEIVED', 200, 'transfer', { acct: 'a6' });\n    if (md0.getMonth() % 3 === 2) { add(28, 'Dividend, total stock fund', [0, 0, 41.37, 0, 0, 38.92, 0][back] || 39.5, 'income', { acct: 'a6' }); add(27, 'Dividend, target date fund', [0, 0, 62.14, 0, 0, 58.8, 0][back] || 60.1, 'income', { acct: 'a8' }); }\n    // Nora's 401(k): her own part out of each paycheck and her work's match (kept out of totals: the pay already counted)\n    add(1, '401(k) contribution', 228.42, 'income', { acct: 'a7', hidden: true }); add(1, 'Employer match', 114.21, 'income', { acct: 'a7', hidden: true });\n    add(15, '401(k) contribution', 228.42, 'income', { acct: 'a7', hidden: true }); add(15, 'Employer match', 114.21, 'income', { acct: 'a7', hidden: true });\n    add(10, 'VANGUARD BUY INVESTMENT ROTH IRA', -150, 'transfer'); add(11, 'CONTRIBUTION ROTH IRA', 150, 'transfer', { acct: 'a8' });\n    if (md0.getMonth() % 3 === 1) add(15, 'RIVERBEND WATER DEPT', -[96.4, 91.8, 102.3][back % 3], 'utilities');\n    if (back % 12 === 4) add(11, 'LEMONADE INSURANCE RENTERS', -180, 'housing');\n    [[4, 'Home Depot', [64.12, 0, 112.9, 0, 0, 45.3, 0]], [10, 'Barnes & Noble', [28.4, 0, 41.2, 0, 19.99, 33.6, 0]], [18, 'Steak n Shake', [31.2, 24.8, 0, 36.4, 22.1, 0, 28.7]], [26, 'Best Buy', [0, 0, 149.99, 0, 0, 89.99, 0]]].forEach(function (r) { var v = cyc(r[2], back); if (v) add(r[0], r[1], -v, r[1] === 'Steak n Shake' ? 'dining' : 'shopping', { acct: 'a5' }); });\n    add(13, 'SQ *BLUE DOOR BAKERY', -cyc([14.25, 9.8, 16.5, 12.1, 18.4, 11.75, 13.6], back), 'other'); add(19, 'POS DEBIT 2291 RIVERBEND HARDWARE', -cyc([42.18, 0, 27.95, 61.4, 0, 33.2, 48.75], back) || 0, 'other');\n    if (back === 1 || back === 3) add(23, 'VENMO PAYMENT 1029384756', -45, 'other');\n    // the older months: Peacock until they cancelled it two months ago, last year's holidays and summer trip\n    if (back >= 3 && back <= 14) add(19, 'Peacock', -7.99, 'subscriptions');\n    if (back > 6 && season === 11) { add(6, 'Amazon', -money(160, 240), 'shopping'); add(13, 'Target', -money(120, 190), 'shopping'); add(18, 'Etsy, holiday gifts', -money(60, 110), 'shopping'); add(20, 'Ben’s work holiday party, Uber', -38.6, 'transport'); }\n    if (back > 6 && season === 6) { add(8, 'Gatlinburg cabin, Airbnb', -684.2, 'fun'); add(10, 'Pancake Pantry', -46.8, 'dining'); }\n    if (back > 6 && season === 3) add(16, 'H&R Block', -129, 'other');\n    if (back > 6 && season === 1) add(14, 'Bistro Lune', -142.5, 'dining');\n    rows = rows.filter(function (t) { return t.amount !== 0; });\n    // which account each payment came from: the shop's money its own checking, everyday buys on the card, the rest checking\n    rows.forEach(function (t) { if (t.acct) return; t.acct = t.cat === 'business' ? 'a3' : (/^(subscriptions|dining|shopping|fun)$/.test(t.cat) || /^(Target|Amazon|Costco|Trader)/.test(t.desc)) ? 'a4' : 'a1'; });\n    rows.sort(function (a, b) { return a.date.localeCompare(b.date); });\n    docs['financeTx/' + m] = { items: rows };\n  }\n  for (var back = 6; back >= 0; back--) monthRows(back);\n  var seedKept = seed; seed = 4417;\n  for (back = BACK; back > 6; back--) monthRows(back);\n  seed = seedKept;\n  // and one that comes every week (the paper's digital edition, on Mondays)\n  for (var wk = 0; wk < 12; wk++) {\n    var wd = day(-((T0.getDay() + 6) % 7) - wk * 7), wm = ym(wd);\n    if (docs['financeTx/' + wm] && wd <= T0) { docs['financeTx/' + wm].items.push(txRow(wm, wd.getDate(), 'NYTIMES DIGITAL 800-698-4637 NY', -4.25, 'subscriptions')); docs['financeTx/' + wm].items.sort(function (a, b) { return a.date.localeCompare(b.date); }); }\n  }\n  var asOf = new Date(T0); asOf.setHours(6, 21, 0, 0); asOf = asOf.toISOString();\n  docs['finance_accounts/data'] = { items: [{ id: 'a1', name: 'Joint checking', org: 'First Valley Bank', balance: 3864.21, source: 'simplefin', kind: 'checking', pos: 0, balanceDate: asOf }, { id: 'a2', name: 'Savings', org: 'First Valley Bank', balance: 9420, source: 'simplefin', kind: 'savings', pos: 1, balanceDate: asOf },\n    { id: 'a3', name: 'Willow & Thread checking', org: 'First Valley Bank', balance: 2215.4, source: 'simplefin', kind: 'checking', owner: 'person1', pos: 2, balanceDate: asOf },\n    { id: 'a4', name: 'Quicksilver card', org: 'Capital One', balance: -684.12, limit: 8000, source: 'simplefin', kind: 'card', pos: 3, balanceDate: asOf },\n    { id: 'a5', name: 'Discover it', org: 'Discover', balance: -1236.4, limit: 5000, source: 'simplefin', kind: 'card', owner: 'person2', pos: 4, balanceDate: asOf },\n    // investing (Kasey, Oct 22: \"at least one brokerage acct & retirement acct\"): a joint brokerage account fed $200 a month\n    // from checking, Nora's 401(k) through her work and Ben's Roth IRA\n    { id: 'a6', name: 'Brokerage', org: 'Fidelity', balance: 18420.55, source: 'simplefin', kind: 'brokerage', pos: 5, balanceDate: asOf },\n    { id: 'a7', name: 'Riverbend PT 401(k)', org: 'Fidelity', balance: 42310.18, source: 'simplefin', kind: 'retirement', owner: 'person1', pos: 6, balanceDate: asOf },\n    { id: 'a8', name: 'Roth IRA', org: 'Vanguard', balance: 15890.42, source: 'simplefin', kind: 'retirement', owner: 'person2', pos: 7, balanceDate: asOf }] };\n  // the car loan (both) and Ben's student loan: payments found in checking by the words on the statement\n  docs['finance_loans/data'] = { items: [{ id: 'l1', name: 'Car loan', balance: 16840, asOf: ymd(day(-200)), start: 24500, rate: 5.4, payment: 389, match: 'TOYOTA FINANCIAL' },\n    { id: 'l2', name: 'Student loan', owner: 'person2', balance: 18920, asOf: ymd(day(-200)), start: 27000, rate: 4.5, payment: 212, match: 'NELNET' }] };\n  // Hulu is on its way out (Plan to cancel, a reminder next week); a typed-in class pack the bank doesn't show\n  docs['finance_subs/data'] = { items: [{ id: 'hulu|monthly', name: 'Hulu', state: 'cancel', remind: ymd(day(6)), at: day(-3).toISOString() },\n    { id: 'canva|monthly', name: 'Canva', label: 'Canva Pro', state: 'keep', remind: '', work: true, at: day(-60).toISOString() },\n    { id: 'new york times|weekly', name: 'New York Times', label: 'New York Times', state: 'keep', remind: '', at: day(-50).toISOString() },\n    { id: 'm:barre', manual: true, name: 'Barre class pack', amount: 59, period: 'monthly', next: ymd(day(9)), state: 'keep', remind: '', at: day(-40).toISOString() }] };\n  // what they set aside each month (Budget > Savings): a spring trip, an emergency fund, holiday gifts\n  docs['finance_savings/data'] = { items: [{ id: 'v1', name: 'Emergency fund', monthly: 300, target: 10000, saved: 6200, at: day(-150).toISOString() },\n    { id: 'v2', name: 'Trip to Highlands', monthly: 250, target: 2400, saved: 1350, at: day(-120).toISOString() },\n    { id: 'v3', name: 'Holiday gifts', monthly: 100, target: 600, saved: 400, at: day(-90).toISOString() }] };\n  // places filed by hand: every Mill Supply payment is the shop's (Business), Steak n Shake is eating out\n  docs['finance_rules/data'] = { items: [{ id: 'r:mill supply fabric', key: 'mill supply fabric', cat: 'business', name: 'Mill Supply' }, { id: 'r:steak n shake', key: 'steak n shake', cat: 'dining', name: 'Steak n Shake' }] };\n  docs['finance_budgets/data'] = { items: [{ cat: 'groceries', limit: 750 }, { cat: 'dining', limit: 280 }, { cat: 'transport', limit: 200 }, { cat: 'shopping', limit: 220 }, { cat: 'fun', limit: 150 }, { cat: 'family', limit: 90 }] };\n  docs['finance_bills/data'] = { items: [{ id: 'b1', name: 'Rent', amount: 1650, day: 1, remind: true }, { id: 'b3', name: 'Power', amount: '', day: 5, remind: true, match: 'duke energy' }, { id: 'b4', name: 'Shopify', amount: 39, day: 6, work: true },\n    { id: 'b5', name: 'Internet', amount: 74.99, day: 12 }, { id: 'b7', name: 'Phone', amount: 112.4, day: 21, remind: true }, { id: 'b8', name: 'Car insurance', amount: 128, day: 28 },\n    { id: 'b9', name: 'Water & sewer', amount: 96, day: 15, freq: 'quarterly', month: 2, match: 'riverbend water' },\n    { id: 'b10', name: 'Renters insurance', amount: 180, day: 11, freq: 'annual', month: new Date(T0.getFullYear(), T0.getMonth() - 4, 15).getMonth() + 1, match: 'lemonade' }] };\n  docs['financeStatus/data'] = { connected: true, accounts: 8, lastSync: new Date(Date.now() - 12 * 60000).toISOString(), institutions: ['First Valley Bank', 'Capital One', 'Discover', 'Fidelity', 'Vanguard'] };\n  /* Things people set by hand (Nov 2): a split Target and Costco run, money in picked as Work / Personal / Not income, an\n     older \"Not income\" and a \"Not work income\", a vet bill typed in by hand that the bank then brought in too (left\n     unanswered, so Month says \"1 payment may be in twice\"), a client's payment Work is waiting for, a checking balance\n     typed in this morning, Peacock cancelled, and a savings goal for the shop. Fixed amounts, no random numbers. */\n  function addAt(mb, d, desc, amt, cat, extra) {\n    var md1 = new Date(T0.getFullYear(), T0.getMonth() - mb, 15), m1 = ym(md1);\n    d = Math.min(d, daysIn(md1.getFullYear(), md1.getMonth())); if (mb === 0) d = Math.min(d, T0.getDate());\n    var doc = docs['financeTx/' + m1] = docs['financeTx/' + m1] || { items: [] };\n    var t = txRow(m1, d, desc, amt, cat, Object.assign({ acct: 'a1' }, extra || {}));\n    doc.items.push(t); doc.items.sort(function (x, y) { return x.date.localeCompare(y.date); });\n    return t;\n  }\n  function addOn(n, desc, amt, cat, extra) { var d = day(n); return addAt((T0.getFullYear() - d.getFullYear()) * 12 + T0.getMonth() - d.getMonth(), d.getDate(), desc, amt, cat, extra); }\n  addAt(1, 8, 'Target', -142.86, 'groceries', { acct: 'a4', catSet: true, split: [{ cat: 'groceries', amt: 88.4 }, { cat: 'shopping', amt: 54.46 }] });\n  addAt(0, 1, 'Costco', -186.2, 'groceries', { acct: 'a4', catSet: true, split: [{ cat: 'groceries', amt: 131.75 }, { cat: 'family', amt: 54.45 }] });\n  addAt(0, 1, 'VENMO CASHOUT', 120, 'business', { payee: 'Leah Park', memo: 'Pot holders x4, pickup order', catSet: true, notWork: false, notIncome: false, incBy: 'work' });\n  addAt(0, 2, 'ZELLE FROM MARGARET ELLIS', 200, 'income', { memo: 'Happy birthday Ben!', catSet: true, notWork: true, notIncome: false, incBy: 'personal' });\n  addAt(0, 2, 'ZELLE FROM SAM ELLIS', 85, 'income', { memo: 'concert tickets', notIncome: true, incBy: 'none' });\n  addAt(1, 14, 'MOBILE CHECK DEPOSIT', 312, 'income', { memo: 'Security deposit back from the old apartment', notIncome: true });\n  addAt(1, 21, 'PAYPAL TRANSFER', 140, 'business', { acct: 'a3', payee: 'Jordan Reyes', memo: 'Ben’s old bike', notWork: true });\n  addOn(-3, 'Riverside Vet', -64, 'family', { source: 'manual', note: 'Juniper’s nail trim + ear drops' });\n  addOn(-1, 'RIVERSIDE VETERINARY CLINIC', -64, 'family');\n  // Dana paid the rest of her baby quilt (Work > Waiting to be paid asks \"Is this Dana's $450?\"), and a café's invoice\n  // paid last month (marked paid there)\n  addOn(-1, 'ZELLE FROM DANA WHITFIELD', 450, 'business', { acct: 'a3', memo: 'Quilt balance', catSet: true });\n  var cafePaid = addAt(1, 6, 'CHECK DEPOSIT HARBOR COFFEE CO', 360, 'business', { acct: 'a3' });\n  // Joint checking typed in from the bank's own app this morning (Update balance: the bank's number comes a day late)\n  var typedAt = new Date(Math.max(Date.now() - 20 * 60000, Date.parse(asOf) + 2 * 60000)).toISOString();\n  docs['finance_accounts/data'].items[0].typed = { amt: 3712.48, at: typedAt };\n  docs['finance_subs/data'].items.push({ id: 'peacock|monthly', name: 'Peacock', state: 'done', doneOn: ymd(new Date(T0.getFullYear(), T0.getMonth() - 2, 21)), remind: '', amt: 7.99, at: new Date(T0.getFullYear(), T0.getMonth() - 2, 21, 20).toISOString() });\n  docs['finance_savings/data'].items.push({ id: 'v4', name: 'Long-arm quilting machine', monthly: 150, target: 4200, saved: 1650, at: day(-75).toISOString() });\n  docs['finance_budgets/data'].items.push({ cat: 'health', limit: 45 });\n  put('dbkSampleMoney', docs);\n\n  // ---------- work: Willow & Thread ----------\n  var BIZ = 'biz_willow_thread';\n  var content = [];\n  function piece(text, stage, n, o) {\n    content.push(Object.assign({ id: uid('c'), bizId: BIZ, text: text, hook: '', body: '', cta: '', type: '', stage: stage, created: iso(n, 9), rating: 0, postedDate: null, scheduledDate: null,\n      platforms: [], format: '', outline: '', shots: '', hashtags: '', notes: '', steps: {} }, o || {}));\n  }\n  /* About five months of posting, the way a small maker really posts: mostly Instagram, reels also to TikTok and\n     YouTube Shorts, a few pins, a long YouTube video and a Substack letter now and then. Each has its numbers as\n     typed in from the apps a few days after (views, likes, comments, saves), except the newest, which is too new.\n     One reel took off (\"Binding a quilt in 60 seconds\"), so What's working shows how it handles one big post.\n     [days ago, hour, title, format, platforms, angle, pillar, views, likes, comments, saves] */\n  var posted = [\n    [150, 9, 'Studio tour: where the quilts happen', 'reel', ['ig', 'tt'], 'personal', 'Studio life', 4800, 290, 22, 41],\n    [146, 19, 'Spring napkin set is live', 'photo', ['ig', 'fb'], 'promotional', 'New work', 820, 38, 4, 6],\n    [142, 9, 'How to pick fabric for a baby quilt', 'carousel', ['ig', 'pi'], 'educational', 'Process', 1900, 160, 14, 120],\n    [138, 10, 'Caring for a handmade quilt', 'newsletter', ['ss'], 'educational', 'Quilt care', 380, 22, 6, 0],\n    [134, 9, 'Why handmade costs what it costs', 'carousel', ['ig'], 'hottake', 'Studio life', 3100, 260, 48, 95],\n    [130, 20, 'Pot holder restock', 'story', ['ig'], 'promotional', 'New work', 410, 9, 1, 0],\n    [126, 8, 'Binding basics: the mitered corner', 'reel', ['ig', 'tt', 'yt'], 'educational', 'Process', 5600, 380, 31, 210],\n    [121, 9, '5 scrap fabric projects', 'pin', ['pi'], 'educational', 'Process', 2200, 40, 2, 180],\n    [117, 19, 'Meet Juniper, studio manager', 'photo', ['ig', 'fb'], 'personal', 'Studio life', 1500, 140, 25, 6],\n    [112, 10, 'Custom quilt process, start to finish', 'video', ['yt'], 'educational', 'Process', 2900, 150, 28, 0],\n    [108, 9, 'What’s your favorite quilt pattern?', 'story', ['ig'], 'engagement', 'Studio life', 650, 20, 0, 0],\n    [103, 9, 'Farmers market setup timelapse', 'reel', ['tt'], 'personal', 'Studio life', 2600, 170, 12, 9],\n    [98, 18, 'Washing a quilt the first time', 'reel', ['ig', 'tt'], 'educational', 'Quilt care', 4100, 260, 30, 190],\n    [93, 9, 'New colorway: Meadow', 'photo', ['ig', 'fb'], 'promotional', 'New work', 760, 41, 5, 4],\n    [88, 9, 'The tools I use every single day', 'carousel', ['ig', 'pi'], 'educational', 'Process', 2400, 180, 16, 150],\n    [82, 20, 'Fall table runners are here', 'photo', ['ig', 'fb'], 'promotional', 'New work', 540, 30, 3, 2],\n    [77, 9, 'A day at the makers market', 'reel', ['ig'], 'personal', 'Studio life', 3900, 300, 26, 18],\n    [72, 10, 'Storing quilts for the season', 'newsletter', ['ss'], 'educational', 'Quilt care', 410, 25, 7, 0],\n    [67, 9, 'Quilt math: how much fabric you need', 'carousel', ['ig', 'pi'], 'educational', 'Process', 2800, 210, 24, 260],\n    [62, 19, 'Restock: napkin sets back in sage', 'story', ['ig'], 'promotional', 'New work', 380, 7, 0, 0],\n    [56, 9, 'Hand quilting vs machine quilting', 'reel', ['ig', 'tt', 'yt'], 'educational', 'Process', 6200, 410, 52, 230],\n    [51, 9, 'Behind the price tag: a napkin set', 'carousel', ['ig'], 'hottake', 'Studio life', 2100, 170, 30, 60],\n    [45, 19, 'Harvest colors are in the shop', 'photo', ['ig', 'fb'], 'promotional', 'New work', 690, 33, 4, 3],\n    [40, 9, 'Fixing a torn quilt binding', 'reel', ['ig', 'tt'], 'educational', 'Quilt care', 4600, 300, 40, 240],\n    [34, 9, 'Packing a custom quilt order', 'reel', ['ig', 'tt'], 'personal', 'Studio life', 5100, 360, 28, 20],\n    [26, 18, 'Fall napkin sets: last call', 'photo', ['ig', 'fb'], 'promotional', 'New work', 610, 30, 2, 2],\n    [19, 9, 'Binding a quilt in 60 seconds', 'reel', ['ig', 'tt', 'yt'], 'educational', 'Process', 58300, 4100, 310, 3900],\n    [13, 9, '3 quilt myths I hear at every market', 'carousel', ['ig'], 'hottake', 'Quilt care', 3300, 280, 45, 150],\n    [8, 10, 'How long does a custom quilt take?', 'reel', ['ig', 'tt'], 'educational', 'Process', 7800, 520, 64, 300],\n    [4, 19, 'Gift sets for the holidays', 'photo', ['ig', 'fb'], 'promotional', 'New work', 820, 45, 6, 8],\n    [2, 9, 'Studio update: winter quilt in progress', 'story', ['ig'], 'personal', 'Studio life', null]\n  ];\n  var FULL = {\n    'Studio tour: where the quilts happen': { pillar: 'Studio life', hook: 'This used to be a one-car garage.', outline: 'Garage door up\\nCutting table + rotary cutter\\nThe fabric wall, by color\\nThe old Juki in the corner\\nJuniper asleep on the batting', shots: 'Wide from the door, slow push in\\nHands on the cutting mat\\nPan across the fabric wall\\nClose on the needle\\nJuniper', body: 'Every quilt, napkin and pot holder starts right here. It’s small, it’s a little cold in January, and I wouldn’t trade it. Ask me anything about the studio below.', cta: 'Ask me anything about the studio', hashtags: '#handmadequilt #studiotour #slowmade' },\n    'How to pick fabric for a baby quilt': { pillar: 'Process', hook: 'Three rules I use for every baby quilt.', outline: '1. Soft first: quilting cotton or double gauze\\n2. One light, one medium, one dark\\n3. Prewash everything\\nBonus: skip anything stiff or shiny', body: 'Baby quilts get washed a lot and dragged everywhere. These three rules keep them soft and lasting. Save this for your next one.', cta: 'Save this for later', hashtags: '#babyquilt #quiltersofinstagram #sewingtips' },\n    'Spring napkin set is live': { pillar: 'New work', hook: 'Spring napkins are in the shop.', body: 'Four napkins, cotton-linen, in sage, butter, clay and sky. Sets of 4 are $38 and they get softer every wash. Link in bio.', cta: 'Shop the set (link in bio)', hashtags: '#tablelinens #handmadehome #springtable' },\n    'Binding a quilt in 60 seconds': { pillar: 'Process', hook: 'The part of quilting everyone dreads, in one minute.', outline: 'Trim the edges\\nJoin the strips on the diagonal\\nSew to the front\\nMiter the corners\\nHand-stitch the back', shots: 'Overhead, sped up\\nClose on the mitered corner\\nThe finished edge, slow pan', body: 'Binding takes me about two hours on a full quilt. Here’s the whole thing in a minute. The mitered corner is the trick: fold up at 45°, then back down.', cta: 'Follow for part 2: hand-finishing the back', hashtags: '#quiltbinding #quiltersofinstagram #sewingtips' },\n    'Why handmade costs what it costs': { pillar: 'Studio life', hook: 'Why is a handmade quilt $450?', outline: '1. 30+ hours of work\\n2. Fabric: about $110\\n3. Batting and thread: $35\\n4. Washing, photos, packing\\n5. What’s left per hour', body: 'I get this question kindly and not so kindly. Here’s the honest math on a custom baby quilt. Handmade isn’t cheap because it isn’t fast.', cta: 'Tell me what surprised you', hashtags: '#handmadeisworthit #slowmade #shopsmall' },\n    'Farmers market setup timelapse': { pillar: 'Studio life', hook: 'Two hours of setup in 20 seconds.', shots: 'Phone on the tripod behind the table, timelapse\\nFinal wide shot\\nClose on the price cards', body: 'Saturday market setup: tent, two tables, a lot of folding. Come find us by the coffee truck until noon.', cta: 'Come say hi this Saturday', hashtags: '#farmersmarket #makersmarket #handmadegifts' },\n    'Pot holder restock': { pillar: 'New work', hook: 'Pot holders are back.', body: 'Twelve new pot holders, quilted with heat-safe batting. $14 each, and they go fast.', cta: 'Tap the link to shop', hashtags: '#potholders #handmadekitchen' },\n    '5 scrap fabric projects': { pillar: 'Process', hook: '5 things to make with your fabric scraps.', outline: '1. Mug rugs\\n2. Zipper pouches\\n3. Scrappy bunting\\n4. Pin cushions\\n5. A crumb-quilt block', body: 'Don’t toss the little pieces. These five projects use up scraps in an afternoon. Pin it for your next rainy day.', cta: 'Pin it for later', hashtags: '#scrapbusting #sewingprojects #quilting' },\n    'Meet Juniper, studio manager': { pillar: 'Studio life', hook: 'Meet the real boss of Willow & Thread.', body: 'Juniper supervises every quilt, mostly by sleeping on it. She’s 6, she loves the batting bin, and she has never once helped with binding.', cta: 'Show me your studio pets', hashtags: '#studiodog #makerlife' },\n    'Custom quilt process, start to finish': { pillar: 'Process', hook: 'Six weeks of work, start to finish.', outline: 'Week 1: picking the fabric together\\nWeek 2: cutting\\nWeeks 3–4: piecing the top\\nWeek 5: quilting\\nWeek 6: binding, washing, packing', shots: 'Fabric pull on the table\\nRotary cutter close-up\\nPieced top on the design wall\\nQuilting at the machine\\nThe finished quilt, folded with a tag', body: 'This is what happens after you order a custom quilt. Every step, every week. Custom spots for spring are open now.', cta: 'Book a custom quilt (link in bio)', hashtags: '#customquilt #babyquilt #handmadequilt' },\n    'What’s your favorite quilt pattern?': { pillar: 'Studio life', hook: 'Settle this for me.', body: 'Log cabin, flying geese, or half-square triangles? I’m planning the next sample quilt and I’ll make the winner.', cta: 'Vote in the poll', hashtags: '#quiltpattern #quiltersofinstagram' },\n    'Fall table runners are here': { pillar: 'New work', hook: 'Fall table runners just landed.', body: 'Rust, mustard and deep green, cotton-linen with a quilted center. $48. Ready for Thanksgiving.', cta: 'Shop the runners', hashtags: '#fallhome #tablelinens #handmadehome' },\n    'A day at the makers market': { pillar: 'Studio life', hook: 'What a market day really looks like.', outline: '5:30 alarm\\nLoading the car\\nSetup\\nThe first sale\\nThe slow middle\\nPacking up tired and happy', shots: 'Car trunk, packed\\nTent going up\\nHands handing over a bag\\nThe empty table at the end', body: 'Thank you to everyone who came out Saturday. We sold out of napkin sets by 10. Next market is the Harvest Makers Fair.', cta: 'See you at the next market', hashtags: '#makersmarket #shopsmall #handmadegifts' },\n    'Caring for a handmade quilt': { pillar: 'Quilt care', hook: 'How to wash a handmade quilt (and keep it for years)', outline: 'Cold water, gentle cycle\\nColor catchers the first few times\\nNo bleach, no fabric softener\\nTumble low or line dry\\nStore folded in cotton, not plastic', body: 'Every quilt I send out comes with a care card, but here’s the longer version. Short answer: yes, you can wash it. Please do.', cta: 'Reply with your quilt questions', hashtags: '' }\n  };\n  Object.assign(FULL, {\n    'Binding basics: the mitered corner': { hook: 'The corner fold that makes binding look professional.', outline: 'Sew to 1/4\" from the corner, stop\\nFold the strip up at 45°\\nFold it back down along the edge\\nStart sewing from the top\\nFlip and see the miter', shots: 'Overhead, close on the corner\\nSlow-motion fold\\nThe finished corner from the front', body: 'If your binding corners bunch up, it’s almost always the fold. Up at 45°, then straight back down. That’s it. Save this for the next quilt.', cta: 'Save this for later', hashtags: '#quiltbinding #quiltersofinstagram #sewingtips' },\n    'Washing a quilt the first time': { hook: 'Yes, you can wash it. Here’s how.', outline: 'Cold water, gentle\\nTwo color catchers\\nNo softener\\nLow tumble\\nThe crinkle after', shots: 'Quilt going into the washer\\nColor catcher close-up\\nThe crinkly texture after drying', body: 'The first wash is the one people worry about. Cold, gentle, a couple of color catchers, low heat. And then the best part: that soft crinkle.', cta: 'Send this to someone with a new quilt', hashtags: '#quiltcare #handmadequilt' },\n    'New colorway: Meadow': { hook: 'Meet Meadow.', shots: 'Napkins folded on the porch table, morning light', body: 'Sage, butter and a little clay. Napkins and table runners in the new Meadow colorway are in the shop now.', cta: 'Shop Meadow (link in bio)', hashtags: '#tablelinens #handmadehome' },\n    'The tools I use every single day': { hook: 'Seven tools, every single day.', slides: ['Rotary cutter (45mm)', 'Self-healing mat, the big one', 'A 6x24 ruler', 'Glass-head pins', 'Wonder clips for binding', 'A good seam ripper', 'The iron, always on'], body: 'People ask what they need to start. Not much. These seven do almost everything in my studio. Pin it for your shopping list.', cta: 'Save this for later', hashtags: '#sewingtools #quilting #sewingtips' },\n    'Storing quilts for the season': { hook: 'Where your quilts should spend the summer', outline: 'Clean first\\nFold, don’t hang\\nRefold every few months\\nCotton bag, not plastic\\nNo attic, no basement', body: 'A short one this month. When you put quilts away for the warm months, wash them first, fold them loosely and keep them somewhere with steady air. Cotton pillowcases make good storage bags.', cta: 'Reply with your storage questions' },\n    'Quilt math: how much fabric you need': { hook: 'How much fabric do you need? The math.', slides: ['Pick your finished size', 'Add 4\" each way for the back', 'Backing: width ÷ 40\" = number of widths', 'Binding: (perimeter + 12\") ÷ 40\" = strips', 'Round up. Always round up.'], body: 'The question I get most at markets, answered with real numbers for a crib, a throw and a queen. Save it: you’ll want it in the fabric store.', cta: 'Save this for later', hashtags: '#quiltmath #quilting #sewingtips' },\n    'Restock: napkin sets back in sage': { outline: 'Frame 1: the stack of sage napkins\\nFrame 2: price and link\\nFrame 3: poll, which color next?' },\n    'Hand quilting vs machine quilting': { hook: 'Hand or machine? Here’s the honest difference.', outline: 'Same quilt block, both ways\\nTime: 6 hours vs 40 minutes\\nHow each one feels\\nWhen I use each\\nWhich lasts longer (both)', shots: 'Split screen: hands, then machine\\nClose-up of both stitches\\nThe two blocks side by side', body: 'I do both. Machine for everyday quilts, hand quilting for heirlooms. Neither is “real quilting” more than the other. Which do you like the look of?', cta: 'Comment hand or machine', hashtags: '#handquilting #machinequilting #quiltersofinstagram' },\n    'Behind the price tag: a napkin set': { hook: 'Where your $38 goes.', slides: ['Fabric: $9', 'Thread and labels: $2', '2 hours of sewing', 'Washing, pressing, photos', 'Shop fees and shipping supplies: $5', 'What’s left'], body: 'After the post about quilt prices, a lot of you asked about the smaller things. Here’s a napkin set, line by line.', cta: 'Tell me what surprised you', hashtags: '#shopsmall #handmadeisworthit' },\n    'Harvest colors are in the shop': { hook: 'Rust, mustard and deep green.', body: 'The harvest napkins and runners are in. Small batches, so when a color’s gone it’s gone until spring.', cta: 'Shop the harvest colors', hashtags: '#fallhome #handmadehome' },\n    'Fixing a torn quilt binding': { hook: 'Don’t throw it out. The binding can be fixed.', outline: 'Find where the tear ends\\nUnpick 2\" past it\\nCut a new strip\\nSew on, miter, hand-finish\\nYou can’t tell', shots: 'The torn edge, close\\nUnpicking\\nNew strip going on\\nThe repaired edge', body: 'An old quilt came in with a torn edge. The binding is the easiest part to replace, and it gives the whole quilt years more. Here’s the whole repair.', cta: 'Send this to someone with a well-loved quilt', hashtags: '#quiltrepair #visiblemending #quiltcare' },\n    'Packing a custom quilt order': { hook: 'Packing a quilt that took six weeks.', shots: 'Overhead of the table\\nTissue wrap\\nThe sticker and the note\\nTaping the box', body: 'Every custom quilt gets wrapped in tissue, tied, tagged and sent with a care card and a handwritten note. This one is going to a baby named Theo.', cta: 'Book a custom quilt (link in bio)', hashtags: '#customquilt #packanorder #smallbusiness' },\n    'Fall napkin sets: last call': { hook: 'Last call for fall napkins.', body: 'Four sets left in rust and two in mustard. After that, the next batch is spring.', cta: 'Shop the last sets', hashtags: '#tablelinens #fallhome' },\n    '3 quilt myths I hear at every market': { hook: 'Three things people get wrong about quilts.', slides: ['Myth: you can’t wash a quilt', 'Myth: hand-quilted is always better', 'Myth: quilts are only for beds', 'What’s true: use it, wash it, love it'], body: 'I hear these every single market. A quilt that’s used and washed lasts longer than one kept in a closet. Which one did you believe?', cta: 'Comment which one you believed', hashtags: '#quiltmyths #quiltersofinstagram #handmadequilt' },\n    'How long does a custom quilt take?': { hook: 'How long does a custom quilt take? Six weeks. Here’s why.', outline: 'Week 1: the fabric pull\\nWeek 2: cutting\\nWeeks 3–4: the top\\nWeek 5: quilting\\nWeek 6: binding, washing, packing', shots: 'Calendar with the weeks marked\\nFabric pull on the table\\nThe quilt at each stage', body: 'This is the question I get most since the binding video. Here’s the honest timeline, week by week. Spring spots are open now.', cta: 'Book a custom quilt (link in bio)', hashtags: '#customquilt #quiltprocess #slowmade' },\n    'Gift sets for the holidays': { hook: 'Gift sets, wrapped and ready.', shots: 'Gift sets stacked on the porch, with ribbon', body: 'A napkin set and two pot holders, wrapped in linen with a tag. $60, and they ship by December 15.', cta: 'Shop the gift sets', hashtags: '#handmadegifts #holidaygifts #shopsmall' },\n    'Studio update: winter quilt in progress': { outline: 'Frame 1: the pieced top on the design wall\\nFrame 2: close on the stars\\nFrame 3: question sticker, name this quilt' }\n  });\n  FULL['Custom quilt process, start to finish'].cta = 'Book a custom quilt (link in the description)';\n  posted.forEach(function (p) {\n    var n = -p[0], res = p[7] == null ? undefined : { views: p[7], likes: p[8], comments: p[9], saves: p[10], at: iso(n + 3, 20) };\n    piece(p[2], 'posted', n - 8, Object.assign({ format: p[3], platforms: p[4], type: p[5], pillar: p[6], postedDate: iso(n, p[1], 15), scheduledDate: dk(n),\n      steps: { film: true, edit: true, create: true }, results: res }, FULL[p[2]] || {}));\n  });\n  piece('Behind the scenes: Dana’s baby quilt', 'ready', -14, { format: 'reel', platforms: ['ig', 'tt', 'yt'], type: 'personal', pillar: 'Process', scheduledDate: dk(1), hook: 'Six weeks of work in thirty seconds',\n    outline: 'Dana’s fabric pull\\nCutting the stars\\nThe top on the design wall\\nQuilting\\nBinding\\nDana opening the box (she said yes to filming)', shots: 'Fabric pull, overhead\\nRotary cutter close\\nDesign wall wide\\nThe box opening', steps: { film: true, edit: true },\n    body: 'Dana asked for a quilt for her daughter in the colors of the garden she grew up in. Here’s all six weeks in thirty seconds, and the moment she opened the box.', cta: 'Book a custom quilt (link in bio)', hashtags: '#customquilt #babyquilt #quiltprocess', notes: 'Post at 9 like the other reels. Tag Dana (she said OK).' });\n  piece('Holiday gift guide: under $40', 'ready', -9, { format: 'carousel', platforms: ['ig', 'pi'], type: 'promotional', pillar: 'New work', scheduledDate: dk(3), hook: 'Gifts that don’t end up in a drawer',\n    slides: ['Gifts under $40 that get used every day', 'Pot holders, $14', 'Mug rugs, set of 2, $18', 'Zip pouches, $22', 'Napkin set of 4, $38', 'Order by Dec 15 to ship in time'], steps: { create: true },\n    body: 'Pot holders, napkin sets, mug rugs and the little zip pouches. Everything here is under $40 and made in the studio. Order by December 15 for it to arrive in time.', cta: 'Shop the guide (link in bio)', hashtags: '#giftguide #handmadegifts #shopsmall' });\n  piece('Harvest Makers Fair: come say hi', 'ready', -4, { format: 'story', platforms: ['ig'], type: 'promotional', scheduledDate: dk(19), steps: { create: true },\n    outline: 'Frame 1: the fair poster\\nFrame 2: what I’m bringing (napkins, runners, gift sets)\\nFrame 3: countdown sticker\\nFrame 4: map, booth 14' });\n  piece('Binding, part 2: hand-finishing the back', 'develop', -12, { format: 'reel', platforms: ['ig', 'tt', 'yt'], type: 'educational', pillar: 'Process', hook: 'Part 2: the invisible stitch on the back.',\n    outline: 'Clip the binding over\\nThread a short length, knot buried\\nThe ladder stitch, slowly\\nThe corner\\nFinished back, slow pan', shots: 'Close on the needle, natural light\\nThe corner fold from the back', steps: { film: true },\n    notes: 'Hundreds asked for part 2 after the 60-second binding reel. Same length (under a minute), same overhead angle so it matches. Edit Sunday.' });\n  piece('Quilting terms nobody explains', 'develop', -18, { format: 'carousel', platforms: ['ig', 'pi'], type: 'educational', pillar: 'Process', hook: 'What is a fat quarter, anyway?',\n    slides: ['Quilting words nobody explains', 'Fat quarter: 18\" x 22\" of fabric', 'Batting: the fluffy middle', 'Binding: the edge that holds it all', 'Sashing: the strips between blocks', ''], notes: 'From the comments on the myths post. Carousels like this get saved a lot, so keep it simple and clear.' });\n  piece('Wholesale: why I said yes', 'develop', -7, { format: 'newsletter', platforms: ['ss'], type: 'personal', pillar: 'Studio life',\n    outline: 'The email from the Old Town gift shop\\nWhy I said no last year\\nWhat changed\\nWhat it means for custom spots\\nWhere to find the napkins now', body: 'Last year a shop asked to carry my napkins and I said no. I didn’t think I could keep up. This year I said yes, and here’s what changed…', notes: 'Send before the fair so people know they can buy in town.' });\n  piece('Thrift store fabric finds', 'capture', -24, { notes: 'Film the next thrift run. Vintage sheets make great quilt backs.' });\n  piece('Before/after: fixing an heirloom quilt', 'capture', -20, { format: 'reel', notes: 'Mrs. Patel’s 1950s quilt: ask if I can film the repair.' });\n  piece('My favorite tools under $20', 'capture', -15, { format: 'carousel' });\n  piece('Color palettes for winter quilts', 'capture', -10, { format: 'pin', notes: 'Three palettes: snow, pine, cranberry.' });\n  piece('Q&A: your custom quilt questions', 'capture', -6, { notes: 'Collect questions from the comments on the six-week reel.' });\n  piece('Studio playlist', 'capture', -3, {});\n  var wr = {\n    dataVersion: 2,\n    businesses: [{ id: BIZ, name: 'Willow & Thread', owner: 'both', created: iso(-400, 9) }],\n    activeBiz: BIZ,\n    content: content,\n    homebase: { biz_willow_thread: { bizName: 'Willow & Thread', tagline: 'Handmade quilts and home goods', elevatorPitch: 'Small-batch quilts, napkins and table linens, sewn in a converted garage studio.',\n      targetAudience: 'People who want a few lovely, lasting things for their home, and gift-givers', voice: 'Warm, plain-spoken, a little funny',\n      platforms: ['ig', 'fb', 'tt', 'yt', 'pi', 'ss'], pillars: ['Process', 'Quilt care', 'Studio life', 'New work'], faqs: ['How long does a custom quilt take?', 'Can I wash it?', 'Do you ship?'], hashtags: [{ name: 'Everyday', tags: '#handmadequilt #quiltersofinstagram #slowmade' }, { name: 'Markets', tags: '#makersmarket #shopsmall #handmadegifts' }] } },\n    brandColors: { biz_willow_thread: ['#5b6b4f', '#e9dcc8', '#b5654a'] },\n    offers: { biz_willow_thread: [{ name: 'Custom baby quilt', price: '$450', description: '6 to 8 weeks', status: 'active' }, { name: 'Napkin set of 4', price: '$38', description: '', status: 'active' }, { name: 'Pot holders', price: '$14', description: '', status: 'active' }] },\n    bizDates: {},\n    sparks: [{ id: uid('s'), bizId: BIZ, title: 'Quilting workshop at the library', note: 'Ask about the community room', excitement: 'high', effort: 'medium', impact: '', created: iso(-70, 9) },\n      { id: uid('s'), bizId: BIZ, title: 'Wholesale to the Old Town gift shop', note: '', excitement: 'medium', effort: 'medium', impact: '', created: iso(-25, 9) },\n      { id: uid('s'), bizId: BIZ, title: 'Pattern PDF for the scrappy star', note: '', excitement: 'high', effort: 'high', impact: '', created: iso(-12, 9) }]\n  };\n  /* Home Base filled in the way someone who uses it every day has it (Nov 2): type and niche, the business's own\n     details, links, where she posts and the pages Post opens, colors with names, the year's dates, what she sets aside\n     for taxes, more offers and sparks, and Waiting to be paid (Dana's balance came in, so Work asks \"Is this Dana's $450?\"). */\n  function longDay(d) { return d.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }); }\n  var yr = T0.getFullYear(), nextDate = function (mo, d) { var x = new Date(yr, mo - 1, d); if (x < T0) x = new Date(yr + 1, mo - 1, d); return x; };\n  Object.assign(wr.homebase[BIZ], { bizType: ['Product-Based', 'E-Commerce'], niche: 'Handmade quilts and table linens', bizEntity: 'Single-member LLC',\n    serviceArea: 'Ships across the US; pickup in Riverbend', hours: 'Studio by appointment, Tue–Sat 10–4',\n    website: 'willowandthread.example', instagram: '@willowandthread.quilts', tiktok: '@willowandthread.quilts', pinterest: 'willowandthreadquilts', email: 'hello@willowandthread.example', phone: '555-0172',\n    customLinks: [{ label: 'Etsy shop', url: 'https://www.etsy.com/shop/WillowAndThreadQuilts' }, { label: 'Makers market schedule', url: 'https://riversidemakers.example/schedule' }, { label: 'Wholesale price sheet', url: 'https://docs.google.com/spreadsheets/' }],\n    platforms: ['ig', 'fb', 'tt', 'yt', 'pi', 'ss'],\n    postUrls: { ig: 'https://business.facebook.com/latest/content_calendar', pi: 'https://www.pinterest.com/pin-builder/' },\n    taxPct: 25 });\n  wr.brandColors[BIZ] = [{ hex: '#5b6b4f', label: 'Moss' }, { hex: '#e9dcc8', label: 'Linen' }, { hex: '#b5654a', label: 'Clay' }];\n  wr.offers[BIZ] = wr.offers[BIZ].concat([{ name: 'Holiday gift set', price: '$60', description: 'Napkin set + 2 pot holders, wrapped', status: 'active' },\n    { name: 'Wholesale napkin sets', price: '$22 a set', description: 'Minimum 12 sets, net 30', status: 'active' },\n    { name: 'Beginner quilting workshop', price: '$65', description: '3 hours, all supplies', status: 'active' },\n    { name: 'Spring napkin set', price: '$38', description: '', status: 'retired' }]);\n  wr.bizDates[BIZ] = [{ label: 'Harvest Makers Fair, booth 14', date: longDay(day(19)) }, { label: 'Last day to order for the holidays', date: longDay(nextDate(12, 15)) },\n    { label: 'Shop’s 4th birthday', date: longDay(nextDate(3, 8)) }, { label: 'Spring custom quilt spots open', date: longDay(nextDate(2, 1)) }, { label: 'LLC annual report due', date: longDay(nextDate(4, 1)) }];\n  wr.sparks = wr.sparks.concat([{ id: uid('s'), bizId: BIZ, title: 'Quilt-of-the-month club', note: 'One small quilt kit a month, $34. Ask 5 regulars first.', excitement: 'high', effort: 'high', impact: '', created: iso(-41, 21) },\n    { id: uid('s'), bizId: BIZ, title: 'Gift wrapping as an add-on', note: '$6, linen wrap and a tag', excitement: 'medium', effort: 'low', impact: '', created: iso(-33, 8) },\n    { id: uid('s'), bizId: BIZ, title: 'Memory quilts from old T-shirts', note: 'Three people asked at the last market', excitement: 'high', effort: 'medium', impact: '', created: iso(-18, 20) },\n    { id: uid('s'), bizId: BIZ, title: 'Team up with Blue Door Bakery for a market bundle', note: '', excitement: 'medium', effort: 'low', impact: '', created: iso(-5, 12) }]);\n  wr.waiting = [{ id: 'wait_dana', bizId: BIZ, client: 'Dana Whitfield', amount: 450, due: dk(3), note: 'Baby quilt, the balance after the deposit', addedAt: dk(-16), by: 'person1', notIds: [] },\n    { id: 'wait_oldtown', bizId: BIZ, client: 'Old Town Gift Shop', amount: 684, due: dk(18), note: 'Wholesale: 24 napkin sets + 12 runners, invoice #1042', addedAt: dk(-12), by: 'person1', notIds: [] },\n    { id: 'wait_library', bizId: BIZ, client: 'Riverbend Library', amount: 250, due: dk(-4), note: 'October quilting workshop', addedAt: dk(-25), by: 'person1', notIds: [] },\n    { id: 'wait_harbor', bizId: BIZ, client: 'Harbor Coffee Co.', amount: 360, due: cafePaid.date, note: 'Café cushions', addedAt: ymd(new Date(T0.getFullYear(), T0.getMonth() - 2, 20)), by: 'person1', notIds: [], gone: 'paid', goneAt: cafePaid.date + 'T18:00:00.000Z', paidTx: cafePaid.id, paidOn: cafePaid.date }];\n  wr.waitUsed = [];\n  wr.taxDatesBy = { person1: iso(-200, 9) };\n  put('wr:data', wr);\n  put('wr:assets', { biz_willow_thread: [{ label: 'Logo', data: '' }, { label: 'Headshot', data: '' }] });\n  put('workThree_person1', { items: [{ text: 'Photograph the new pot holders', done: true }, { text: 'Reply to the wholesale inquiry', done: false }, { text: 'Order more mailers', done: false }], updatedAt: iso(0, 8) });\n\n  // ---------- sample: habits, workouts, today extras (Nov 2) ----------\n  (function () {\n    // its own seeded numbers, so what other parts of the sample draw never changes these (and the other way round)\n    var s2 = 7331;\n    function r2() { s2 |= 0; s2 = s2 + 0x6D2B79F5 | 0; var t = Math.imul(s2 ^ s2 >>> 15, 1 | s2); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n    var ch2 = function (p) { return r2() < p; }, int2 = function (a, b) { return a + Math.floor(r2() * (b - a + 1)); };\n    var ms = function (n, h, m) { var d = day(n); d.setHours(h || 12, m || 0, 0, 0); return d.getTime(); };\n    var get = function (k) { try { return JSON.parse(out[k]); } catch (e) { return null; } };\n\n    // --- Workouts (workouts.js): with no online storage the card reads this phone's copy, dbkPrivate_workout_<login uid>,\n    // and only on the Habits page of the person this phone is (myPersonRole). The preview has no login, so the sample\n    // gives this browser a stand-in uid for whoever demo.html opens as (?demo&as=person2, else the person already here).\n    var viewer = 'person1';\n    try {\n      var q = new URLSearchParams(location.search).get('as');\n      viewer = q === 'person1' || q === 'person2' ? q : (localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1');\n    } catch (e) {}\n    put('dbkRoleUid', 'demo_' + viewer);\n    function slug(x) { return String(x).toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60); }\n    var PLAN_T = ms(-86, 20);\n    // one person's plan and about 12 weeks of logging. sess: { id: { n, about, ex } }; start: per exercise key, the first weight\n    // and how much it goes up; swaps: { dayOffset: workout id or '-' }; notes: { dayOffset: text }\n    function workouts(who, o) {\n      var sess = {};\n      Object.keys(o.sess).forEach(function (id) { sess[id] = Object.assign({ t: PLAN_T, about: '' }, o.sess[id]); });\n      var plan = { sess: sess, gone: {}, days: { t: PLAN_T, v: o.days }, unit: { t: PLAN_T, v: 'lb' }, rules: { t: PLAN_T, v: o.rules } };\n      var m = {}, st = {};   // st: where each lift is now { w, r } (weight, reps on the first set)\n      var mon = function (n) { var k = 'm-' + dk(n).slice(0, 7); return m[k] || (m[k] = { l: {}, d: {}, w: {} }); };\n      for (var n = -84; n <= 0; n++) {\n        var dow = String(day(n).getDay()), planned = o.days[dow] || '', sw = o.swaps[n], id = sw !== undefined ? sw : planned;\n        if (sw !== undefined) mon(n).w[dk(n)] = { t: ms(n, 7), v: sw };\n        if (!id || id === '-' || !sess[id]) continue;\n        if (n < 0 && sw === undefined && ch2(o.miss)) continue;          // a day missed\n        var M = mon(n), D = M.l[dk(n)] = {}, t0 = ms(n, o.hour, int2(0, 20)), ex = sess[id].ex.filter(function (e) { return !e.h; });\n        var upto = n === 0 ? Math.min(o.today, ex.length) : ex.length;                         // today: as far as they've got\n        ex.slice(0, upto).forEach(function (e, i) {\n          var k = slug(e.n), sets = [], t = t0 + i * 6 * 60000;\n          if (e.k === 'lift' || e.k === 'carry') {\n            var low = e.top ? e.top - (e.top <= 5 ? 1 : e.top >= 15 ? 3 : 2) : 8;\n            var p = st[k] || (st[k] = { w: o.start[k] ? o.start[k][0] : 20, r: low }), inc = o.start[k] ? o.start[k][1] : 5, all = e.top && p.r >= e.top;\n            for (var j = 0; j < e.sets; j++) sets.push({ w: String(p.w), r: e.k === 'carry' ? '' : String(all ? e.top : Math.max(1, p.r - (j > 0 && ch2(0.4) ? 1 : 0) - (j > 1 && ch2(0.25) ? 1 : 0))) });\n            // next time: a rep or so more; the day every set hits the top, the weight goes up next time and the reps start lower again\n            if (all) { p.w += inc; p.r = low; }\n            else if (e.top && ch2(0.65)) p.r = Math.min(e.top, p.r + 1);\n            else if (!e.top && ch2(0.2)) p.w += inc;\n          } else if (e.k === 'reps') { for (var j2 = 0; j2 < e.sets; j2++) sets.push({ w: '', r: String(int2(e.lo || 8, e.hi || 12)) }); }\n          else if (e.k === 'time') { for (var j3 = 0; j3 < e.sets; j3++) sets.push({ w: '', r: String(int2(e.lo || 30, e.hi || 45)) }); }\n          else if (e.k === 'cardio') sets.push({ w: e.lv ? String(int2(5, 8)) : '', r: String(int2(e.lo || 20, e.hi || 35)) });\n          else sets.push({ w: '', r: 'done' });\n          D[k] = { t: t, s: sets };\n        });\n        if (o.notes[n]) D._n = { t: t0 + 50 * 60000, x: o.notes[n] };\n        if (upto === ex.length) M.d[dk(n)] = t0 + 55 * 60000;\n      }\n      // the next workout ahead: its first lift hit the top on every set last time, so it says \"go up a little next time\"\n      for (var a = 1; a <= 7; a++) {\n        var nid = o.days[String(day(a).getDay())]; if (!nid || !sess[nid]) continue;\n        var e0 = sess[nid].ex.filter(function (e) { return e.k === 'lift' && e.top; })[0]; if (!e0) continue;\n        var k0 = slug(e0.n), last = null;\n        Object.keys(m).sort().forEach(function (mk) { Object.keys(m[mk].l).sort().forEach(function (dd) { if (m[mk].l[dd][k0]) last = m[mk].l[dd][k0]; }); });\n        if (last) last.s.forEach(function (x) { x.r = String(e0.top); });\n        break;\n      }\n      var s = {}; Object.keys(o.setup).forEach(function (k) { s[k] = { t: PLAN_T + 864e5 * 3, x: o.setup[k] }; });\n      put('dbkPrivate_workout_demo_' + who, { plan: plan, s: s, m: m, dirty: [] });\n    }\n    var off = function (dow, back) { var n = 0; while (day(n).getDay() !== dow) n--; return n - 7 * (back || 0); };   // a past weekday\n    // Nora: three days, strength twice and pilates once, a walk after Friday's\n    workouts('person1', {\n      days: { '1': 'noraLower', '3': 'noraPilates', '5': 'noraUpper' }, hour: 9, miss: 0.12, today: 3,\n      rules: 'Warm up 5 minutes on the bike first.\\nStop any set where my lower back complains.\\nWater bottle, and eat something by 8:30.',\n      sess: {\n        noraLower: { n: 'Lower body + core', about: 'Glutes, legs, a little core', ex: [\n          { h: 'Warm-up' }, { n: 'Glute bridges', k: 'reps', sets: 2, target: '2 x 15', lo: 14, hi: 15 },\n          { h: 'Strength' },\n          { n: 'Goblet squat', k: 'lift', sets: 3, target: '3 x 8-12', top: 12, how: 'Hold the dumbbell at your chest, elbows in. Sit back between your heels, chest up, and push the floor away.' },\n          { n: 'Leg press', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Romanian deadlift', k: 'lift', sets: 3, target: '3 x 8-10', top: 10, how: 'Soft knees, push your hips back until you feel the hamstrings, then stand tall. Dumbbells stay close to your legs.' },\n          { n: 'Side plank', k: 'time', sets: 2, target: '2 x 30 sec each side', side: 1, lo: 25, hi: 40 }] },\n        noraPilates: { n: 'Pilates mat', about: 'The 45-minute class video, then a walk if it’s nice', ex: [\n          { n: 'The hundred', k: 'tick', sets: 1, target: '100 pumps' },\n          { n: 'Roll-ups', k: 'reps', sets: 2, target: '2 x 8', lo: 6, hi: 8 },\n          { n: 'Single leg stretch', k: 'reps', sets: 2, target: '2 x 10 each side', lo: 10, hi: 10 },\n          { n: 'Plank', k: 'time', sets: 3, target: '3 x 40 sec', lo: 35, hi: 50 },\n          { n: 'Swan', k: 'tick', sets: 1, target: '5 slow ones' },\n          { n: 'Walk Juniper (the long loop)', k: 'cardio', sets: 1, target: '30-40 min', lo: 28, hi: 45 }] },\n        noraUpper: { n: 'Upper body + walk', about: 'Back, shoulders, arms, then the treadmill', ex: [\n          { n: 'Lat pulldown', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Seated cable row', k: 'lift', sets: 3, target: '3 x 10-12', top: 12, m: 'cable-stack' },\n          { n: 'Dumbbell shoulder press', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n          { n: 'Cable face pulls', k: 'lift', sets: 2, target: '2 x 15', top: 15, m: 'cable-stack', how: 'Rope at forehead height. Pull toward your eyes, elbows high, squeeze between the shoulder blades.' },\n          { n: 'Incline walk', k: 'cardio', sets: 1, lv: 1, target: '20 min, incline 6-8', lo: 18, hi: 25 }] }\n      },\n      start: { 'goblet-squat': [25, 5], 'leg-press': [90, 10], 'romanian-deadlift': [30, 5], 'lat-pulldown': [55, 5], 'seated-cable-row': [50, 5], 'dumbbell-shoulder-press': [12, 2.5], 'cable-face-pulls': [20, 2.5] },\n      setup: { 'leg-press': 'Seat on 5, feet high and hip width', 'lat-pulldown': 'Thigh pad on 3, wide grip bar', 'cable-stack': 'Cable stack by the window: pin on the 2nd hole for face pulls' },\n      swaps: (function () { var x = {}; x[off(3, 3)] = '-'; return x; })(),   // a Wednesday off three weeks ago (the wedding weekend prep)\n      notes: (function () { var x = {}; x[off(1, 1)] = 'Squats felt strong. Left hip a little tight on the RDLs.'; x[off(5, 4)] = 'Gym was packed, did the rows on the dumbbell bench instead.'; return x; })()\n    });\n    // Ben: four days, upper/lower\n    workouts('person2', {\n      days: { '1': 'benUpA', '2': 'benLoA', '4': 'benUpB', '5': 'benLoB' }, hour: 6, miss: 0.1, today: 99,\n      rules: 'Two warm-up sets before the first lift.\\nRest 2-3 minutes on the big lifts, 90 seconds on the rest.\\nGo up 5 lb when every set hits the top of the range.',\n      sess: {\n        benUpA: { n: 'Upper A', about: 'Bench day', ex: [\n          { n: 'Bench press', k: 'lift', sets: 3, target: '3 x 6-8', top: 8, how: 'Shoulder blades pinched, feet planted. Bar touches just under the chest, press up and slightly back.' },\n          { n: 'Bent-over row', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n          { n: 'Incline dumbbell press', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n          { n: 'Lat pulldown', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Dumbbell curls', k: 'lift', sets: 2, target: '2 x 10-12', top: 12 }] },\n        benLoA: { n: 'Lower A', about: 'Squat day', ex: [\n          { n: 'Back squat', k: 'lift', sets: 3, target: '3 x 5-7', top: 7, how: 'Bar on the upper back, brace before you go down. Hips and knees break together, depth at or below parallel.' },\n          { n: 'Romanian deadlift', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n          { n: 'Leg curl', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Calf raises', k: 'lift', sets: 3, target: '3 x 12-15', top: 15 },\n          { n: 'Plank', k: 'time', sets: 2, target: '2 x 60 sec', lo: 50, hi: 70 }] },\n        benUpB: { n: 'Upper B', about: 'Overhead day', ex: [\n          { n: 'Overhead press', k: 'lift', sets: 3, target: '3 x 6-8', top: 8 },\n          { n: 'Pull-ups', k: 'reps', sets: 3, target: '3 x as many as you can', lo: 6, hi: 9 },\n          { n: 'Seated cable row', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Lateral raises', k: 'lift', sets: 3, target: '3 x 12-15', top: 15 },\n          { n: 'Triceps pushdown', k: 'lift', sets: 2, target: '2 x 10-12', top: 12 }] },\n        benLoB: { n: 'Lower B', about: 'Deadlift day', ex: [\n          { n: 'Deadlift', k: 'lift', sets: 3, target: '3 x 5', top: 5, how: 'Bar over mid-foot, shins touch it. Chest up, push the floor away, lock out with the glutes. Reset each rep.' },\n          { n: 'Bulgarian split squat', k: 'lift', sets: 3, target: '3 x 8 each leg', top: 8, side: 1 },\n          { n: 'Leg press', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n          { n: 'Farmer carry', k: 'carry', sets: 3, target: '3 x 40 yards' },\n          { n: 'Bike cooldown', k: 'cardio', sets: 1, lv: 1, target: '10 min easy', lo: 8, hi: 12 }] }\n      },\n      start: { 'bench-press': [155, 5], 'bent-over-row': [115, 5], 'incline-dumbbell-press': [45, 5], 'lat-pulldown': [130, 5], 'dumbbell-curls': [25, 5],\n        'back-squat': [185, 5], 'romanian-deadlift': [135, 10], 'leg-curl': [80, 5], 'calf-raises': [120, 10],\n        'overhead-press': [95, 5], 'seated-cable-row': [120, 5], 'lateral-raises': [15, 2.5], 'triceps-pushdown': [50, 5],\n        'deadlift': [225, 10], 'bulgarian-split-squat': [30, 5], 'leg-press': [270, 20], 'farmer-carry': [60, 5] },\n      setup: { 'lat-pulldown': 'Thigh pad on 6', 'leg-curl': 'Back pad on 4, ankle pad just above the heel', 'leg-press': 'Seat on 3, feet middle of the plate', 'seated-cable-row': 'V-handle, foot plate on the 2nd notch' },\n      swaps: (function () { var x = {}; x[off(3, 2)] = 'benLoA'; x[off(4, 2)] = '-'; x[off(2, 6)] = '-'; return x; })(),   // squats on a Wednesday (Thursday was soccer and a late dinner); a sick day\n      notes: (function () { var x = {}; x[off(1, 2)] = 'Bench moved well. Right shoulder fine after the warm-up.'; x[off(5, 1)] = 'Deadlifts felt heavy, slept badly. Kept the weight.'; x[0] = 'Early one, gym was empty.'; return x; })()\n    });\n\n    // --- Recently removed (daybook-theme.js dbkRemoved.track's shape), from the last few days: none of these are in their lists any more\n    function gone(kind, key, items, hoursAgo, by, opts) {\n      opts = opts || {};\n      var tf = opts.title || 'title', e = { id: 'rr' + (1700000000 + hoursAgo * 3600).toString(36) + 'demo', kind: kind, title: String(items[0][tf] || items[0].text || ''), n: items.length, key: key, idf: opts.id || 'id', items: items, at: Date.now() - hoursAgo * 3600000, by: by };\n      return e;\n    }\n    put('dbkRemoved', [\n      gone('Done reminder', 'lifeReminders', [rem({ title: 'Drop off the wedding gift card', frequency: 'once', notifyDate: dk(-1), lastDone: iso(-1, 18) })], 20, 'person1'),\n      gone('Grocery item', 'groceries', [{ id: 1700000001900, text: 'Cilantro', completed: false }], 30, 'person2', { title: 'text' }),\n      gone('Event', 'calendarEvents', [{ id: uid('lh'), title: 'Haircut (Ben)', date: dk(3), time: '17:30', endTime: null, allDay: false, note: 'Moved to next month', location: 'Clip Joint', url: null, color: null, isMultiDay: false, eventGroup: null, repeatMode: 'single', recurring: null }], 44, 'person2'),\n      gone('Back Burner', 'futureTodos_person1', [{ id: 1700000099001, text: 'Look into a longarm quilting class', completed: false, createdAt: iso(-64, 20) }], 52, 'person1', { title: 'text' }),\n      gone('Restaurants', 'dreams_restaurants', [{ id: 1700000099002, firebaseId: 'item_1700000099002', title: 'Smoke & Barrel BBQ', details: 'Closed for good', notes: '', achieved: false, dateAdded: iso(-120, 12), priceRange: '$$', restaurantTypes: ['dinner'], occasion: 'casual', priority: 'low' }], 70, 'person1', { id: 'firebaseId' }),\n      gone('Inbox note', 'capturedThoughts_person1', [{ id: Date.now() - 4 * 864e5, text: 'ask Marie about the longarm rental', tag: null, createdAt: new Date(Date.now() - 4 * 864e5).toISOString() }], 80, 'person1', { title: 'text' })\n    ]);\n\n    // --- Today: a couple more Inbox notes with clear suggestions (inbox-suggest.js: a reminder, a wishlist idea, a show, a chore)\n    var inb = function (k, add) { var l = get(k) || []; put(k, l.concat(add.map(function (a) { var t = Date.now() - a[1] * 60000; return { id: t, text: a[0], tag: null, createdAt: new Date(t).toISOString() }; }))); };\n    inb('capturedThoughts_person1', [['call mom back about thanksgiving', 140], ['Christmas gift ideas for Ben', 40]]);\n    inb('capturedThoughts_person2', [['Watch Slow Horses', 60 * 9], ['clean the gutters before thanksgiving', 35]]);\n  })();\n\n  // ---------- sample: meals extras (Nov 2) ----------\n  // Both people's goals, planning together, every meal of the day (recipes and \"Something else\" typed meals), a week\n  // ahead with a leftovers night and two open nights, dinner reminders, a lived-in grocery list and a few more of the\n  // household's own recipes. Its own seeded numbers (mr), so nothing above it changes.\n  (function () {\n    var ms = 7713;\n    function mr() { ms |= 0; ms = ms + 0x6D2B79F5 | 0; var t = Math.imul(ms ^ ms >>> 15, 1 | ms); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n    function mc(p) { return mr() < p; }\n    function mp(a) { return a[Math.floor(mr() * a.length)]; }\n    function at(n, h) { var d = day(n); d.setHours(h || 9, 0, 0, 0); return d.getTime(); }\n    var DAYN = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n    // goals: Ben eats more than Nora, so his plates are bigger; `at` as the goals pop-up saves it\n    put('mealplan_goals', { person1: { calories: '1800', protein: '130', fiber: '25-30', at: at(-41, 20) }, person2: { calories: '2600', protein: '190', fiber: '30-38', at: at(-41, 20) } });\n    put('mealShareTwo', 'true');\n\n    // a few more of the household's own recipes, with everything a recipe holds\n    var MORE = [\n      { name: 'Nora’s Greek Chicken Sheet Pan', type: 'Dinner', protein: 46, calories: 520, fiber: 6, prepTime: 15, servings: 4, cuisineTags: ['Mediterranean', 'Greek'],\n        ingredients: ['1.5 lb chicken breast, cut in chunks', '1 lb baby potatoes, halved', '1 red onion, in wedges', '1 pint cherry tomatoes', '2 tbsp olive oil', '1 lemon, juiced', '2 tsp dried oregano', '3 cloves garlic, minced', '1/2 cup crumbled feta', '1 cup tzatziki'],\n        steps: ['Heat oven to 425°F.', 'Toss chicken, potatoes and onion with oil, lemon, oregano, garlic, salt and pepper.', 'Roast 20 minutes, add the tomatoes, roast 10 more.', 'Top with feta; serve with tzatziki.'], tip: 'Makes four; the leftovers are lunch.' },\n      { name: 'Egg Bites (Copycat)', type: 'Breakfast', protein: 19, calories: 230, fiber: 1, prepTime: 10, servings: 6, cuisineTags: ['American'],\n        ingredients: ['8 eggs', '1 cup cottage cheese', '1/2 cup shredded gruyère', '4 slices cooked bacon, crumbled', 'Salt, pepper'],\n        steps: ['Heat oven to 300°F with a pan of water on the bottom rack.', 'Blend eggs, cottage cheese, gruyère, salt and pepper.', 'Fill a greased muffin tin, add bacon, bake 25 minutes.'], tip: 'Two make a breakfast. They keep 5 days.' },\n      { name: 'Peanut Butter Protein Bites', type: 'Snack', protein: 8, calories: 190, fiber: 3, prepTime: 10, servings: 12, cuisineTags: [],\n        ingredients: ['1 cup oats', '1/2 cup peanut butter', '2 scoops vanilla protein powder', '1/3 cup honey', '1/4 cup mini chocolate chips'],\n        steps: ['Stir everything together.', 'Roll into 12 balls.', 'Chill 30 minutes.'], tip: '' },\n      { name: 'Dark Chocolate Yogurt Bark', type: 'Dessert', protein: 9, calories: 150, fiber: 2, prepTime: 10, servings: 6, cuisineTags: [],\n        ingredients: ['2 cups Greek yogurt', '2 tbsp honey', '1/2 cup raspberries', '2 oz dark chocolate, melted'],\n        steps: ['Spread yogurt mixed with honey on a lined sheet.', 'Dot with raspberries, drizzle with chocolate.', 'Freeze 3 hours, break into pieces.'], tip: '' }\n    ].map(function (r, i) {\n      return Object.assign({ id: 'r_custom_' + (CUSTOM.length + i) + '_demo', types: [r.type], prepped: null, portion: r.protein + 'g protein - ' + r.calories + ' cal',\n        portions: [r.protein + 'g protein', r.calories + ' cal', r.fiber + 'g fiber', r.prepTime + ' min'], color: 'var(--lh-accent)', favorite: false, timesUsed: 0, source: 'custom' }, r);\n    });\n    // what the first of their own recipes make, so Tonight's plan can compare\n    var SERVES = { 'Ben’s Sunday Chili': 6, 'Sheet Pan Gnocchi with Sausage & Peppers': 4, 'Black Bean Tacos': 4, 'Grandma Ruth’s Chicken & Dumplings': 6, 'Overnight Oats': 1 };\n    ALL.forEach(function (r) { if (SERVES[r.name]) r.servings = SERVES[r.name]; });\n    var BOOK = ALL.concat(MORE);\n    function rec(nm) { return BOOK.filter(function (r) { return r.name === nm; })[0]; }\n    // a meal in the plan, as the planner's assignMealToSlot saves it\n    function slot(r, id) {\n      return { id: id || r.id, name: r.name, type: r.type, types: r.types || [r.type], baseProtein: r.protein || 0, baseCalories: r.calories || 0, baseFiber: r.fiber || 0,\n        protein: r.protein || 0, calories: r.calories || 0, fiber: r.fiber || 0, ingredients: r.ingredients || [], steps: r.steps || [], tip: r.tip || '',\n        portion: (r.protein || 0) + 'g protein - ' + (r.calories || 0) + ' cal', portions: [(r.protein || 0) + 'g protein', (r.calories || 0) + ' cal'].concat((r.fiber || 0) > 0 ? [(r.fiber || 0) + 'g fiber'] : []),\n        color: r.color || 'var(--lh-accent)' };\n    }\n    // \"Something else\": what was typed, with its numbers, an id starting typed_ (meal-typed.js add)\n    var tN = 0;\n    function typed(t, type, n) {\n      tN++;\n      return slot({ name: t[0], type: type, types: [type], protein: t[2], calories: t[1], fiber: 0, ingredients: [], steps: [], tip: '' },\n        'typed_' + Math.round(day(n).getTime() / 1000 + tN * 37).toString(36) + ('000' + tN).slice(-4));\n    }\n    var BK = { person1: [['Greek yogurt + berries', 210, 20], ['Protein shake', 160, 30], ['2 eggs and toast', 330, 16], ['Coffee and a banana', 140, 2], ['Bagel with cream cheese', 360, 11]],\n      person2: [['Protein shake + banana', 265, 31], ['3 eggs, toast and bacon', 560, 32], ['Bagel with cream cheese', 360, 11], ['Oatmeal with peanut butter', 390, 14], ['Greek yogurt + berries', 210, 20]] };\n    var LU = { person1: [['Turkey sandwich', 450, 30], ['Big salad with chicken', 420, 38], ['Chipotle bowl', 690, 45], ['Panera soup and half sandwich', 520, 22], ['Tuna wrap', 410, 32]],\n      person2: [['Chipotle bowl, double chicken', 930, 68], ['Turkey sandwich', 450, 30], ['Leftover pizza', 570, 24], ['Jimmy John’s sub', 780, 40], ['Tuna wrap', 410, 32]] };\n    var SN = [['Protein bar', 200, 20], ['Apple + peanut butter', 270, 8], ['String cheese', 80, 7], ['Cottage cheese cup', 110, 13], ['Chips and salsa', 250, 3], ['Trail mix', 170, 5]];\n    var DS = [['Graeter’s ice cream', 300, 5], ['Square of dark chocolate', 100, 1], ['Kroger bakery cookie', 220, 2]];\n    function blankD() { return { breakfast: null, lunch: null, dinner: null, dessert: null, snack: [] }; }\n    function dayOf(k) { if (!sched[k]) sched[k] = { person1: blankD(), person2: blankD() }; ['person1', 'person2'].forEach(function (p) { if (!sched[k][p]) sched[k][p] = blankD(); if (!Array.isArray(sched[k][p].snack)) sched[k][p].snack = []; }); return sched[k]; }\n    function isTyped(m) { return !!m && String(m.id || '').indexOf('typed_') === 0; }\n\n    // the next six nights: a leftovers night and two open; tonight keeps its dinner\n    var next = [[1, 'Creamy Tuscan Chicken'], [2, 'left'], [3, null], [4, 'Nora’s Greek Chicken Sheet Pan'], [5, 'Ben’s Sunday Chili'], [6, null]];\n    next.forEach(function (x) {\n      var n = x[0], v = x[1], d = dayOf(dk(n)); delete d.skippedSlots;\n      ['person1', 'person2'].forEach(function (p) {\n        if (v === null) d[p].dinner = null;\n        else if (v === 'left') { var m = JSON.parse(JSON.stringify(sched[dk(n - 1)].person1.dinner)); m.leftover = dk(n - 1); m.ingredients = []; m.groceryItems = []; m.steps = []; m.tip = 'Leftovers from ' + DAYN[day(n - 1).getDay()] + '’s dinner.'; d[p].dinner = m; }\n        else d[p].dinner = slot(rec(v));\n      });\n    });\n    // a couple of dinners out in the last two weeks, with their numbers\n    [[-2, 'Takeout from Marigold Thai', 780, 32, 1050, 44], [-9, 'Tacos at Casa Verde', 720, 36, 980, 50]].forEach(function (x) {\n      var k = dk(x[0]), d = dayOf(k); delete d.skippedSlots; delete out2[k + '_person1']; delete out2[k + '_person2'];\n      d.person1.dinner = typed([x[1], x[2], x[3]], 'dinner', x[0]); d.person2.dinner = typed([x[1], x[4], x[5]], 'dinner', x[0]);\n    });\n    put('mealEatingOut', out2);\n\n    // breakfast, lunch, snacks and dessert: most days, never every slot; the days ahead thinner the further out, and\n    // only recipes there (what's typed in is what was eaten, and Had before lists the plan's newest first)\n    for (var n = -85; n <= 6; n++) {\n      var d = dayOf(dk(n)), far = n > 3 ? 0.35 : n > 0 ? 0.75 : 1, wk = day(n).getDay() % 6 === 0, ahead = n > 0;\n      ['person1', 'person2'].forEach(function (p) {\n        var x = d[p], two = p === 'person2';\n        if (!x.breakfast && mc((two ? 0.72 : 0.82) * far))\n          x.breakfast = mc(wk ? 0.5 : 0.3) || ahead ? slot(mp([rec('Breakfast Burritos (Freezer-Friendly)'), rec('Overnight Oats'), rec('Egg Bites (Copycat)')])) : typed(mp(BK[p]), 'breakfast', n);\n        if (!x.lunch && mc((wk ? 0.5 : 0.75) * far)) {\n          var prev = sched[dk(n - 1)], pd = prev && prev[p] && prev[p].dinner;\n          if (pd && !pd.leftover && !isTyped(pd) && mc(0.3) && !ahead) x.lunch = typed(['Leftover ' + pd.name.replace(/\\s*\\(.*\\)$/, '').replace(/^(Ben’s|Nora’s|Grandma Ruth’s) /, '').toLowerCase(), pd.calories, pd.protein], 'lunch', n);\n          else if (ahead) x.lunch = slot(mp([rec('Chicken Burrito Bowl'), rec('Chicken Burrito Bowl'), rec('Black Bean Tacos')]));\n          else if (mc(0.1)) x.lunch = slot(rec('Chicken Burrito Bowl'));\n          else x.lunch = typed(mp(LU[p]), 'lunch', n);\n        }\n        if (!x.snack.length && mc((two ? 0.6 : 0.55) * far)) {\n          x.snack = [mc(0.25) || ahead ? slot(rec('Peanut Butter Protein Bites')) : typed(mp(SN), 'snack', n)];\n          if (two && mc(0.4) && !ahead) x.snack.push(typed(mp(SN), 'snack', n));\n        }\n      });\n      if (!d.person1.dessert && mc((wk ? 0.35 : 0.15) * far)) {\n        var ds = mc(0.3) || ahead ? slot(rec('Dark Chocolate Yogurt Bark')) : typed(mp(DS), 'dessert', n);\n        d.person1.dessert = ds; d.person2.dessert = JSON.parse(JSON.stringify(ds));\n      }\n    }\n    // today, like a real day: breakfast, lunch and a snack each\n    var t0 = dayOf(dk(0));\n    t0.person1.breakfast = typed(['Greek yogurt + berries', 210, 20], 'breakfast', 0); t0.person2.breakfast = typed(['Protein shake + banana', 265, 31], 'breakfast', 0);\n    t0.person1.lunch = typed(['Turkey sandwich', 450, 30], 'lunch', 0); t0.person2.lunch = typed(['Chipotle bowl, double chicken', 930, 68], 'lunch', 0);\n    t0.person1.snack = [typed(['Protein bar', 200, 20], 'snack', 0)]; t0.person2.snack = [slot(rec('Peanut Butter Protein Bites'))];\n    put('mealplan_schedule', sched);\n\n    // the Journal: stars on some of the other meals of the last six weeks, and how a few of them sat (a small salad\n    // leaves Nora hungry, a protein-heavy breakfast keeps her going), never over anything already noted\n    for (var j = -45; j <= -1; j++) {\n      ['person1', 'person2'].forEach(function (p) {\n        var x = sched[dk(j)] && sched[dk(j)][p]; if (!x) return;\n        [['breakfast', x.breakfast], ['lunch', x.lunch], ['snack', (x.snack || [])[0]], ['dessert', x.dessert]].forEach(function (s) {\n          var m = s[1]; if (!m || !mc(p === 'person1' ? 0.4 : 0.22)) return;\n          var rk = 'journal_rating_' + dk(j) + '_' + s[0] + '_' + p, fk = 'journal_feel_' + dk(j) + '_' + s[0] + '_' + p;\n          if (out[rk] === undefined) put(rk, String(mp(/salad|coffee/i.test(m.name) ? [3, 3, 4] : [5, 5, 4, 4, 4, 3])));\n          if (out[fk] === undefined && mc(0.45)) {\n            var tg = /salad|coffee|string cheese/i.test(m.name) ? [mc(0.8) ? 'hungry' : 'light'] : /shake|egg|yogurt|protein/i.test(m.name) ? [mc(0.75) ? 'satisfied' : 'energized'] : /chipotle|pizza|sub|bagel|ice cream|cookie/i.test(m.name) ? [mp(['heavy', 'tired', 'satisfied'])] : [mp(['satisfied', 'satisfied', 'light'])];\n            put(fk, JSON.stringify({ tags: tg, note: '' }));\n          }\n        });\n      });\n    }\n\n    // recipes: how often each was planned, and the hearts on each person's favourites\n    var cnt = {};\n    Object.keys(sched).forEach(function (k) {\n      ['person1', 'person2'].forEach(function (p) {\n        var x = sched[k][p]; if (!x) return;\n        [x.breakfast, x.lunch, p === 'person1' ? x.dinner : null, p === 'person1' ? x.dessert : null].concat(x.snack || []).forEach(function (m) { if (m && !m.leftover && !isTyped(m)) cnt[m.name] = (cnt[m.name] || 0) + 1; });\n      });\n    });\n    BOOK.forEach(function (r) { r.timesUsed = cnt[r.name] || 0; });\n    rec('Nora’s Greek Chicken Sheet Pan').favoritePerson1 = true; rec('Dark Chocolate Yogurt Bark').favoritePerson1 = true;\n    rec('Egg Bites (Copycat)').favoritePerson2 = true; rec('Peanut Butter Protein Bites').favoritePerson2 = true;\n    BOOK.forEach(function (r) { r.favoritePerson1 = !!r.favoritePerson1; r.favoritePerson2 = !!r.favoritePerson2; r.favorite = r.favoritePerson1 || r.favoritePerson2; });\n    put('mealplan_recipes', BOOK);\n\n    // dinner reminders (meal-notes.js): Nora's for today and one done yesterday; Ben has his own\n    var din = function (n) { var x = sched[dk(n)]; return x && x.person1 && x.person1.dinner ? x.person1.dinner.name : ''; };\n    put('dbkMealNotes_person1', [\n      { id: 'mn_demo_1', day: dk(-1), text: 'Stop at the store', dish: din(-1), time: '17:00', done: true, at: at(-1, 17) },\n      { id: 'mn_demo_2', day: dk(0), text: 'Take the chicken out to thaw', dish: din(1), time: '20:00', done: false, at: at(-1, 21) }]);\n    put('dbkMealNotes_person2', [{ id: 'mn_demo_3', day: dk(0), text: /crock|slow/i.test(din(0)) ? 'Start the slow cooker' : 'Stop at the store', dish: din(0), time: /crock|slow/i.test(din(0)) ? '13:00' : '17:00', done: false, at: at(-1, 20) }]);\n\n    // the grocery list (Today's and Meals > Grocery are one list, 'groceries'): sections, amounts changed by hand\n    // (\"Name — amount\", as Edit item saves it), a section picked by hand on some, a few already in the cart\n    var GL = [['Chicken breast — 2 lb', 'Protein', 1], ['Ground turkey (93% lean)'], ['Chicken sausage'], ['Eggs — 2 dozen', 'Dairy', 1], ['Greek yogurt — 2 tubs'],\n      ['Cottage cheese'], ['Shredded mozzarella'], ['Feta'], ['Oat milk'], ['Baby spinach'], ['Bananas'], ['Raspberries'], ['Lemons — 3', 'Produce', 1],\n      ['Red onion'], ['Cherry tomatoes'], ['Baby potatoes'], ['Broccoli'], ['Avocados'], ['Green onions'], ['Sourdough bread'],\n      ['Whole wheat tortillas'], ['Brown rice'], ['Marinara sauce — 2 jars', 'Canned & Jarred', 1], ['Black beans'], ['Sun-dried tomatoes'],\n      ['Frozen corn'], ['Honey'], ['Protein bars', 'Baking & Snacks', 1], ['Tortilla chips'], ['Coffee beans'], ['Sparkling water'],\n      ['Dog treats'], ['Paper towels'], ['Dish soap']];\n    var cart = { 'Bananas': 1, 'Eggs — 2 dozen': 1, 'Coffee beans': 1, 'Oat milk': 1, 'Paper towels': 1 };\n    put('groceries', GL.map(function (g, i) { var it = { id: 1700000002000 + i, text: g[0], completed: !!cart[g[0]] }; if (g[2]) { it.cat = g[1]; it.catSet = true; } return it; }));\n    put('dbkGroceryOneList', String(at(-60, 9)));\n  })();\n\n  // ---------- sample: money and work extras (Nov 2) ----------\n  /* Nora's Work reminders: the four quarterly tax dates as Home Base's \"+ Add the 4 quarterly tax dates\" makes them\n     (work-kept.js taxReminders: ids tax-qN-person1, yearly, the day before each due date; the ones already past this\n     year ticked off), in place of the older hand-made \"Quarterly estimated taxes\", and a few more of the shop's. */\n  var TAXQ = [[1, 4, 15, 'Apr 15'], [2, 6, 15, 'Jun 15'], [3, 9, 15, 'Sep 15'], [4, 1, 15, 'Jan 15']];\n  var taxRems = TAXQ.map(function (t) {\n    var on = new Date(T0.getFullYear(), t[1] - 1, t[2] - 1), r = { id: 'tax-q' + t[0] + '-person1', title: 'Estimated tax payment', frequency: 'yearly', notifyDate: { month: on.getMonth() + 1, day: on.getDate() },\n      description: 'Estimated tax payment. Due: ' + t[3] + '.' + (t[0] === 4 ? ' (This one is for the last part of the year before.)' : '') + ' When the 15th is a weekend or a holiday, it’s due the next business day.',\n      link: null, phone: null, email: null, lastDone: null, snoozedUntil: null, space: 'work', taxQ: t[0], taxBiz: 'person1', spaceBy: 'person1' };\n    if (on < T0) { var doneN = Math.round((on - T0) / 864e5); r.lastDoneFor = ymd(on); r.lastDone = iso(doneN, 19, 40); r.link = 'https://www.irs.gov/payments/direct-pay'; }\n    return r;\n  });\n  reminders = reminders.filter(function (r) { return r.title !== 'Quarterly estimated taxes'; }).concat(taxRems, [\n    rem({ title: 'Ship Dana’s quilt (insured, signature)', frequency: 'once', notifyDate: dk(3), space: 'work', spaceBy: 'person1', link: 'https://www.pirateship.com' }),\n    rem({ title: 'Bookkeeping: match last month’s receipts', frequency: 'monthly', notifyDate: { month: 1, day: 4 }, lastDoneFor: occ(4, 1), lastDone: iso(-26, 20), space: 'work', spaceBy: 'person1' }),\n    rem({ title: 'Load the car for the Harvest Makers Fair', frequency: 'once', notifyDate: dk(18), space: 'work', spaceBy: 'person1', description: 'Tent, weights, 2 tables, card reader, change box' }),\n    rem({ title: 'Renew the business license', frequency: 'yearly', notifyDate: md(47), space: 'work', spaceBy: 'person1', description: 'City of Riverbend, $50' })\n  ]);\n  put('lifeReminders', reminders);\n\n  \n  // ---------- recipes.js ----------\n  (function () {\n    // Nov 2 (recipes helper): the recipe book filled up. All of the app's own recipes (as the Meals page saves them,\n    // source 'bonus'), about sixty of the household's own (typed in or imported over the years), hearts and thumbs, and\n    // the past weeks of the plan using them. Own seeded numbers (rr), so nothing else changes.\n    var rs = 52731;\n    function rr() { rs |= 0; rs = rs + 0x6D2B79F5 | 0; var t = Math.imul(rs ^ rs >>> 15, 1 | rs); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n    function rc(p) { return rr() < p; }\n    function rp(a) { return a[Math.floor(rr() * a.length)]; }\n    var BOOK = JSON.parse(out.mealplan_recipes || '[]'), sched = JSON.parse(out.mealplan_schedule || '{}');\n    var have = {}; BOOK.forEach(function (r) { have[r.name] = 1; });\n    var SLOTC = { Breakfast: 'var(--lh-accent)', Lunch: 'var(--slot-lunch, #c4a882)', Dinner: 'var(--slot-dinner, #b4828c)', Dessert: 'var(--slot-dessert, #a08cb4)', Snack: 'var(--slot-snack, #8ec4a8)' };\n    function guessCuisine(name, ing) { var n = (name + ' ' + ing.join(' ')).toLowerCase(), t = []; if (/chipotle|enchilada|burrito|taco|mexican|salsa|cumin/.test(n)) t.push('Mexican'); if (/asian|soy sauce|ginger|sesame/.test(n)) t.push('Asian'); if (/alfredo|orzo|marinara|italian|basil|parmesan|ricotta|mozzarella|bolognese/.test(n)) t.push('Italian'); if (/lemon|farro|olive oil|chickpea|mediterranean|feta/.test(n)) t.push('Mediterranean'); if (/smoothie|oats|parfait|muffin/.test(n)) t.push('American'); if (!t.length) t.push('American'); return t; }\n    // the app's own recipes (app.bundle.js additionalRecipes, as extractRecipesFromPlan turns them into bank recipes)\n    var BONUS = [{\"id\":\"r_bonus_0_savoryeggveggiebreakfast\",\"name\":\"Savory Egg & Veggie Breakfast Scramble\",\"type\":\"Breakfast\",\"types\":[\"Breakfast\"],\"protein\":24,\"calories\":380,\"fiber\":3,\"prepTime\":10,\"ingredients\":[\"3 eggs (or 2 whole + 2 whites)\",\"1 cup baby spinach\",\"1/4 cup diced bell pepper\",\"1/4 cup diced onion\",\"2 tbsp crumbled feta\",\"1 tsp olive oil\",\"Salt, pepper, garlic powder\",\"Hot sauce\",\"1 slice whole grain toast\"],\"steps\":[\"Heat olive oil in a nonstick skillet over medium heat.\",\"Sauté bell pepper and onion 2-3 min until softened.\",\"Add spinach, stir until just wilted (30 sec).\",\"Pour in beaten eggs seasoned with salt, pepper, garlic powder.\",\"Scramble gently until just set. Don't overcook.\",\"Top with feta and hot sauce. Serve with toast if desired.\"],\"prepped\":null,\"tip\":\"Classic protein-packed breakfast in 10 minutes. Spinach delivers iron and folate for energy, while bell peppers add more vitamin C than an orange to help your body absorb that iron.\",\"portion\":\"24g protein - 380 cal\",\"portions\":[\"24g protein\",\"380 cal\",\"3g fiber\",\"10 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_2_sweetpotatobreakfasthash\",\"name\":\"Sweet Potato Breakfast Hash\",\"type\":\"Breakfast\",\"types\":[\"Breakfast\"],\"protein\":24,\"calories\":440,\"fiber\":5,\"prepTime\":20,\"ingredients\":[\"1 small sweet potato, diced small (1/2 inch)\",\"2 oz chicken sausage, sliced\",\"1/4 cup diced onion\",\"1 cup baby spinach\",\"2 eggs\",\"1 tbsp olive oil\",\"1/2 tsp smoked paprika\",\"1/2 tsp garlic powder\",\"Salt, pepper, hot sauce\"],\"steps\":[\"Heat olive oil in cast iron or skillet over medium. Add sweet potato, season with paprika + garlic powder. Cover and cook 5 min to steam through, then uncover and cook 3-5 min more, stirring occasionally, until fork-tender and crispy.\",\"Push potatoes to sides, add sausage and onion to center. Cook 3 min.\",\"Add spinach, stir until wilted.\",\"Make 2 wells, crack eggs into them. Cover pan, cook 3-4 min until whites are set.\",\"Hit with hot sauce and serve straight from the pan.\"],\"prepped\":null,\"tip\":\"Savory, spicy, satisfying. The sweet potato gets crispy edges while staying soft inside. Sweet potatoes are rich in vitamin A and complex carbs that provide sustained energy without blood sugar spikes.\",\"portion\":\"24g protein - 440 cal\",\"portions\":[\"24g protein\",\"440 cal\",\"5g fiber\",\"20 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_3_caramelizedbananatoast\",\"name\":\"Caramelized Banana Toast\",\"type\":\"Breakfast\",\"types\":[\"Breakfast\",\"Snack\"],\"protein\":12,\"calories\":480,\"fiber\":5,\"prepTime\":10,\"ingredients\":[\"1 slice whole grain bread\",\"1 banana, sliced lengthwise\",\"2 tbsp almond butter\",\"1 tsp coconut oil\",\"1 tbsp honey\",\"1 tsp cinnamon\",\"1 tbsp toasted coconut flakes\",\"Flaky sea salt\"],\"steps\":[\"Toast bread.\",\"Heat coconut oil in a small pan over medium. Add banana slices, cook 2 min per side until golden and caramelized.\",\"Spread almond butter on toast. Layer caramelized banana on top.\",\"Drizzle with honey, sprinkle cinnamon, coconut flakes, and a pinch of flaky salt.\"],\"prepped\":null,\"tip\":\"Indulgent but lower in protein on its own. Best paired with eggs, Greek yogurt, or a protein shake to round out your breakfast. Almond butter provides vitamin E and magnesium for heart health.\",\"portion\":\"12g protein - 480 cal\",\"portions\":[\"12g protein\",\"480 cal\",\"5g fiber\",\"10 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_4_fluffyproteinblueberrypa\",\"name\":\"Fluffy Protein Blueberry Pancakes\",\"type\":\"Breakfast\",\"types\":[\"Breakfast\"],\"protein\":36,\"calories\":470,\"fiber\":4,\"prepTime\":15,\"ingredients\":[\"1/3 cup rolled oats, blended into flour\",\"1 scoop whey protein (any flavor)\",\"1 egg\",\"1/4 cup nonfat Greek yogurt\",\"1/4 cup almond milk\",\"1/2 tsp baking powder\",\"1/2 tsp vanilla extract\",\"1/4 cup fresh blueberries\",\"Cooking spray\",\"--- TOPPINGS ---\",\"2 tbsp pure maple syrup\",\"1 tbsp walnuts, chopped\",\"Extra blueberries\"],\"steps\":[\"Blend oats into flour. Mix with protein powder and baking powder.\",\"Whisk egg, yogurt, almond milk, vanilla. Combine wet and dry. Don't overmix, lumps are fine. Let batter rest 2 min.\",\"Gently fold in blueberries.\",\"Cook 1/4 cup batter per pancake on a nonstick pan, 2-3 min per side.\",\"Stack and top with maple syrup, walnuts, and extra blueberries.\"],\"prepped\":null,\"tip\":\"Makes 1 serving (3-4 pancakes). Oat flour + protein powder = high-protein pancakes that actually taste amazing. Oats contain beta-glucan fiber that helps lower cholesterol and keeps blood sugar steady. Greek yogurt adds probiotics for gut health. Make extra batter and refrigerate for tomorrow.\",\"portion\":\"36g protein - 470 cal\",\"portions\":[\"36g protein\",\"470 cal\",\"4g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_6_greekchickenhummusbowl\",\"name\":\"Greek Chicken & Hummus Bowl\",\"type\":\"Lunch\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":48,\"calories\":580,\"fiber\":5,\"prepTime\":15,\"ingredients\":[\"5 oz chicken breast\",\"1/2 tsp dried oregano\",\"1/2 tsp garlic powder\",\"Salt, pepper\",\"1 tbsp olive oil\",\"1/2 cup cooked brown rice\",\"1/4 cup hummus\",\"1/4 cucumber, diced\",\"2 tbsp crumbled feta\",\"Roasted red pepper strips\",\"Squeeze of lemon\",\"Red pepper flakes\"],\"steps\":[\"Season chicken with oregano, garlic powder, salt, and pepper.\",\"Heat half the olive oil in a skillet over medium-high. Cook chicken 5-6 min per side until golden and cooked through (165°F). Let rest 3 min, then slice.\",\"Bowl: rice on the bottom, sliced chicken on top.\",\"Add hummus on the side, cucumber, roasted red peppers, feta.\",\"Drizzle with remaining olive oil, lemon, extra oregano, red pepper flakes.\"],\"prepped\":{\"ingredients\":[\"5 oz prepped chicken (grilled or rotisserie)\",\"1/2 cup cooked brown rice\",\"1/4 cup hummus\",\"1/4 cucumber, diced\",\"2 tbsp crumbled feta\",\"Roasted red pepper strips\",\"1 tbsp olive oil\",\"Squeeze of lemon\",\"Dried oregano\",\"Red pepper flakes\"],\"steps\":[\"Bowl: rice, chicken (warm or cold).\",\"Add hummus on the side, cucumber, roasted red peppers, feta.\",\"Drizzle with olive oil, lemon, oregano, red pepper flakes.\"]},\"tip\":\"Mediterranean-style lunch packed with heart-healthy fats from olive oil and chickpea fiber from hummus that helps stabilize blood sugar. Works great warm or cold, making it perfect for packed lunches.\",\"portion\":\"48g protein - 580 cal\",\"portions\":[\"48g protein\",\"580 cal\",\"5g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_7_eggrollinabowl\",\"name\":\"Egg Roll in a Bowl\",\"type\":\"Lunch\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":34,\"calories\":410,\"fiber\":5,\"prepTime\":10,\"ingredients\":[\"6 oz ground chicken or turkey\",\"2 cups coleslaw mix (shredded cabbage + carrots)\",\"2 cloves garlic, minced\",\"1 tsp fresh ginger, grated\",\"2 tbsp low-sodium soy sauce\",\"1 tbsp sesame oil\",\"1 tsp sriracha\",\"Green onions, sliced\",\"Sesame seeds\"],\"steps\":[\"Heat sesame oil in a large skillet over medium-high. Brown ground meat 5-6 min, breaking into small pieces.\",\"Add garlic and ginger, cook 30 sec until fragrant.\",\"Add coleslaw mix, stir-fry 3-4 min until cabbage is wilted but still has some crunch.\",\"Pour soy sauce and sriracha over everything, toss to coat.\",\"Top with green onions and sesame seeds. Eat as-is or over rice.\"],\"prepped\":null,\"tip\":\"10 minutes, one pan, zero leftovers. Cabbage is rich in vitamin C and contains compounds that support healthy digestion. Incredibly filling for very few calories, so the protein ratio is impressive.\",\"portion\":\"34g protein - 410 cal\",\"portions\":[\"34g protein\",\"410 cal\",\"5g fiber\",\"10 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Asian\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_8_chickencaesarwrap\",\"name\":\"Chicken Caesar Wrap\",\"type\":\"Lunch\",\"types\":[\"Lunch\"],\"protein\":50,\"calories\":460,\"fiber\":3,\"prepTime\":15,\"ingredients\":[\"5 oz chicken breast\",\"Salt, pepper\",\"1/2 tsp garlic powder\",\"1 tsp olive oil\",\"1 large whole wheat tortilla\",\"1 cup chopped romaine\",\"2 tbsp shaved parmesan\",\"Squeeze of lemon\",\"Black pepper\",\"--- YOGURT CAESAR ---\",\"3 tbsp Greek yogurt\",\"1 tsp Dijon mustard\",\"1 tsp lemon juice\",\"1 small clove garlic, pressed\",\"1 tbsp parmesan\",\"Dash of Worcestershire\"],\"steps\":[\"Season chicken with salt, pepper, and garlic powder. Heat olive oil in a skillet over medium-high. Cook 5-6 min per side until cooked through (165°F). Let rest 3 min, then slice thin.\",\"Make yogurt Caesar: whisk Greek yogurt, Dijon, lemon, garlic, parmesan, Worcestershire.\",\"Lay tortilla flat. Spread Caesar dressing, layer romaine, sliced chicken, shaved parm.\",\"Roll tightly, cut in half on the diagonal.\"],\"prepped\":{\"ingredients\":[\"5 oz prepped chicken, sliced or shredded\",\"1 large whole wheat tortilla\",\"1 cup chopped romaine\",\"2 tbsp shaved parmesan\",\"Squeeze of lemon\",\"Black pepper\",\"--- YOGURT CAESAR ---\",\"3 tbsp Greek yogurt\",\"1 tsp Dijon mustard\",\"1 tsp lemon juice\",\"1 small clove garlic, pressed\",\"1 tbsp parmesan\",\"Dash of Worcestershire\"],\"steps\":[\"Make yogurt Caesar: whisk Greek yogurt, Dijon, lemon, garlic, parmesan, Worcestershire.\",\"Lay tortilla flat. Spread Caesar dressing, layer romaine, chicken, shaved parm.\",\"Roll tightly, cut in half on the diagonal.\"]},\"tip\":\"The yogurt-based Caesar dressing has way more protein than store-bought and tastes incredible. Greek yogurt adds probiotics that support gut health. Make a big batch of the dressing and keep it in the fridge all week.\",\"portion\":\"50g protein - 460 cal\",\"portions\":[\"50g protein\",\"460 cal\",\"3g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_9_crispychickpeaquinoatzat\",\"name\":\"Crispy Chickpea & Quinoa Tzatziki Bowl\",\"type\":\"Lunch\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":46,\"calories\":580,\"fiber\":8,\"prepTime\":25,\"ingredients\":[\"1/2 cup canned chickpeas, drained and patted dry\",\"1/2 cup cooked quinoa\",\"4 oz chicken breast (optional, skip for vegetarian)\",\"Salt, pepper\",\"1/4 cucumber, diced\",\"Roasted red pepper strips\",\"2 tbsp red onion, diced\",\"2 tbsp crumbled feta\",\"1 tbsp olive oil\",\"1/2 tsp smoked paprika\",\"1/2 tsp garlic powder\",\"--- TZATZIKI ---\",\"3 tbsp Greek yogurt\",\"1 tsp lemon juice\",\"1 small clove garlic, pressed\",\"Pinch of dill\"],\"steps\":[\"Crispy chickpeas: toss drained chickpeas with half the olive oil, paprika, garlic powder, salt. Roast 400°F 20 min (or air fry 10 min) until crunchy.\",\"If using chicken: season with salt and pepper, heat remaining olive oil in a skillet over medium-high, cook 5-6 min per side until cooked through (165°F). Let rest 3 min, then slice or cube.\",\"Bowl: quinoa base, sliced chicken if using, cucumber, roasted red peppers, red onion, feta.\",\"Top with crispy chickpeas and a generous drizzle of tzatziki.\"],\"prepped\":{\"ingredients\":[\"1/2 cup canned chickpeas, drained and patted dry\",\"1/2 cup cooked quinoa\",\"4 oz prepped chicken (optional for vegetarian)\",\"1/4 cucumber, diced\",\"Roasted red pepper strips\",\"2 tbsp red onion, diced\",\"2 tbsp crumbled feta\",\"1 tbsp olive oil\",\"1/2 tsp smoked paprika\",\"1/2 tsp garlic powder\",\"--- TZATZIKI ---\",\"3 tbsp Greek yogurt\",\"1 tsp lemon juice\",\"1 small clove garlic, pressed\",\"Pinch of dill\"],\"steps\":[\"Crispy chickpeas: toss drained chickpeas with olive oil, paprika, garlic powder, salt. Roast 400°F 20 min (or air fry 10 min) until crunchy.\",\"Bowl: quinoa base, chicken if using, cucumber, roasted red peppers, red onion, feta.\",\"Top with crispy chickpeas and a generous drizzle of tzatziki.\"]},\"tip\":\"The crispy chickpeas add incredible crunch and plant-based protein. Chickpeas are packed with fiber that helps keep blood sugar stable and supports gut health. Without chicken (vegetarian): 18g protein, 420 cal. Batch-roast a big tray of chickpeas for snacking all week.\",\"portion\":\"46g protein - 580 cal\",\"portions\":[\"46g protein\",\"580 cal\",\"8g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_10_spicyturkeyenchiladas\",\"name\":\"Spicy Turkey Enchiladas\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":36,\"calories\":540,\"fiber\":4,\"prepTime\":35,\"ingredients\":[\"4 oz ground turkey (93% lean)\",\"2 tbsp diced onion\",\"1 clove garlic, minced\",\"1/2 tsp cumin\",\"1/2 tsp chili powder\",\"Red pepper flakes\",\"2 small flour or whole wheat tortillas\",\"2/3 cup enchilada sauce\",\"1/3 cup Mexican blend shredded cheese\",\"1 tbsp sour cream\",\"Hot sauce\"],\"steps\":[\"Preheat oven to 375°F.\",\"Brown ground turkey with onion, garlic, cumin, chili powder, and red pepper flakes.\",\"Divide turkey mix between tortillas. Roll up and place seam-down in a baking dish.\",\"Pour enchilada sauce over. Top with cheese.\",\"Bake 20 min until bubbly and golden.\",\"Top with sour cream and hot sauce.\",\"NOTE: Scale up to make a batch. Full recipe (12 oz turkey, 6 tortillas) makes 3 servings.\"],\"prepped\":null,\"tip\":\"Comfort food at its best. Cumin and chili powder both have anti-inflammatory properties that support joint and gut health. Makes great leftovers. Serve with a side of rice and beans for extra fuel.\",\"portion\":\"36g protein - 540 cal\",\"portions\":[\"36g protein\",\"540 cal\",\"4g fiber\",\"35 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_12_onepotchipotlechickenorz\",\"name\":\"One-Pot Chipotle Chicken & Orzo\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":58,\"calories\":650,\"fiber\":6,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast\",\"1/2 cup orzo\",\"1 cup marinara sauce\",\"1 cup baby spinach\",\"1 chipotle pepper in adobo, minced\",\"2 cloves garlic, minced\",\"1 tsp olive oil\",\"1 tbsp shredded parmesan\",\"1 cup chicken broth\",\"Red pepper flakes\"],\"steps\":[\"Season chicken. Sear in olive oil 5-6 min per side. Remove and set aside.\",\"Sauté garlic and minced chipotles 30 seconds.\",\"Add marinara, broth, and orzo. Stir. Simmer 10 min until orzo is tender.\",\"Nestle chicken back in. Cook 5 more min.\",\"Stir in spinach until wilted. Top with parmesan and red pepper flakes.\",\"Slice chicken and serve directly from the pot.\"],\"prepped\":null,\"tip\":\"Smoky chipotle + marinara is an incredible combo. The one-pot method means the orzo soaks up all that smoky tomato flavor. Tomatoes are rich in lycopene, which supports cardiovascular health and gets more potent when cooked.\",\"portion\":\"58g protein - 650 cal\",\"portions\":[\"58g protein\",\"650 cal\",\"6g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\",\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_13_cajunchickenpasta\",\"name\":\"Cajun Chicken Pasta\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":68,\"calories\":800,\"fiber\":4,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast, sliced thin\",\"4 oz whole wheat penne or pasta of choice\",\"1 cup baby spinach\",\"1/3 cup cottage cheese, blended smooth\",\"2 tbsp parmesan\",\"2 cloves garlic, minced\",\"1 tbsp olive oil\",\"--- CAJUN SPICE ---\",\"1 tsp smoked paprika\",\"1/2 tsp garlic powder\",\"1/2 tsp onion powder\",\"1/4 tsp cayenne\",\"1/2 tsp oregano\",\"Salt, pepper\"],\"steps\":[\"Cook pasta per package, reserve 1/2 cup pasta water. Drain.\",\"Season chicken with cajun spice mix. Heat olive oil in skillet over medium-high, sear chicken 3-4 min per side. Remove, slice.\",\"In same pan, sauté garlic 30 sec. Add blended cottage cheese, parmesan, and a splash of pasta water. Stir into a creamy sauce.\",\"Add spinach, stir until wilted. Toss in pasta and chicken, coat everything in sauce.\",\"Add more pasta water if needed for consistency.\"],\"prepped\":null,\"tip\":\"The cottage cheese becomes an insanely creamy cajun alfredo without the guilt. Cottage cheese is one of the highest-protein dairy options, with slow-digesting casein that keeps you full longer. Adjust cayenne up or down based on your heat tolerance.\",\"portion\":\"68g protein - 800 cal\",\"portions\":[\"68g protein\",\"800 cal\",\"4g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_15_mediterraneansheetpanchi\",\"name\":\"Mediterranean Sheet Pan Chicken\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":52,\"calories\":580,\"fiber\":5,\"prepTime\":30,\"ingredients\":[\"6 oz chicken breast\",\"1 cup broccoli florets\",\"1/2 cup roasted red pepper strips\",\"1/4 red onion, sliced\",\"1/4 cup sun-dried tomatoes\",\"2 tbsp olive oil\",\"1 tsp oregano\",\"1/2 tsp garlic powder\",\"Squeeze of lemon\",\"2 tbsp crumbled feta\",\"Salt, pepper\"],\"steps\":[\"Preheat 425°F. Toss chicken and all veggies with olive oil, oregano, garlic powder, salt, pepper on a sheet pan.\",\"Spread in a single layer. Don't crowd the pan.\",\"Roast 20-25 min until chicken reaches 165°F and veggies are charred.\",\"Remove, squeeze lemon over everything, scatter feta and sun-dried tomatoes.\",\"Let chicken rest 5 min before slicing. Serve over rice, orzo, or with warm pita.\"],\"prepped\":null,\"tip\":\"One pan, zero cleanup. The high heat chars the broccoli and peppers beautifully. Broccoli contains sulforaphane, a compound linked to reduced inflammation and cellular repair. Sun-dried tomatoes add concentrated flavor.\",\"portion\":\"52g protein - 580 cal\",\"portions\":[\"52g protein\",\"580 cal\",\"5g fiber\",\"30 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_16_chickenpiccata\",\"name\":\"Chicken Piccata\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":50,\"calories\":580,\"fiber\":3,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast, pounded thin\",\"2 tbsp whole wheat flour\",\"1 tbsp olive oil\",\"1 tbsp butter\",\"1/2 cup chicken broth\",\"2 tbsp lemon juice\",\"2 tbsp capers, drained\",\"1 clove garlic, minced\",\"Fresh parsley\",\"1/2 cup cooked farro or brown rice\"],\"steps\":[\"Pound chicken to even 1/2-inch thickness. Season with salt and pepper, dust lightly with flour.\",\"Heat olive oil in skillet over medium-high. Sear chicken 3-4 min per side until golden. Remove.\",\"In same pan, add butter + garlic (30 sec), then broth + lemon juice + capers. Simmer 2 min, scraping up brown bits.\",\"Return chicken to pan, spoon sauce over. Garnish with parsley.\",\"Serve over farro or rice.\"],\"prepped\":null,\"tip\":\"The lemon-caper sauce is bright and fresh. Lemon juice is rich in vitamin C and aids iron absorption from the chicken, helping your body get more out of every bite. Classic technique that looks impressive but takes 25 minutes.\",\"portion\":\"50g protein - 580 cal\",\"portions\":[\"50g protein\",\"580 cal\",\"3g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_17_lemongarlicbutterchicken\",\"name\":\"Lemon Garlic Butter Chicken Pasta\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":62,\"calories\":800,\"fiber\":5,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast, pounded thin\",\"4 oz whole wheat spaghetti or linguine\",\"1 cup broccolini or broccoli florets\",\"3 cloves garlic, minced\",\"1.5 tbsp butter\",\"Juice of 1 lemon\",\"1/4 cup chicken broth\",\"2 tbsp parmesan\",\"Red pepper flakes\",\"Fresh parsley\",\"Salt, pepper\"],\"steps\":[\"Cook pasta per package, adding broccolini last 3 min. Reserve 1/2 cup pasta water, drain.\",\"Season chicken with salt and pepper. Heat 1/2 tbsp butter in skillet, sear 3-4 min per side. Remove, rest, slice.\",\"Same pan: add remaining butter + garlic, cook 30 sec. Add lemon juice + broth, simmer 2 min, scraping up brown bits.\",\"Toss pasta + broccolini into the pan. Add parmesan, splash of pasta water, red pepper flakes. Toss to coat.\",\"Top with sliced chicken and fresh parsley.\"],\"prepped\":null,\"tip\":\"Light, bright, and not cream-heavy. The lemon-butter sauce coats the pasta and broccolini beautifully without weighing it down. Lemon aids iron absorption from the chicken, and broccolini provides vitamin C and fiber. The broccolini cooks right in the pasta water to save a dish.\",\"portion\":\"62g protein - 800 cal\",\"portions\":[\"62g protein\",\"800 cal\",\"5g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_19_crockpotwhitechickenchil\",\"name\":\"Crock Pot White Chicken Chili\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":56,\"calories\":400,\"fiber\":8,\"prepTime\":0,\"ingredients\":[\"6 oz chicken breast\",\"1/3 can (5 oz) white beans (cannellini or great northern), drained\",\"2 tbsp diced green chiles\",\"3/4 cup chicken broth\",\"2 tbsp diced onion\",\"1 clove garlic, minced\",\"1/4 tsp cumin\",\"Pinch of coriander\",\"Pinch of chili powder\",\"Pinch of cayenne\",\"Squeeze of lime\",\"Salt, pepper\",\"--- TOPPINGS ---\",\"2 tbsp Greek yogurt (as sour cream)\",\"1 tbsp shredded cheese\",\"Hot sauce\",\"Green onions\"],\"steps\":[\"Add chicken, beans, green chiles, broth, onion, garlic, cumin, coriander, chili powder, cayenne, salt, pepper to crock pot.\",\"Cook LOW 4-5 hours or HIGH 2-3 hours.\",\"Remove chicken, shred with two forks. Return to pot, stir.\",\"Add lime juice, taste and adjust seasoning.\",\"Serve topped with Greek yogurt, cheese, hot sauce, green onions.\",\"BATCH TIP: Full recipe (1.5 lbs chicken, 1 can beans) makes 4-6 servings. Freezes beautifully up to 3 months.\"],\"prepped\":null,\"tip\":\"Ingredients listed make 1 serving. White beans are rich in potassium for heart health and deliver fiber that keeps you full for hours. The green chiles give it a smoky heat. Freezes beautifully for up to 3 months.\",\"portion\":\"56g protein - 400 cal\",\"portions\":[\"56g protein\",\"400 cal\",\"8g fiber\",\"4-5 hrs crock\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_20_bananasnickersbites\",\"name\":\"Banana Snickers Bites\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":4,\"calories\":170,\"fiber\":3,\"prepTime\":10,\"ingredients\":[\"1 medium banana\",\"2 tbsp almond butter\",\"1 oz dark chocolate (70%+), melted\",\"1 tbsp walnuts, chopped\",\"Flaky sea salt\"],\"steps\":[\"Slice banana into thick rounds.\",\"Sandwich two rounds together with a smear of almond butter between them.\",\"Dip each sandwich halfway into melted dark chocolate.\",\"Sprinkle with chopped walnuts and flaky sea salt.\",\"Place on parchment paper. Freeze 20 min until chocolate sets.\"],\"prepped\":null,\"tip\":\"Tastes like Snickers but it's all real food. Dark chocolate contains flavonoids that support heart health and improve blood flow to the brain. The flaky salt on top is non-negotiable. Keep them in the freezer for when the craving hits.\",\"portion\":\"4g protein - 170 cal\",\"portions\":[\"4g protein\",\"170 cal\",\"3g fiber\",\"10 min + freeze\",\"serving: 2 bites\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_21_proteinbrowniebites\",\"name\":\"Protein Brownie Bites\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":10,\"calories\":150,\"fiber\":4,\"prepTime\":0,\"ingredients\":[\"1/2 cup canned black beans, rinsed well\",\"2 tbsp cocoa powder\",\"1 scoop chocolate whey protein\",\"1 egg\",\"2 tbsp honey\",\"1/4 tsp baking powder\",\"Pinch of salt\",\"1 tbsp mini dark chocolate chips\"],\"steps\":[\"Preheat 350°F. Blend black beans, cocoa, protein powder, egg, honey, baking powder, and salt until smooth.\",\"Fold in chocolate chips.\",\"Pour into a greased mini muffin tin (makes 6-8 bites).\",\"Bake 12-15 min until set. Don't overbake. They firm up as they cool.\",\"Let cool completely before removing.\"],\"prepped\":null,\"tip\":\"You cannot taste the black beans. They create an incredibly fudgy texture while adding fiber and plant protein that help keep blood sugar stable even while satisfying a sweet tooth. Recipe makes 6-8 bites (3-4 servings of 2). Store in the fridge up to 5 days.\",\"portion\":\"10g protein - 150 cal\",\"portions\":[\"10g protein\",\"150 cal\",\"4g fiber\",\"serving: 2 bites\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_22_chocolategreekyogurt\",\"name\":\"Chocolate Greek Yogurt\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":16,\"calories\":200,\"fiber\":2,\"prepTime\":2,\"ingredients\":[\"3/4 cup nonfat Greek yogurt\",\"1 tbsp cocoa powder\",\"1 tsp honey\",\"1/4 tsp vanilla\",\"1 tbsp dark chocolate chips\",\"Pinch of sea salt\"],\"steps\":[\"Stir cocoa powder into yogurt until fully combined.\",\"Add honey, vanilla, and salt. Mix well.\",\"Top with chocolate chips.\",\"Eat immediately or refrigerate.\"],\"prepped\":null,\"tip\":\"Chocolate mousse vibes in 2 minutes with 16g protein. Cocoa is rich in magnesium, which supports mood and helps with muscle recovery. The sea salt makes the chocolate pop. Add berries, crushed graham crackers, or coconut flakes to mix it up.\",\"portion\":\"16g protein - 200 cal\",\"portions\":[\"16g protein\",\"200 cal\",\"2g fiber\",\"2 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_23_chickenfajitabowl\",\"name\":\"Chicken Fajita Bowl\",\"type\":\"Lunch\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":43,\"calories\":490,\"fiber\":6,\"prepTime\":15,\"ingredients\":[\"5 oz chicken breast, sliced into strips\",\"1 tsp fajita seasoning (cumin, chili, garlic, paprika)\",\"Salt, pepper\",\"2 tsp olive oil\",\"1/2 cup cooked brown rice\",\"1/4 cup black beans\",\"1/3 bell pepper, sliced\",\"1/4 onion, sliced\",\"2 tbsp salsa\",\"1 tbsp sour cream\",\"Squeeze of lime\",\"Hot sauce\"],\"steps\":[\"Season chicken strips with fajita seasoning, salt, and pepper.\",\"Heat 1 tsp olive oil in a skillet over medium-high. Cook chicken strips 3-4 min per side until cooked through and slightly charred. Remove and set aside.\",\"In the same pan, add remaining oil. Sear sliced peppers and onions 2-3 min until charred but still crisp.\",\"Bowl: rice on the bottom, chicken strips and fajita veggies on top.\",\"Add black beans, salsa, sour cream, and a big squeeze of lime. Hot sauce to taste.\"],\"prepped\":{\"ingredients\":[\"5 oz prepped chicken (grilled or rotisserie)\",\"1/2 cup cooked brown rice\",\"1/4 cup black beans\",\"1/3 bell pepper, sliced\",\"1/4 onion, sliced\",\"1 tsp fajita seasoning (cumin, chili, garlic, paprika)\",\"1 tsp olive oil\",\"2 tbsp salsa\",\"1 tbsp sour cream\",\"Squeeze of lime\",\"Hot sauce\"],\"steps\":[\"Quick-sear sliced peppers and onions in olive oil in a hot pan with fajita seasoning (2 min) until charred.\",\"Warm prepped chicken in the microwave or alongside the veggies.\",\"Bowl: rice on the bottom, chicken and fajita veggies on top.\",\"Add black beans, salsa, sour cream, and a big squeeze of lime.\",\"Hot sauce to taste.\"]},\"tip\":\"The charred peppers and onions take this from basic to restaurant-quality in 2 minutes. Bell peppers have more vitamin C than oranges, supporting immune health and helping your body absorb iron from the chicken.\",\"portion\":\"43g protein - 490 cal\",\"portions\":[\"43g protein\",\"490 cal\",\"6g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mexican\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_24_creamylemonchickenfarro\",\"name\":\"Creamy Lemon Chicken & Farro\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":54,\"calories\":590,\"fiber\":6,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast\",\"1 cup cooked farro\",\"1 cup baby spinach\",\"3 cloves garlic, minced\",\"Juice of 1 lemon\",\"1/4 cup chicken broth\",\"2 tbsp coconut milk (or splash of cream)\",\"1 tbsp olive oil\",\"2 tbsp shredded parmesan\",\"Red pepper flakes\",\"Salt, pepper\"],\"steps\":[\"Cook farro if not prepped already.\",\"Season chicken with salt and pepper. Sear in olive oil 5-6 min per side. Remove and let rest.\",\"In the same pan, sauté garlic 30 seconds.\",\"Add broth and lemon juice. Let it reduce by half (about 2 min).\",\"Stir in coconut milk. Add spinach, wilt down.\",\"Slice chicken. Serve over farro with the creamy lemon sauce spooned over. Top with parmesan and red pepper flakes.\"],\"prepped\":null,\"tip\":\"The pan sauce comes together in 3 minutes and tastes restaurant-quality. Lemon juice aids iron absorption from the chicken, and farro is an ancient grain packed with fiber and protein. Farro has a great chewy texture but rice works too.\",\"portion\":\"54g protein - 590 cal\",\"portions\":[\"54g protein\",\"590 cal\",\"6g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_25_garlicherbchickenwithmas\",\"name\":\"Garlic Herb Chicken with Mashed Potatoes & Carrots\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":48,\"calories\":580,\"fiber\":5,\"prepTime\":30,\"ingredients\":[\"6 oz chicken breast\",\"1 Yukon Gold potato, cubed\",\"1 cup carrots, sliced\",\"2 tbsp milk\",\"1 tbsp butter\",\"2 cloves garlic, minced\",\"1 tbsp olive oil\",\"1/2 tsp dried rosemary\",\"1/2 tsp dried thyme\",\"Salt, pepper\"],\"steps\":[\"Preheat oven to 400°F. Toss carrots with olive oil, salt, pepper. Spread on a baking sheet and roast 20 min until caramelized.\",\"While carrots roast, boil potato cubes in salted water 12-15 min until fork-tender. Drain and mash with milk, half the butter, salt and pepper until smooth.\",\"While potatoes drain, season chicken with rosemary, thyme, garlic, salt, pepper. Heat remaining butter in a skillet. Cook chicken 5-6 min per side until golden and cooked through.\",\"Plate: mashed potatoes, sliced chicken on top, roasted carrots on the side.\"],\"prepped\":null,\"tip\":\"Classic comfort food done right. The garlic herb butter on the chicken makes the whole kitchen smell incredible. Garlic supports immune function and cardiovascular health, and roasting brings out its natural sweetness.\",\"portion\":\"48g protein - 580 cal\",\"portions\":[\"48g protein\",\"580 cal\",\"5g fiber\",\"30 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_26_chocolatechipoatenergyba\",\"name\":\"Chocolate Chip Oat Energy Balls\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":10,\"calories\":170,\"fiber\":3,\"prepTime\":0,\"ingredients\":[\"1/2 cup rolled oats\",\"2 tbsp almond butter\",\"1 tbsp honey\",\"1 scoop whey protein (any flavor)\",\"1 tbsp dark chocolate chips\",\"1 tbsp hemp hearts\"],\"steps\":[\"Combine oats, almond butter, honey, protein powder, and hemp hearts in a bowl.\",\"Mix until everything holds together. If too dry, add a splash of almond milk.\",\"Fold in chocolate chips.\",\"Roll into 6-8 balls.\",\"Refrigerate 30 min to firm up. Store in the fridge up to a week.\"],\"prepped\":null,\"tip\":\"No-bake, 10 minutes, perfect for meal prep. Recipe makes 6-8 balls (3-4 servings of 2). Oats provide beta-glucan fiber that helps lower cholesterol and keeps energy steady between meals. Make a batch on Sunday and grab two whenever you need something sweet.\",\"portion\":\"10g protein - 170 cal\",\"portions\":[\"10g protein\",\"170 cal\",\"3g fiber\",\"serving: 2 balls\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_27_maplecinnamonroastedappl\",\"name\":\"Maple Cinnamon Roasted Apples\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":2,\"calories\":160,\"fiber\":3,\"prepTime\":25,\"ingredients\":[\"2 apples, sliced\",\"1 tsp coconut oil, melted\",\"1 tbsp maple syrup\",\"1 tsp cinnamon\",\"1/4 tsp nutmeg\",\"1 tbsp walnuts, chopped\",\"2 tbsp Greek yogurt\"],\"steps\":[\"Preheat oven to 375°F.\",\"Toss apple slices with melted coconut oil, maple syrup, cinnamon, and nutmeg.\",\"Spread on a parchment-lined baking sheet in a single layer.\",\"Roast 20-25 min until soft and caramelized at the edges.\",\"Divide between 2 bowls. Top each with chopped walnuts and a dollop of Greek yogurt.\"],\"prepped\":null,\"tip\":\"Roasting concentrates the natural sugars so you barely need any added sweetener. Recipe makes 2 servings. Tastes like apple pie filling without a crust. Apples contain pectin fiber that supports gut health, and cinnamon helps regulate blood sugar naturally.\",\"portion\":\"2g protein - 160 cal\",\"portions\":[\"2g protein\",\"160 cal\",\"3g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_28_applesamoas\",\"name\":\"Apple Samoas\",\"type\":\"Dessert\",\"types\":[\"Dessert\",\"Snack\"],\"protein\":3,\"calories\":170,\"fiber\":4,\"prepTime\":5,\"ingredients\":[\"1 medium apple, sliced into rings\",\"2 tbsp almond butter\",\"1 oz dark chocolate, melted\",\"2 tbsp toasted coconut flakes\",\"Flaky sea salt\"],\"steps\":[\"Core the apple and slice into 1/2-inch rings.\",\"Spread almond butter on each apple ring.\",\"Drizzle melted dark chocolate over the top.\",\"Sprinkle with toasted coconut flakes and flaky sea salt.\",\"Eat immediately or refrigerate for a firmer chocolate shell.\"],\"prepped\":null,\"tip\":\"Tastes like the Girl Scout cookie but made with real food. Dark chocolate is rich in flavonoids that support heart health and improve blood flow to the brain. Almond butter adds vitamin E and healthy fats. Zero baking required.\",\"portion\":\"3g protein - 170 cal\",\"portions\":[\"3g protein\",\"170 cal\",\"4g fiber\",\"5 min\",\"serving: 2-3 rings\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"American\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_29_marrymechickensoup\",\"name\":\"Marry Me Chicken Soup\",\"type\":\"Dinner\",\"types\":[\"Dinner\"],\"protein\":44,\"calories\":480,\"fiber\":3,\"prepTime\":25,\"ingredients\":[\"6 oz chicken breast\",\"1/4 cup sun-dried tomatoes, chopped\",\"2 cloves garlic, minced\",\"1/4 cup diced onion\",\"2 cups chicken broth\",\"1/3 cup coconut milk (or heavy cream)\",\"1 cup baby spinach\",\"2 tbsp parmesan\",\"1 tbsp olive oil\",\"1/2 tsp Italian seasoning\",\"1/4 tsp red pepper flakes\",\"1/2 tsp smoked paprika\",\"Fresh basil\",\"Salt, pepper\"],\"steps\":[\"Season chicken with Italian seasoning, smoked paprika, salt, pepper. Sear in olive oil 5-6 min per side until golden. Remove and let rest.\",\"In the same pot, sauté onion 2 min. Add garlic and sun-dried tomatoes, cook 1 min until fragrant.\",\"Pour in chicken broth, scraping up all the brown bits from the bottom. Bring to a simmer.\",\"Stir in coconut milk and parmesan. Let it simmer 5 min until slightly thickened.\",\"Add spinach, stir until wilted. Slice chicken and nestle it back into the soup.\",\"Ladle into bowls, top with fresh basil and extra parmesan.\",\"BATCH TIP: Double the broth and coconut milk for a soupier version. Freezes well for up to 2 months.\"],\"prepped\":null,\"tip\":\"The broth gets its signature richness from sun-dried tomatoes and parmesan melting together. Sun-dried tomatoes pack concentrated lycopene for heart and skin health, and coconut milk adds healthy medium-chain fats that your body uses quickly for energy. This is the soup that makes people propose.\",\"portion\":\"44g protein - 480 cal\",\"portions\":[\"44g protein\",\"480 cal\",\"3g fiber\",\"25 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Italian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"},{\"id\":\"r_bonus_30_crispyhoneychilishrimp\",\"name\":\"Crispy Honey Chili Shrimp\",\"type\":\"Dinner\",\"types\":[\"Lunch\",\"Dinner\"],\"protein\":36,\"calories\":460,\"fiber\":2,\"prepTime\":15,\"ingredients\":[\"8 oz shrimp, peeled and deveined\",\"2 tbsp cornstarch\",\"1 tbsp olive oil\",\"--- HONEY CHILI GLAZE ---\",\"1.5 tbsp honey\",\"1 tbsp soy sauce\",\"1 tsp sriracha\",\"1 tsp rice vinegar\",\"1 clove garlic, minced\",\"1/2 tsp fresh ginger, grated\",\"--- SERVE WITH ---\",\"1/2 cup cooked jasmine rice\",\"1/2 cup steamed broccoli\",\"Sesame seeds\",\"Sliced green onions\"],\"steps\":[\"Pat shrimp very dry with paper towels. Toss with cornstarch, salt, and pepper until evenly coated.\",\"Heat olive oil in a skillet over medium-high. Add shrimp in a single layer, do not crowd. Cook 2 min per side until golden and crispy. Remove to a plate.\",\"In a small bowl, whisk together honey, soy sauce, sriracha, and rice vinegar.\",\"Lower heat to medium. Add garlic and ginger to the hot pan, sauté 30 seconds until fragrant. Pour in the glaze, let it bubble 30 seconds until it thickens slightly.\",\"Toss shrimp back in, coat in the sticky glaze. Remove from heat immediately so the coating stays crispy.\",\"Serve over jasmine rice with steamed broccoli. Top with sesame seeds and green onions.\"],\"prepped\":null,\"tip\":\"The cornstarch coating is the secret to that takeout-level crunch. Pat the shrimp bone dry or it won't crisp. Shrimp is one of the highest-protein, lowest-calorie proteins available and rich in selenium for thyroid health. The honey chili glaze comes together in 30 seconds and tastes like it took an hour.\",\"portion\":\"36g protein - 460 cal\",\"portions\":[\"36g protein\",\"460 cal\",\"2g fiber\",\"15 min\"],\"color\":\"var(--lh-accent)\",\"cuisineTags\":[\"Asian\",\"Mediterranean\"],\"favorite\":false,\"timesUsed\":0,\"source\":\"bonus\"}];\n    // [name, types, protein, calories, fiber, minutes, serves, days ago it was added, ingredients, steps, tip, extra]\n    var OWN = [\n      ['Ben’s Saturday Buttermilk Pancakes', ['Breakfast'], 14, 410, 2, 25, 4, 880,\n        ['2 cups all-purpose flour', '2 tbsp sugar', '2 tsp baking powder', '1 tsp baking soda', '1/2 tsp salt', '2 cups buttermilk', '2 eggs', '4 tbsp butter, melted', '1 tsp vanilla', '--- TO SERVE ---', 'Maple syrup', 'Blueberries or sliced bananas'],\n        ['Whisk the flour, sugar, baking powder, baking soda and salt in a big bowl.', 'Whisk the buttermilk, eggs, melted butter and vanilla in another bowl.', 'Pour the wet into the dry and stir just until there are no dry streaks. Lumps are fine. Let it sit 5 minutes.', 'Heat a griddle over medium and butter it lightly. Pour 1/4 cup per pancake.', 'Flip when bubbles pop on top and the edges look set, about 2 minutes. Cook 1 minute more.', 'Keep warm in a 200°F oven while you finish the batch.'],\n        'No buttermilk: 2 cups milk with 2 tbsp lemon juice, 5 minutes. Freeze the extras flat and toast them on weekdays.'],\n      ['Shakshuka', ['Breakfast', 'Dinner'], 19, 330, 6, 30, 3, 640,\n        ['2 tbsp olive oil', '1 onion, diced', '1 red bell pepper, diced', '3 cloves garlic, sliced', '1 tsp cumin', '1 tsp smoked paprika', '1/4 tsp cayenne', '1 can (28 oz) crushed tomatoes', '6 eggs', '1/3 cup crumbled feta', 'Cilantro', 'Crusty bread to serve'],\n        ['Heat the oil in a large skillet over medium. Cook the onion and pepper until soft, about 8 minutes.', 'Add garlic, cumin, paprika and cayenne; cook 1 minute.', 'Pour in the tomatoes, season with salt and simmer 10 minutes until a little thick.', 'Make 6 wells with a spoon and crack an egg into each.', 'Cover and cook on low 6-8 minutes, until the whites are set and the yolks still runny.', 'Top with feta and cilantro. Serve straight from the pan with bread.'],\n        'Breakfast-for-dinner night. Ben likes harissa stirred into the sauce.'],\n      ['Grandma Ruth’s Biscuits & Sausage Gravy', ['Breakfast'], 18, 620, 1, 40, 6, 910,\n        ['--- BISCUITS ---', '2 1/2 cups White Lily self-rising flour', '1/2 cup cold butter, cubed', '1 cup cold buttermilk', '--- GRAVY ---', '1 lb breakfast sausage', '1/3 cup flour', '3 cups whole milk', '1/2 tsp black pepper', 'Pinch of salt'],\n        ['Heat the oven to 450°F.', 'Cut the butter into the flour with your fingers until it looks like coarse crumbs.', 'Stir in the buttermilk just until it holds together. Pat out 1 inch thick, fold over twice, pat again.', 'Cut straight down (no twisting), set the biscuits touching on a sheet pan and bake 12-14 minutes.', 'Meanwhile brown the sausage in a skillet, breaking it up. Do not drain.', 'Sprinkle the flour over the sausage and stir 1 minute. Pour in the milk slowly, stirring, and simmer until thick, about 5 minutes. Season with lots of pepper.', 'Split the biscuits and spoon gravy over them.'],\n        'Ruth always said White Lily or nothing. Christmas morning, every year.'],\n      ['Spinach Feta Egg Muffins', ['Breakfast', 'Snack'], 13, 150, 1, 30, 12, 520,\n        ['12 eggs', '1/4 cup milk', '2 cups baby spinach, chopped', '1/2 cup sun-dried tomatoes, chopped', '1/2 cup crumbled feta', '1/4 cup red onion, finely diced', '1/2 tsp garlic powder', 'Salt, pepper'],\n        ['Heat the oven to 350°F and grease a 12-cup muffin tin well.', 'Whisk the eggs, milk, garlic powder, salt and pepper.', 'Divide the spinach, tomatoes, onion and feta between the cups.', 'Pour the eggs over, about 3/4 full.', 'Bake 20-22 minutes until puffed and set in the middle.', 'Cool 5 minutes, run a knife around each one and lift out.'],\n        'Keep 5 days in the fridge. Two plus a piece of fruit is Nora’s clinic-day breakfast.'],\n      ['Cottage Cheese Protein Waffles', ['Breakfast'], 27, 360, 4, 15, 2, 300,\n        ['1 cup cottage cheese', '2 eggs', '1 cup rolled oats', '1 scoop vanilla protein powder', '1 tsp baking powder', '1/2 tsp cinnamon', '1 tsp vanilla', 'Pinch of salt', 'Berries and a little maple syrup to top'],\n        ['Heat the waffle iron.', 'Blend everything except the toppings until smooth, about 30 seconds.', 'Let the batter sit 3 minutes to thicken.', 'Grease the iron and cook about 1/2 cup at a time until golden, 4-5 minutes.', 'Top with berries and a drizzle of syrup.'],\n        ''],\n      ['Baked Apple Cinnamon Oatmeal', ['Breakfast'], 11, 320, 6, 45, 6, 760,\n        ['2 cups old-fashioned oats', '1/3 cup chopped pecans', '1 1/2 tsp cinnamon', '1 tsp baking powder', '1/2 tsp salt', '2 cups milk', '1 egg', '1/3 cup maple syrup', '2 tbsp butter, melted', '1 tsp vanilla', '2 apples, diced'],\n        ['Heat the oven to 375°F and grease an 8x8 baking dish.', 'Mix the oats, pecans, cinnamon, baking powder and salt.', 'Whisk the milk, egg, maple syrup, butter and vanilla.', 'Spread the apples in the dish, scatter the oat mixture over, pour the milk mixture on top.', 'Bake 40 minutes until golden and set.', 'Serve warm with a splash of milk or a spoon of Greek yogurt.'],\n        'Make Sunday, reheat a square all week. Fall apples from Sky Top Orchard are best.'],\n      ['Smoked Salmon Bagel Board', ['Breakfast', 'Lunch'], 24, 450, 3, 10, 2, 410,\n        ['2 everything bagels, split and toasted', '4 oz smoked salmon', '4 tbsp whipped cream cheese', '1/2 cucumber, thinly sliced', '1/4 red onion, thinly sliced', '1 tbsp capers', '1 tomato, sliced', 'Fresh dill', 'Lemon wedges'],\n        ['Toast the bagels.', 'Lay out the salmon, cucumber, onion, tomato and capers on a board.', 'Spread cream cheese on the bagels and pile on what you like.', 'Finish with dill and a squeeze of lemon.'],\n        'Sunday brunch when nobody wants to cook.'],\n      ['Huevos Rancheros', ['Breakfast'], 22, 470, 10, 20, 2, 590,\n        ['4 corn tortillas', '1 can black beans, drained', '1/2 tsp cumin', '4 eggs', '1 cup salsa roja', '1/2 avocado, sliced', '2 tbsp crumbled cotija', 'Cilantro', 'Hot sauce'],\n        ['Warm the beans with the cumin and a splash of water; mash about half.', 'Crisp the tortillas in a dry skillet, 1 minute a side.', 'Fry the eggs to your liking in a little oil.', 'Warm the salsa in a small pan.', 'Layer tortillas, beans, an egg, salsa, avocado and cotija. Add cilantro and hot sauce.'],\n        ''],\n      ['Pumpkin Pie Overnight Oats', ['Breakfast'], 21, 380, 7, 5, 1, 380,\n        ['1/2 cup rolled oats', '1/3 cup pumpkin purée', '1/2 cup milk', '1/3 cup vanilla Greek yogurt', '1 tbsp chia seeds', '1 tbsp maple syrup', '1/2 tsp pumpkin pie spice', '1 tbsp chopped pecans'],\n        ['Stir everything except the pecans in a jar.', 'Cover and refrigerate overnight.', 'Stir, add a splash of milk if thick, and top with pecans.'],\n        'Fall version of the regular overnight oats. Makes the rest of the can of pumpkin worth buying.'],\n      ['Turkey Sausage Breakfast Skillet', ['Breakfast'], 26, 410, 4, 25, 4, 470,\n        ['1 lb turkey breakfast sausage', '1 1/2 lb Yukon gold potatoes, diced small', '1 green bell pepper, diced', '1 onion, diced', '2 tbsp olive oil', '1 tsp smoked paprika', '6 eggs', '1/2 cup shredded sharp cheddar', 'Green onions'],\n        ['Microwave the potatoes in a covered bowl 5 minutes to get a head start.', 'Brown the sausage in a big cast-iron skillet; set aside.', 'Add the oil, potatoes, pepper and onion with the paprika and some salt. Cook 10-12 minutes until crisp.', 'Return the sausage and stir.', 'Make 6 wells, crack in the eggs, cover and cook 5 minutes.', 'Scatter the cheddar and green onions over and serve from the pan.'],\n        ''],\n      ['Best Banana Bread', ['Breakfast', 'Snack'], 4, 240, 1, 70, 10, 700,\n        ['3 ripe bananas, mashed', '1/3 cup butter, melted', '1/2 cup brown sugar', '1 egg, beaten', '1 tsp vanilla', '1 tsp baking soda', 'Pinch of salt', '1 1/2 cups all-purpose flour', '1/2 cup chopped walnuts'],\n        ['Heat the oven to 350°F and butter a 4x8-inch loaf pan.', 'Stir the melted butter into the mashed bananas.', 'Mix in the baking soda and salt, then the sugar, egg and vanilla.', 'Stir in the flour, then the walnuts.', 'Pour into the pan and bake 55-65 minutes, until a tester comes out clean.', 'Cool in the pan 10 minutes, then on a rack.'],\n        'From Simply Recipes. We cut the sugar to 1/2 cup and nobody noticed.',\n        { totalMinutes: 70, prepMinutes: 10, cookMinutes: 60, category: 'Bread', keywords: 'banana bread, quick bread, easy' }],\n      ['Nora’s Green Smoothie', ['Breakfast', 'Snack'], 28, 330, 7, 5, 1, 820,\n        ['1 cup unsweetened almond milk', '1 scoop vanilla protein powder', '1 big handful baby spinach', '1 frozen banana', '1/2 cup frozen pineapple', '1 tbsp almond butter', '1 tbsp ground flax'],\n        ['Put the milk in the blender first, then everything else.', 'Blend until completely smooth, about 1 minute.', 'Add a few ice cubes or more milk to get it how you like.'],\n        'Keep bags of spinach in the freezer for this. It doesn’t taste like spinach, promise.'],\n      ['Chicken Salad with Grapes & Pecans', ['Lunch'], 31, 390, 2, 15, 4, 690,\n        ['3 cups cooked chicken, chopped (a rotisserie chicken)', '1/2 cup plain Greek yogurt', '1/4 cup mayonnaise', '1 tsp Dijon mustard', '1 tbsp lemon juice', '1 cup red grapes, halved', '2 celery stalks, diced', '1/3 cup toasted pecans, chopped', '2 tbsp fresh dill', 'Salt, pepper'],\n        ['Stir the yogurt, mayo, mustard and lemon juice together.', 'Fold in the chicken, grapes, celery, pecans and dill.', 'Season well with salt and pepper.', 'Chill at least 30 minutes. Serve on croissants, crackers or lettuce.'],\n        'Keeps 4 days. Lunch for both of us most of the week.'],\n      ['Turkey Cranberry Wraps', ['Lunch'], 29, 430, 5, 10, 2, 330,\n        ['2 large whole wheat tortillas', '6 oz sliced deli turkey', '2 tbsp whipped cream cheese', '2 tbsp cranberry sauce', '1 cup baby spinach', '1/4 cup shredded carrot', '2 tbsp chopped pecans'],\n        ['Spread each tortilla with cream cheese and cranberry sauce.', 'Layer turkey, spinach, carrot and pecans.', 'Roll up tightly, folding in the sides, and cut in half.'],\n        'The week after Thanksgiving, with the real leftovers.'],\n      ['Mason Jar Cobb Salads', ['Lunch'], 34, 480, 6, 25, 4, 450,\n        ['--- DRESSING ---', '1/2 cup plain Greek yogurt', '2 tbsp buttermilk', '1 tsp dried dill', '1/2 tsp garlic powder', '--- SALAD ---', '2 cups cooked chicken, diced', '4 hard-boiled eggs, chopped', '6 slices bacon, cooked and crumbled', '1 cup cherry tomatoes, halved', '1 avocado, diced (add the day of)', '1/2 cup crumbled blue cheese', '8 cups chopped romaine'],\n        ['Whisk the dressing and divide between 4 quart jars.', 'Layer tomatoes, chicken, eggs, bacon and blue cheese.', 'Pack the romaine on top and close the lids.', 'Add avocado the morning you eat it. Shake into a bowl at lunch.'],\n        'Dressing on the bottom so nothing gets soggy. Good through Thursday.'],\n      ['Lemony Lentil Soup', ['Lunch', 'Dinner'], 18, 340, 15, 45, 6, 600,\n        ['2 tbsp olive oil', '1 onion, diced', '2 carrots, diced', '2 celery stalks, diced', '4 cloves garlic, minced', '1 1/2 tsp cumin', '1 tsp turmeric', '1 1/2 cups brown lentils, rinsed', '8 cups vegetable broth', '1 can (14 oz) diced tomatoes', '3 cups chopped kale', '1 lemon, juiced'],\n        ['Heat the oil in a big pot and cook the onion, carrots and celery 8 minutes.', 'Stir in garlic, cumin and turmeric for 1 minute.', 'Add the lentils, broth and tomatoes. Bring to a boil, then simmer 30 minutes until the lentils are tender.', 'Stir in the kale and cook 3 minutes.', 'Turn off the heat, add the lemon juice and season with salt and pepper.'],\n        'Freezes well in quart containers. Lemon at the end, never before.'],\n      ['Asian Chicken Lettuce Wraps', ['Lunch', 'Dinner'], 30, 340, 3, 20, 4, 540,\n        ['1 lb ground chicken', '1 tbsp sesame oil', '1 can water chestnuts, drained and chopped', '4 green onions, sliced', '2 cloves garlic, minced', '1 tbsp fresh ginger, grated', '3 tbsp hoisin sauce', '2 tbsp low-sodium soy sauce', '1 tbsp rice vinegar', '1 tsp sriracha', '1 head butter lettuce'],\n        ['Heat the sesame oil in a skillet over medium-high. Brown the chicken, breaking it up, 6-7 minutes.', 'Add garlic, ginger and water chestnuts; cook 2 minutes.', 'Stir in hoisin, soy sauce, vinegar and sriracha; cook until glossy, 1-2 minutes.', 'Stir in most of the green onions.', 'Spoon into lettuce cups and top with the rest of the onions.'],\n        'Copycat of the P.F. Chang’s ones. Ben eats these with a side of rice.'],\n      ['Tuna Salad Stuffed Avocados', ['Lunch'], 27, 410, 9, 10, 2, 260,\n        ['2 cans (5 oz) solid white tuna, drained', '2 tbsp plain Greek yogurt', '1 tbsp mayonnaise', '1 tsp Dijon mustard', '1 celery stalk, diced', '2 tbsp red onion, diced', '1 tbsp lemon juice', '2 avocados, halved and pitted', 'Everything bagel seasoning'],\n        ['Mix the tuna, yogurt, mayo, mustard, celery, onion and lemon juice.', 'Season with salt and pepper.', 'Scoop into the avocado halves and sprinkle with everything seasoning.'],\n        ''],\n      ['Smashed Chickpea Salad Sandwiches', ['Lunch'], 16, 420, 11, 10, 3, 360,\n        ['1 can chickpeas, drained and rinsed', '3 tbsp plain Greek yogurt', '1 tsp Dijon mustard', '1 tbsp lemon juice', '1 celery stalk, diced', '2 tbsp dill pickles, chopped', '1 tbsp fresh dill', '6 slices whole grain bread', 'Lettuce and tomato'],\n        ['Mash the chickpeas with a fork, leaving some whole.', 'Stir in the yogurt, mustard, lemon, celery, pickles and dill.', 'Season with salt and pepper.', 'Pile onto bread with lettuce and tomato.'],\n        'Meatless Monday lunch. Better the second day.'],\n      ['Broccoli Cheddar Soup', ['Lunch', 'Dinner'], 17, 420, 4, 35, 6, 720,\n        ['4 tbsp butter', '1 onion, diced', '2 carrots, grated', '3 cloves garlic, minced', '1/4 cup flour', '3 cups chicken broth', '2 cups whole milk', '5 cups broccoli florets, chopped small', '8 oz sharp cheddar, shredded', '1/2 tsp smoked paprika', 'Pinch of nutmeg'],\n        ['Melt the butter in a pot and cook the onion 5 minutes. Add garlic for 30 seconds.', 'Stir in the flour and cook 1 minute.', 'Whisk in the broth and milk slowly. Add broccoli and carrots.', 'Simmer 15-20 minutes until the broccoli is tender.', 'Blend about half with an immersion blender.', 'Off the heat, stir in the cheddar a handful at a time. Season with paprika, nutmeg, salt and pepper.'],\n        'Shred the cheese yourself; the bagged kind goes grainy.'],\n      ['Pesto Tortellini Pasta Salad', ['Lunch'], 18, 470, 3, 20, 6, 430,\n        ['20 oz refrigerated cheese tortellini', '1/2 cup basil pesto', '2 tbsp red wine vinegar', '1 cup cherry tomatoes, halved', '8 oz fresh mozzarella pearls', '1/3 cup sliced kalamata olives', '1/4 cup jarred roasted red peppers, chopped', '2 cups baby arugula', 'Parmesan'],\n        ['Cook the tortellini per the package, drain and rinse under cold water.', 'Toss with pesto and vinegar.', 'Fold in the tomatoes, mozzarella, olives and peppers.', 'Add the arugula just before serving and top with parmesan.'],\n        'Takes to every cookout. Double it for a crowd.'],\n      ['Southwest Quinoa Salad', ['Lunch'], 14, 390, 10, 25, 4, 500,\n        ['1 cup quinoa, rinsed', '1 can black beans, drained', '1 cup corn (frozen is fine)', '1 red bell pepper, diced', '1/4 red onion, diced', '1 avocado, diced', '1/2 cup cilantro', '--- DRESSING ---', '3 tbsp olive oil', '2 limes, juiced', '1 tsp cumin', '1 tsp honey'],\n        ['Simmer the quinoa in 2 cups water, covered, 15 minutes. Spread out to cool.', 'Whisk the dressing.', 'Toss the quinoa with the beans, corn, pepper, onion and cilantro.', 'Pour the dressing over and add avocado just before eating.'],\n        'Add grilled chicken to make it a dinner.'],\n      ['Slow Cooker Pot Roast', ['Dinner'], 44, 540, 4, 20, 6, 850,\n        ['3 lb chuck roast', '2 tbsp olive oil', '1 1/2 lb Yukon gold potatoes, halved', '4 carrots, in big chunks', '1 onion, in wedges', '4 cloves garlic', '1 cup beef broth', '2 tbsp Worcestershire sauce', '2 tbsp tomato paste', '2 sprigs fresh rosemary', '3 sprigs fresh thyme'],\n        ['Pat the roast dry and season all over with salt and pepper.', 'Sear it in the oil in a hot skillet, 4 minutes a side, until deeply browned.', 'Put the potatoes, carrots, onion and garlic in the slow cooker and set the roast on top.', 'Whisk the broth, Worcestershire and tomato paste; pour over. Tuck in the herbs.', 'Cook on LOW 8-9 hours, until it falls apart with a fork.', 'Shred, spoon the juices over and serve with the vegetables.'],\n        'Start it before work. The searing is worth the 10 minutes.'],\n      ['Carolina Pulled Pork with Vinegar Slaw', ['Dinner'], 38, 560, 3, 20, 8, 800,\n        ['4 lb pork shoulder (Boston butt)', '2 tbsp brown sugar', '1 tbsp smoked paprika', '2 tsp garlic powder', '2 tsp salt', '1 tsp black pepper', '1 cup apple cider vinegar', '1/2 cup chicken broth', '1 tsp red pepper flakes', '--- SLAW ---', '1 bag coleslaw mix', '1/3 cup apple cider vinegar', '2 tbsp sugar', '8 brioche buns'],\n        ['Mix the sugar and spices and rub all over the pork.', 'Put the pork in the slow cooker. Pour the vinegar and broth around it and add the pepper flakes.', 'Cook on LOW 9-10 hours.', 'Shred with two forks and stir in about 1 cup of the cooking liquid.', 'Toss the slaw mix with the vinegar, sugar and a pinch of salt; let it sit 20 minutes.', 'Pile pork on buns and top with slaw.'],\n        'Eastern NC style: vinegar, not ketchup. Freeze the leftover pork with some of its juice.'],\n      ['Shrimp & Grits', ['Dinner'], 36, 590, 2, 35, 4, 680,\n        ['1 cup stone-ground grits', '4 cups chicken broth', '1 cup whole milk', '1 cup sharp cheddar, shredded', '2 tbsp butter', '1 lb large shrimp, peeled', '4 slices bacon, chopped', '1/2 cup green bell pepper, diced', '3 green onions, sliced', '2 cloves garlic, minced', '1 tbsp lemon juice', '1/2 tsp Cajun seasoning'],\n        ['Bring the broth and milk to a simmer and whisk in the grits. Cook on low, stirring often, 25-30 minutes until creamy.', 'Stir in the cheddar and butter; season with salt and pepper.', 'Cook the bacon in a skillet until crisp. Remove, leaving the fat.', 'Cook the pepper in the bacon fat 3 minutes. Add the shrimp, garlic and Cajun seasoning; cook 2 minutes a side.', 'Add lemon juice, the bacon and most of the green onions.', 'Spoon the shrimp over the grits and top with the rest of the onions.'],\n        'Anson Mills or Bulls Bay grits if we can find them. Instant grits are not the same dish.'],\n      ['Chicken Tikka Masala', ['Dinner'], 39, 560, 3, 45, 5, 560,\n        ['1 1/2 lb boneless chicken thighs, cut in pieces', '1/2 cup plain yogurt', '1 tbsp garam masala', '1 tsp turmeric', '1 tsp cumin', '1 tsp chili powder', '2 tbsp butter', '1 onion, finely chopped', '4 cloves garlic, minced', '1 tbsp fresh ginger, grated', '1 can (15 oz) tomato sauce', '1 cup heavy cream', 'Cilantro', 'Basmati rice and naan to serve'],\n        ['Mix the chicken with the yogurt and half of the spices. Marinate at least 30 minutes.', 'Sear the chicken in batches in a hot oiled skillet until charred in spots. Set aside.', 'Melt the butter and cook the onion 5 minutes, then the garlic and ginger 1 minute.', 'Add the rest of the spices for 20 seconds, then the tomato sauce. Simmer 10 minutes.', 'Stir in the cream and the chicken. Simmer 8-10 minutes until the chicken is cooked through.', 'Top with cilantro and serve with rice and naan.'],\n        'From Cafe Delites. Ben adds more chili powder to his.',\n        { totalMinutes: 45, prepMinutes: 10, cookMinutes: 35, category: 'Dinner', keywords: 'chicken tikka masala, indian, curry' }],\n      ['Beef & Broccoli Stir-Fry', ['Dinner'], 37, 520, 4, 25, 4, 610,\n        ['1 1/4 lb flank steak, thinly sliced against the grain', '1 tbsp cornstarch', '5 cups broccoli florets', '2 tbsp avocado oil', '3 cloves garlic, minced', '1 tbsp fresh ginger, grated', '--- SAUCE ---', '1/3 cup low-sodium soy sauce', '2 tbsp brown sugar', '1 tbsp oyster sauce', '1 tsp sesame oil', '2 tsp cornstarch', '1/2 cup water', 'Steamed rice to serve'],\n        ['Toss the beef with the cornstarch and a pinch of salt.', 'Whisk the sauce ingredients.', 'Steam the broccoli in the skillet with 1/4 cup water, covered, 3 minutes. Remove.', 'Heat the oil over high and sear the beef in two batches, 2 minutes each.', 'Add garlic and ginger for 30 seconds, then the sauce. Stir until it thickens.', 'Return the broccoli and beef, toss and serve over rice.'],\n        'Better than takeout from the place on Merrimon, and done before the delivery would have come.'],\n      ['Honey Mustard Salmon & Asparagus', ['Dinner'], 38, 470, 3, 25, 4, 490,\n        ['4 salmon fillets (5 oz each)', '1 lb asparagus, ends snapped', '1 tbsp olive oil', '--- GLAZE ---', '2 tbsp Dijon mustard', '1 tbsp whole grain mustard', '2 tbsp honey', '1 tbsp lemon juice', '2 cloves garlic, minced', 'Lemon slices and fresh dill'],\n        ['Heat the oven to 400°F and line a sheet pan.', 'Toss the asparagus with the oil, salt and pepper and spread on the pan.', 'Set the salmon in the middle and season it.', 'Whisk the glaze and spoon it over the salmon.', 'Roast 12-15 minutes, until the salmon flakes.', 'Finish with lemon and dill.'],\n        'One pan. Nora’s favorite weeknight fish.'],\n      ['Turkey Meatballs in Marinara', ['Dinner'], 35, 460, 4, 40, 6, 740,\n        ['2 lb ground turkey', '2/3 cup panko', '1/2 cup grated parmesan', '1/3 cup milk', '1 egg', '3 cloves garlic, grated', '2 tsp Italian seasoning', '1 tsp salt', '1 jar (24 oz) Rao’s marinara', 'Fresh basil', 'Spaghetti or zucchini noodles to serve'],\n        ['Heat the oven to 400°F and line a sheet pan.', 'Mix the panko and milk and let it sit 2 minutes.', 'Add the turkey, parmesan, egg, garlic, seasoning and salt. Mix with your hands, gently.', 'Roll into about 30 meatballs and bake 18 minutes.', 'Warm the marinara in a big pot, add the meatballs and simmer 10 minutes.', 'Serve over spaghetti with basil and more parmesan.'],\n        'Freeze half the baked meatballs on a tray, then bag them. Straight from frozen into the sauce for 20 minutes.'],\n      ['Chicken Enchiladas Verdes', ['Dinner'], 34, 520, 6, 45, 6, 650,\n        ['3 cups shredded cooked chicken', '1 can black beans, drained', '4 oz cream cheese, softened', '1 cup Monterey Jack, shredded', '1 tsp cumin', '1 jar (16 oz) salsa verde', '10 small flour tortillas', '1/2 cup sour cream', 'Cilantro and sliced radishes'],\n        ['Heat the oven to 375°F.', 'Mix the chicken, beans, cream cheese, half the Jack, cumin and 1/2 cup salsa verde.', 'Spread 1/2 cup salsa verde in a 9x13 dish.', 'Fill and roll the tortillas and set them seam side down.', 'Pour the rest of the salsa over and top with the rest of the cheese.', 'Bake 20-25 minutes until bubbly. Top with sour cream, cilantro and radishes.'],\n        'Make two pans: one now, one wrapped in foil for the freezer (bake from frozen at 375°F, 50 minutes).'],\n      ['Thai Red Curry with Chicken & Sweet Potato', ['Dinner'], 32, 580, 5, 35, 4, 420,\n        ['1 1/4 lb chicken thighs, sliced', '1 tbsp coconut oil', '3 tbsp red curry paste', '1 can (13.5 oz) coconut milk', '1 cup chicken broth', '1 large sweet potato, cubed', '1 red bell pepper, sliced', '2 cups baby spinach', '1 tbsp fish sauce', '1 tsp brown sugar', '1 lime', 'Thai basil', 'Jasmine rice to serve'],\n        ['Heat the oil and fry the curry paste 1 minute until fragrant.', 'Add the chicken and stir to coat; cook 3 minutes.', 'Pour in the coconut milk and broth, add the sweet potato and simmer 15 minutes.', 'Add the bell pepper and cook 4 minutes more.', 'Stir in the spinach, fish sauce, sugar and lime juice.', 'Serve over rice with Thai basil.'],\n        'From RecipeTin Eats, with sweet potato because we always have one. Maesri curry paste from the Asian market on Patton.',\n        { totalMinutes: 35, prepMinutes: 10, cookMinutes: 25, category: 'Main Course', keywords: 'thai red curry, chicken curry, coconut' }],\n      ['White Bean, Sausage & Kale Soup', ['Dinner', 'Lunch'], 24, 420, 9, 35, 6, 780,\n        ['1 lb Italian chicken sausage, casings off', '1 tbsp olive oil', '1 onion, diced', '2 carrots, diced', '4 cloves garlic, minced', '2 cans cannellini beans, drained', '6 cups chicken broth', '1 parmesan rind', '1 bunch lacinato kale, chopped', '1/2 tsp red pepper flakes', 'Grated parmesan'],\n        ['Brown the sausage in the oil in a big pot, breaking it up. Remove.', 'Cook the onion and carrots 6 minutes, then the garlic 1 minute.', 'Add the beans, broth, parmesan rind and pepper flakes. Simmer 15 minutes.', 'Mash some of the beans against the pot to thicken it.', 'Add the kale and sausage and cook 5 minutes.', 'Take out the rind and serve with parmesan.'],\n        'Keep parmesan rinds in a bag in the freezer for this one.'],\n      ['Friday Pizza Night (Margherita)', ['Dinner'], 26, 680, 3, 30, 3, 900,\n        ['1 lb pizza dough, room temperature', '1/2 cup crushed San Marzano tomatoes', '1 clove garlic, grated', '8 oz fresh mozzarella, torn and patted dry', '1 tbsp olive oil', 'Fresh basil', 'Flaky salt', 'Semolina or cornmeal for the peel'],\n        ['Heat the oven to 500°F with a pizza stone or upside-down sheet pan inside for 45 minutes.', 'Season the tomatoes with the garlic and a pinch of salt.', 'Stretch half the dough on a floured peel dusted with semolina.', 'Spread a thin layer of sauce and scatter the mozzarella.', 'Slide onto the stone and bake 8-10 minutes until the crust is blistered.', 'Top with basil, a drizzle of oil and flaky salt. Repeat with the other half.'],\n        'Dough from the bakery case at Ingles, or Ben’s from scratch when he feels like it.'],\n      ['Fish Tacos with Lime Crema', ['Dinner'], 31, 490, 7, 25, 4, 470,\n        ['1 1/2 lb cod or mahi mahi', '1 tsp chili powder', '1 tsp cumin', '1/2 tsp garlic powder', '1 tbsp olive oil', '12 corn tortillas', '2 cups shredded red cabbage', '1 avocado, sliced', '--- LIME CREMA ---', '1/2 cup sour cream', '1 lime, zest and juice', '1 tbsp chopped cilantro', 'Pinch of salt'],\n        ['Stir the crema ingredients together.', 'Season the fish with the spices and salt.', 'Cook in the oil over medium-high, 3-4 minutes a side, until it flakes. Break into pieces.', 'Char the tortillas over a gas flame or in a dry skillet.', 'Fill with fish, cabbage and avocado and drizzle with crema.'],\n        ''],\n      ['Stuffed Bell Peppers', ['Dinner'], 30, 450, 5, 55, 6, 560,\n        ['6 bell peppers, tops cut off and seeded', '1 lb lean ground beef', '1 onion, diced', '2 cloves garlic, minced', '1 1/2 cups cooked rice', '1 can (14 oz) diced tomatoes, drained', '1 cup marinara', '1 tsp Italian seasoning', '1 cup shredded mozzarella'],\n        ['Heat the oven to 375°F.', 'Brown the beef with the onion and garlic; drain.', 'Stir in the rice, tomatoes, half the marinara and the seasoning.', 'Stand the peppers in a baking dish and fill them.', 'Spoon the rest of the marinara on top, cover with foil and bake 35 minutes.', 'Uncover, add the cheese and bake 10 minutes more.'],\n        'Freeze them baked, wrapped one by one.'],\n      ['Grandma Ruth’s Meatloaf', ['Dinner'], 33, 480, 1, 75, 6, 920,\n        ['2 lb ground beef (85/15)', '1 onion, grated', '2 eggs', '3/4 cup saltine crumbs (about 20 crackers)', '1/2 cup milk', '1 tbsp Worcestershire sauce', '1 1/2 tsp salt', '1/2 tsp black pepper', '--- GLAZE ---', '1/2 cup ketchup', '2 tbsp brown sugar', '1 tbsp apple cider vinegar'],\n        ['Heat the oven to 350°F.', 'Soak the cracker crumbs in the milk 5 minutes.', 'Add the beef, onion, eggs, Worcestershire, salt and pepper and mix with your hands just until combined.', 'Shape into a loaf on a foil-lined sheet pan.', 'Stir the glaze together and spread half over the loaf.', 'Bake 45 minutes, add the rest of the glaze, bake 15 more. Rest 10 minutes before slicing.'],\n        'Her recipe card says “saltines, not breadcrumbs, and don’t argue.” Meatloaf sandwiches the next day.'],\n      ['Pork Tenderloin with Apples & Onions', ['Dinner'], 36, 430, 4, 35, 4, 520,\n        ['1 1/4 lb pork tenderloin', '1 tbsp olive oil', '1 tsp dried thyme', '2 apples (Honeycrisp), sliced', '1 onion, sliced', '1/2 cup apple cider', '1 tbsp Dijon mustard', '1 tbsp butter'],\n        ['Heat the oven to 400°F.', 'Season the pork with thyme, salt and pepper and sear in the oil in an oven-safe skillet until browned all over.', 'Move the pork aside, add the apples and onion and cook 3 minutes.', 'Whisk the cider and mustard, pour over, set the pork on top.', 'Roast 15-18 minutes to 145°F inside. Rest 5 minutes.', 'Swirl the butter into the pan juices, slice the pork and spoon the apples over.'],\n        'Fall in the mountains on a plate.'],\n      ['Korean Beef Bowls', ['Dinner', 'Lunch'], 33, 560, 3, 20, 4, 600,\n        ['1 lb lean ground beef', '3 cloves garlic, minced', '1 tbsp fresh ginger, grated', '1/3 cup low-sodium soy sauce', '3 tbsp brown sugar', '1 tsp sesame oil', '1/2 tsp red pepper flakes', '2 cups cooked rice', '1 cucumber, sliced', '1 cup shredded carrots', 'Green onions and sesame seeds', '4 fried eggs (optional)'],\n        ['Brown the beef in a skillet; drain the fat.', 'Add the garlic and ginger and cook 1 minute.', 'Stir in the soy sauce, brown sugar, sesame oil and pepper flakes. Simmer 2-3 minutes.', 'Serve over rice with cucumber and carrots.', 'Top with green onions, sesame seeds and a fried egg.'],\n        'From Budget Bytes. Twenty minutes, every time.',\n        { totalMinutes: 20, prepMinutes: 5, cookMinutes: 15, category: 'Main Dish', keywords: 'korean beef, ground beef, rice bowl' }],\n      ['Spinach & Ricotta Vegetable Lasagna', ['Dinner'], 27, 510, 5, 80, 8, 830,\n        ['12 lasagna noodles', '15 oz ricotta', '1 egg', '1 cup grated parmesan', '10 oz frozen spinach, thawed and squeezed dry', '2 zucchini, diced', '8 oz mushrooms, sliced', '1 tbsp olive oil', '1 jar (24 oz) marinara', '3 cups shredded mozzarella', '1 tsp Italian seasoning'],\n        ['Heat the oven to 375°F. Cook the noodles 2 minutes short of the package time.', 'Sauté the zucchini and mushrooms in the oil until their water cooks off, about 8 minutes.', 'Mix the ricotta, egg, spinach, half the parmesan and the seasoning.', 'Layer in a 9x13: sauce, noodles, ricotta, vegetables, mozzarella. Repeat twice and finish with sauce, mozzarella and parmesan.', 'Cover with foil and bake 45 minutes, uncover and bake 15 more.', 'Rest 15 minutes before cutting.'],\n        'Freezer meal: assemble, wrap well, freeze up to 3 months. Thaw overnight and bake as written.'],\n      ['Chicken Pot Pie', ['Dinner'], 29, 580, 4, 60, 6, 870,\n        ['1 refrigerated pie crust', '4 tbsp butter', '1 onion, diced', '2 carrots, diced', '2 celery stalks, diced', '1/3 cup flour', '2 cups chicken broth', '3/4 cup milk', '3 cups cooked chicken, shredded', '1 cup frozen peas', '1 tsp fresh thyme', '1 egg, beaten'],\n        ['Heat the oven to 400°F.', 'Melt the butter and cook the onion, carrots and celery 8 minutes.', 'Stir in the flour for 1 minute, then whisk in the broth and milk. Simmer until thick.', 'Stir in the chicken, peas and thyme; season well.', 'Pour into a deep pie dish, lay the crust over, crimp the edges and cut a few slits.', 'Brush with egg and bake 30 minutes until golden. Rest 10 minutes.'],\n        'Use the rotisserie chicken from Costco. Snow-day dinner.'],\n      ['Slow Cooker Chicken Tortilla Soup', ['Dinner', 'Lunch'], 31, 380, 8, 15, 6, 630,\n        ['1 1/2 lb chicken breasts', '1 onion, diced', '1 jalapeño, seeded and minced', '3 cloves garlic, minced', '1 can black beans, drained', '1 can (14 oz) fire-roasted diced tomatoes', '1 cup frozen corn', '4 cups chicken broth', '2 tsp cumin', '1 tsp chili powder', '1 lime', '--- TOPPINGS ---', 'Tortilla strips, avocado, cilantro, shredded cheese'],\n        ['Put everything except the lime and toppings in the slow cooker.', 'Cook on LOW 6 hours or HIGH 3 hours.', 'Take the chicken out, shred it and return it.', 'Squeeze in the lime and season with salt.', 'Serve with tortilla strips, avocado, cilantro and cheese.'],\n        ''],\n      ['Sheet Pan Sausage, Sweet Potatoes & Brussels Sprouts', ['Dinner'], 26, 470, 8, 40, 4, 440,\n        ['1 package (12 oz) chicken apple sausage, sliced', '2 sweet potatoes, cubed', '1 lb Brussels sprouts, halved', '1 red onion, in wedges', '3 tbsp olive oil', '1 tsp smoked paprika', '1 tsp garlic powder', '1 tbsp maple syrup', '1 tbsp balsamic vinegar'],\n        ['Heat the oven to 425°F.', 'Toss the sweet potatoes, sprouts and onion with the oil, spices, salt and pepper on a large sheet pan.', 'Roast 15 minutes.', 'Add the sausage, stir and roast 15-20 minutes more until everything is browned.', 'Drizzle with maple syrup and balsamic before serving.'],\n        'Cut the sweet potato small so it’s done with the sprouts.'],\n      ['Red Beans & Rice', ['Dinner'], 27, 540, 13, 30, 6, 710,\n        ['1 lb andouille sausage, sliced', '1 onion, diced', '1 green bell pepper, diced', '2 celery stalks, diced', '4 cloves garlic, minced', '2 cans red kidney beans, with their liquid', '2 cups chicken broth', '2 bay leaves', '1 tsp Cajun seasoning', '1/2 tsp dried thyme', 'Hot sauce', '4 cups cooked white rice', 'Green onions'],\n        ['Brown the sausage in a Dutch oven. Remove.', 'Cook the onion, pepper and celery in the fat 6 minutes. Add garlic.', 'Add the beans, broth, bay leaves, Cajun seasoning and thyme. Simmer 20 minutes.', 'Mash a cup of the beans against the pot to make it creamy.', 'Return the sausage and simmer 5 minutes. Season with hot sauce.', 'Serve over rice with green onions.'],\n        'Monday night supper, the New Orleans way. Leftovers freeze.'],\n      ['Teriyaki Salmon Rice Bowls', ['Dinner', 'Lunch'], 36, 590, 5, 25, 4, 390,\n        ['4 salmon fillets (5 oz each)', '1/3 cup low-sodium soy sauce', '2 tbsp honey', '1 tbsp rice vinegar', '1 tsp fresh ginger, grated', '1 clove garlic, grated', '1 tsp cornstarch', '3 cups cooked rice', '1 cup shelled edamame', '1 cucumber, sliced', '1 avocado', 'Sesame seeds'],\n        ['Heat the oven to 400°F.', 'Simmer the soy sauce, honey, vinegar, ginger and garlic. Stir in the cornstarch mixed with 1 tbsp water until it thickens.', 'Brush half the sauce over the salmon and bake 12 minutes.', 'Warm the edamame.', 'Build bowls: rice, salmon, edamame, cucumber and avocado.', 'Drizzle the rest of the sauce and sprinkle sesame seeds.'],\n        ''],\n      ['Smash Burgers', ['Dinner'], 34, 640, 2, 20, 4, 480,\n        ['1 lb ground beef (80/20), in 8 loose balls', '4 potato buns, toasted', '4 slices American cheese', '1/2 onion, very thinly sliced', 'Dill pickle chips', '--- SAUCE ---', '1/4 cup mayonnaise', '1 tbsp ketchup', '1 tbsp yellow mustard', '1 tbsp pickle juice'],\n        ['Stir the sauce together.', 'Heat a cast-iron skillet over high until smoking.', 'Put in two beef balls, top each with onion and smash flat with a sturdy spatula. Season with salt.', 'Cook 2 minutes until the edges are deeply browned. Flip, add cheese on one, stack the other on top.', 'Cook 1 minute more.', 'Serve on toasted buns with sauce and pickles.'],\n        'From Serious Eats. Open a window first.',\n        { totalMinutes: 20, prepMinutes: 10, cookMinutes: 10, category: 'Dinner', keywords: 'smash burger, cheeseburger, griddle' }],\n      ['Dutch Oven Beef Stew', ['Dinner'], 35, 520, 5, 30, 6, 890,\n        ['2 1/2 lb beef chuck, in 1 1/2-inch pieces', '3 tbsp flour', '2 tbsp olive oil', '1 onion, diced', '3 cloves garlic, minced', '2 tbsp tomato paste', '1 cup red wine', '4 cups beef broth', '1 tbsp Worcestershire sauce', '2 bay leaves', '1 tsp dried thyme', '4 carrots, in chunks', '1 1/2 lb Yukon gold potatoes, in chunks', '1 cup frozen peas'],\n        ['Heat the oven to 325°F. Toss the beef with the flour, salt and pepper.', 'Brown the beef in batches in the oil in a Dutch oven. Set aside.', 'Cook the onion 5 minutes, then the garlic and tomato paste 1 minute.', 'Pour in the wine and scrape up the brown bits. Add the broth, Worcestershire, bay leaves, thyme and the beef.', 'Cover and bake 1 1/2 hours. Add the carrots and potatoes and bake 1 hour more.', 'Stir in the peas, take out the bay leaves and season.'],\n        'Freezes beautifully (without the potatoes if you can). The first cold Sunday of the year.'],\n      ['Chicken Parmesan', ['Dinner'], 48, 620, 3, 40, 4, 580,\n        ['2 large chicken breasts, halved into 4 cutlets', '1/2 cup flour', '2 eggs, beaten', '1 cup panko', '1/2 cup grated parmesan', '1 tsp Italian seasoning', '3 tbsp olive oil', '1 1/2 cups marinara', '1 cup shredded mozzarella', 'Fresh basil', '8 oz spaghetti to serve'],\n        ['Heat the oven to 425°F.', 'Pound the cutlets to an even 1/2 inch and season.', 'Dredge in flour, then egg, then the panko mixed with parmesan and seasoning.', 'Fry in the oil 3 minutes a side until golden. Move to a baking dish.', 'Spoon marinara over each, top with mozzarella and bake 12-15 minutes.', 'Serve over spaghetti with basil.'],\n        'Ben’s birthday dinner request three years running.'],\n      ['Coconut Chickpea Curry', ['Dinner', 'Lunch'], 15, 450, 12, 30, 4, 400,\n        ['1 tbsp coconut oil', '1 onion, diced', '3 cloves garlic, minced', '1 tbsp fresh ginger, grated', '2 tbsp curry powder', '1 tsp garam masala', '2 cans chickpeas, drained', '1 can (14 oz) diced tomatoes', '1 can (13.5 oz) coconut milk', '4 cups baby spinach', '1 lime', 'Cilantro', 'Brown rice to serve'],\n        ['Cook the onion in the oil 6 minutes, then the garlic and ginger 1 minute.', 'Add the curry powder and garam masala and stir 30 seconds.', 'Add the chickpeas, tomatoes and coconut milk. Simmer 15 minutes.', 'Stir in the spinach until it wilts.', 'Finish with lime juice and salt. Serve over rice with cilantro.'],\n        'Pantry dinner. Everything but the spinach lives in the cupboard.'],\n      ['Pan-Fried Trout with Brown Butter & Green Beans', ['Dinner'], 34, 440, 3, 20, 2, 340,\n        ['2 rainbow trout fillets (Sunburst Trout Farms)', '2 tbsp flour', '1 tbsp olive oil', '3 tbsp butter', '2 tbsp sliced almonds', '1 lemon', '8 oz green beans, trimmed', 'Fresh parsley'],\n        ['Blanch the green beans in salted boiling water 3 minutes; drain.', 'Pat the trout dry, season and dust the flesh side with flour.', 'Heat the oil in a skillet over medium-high and cook the trout skin side down 3 minutes, then flip for 1 minute. Move to plates.', 'Wipe the pan, add the butter and almonds and cook until the butter smells nutty and turns golden brown.', 'Toss the green beans in the brown butter with a squeeze of lemon.', 'Spoon the beans and almonds over the trout and top with parsley.'],\n        'Local trout from the farmers market. Done in the time it takes to set the table.'],\n      ['Baked Mac & Cheese', ['Dinner'], 24, 610, 2, 50, 8, 860,\n        ['1 lb elbow macaroni', '4 tbsp butter', '1/4 cup flour', '3 cups whole milk', '1 cup half-and-half', '12 oz sharp cheddar, shredded', '4 oz gruyère, shredded', '1 tsp dry mustard', '1/2 tsp smoked paprika', '--- TOPPING ---', '1 cup panko', '2 tbsp butter, melted'],\n        ['Heat the oven to 375°F. Cook the macaroni 2 minutes short of the package time.', 'Melt the butter, whisk in the flour and cook 1 minute.', 'Whisk in the milk and half-and-half and simmer until thick, about 5 minutes.', 'Off the heat, stir in most of the cheese, the mustard and paprika. Season.', 'Fold in the pasta, pour into a 9x13 dish and top with the rest of the cheese.', 'Toss the panko with the melted butter, scatter over and bake 25 minutes until golden.'],\n        'Thanksgiving side that became a dinner. Serve with a big salad.'],\n      ['Roasted Red Pepper Hummus', ['Snack'], 5, 160, 4, 10, 8, 610,\n        ['1 can chickpeas, drained (save the liquid)', '1/2 cup jarred roasted red peppers', '1/4 cup tahini', '1 lemon, juiced', '1 clove garlic', '1/2 tsp cumin', '2 tbsp olive oil', '2-3 tbsp chickpea liquid', 'Carrots, cucumbers and pita chips to dip'],\n        ['Blend the tahini and lemon juice 1 minute until creamy.', 'Add the chickpeas, peppers, garlic, cumin and salt.', 'With the blender running, drizzle in the oil and enough chickpea liquid to make it smooth.', 'Taste for salt and lemon.'],\n        'Keeps a week. Cheaper than the store tubs by a mile.'],\n      ['Cinnamon Roasted Almonds', ['Snack'], 7, 190, 4, 30, 8, 450,\n        ['2 cups raw almonds', '1 egg white', '1 tsp vanilla', '1/4 cup brown sugar', '1 1/2 tsp cinnamon', '1/2 tsp salt'],\n        ['Heat the oven to 300°F and line a sheet pan.', 'Whisk the egg white and vanilla until frothy.', 'Toss in the almonds to coat.', 'Mix the sugar, cinnamon and salt and toss with the almonds.', 'Spread out and bake 25 minutes, stirring once. Cool completely.'],\n        'A quarter cup is a serving. Tins of these at Christmas for the neighbors.'],\n      ['Greek Yogurt Ranch Dip', ['Snack'], 9, 90, 1, 10, 6, 280,\n        ['1 1/2 cups plain Greek yogurt', '1 tsp dried dill', '1 tsp dried parsley', '1/2 tsp garlic powder', '1/2 tsp onion powder', '1 tbsp lemon juice', '1/4 tsp salt', 'Black pepper', 'Cut vegetables to dip'],\n        ['Stir everything together.', 'Chill at least 30 minutes so the herbs soften.', 'Serve with carrots, peppers, snap peas and cucumbers.'],\n        ''],\n      ['Grandma Ruth’s Pimento Cheese', ['Snack', 'Lunch'], 8, 210, 0, 10, 10, 900,\n        ['8 oz extra-sharp cheddar, grated', '4 oz cream cheese, softened', '1/3 cup Duke’s mayonnaise', '1 jar (4 oz) diced pimentos, drained', '1/4 tsp garlic powder', 'Pinch of cayenne', 'Dash of Worcestershire sauce'],\n        ['Grate the cheddar by hand on the small holes.', 'Beat the cream cheese and mayo until smooth.', 'Stir in the cheddar, pimentos, garlic powder, cayenne and Worcestershire.', 'Chill an hour. Serve with Ritz crackers, celery, or on white bread.'],\n        'Duke’s only. Ruth’s card underlines it twice.'],\n      ['Deviled Eggs', ['Snack'], 6, 90, 0, 25, 12, 670,\n        ['6 eggs', '3 tbsp mayonnaise', '1 tsp Dijon mustard', '1 tsp sweet pickle relish', '1/2 tsp apple cider vinegar', 'Salt, pepper', 'Smoked paprika and chives'],\n        ['Put the eggs in a pot, cover with cold water, bring to a boil, cover and turn off the heat for 11 minutes.', 'Move to ice water for 5 minutes and peel.', 'Halve the eggs and pop the yolks into a bowl.', 'Mash the yolks with the mayo, mustard, relish, vinegar, salt and pepper.', 'Spoon or pipe back into the whites and dust with paprika and chives.'],\n        'Serving is two halves. Easter, the Fourth, every potluck.'],\n      ['Skillet Apple Crisp', ['Dessert'], 3, 290, 4, 50, 8, 750,\n        ['6 apples (half Granny Smith, half Honeycrisp), sliced', '2 tbsp sugar', '1 tbsp lemon juice', '1 1/2 tsp cinnamon', '--- TOPPING ---', '3/4 cup old-fashioned oats', '1/2 cup flour', '1/2 cup brown sugar', '1/2 tsp cinnamon', '1/4 tsp salt', '6 tbsp cold butter, cubed'],\n        ['Heat the oven to 375°F.', 'Toss the apples with the sugar, lemon juice and cinnamon in a 10-inch cast-iron skillet.', 'Rub the topping ingredients together until clumpy.', 'Scatter over the apples.', 'Bake 40-45 minutes until bubbling and golden.', 'Serve warm with vanilla ice cream.'],\n        'Apple-picking weekend in Hendersonville, every September.'],\n      ['Ben’s Brown Butter Chocolate Chip Cookies', ['Dessert', 'Snack'], 3, 230, 1, 30, 24, 690,\n        ['1 cup (2 sticks) butter', '1 cup brown sugar', '1/2 cup sugar', '2 eggs', '2 tsp vanilla', '2 1/4 cups all-purpose flour', '1 tsp baking soda', '1 tsp salt', '1 1/2 cups dark chocolate chunks', 'Flaky salt'],\n        ['Brown the butter in a light pan until it smells nutty and has brown flecks. Cool 15 minutes.', 'Whisk in both sugars, then the eggs and vanilla.', 'Stir in the flour, baking soda and salt, then the chocolate.', 'Chill the dough 30 minutes (or up to 3 days).', 'Scoop 2-tbsp balls onto lined sheets and bake at 350°F for 10-11 minutes, until the edges are golden and the middles look underdone.', 'Sprinkle with flaky salt and cool on the sheet 5 minutes.'],\n        'Freeze scooped dough balls and bake two at a time.'],\n      ['Grandma Ruth’s Pecan Pie', ['Dessert'], 5, 480, 2, 75, 8, 900,\n        ['1 unbaked 9-inch pie crust', '1 cup light corn syrup', '1 cup brown sugar', '3 eggs', '1/3 cup butter, melted', '1 tsp vanilla', '1/2 tsp salt', '1 1/2 cups pecan halves'],\n        ['Heat the oven to 350°F.', 'Whisk the corn syrup, brown sugar, eggs, butter, vanilla and salt until smooth.', 'Scatter the pecans in the crust and pour the filling over.', 'Bake 55-60 minutes, until the middle jiggles only a little. Cover the edges with foil if they brown too fast.', 'Cool at least 2 hours before cutting.'],\n        'Thanksgiving. Ben gets the first slice, it’s a rule.'],\n      ['Peach Cobbler', ['Dessert'], 3, 340, 2, 60, 8, 640,\n        ['6 cups sliced peaches (fresh or frozen)', '1/4 cup sugar', '1 tsp cinnamon', '1 tbsp lemon juice', '1/2 cup butter', '1 cup flour', '1 cup sugar', '2 tsp baking powder', '1/4 tsp salt', '1 cup milk'],\n        ['Heat the oven to 350°F. Melt the butter in a 9x13 dish in the oven.', 'Toss the peaches with 1/4 cup sugar, cinnamon and lemon juice.', 'Whisk the flour, 1 cup sugar, baking powder, salt and milk into a batter.', 'Pour the batter over the melted butter. Do not stir.', 'Spoon the peaches over the top. Do not stir.', 'Bake 45-50 minutes until golden. Serve warm with ice cream.'],\n        'Summer peaches from the tailgate market at the Grove Arcade.'],\n      ['Pumpkin Chocolate Chip Muffins', ['Snack', 'Dessert'], 4, 230, 2, 35, 18, 420,\n        ['1 can (15 oz) pumpkin purée', '2 eggs', '1/2 cup brown sugar', '1/3 cup maple syrup', '1/2 cup coconut oil, melted', '1 tsp vanilla', '2 cups whole wheat pastry flour', '1 tsp baking soda', '2 tsp pumpkin pie spice', '1/2 tsp salt', '3/4 cup mini chocolate chips'],\n        ['Heat the oven to 350°F and line 18 muffin cups.', 'Whisk the pumpkin, eggs, sugar, syrup, oil and vanilla.', 'Stir in the flour, baking soda, spice and salt just until mixed.', 'Fold in the chocolate chips.', 'Fill the cups 3/4 full and bake 20-22 minutes.'],\n        'October through December, a batch every other week.'],\n      ['Lemon Blueberry Yogurt Cake', ['Dessert'], 6, 280, 1, 60, 10, 380,\n        ['1 1/2 cups flour', '2 tsp baking powder', '1/2 tsp salt', '1 cup plain Greek yogurt', '1 cup sugar', '3 eggs', '2 lemons, zest and juice', '1/2 cup olive oil', '1 1/2 cups blueberries', '--- GLAZE ---', '1 cup powdered sugar', '2 tbsp lemon juice'],\n        ['Heat the oven to 350°F and grease a loaf pan.', 'Whisk the flour, baking powder and salt.', 'Whisk the yogurt, sugar, eggs, zest and juice, then the oil.', 'Fold in the dry ingredients, then the blueberries tossed in 1 tbsp flour.', 'Bake 50-55 minutes until a tester comes out clean.', 'Cool, then pour the glaze over.'],\n        'From Ina Garten’s lemon yogurt cake, with blueberries. Freezes in slices.',\n        { totalMinutes: 75, prepMinutes: 15, cookMinutes: 55, category: 'Dessert', keywords: 'lemon cake, yogurt cake, blueberry' }],\n      ['Peanut Butter Banana Nice Cream', ['Dessert'], 8, 240, 4, 5, 2, 300,\n        ['3 frozen ripe bananas, sliced', '2 tbsp peanut butter', '2 tbsp milk', '1 tbsp cocoa powder (optional)', 'Pinch of salt'],\n        ['Let the bananas sit 5 minutes out of the freezer.', 'Blend everything, scraping down the sides, until it looks like soft-serve.', 'Eat right away, or freeze 1 hour for scoops.'],\n        'Summer dessert that keeps Nora on track.'],\n      ['Bang Bang Chicken Tacos', ['Dinner'], 33, 510, 4, 25, 4, 200,\n        ['1 1/2 lb chicken breast, in bite-size pieces', '1/2 cup cornstarch', '2 tbsp avocado oil', '--- SAUCE ---', '1/3 cup mayonnaise', '3 tbsp sweet chili sauce', '1 tsp sriracha', '1 tsp lime juice', '8 small flour tortillas', '2 cups shredded cabbage', 'Green onions and cilantro'],\n        ['Stir the sauce together.', 'Season the chicken and toss in the cornstarch.', 'Fry in the oil over medium-high until crisp and cooked through, 6-7 minutes. Or air fry 10-12 minutes at 400°F.', 'Toss the chicken with half the sauce.', 'Fill warm tortillas with cabbage and chicken, drizzle with the rest of the sauce and top with green onions and cilantro.'],\n        'Newest favorite. Ben found it on Instagram.'],\n      ['Sloppy Joes', ['Dinner'], 27, 470, 3, 25, 6, 790,\n        ['1 1/2 lb lean ground beef', '1 onion, diced', '1 green bell pepper, diced', '2 cloves garlic, minced', '1 cup ketchup', '2 tbsp tomato paste', '1 tbsp Worcestershire sauce', '1 tbsp brown sugar', '1 tsp yellow mustard', '1/2 cup water', '6 potato buns'],\n        ['Brown the beef with the onion and pepper; drain.', 'Add the garlic for 1 minute.', 'Stir in the ketchup, tomato paste, Worcestershire, sugar, mustard and water.', 'Simmer 10-15 minutes until thick.', 'Pile onto toasted buns.'],\n        'The meal for nights we’re both tired.']\n    ];\n    BONUS.forEach(function (r) { if (!have[r.name]) { BOOK.push(r); have[r.name] = 1; } });\n    var NEW = [];\n    OWN.forEach(function (o, i) {\n      if (have[o[0]]) return;\n      var made = day(-o[7]); made.setHours(19, Math.floor(rr() * 60), Math.floor(rr() * 60), 0);\n      var p = o[2], c = o[3], f = o[4], sv = o[6], por = [p + 'g protein', c + ' cal'];\n      if (f > 0) por.push(f + 'g fiber'); if (sv > 1) por.push('serves ' + sv); por.push(o[5] + ' min');\n      var r = Object.assign({ id: 'r_custom_' + made.getTime() + '_' + Math.floor(rr() * 2176782336).toString(36), name: o[0], type: o[1][0], types: o[1], protein: p, calories: c, fiber: f,\n        servings: sv, prepTime: o[5], ingredients: o[8], steps: o[9], prepped: null, tip: o[10] || '', portion: p + 'g protein - ' + c + ' cal', portions: por,\n        color: SLOTC[o[1][0]] || 'var(--lh-accent)', cuisineTags: guessCuisine(o[0], o[8]), favorite: false, timesUsed: 0, source: 'custom' }, o[11] || {});\n      BOOK.push(r); NEW.push(r); have[o[0]] = 1;\n    });\n    function rec(nm) { return BOOK.filter(function (r) { return r.name === nm; })[0]; }\n    function has(r, t) { return (r.types || [r.type]).indexOf(t) !== -1; }\n    // a meal in the plan, as the planner's assignMealToSlot saves it (same as the meals extras' slot())\n    function slot(r) {\n      return { id: r.id, name: r.name, type: r.type, types: r.types || [r.type], baseProtein: r.protein || 0, baseCalories: r.calories || 0, baseFiber: r.fiber || 0,\n        protein: r.protein || 0, calories: r.calories || 0, fiber: r.fiber || 0, ingredients: r.ingredients || [], steps: r.steps || [], tip: r.tip || '',\n        portion: (r.protein || 0) + 'g protein - ' + (r.calories || 0) + ' cal', portions: [(r.protein || 0) + 'g protein', (r.calories || 0) + ' cal'].concat((r.fiber || 0) > 0 ? [(r.fiber || 0) + 'g fiber'] : []),\n        color: r.color || 'var(--lh-accent)' };\n    }\n    function isTyped(m) { return !!m && String(m.id || '').indexOf('typed_') === 0; }\n    // what each meal could become; the household's own recipes come up a bit more than the app's\n    function pool(t, extra) { var a = []; BOOK.forEach(function (r) { if (!has(r, t)) return; a.push(r); if (r.source === 'custom') a.push(r); }); return a; }\n    var PD = pool('Dinner'), PB = pool('Breakfast'), PL = pool('Lunch'), PS = pool('Snack'), PDs = pool('Dessert');\n    var seasonal = function (r, n) { var mo = day(n).getMonth(); if (/Peach|Nice Cream|Pasta Salad|Quinoa Salad/.test(r.name)) return mo >= 5 && mo <= 8; if (/Pumpkin|Pecan Pie|Pot Roast|Beef Stew|Pot Pie/.test(r.name)) return mo >= 9 || mo <= 2; return true; };\n    function pickFor(P, n, recent) { for (var i = 0; i < 12; i++) { var r = rp(P); if (seasonal(r, n) && recent.indexOf(r.name) === -1) return r; } return rp(P); }\n    function hasNote(k) { var bad = false; ['person1', 'person2'].forEach(function (p) { try { var f = out['journal_feel_' + k + '_dinner_' + p]; if (f && JSON.parse(f).note) bad = true; } catch (e) {} }); return bad; }\n    var recentD = [], swapped = {};\n    for (var n = -85; n <= -3; n++) {\n      var k = dk(n), d = sched[k]; if (!d || !d.person1) continue;\n      var a = d.person1, b = d.person2 || {};\n      // dinner (one dish for both)\n      if (a.dinner && !isTyped(a.dinner) && !a.dinner.leftover && b.dinner && b.dinner.name === a.dinner.name && !hasNote(k) && rc(0.7)) {\n        var nd = pickFor(PD, n, recentD); a.dinner = slot(nd); d.person2.dinner = slot(nd); swapped[k] = nd;\n      }\n      if (a.dinner) { recentD.push(a.dinner.name); if (recentD.length > 9) recentD.shift(); }\n      // Nora's own meals (what she sees); Ben's only where it's the same dish\n      if (a.breakfast && (isTyped(a.breakfast) ? rc(0.22) : rc(0.65))) {\n        var wasB = a.breakfast.name, nb = pickFor(PB, n, []); a.breakfast = slot(nb);\n        if (b.breakfast && b.breakfast.name === wasB && !isTyped(b.breakfast)) d.person2.breakfast = slot(nb);\n      }\n      if (a.lunch && !/^Leftover /.test(a.lunch.name) && (isTyped(a.lunch) ? rc(0.16) : rc(0.6))) a.lunch = slot(pickFor(PL, n, []));\n      if (a.snack && a.snack[0] && (isTyped(a.snack[0]) ? rc(0.14) : rc(0.6))) a.snack[0] = slot(pickFor(PS, n, []));\n      if (a.dessert && (isTyped(a.dessert) ? rc(0.2) : rc(0.6))) { var ns = slot(pickFor(PDs, n, [])); a.dessert = ns; if (d.person2 && d.person2.dessert) d.person2.dessert = JSON.parse(JSON.stringify(ns)); }\n    }\n    // the day after a changed dinner: \"Leftover …\" lunches name the new dish; the Journal's feelings fit it\n    Object.keys(swapped).forEach(function (k) {\n      var r = swapped[k], n = Math.round((new Date(k + 'T12:00:00') - day(0)) / 86400000) + 0, nk = dk(n + 1), nx = sched[nk];\n      ['person1', 'person2'].forEach(function (p) {\n        var l = nx && nx[p] && nx[p].lunch;\n        if (l && isTyped(l) && /^Leftover /.test(l.name)) {\n          l.name = 'Leftover ' + r.name.replace(/\\s*\\(.*\\)$/, '').replace(/^(Ben’s|Nora’s|Grandma Ruth’s) /, '').toLowerCase();\n          l.calories = l.baseCalories = r.calories; l.protein = l.baseProtein = r.protein; l.portion = r.protein + 'g protein - ' + r.calories + ' cal'; l.portions = [r.protein + 'g protein', r.calories + ' cal'];\n        }\n        var fk = 'journal_feel_' + k + '_dinner_' + p; if (!out[fk]) return;\n        var txt = (r.name + ' ' + r.ingredients.join(' ')).toLowerCase(), tg = [];\n        if (/cream|cheese|sausage|gravy|biscuit|pie|pizza|burger|mac /.test(txt)) { if (rc(0.75)) tg.push(rp(['heavy', 'bloated', 'tired'])); }\n        else if (/salmon|trout|greek|lemon|bowl|lentil|curry|quinoa|mediterranean/.test(txt)) { if (rc(0.75)) tg.push(rp(['energized', 'light', 'energized'])); if (rc(0.5)) tg.push('satisfied'); }\n        else if (rc(0.6)) tg.push('satisfied');\n        put(fk, JSON.stringify({ tags: tg, note: '' }));\n      });\n    });\n    // Saturday's dinner in the week ahead was tonight's chili again: something they haven't had in a while\n    var sat = sched[dk(5)], pp = rec('Carolina Pulled Pork with Vinegar Slaw');\n    if (sat && sat.person1 && sat.person1.dinner && sat.person1.dinner.name === (sched[dk(0)] && sched[dk(0)].person1 && sched[dk(0)].person1.dinner || {}).name && pp) { sat.person1.dinner = slot(pp); if (sat.person2) sat.person2.dinner = slot(pp); }\n    put('mealplan_schedule', sched);\n\n    // how often each was planned: the plan's last few months, plus the years before them for the older recipes\n    var cnt = {};\n    Object.keys(sched).forEach(function (k) {\n      ['person1', 'person2'].forEach(function (p) {\n        var x = sched[k][p]; if (!x) return;\n        [x.breakfast, x.lunch, p === 'person1' ? x.dinner : null, p === 'person1' ? x.dessert : null].concat(x.snack || []).forEach(function (m) { if (m && !m.leftover && !isTyped(m)) cnt[m.name] = (cnt[m.name] || 0) + 1; });\n      });\n    });\n    BOOK.forEach(function (r) {\n      var age = 900, m = /^r_custom_(\\d{12,})_/.exec(r.id || ''); if (m) age = Math.round((Date.now() - +m[1]) / 86400000);\n      var c = cnt[r.name] || 0, before = age > 90 ? Math.round((c + 0.6) * (age - 90) / 90 * (0.35 + rr() * 0.4)) : 0;\n      r.timesUsed = c + before;\n    });\n    // hearts: Nora's and Ben's favourites (some the same), and their thumbs on what they've eaten\n    var NORA = ['Honey Mustard Salmon & Asparagus', 'Shakshuka', 'Lemony Lentil Soup', 'Thai Red Curry with Chicken & Sweet Potato', 'Spinach Feta Egg Muffins', 'Chicken Salad with Grapes & Pecans',\n      'Skillet Apple Crisp', 'Nora’s Green Smoothie'];\n    var BEN = ['Carolina Pulled Pork with Vinegar Slaw', 'Smash Burgers', 'Chicken Parmesan', 'Ben’s Brown Butter Chocolate Chip Cookies', 'Grandma Ruth’s Biscuits & Sausage Gravy', 'Korean Beef Bowls',\n      'Thai Red Curry with Chicken & Sweet Potato', 'Skillet Apple Crisp'];\n    function day0(n) { return dk(-n); }\n    NORA.forEach(function (nm) { var r = rec(nm); if (r) r.favoritePerson1 = true; });\n    BEN.forEach(function (nm) { var r = rec(nm); if (r) r.favoritePerson2 = true; });\n    BOOK.forEach(function (r) {\n      if ((r.favoritePerson1 || r.favoritePerson2) && r.timesUsed < 8) r.timesUsed += 6 + Math.floor(rr() * 12);\n      r.favoritePerson1 = !!r.favoritePerson1; r.favoritePerson2 = !!r.favoritePerson2; r.favorite = r.favoritePerson1 || r.favoritePerson2;\n      if (!r.timesUsed) return;\n      var rt = Array.isArray(r.ratings) ? r.ratings : [];\n      ['person1', 'person2'].forEach(function (p) {\n        if (rt.some(function (x) { return x.person === p; })) return;\n        var fav = p === 'person1' ? r.favoritePerson1 : r.favoritePerson2;\n        if (fav) rt.push({ person: p, rating: 'love', date: day0(5 + Math.floor(rr() * 400)) });\n        else if (rc(0.55)) rt.push({ person: p, rating: rc(0.88) ? 'up' : 'down', date: day0(3 + Math.floor(rr() * 500)) });\n      });\n      if (rt.length) r.ratings = rt;\n    });\n    put('mealplan_recipes', BOOK);\n\n  })();\n\n  // ---------- workouts.js ----------\n  (function () {\n// Nora's workouts, full (Nov 2): her whole week (two lower days, upper, pilates, a Saturday hike) and a year of logging\n// with slow progressive overload, a deload week, trips and a cold, swaps, new bests and notes. Replaces the shorter\n// dbkPrivate_workout_demo_person1 made above; Ben's stays as it is. Its own seeded numbers (wr), so nothing else changes.\nvar ws = 4409;\nfunction wr() { ws |= 0; ws = ws + 0x6D2B79F5 | 0; var t = Math.imul(ws ^ ws >>> 15, 1 | ws); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\nvar wc = function (p) { return wr() < p; }, wi = function (a, b) { return a + Math.floor(wr() * (b - a + 1)); }, wp = function (a) { return a[Math.floor(wr() * a.length)]; };\nvar at = function (n, h, m) { var d = day(n); d.setHours(h || 9, m || 0, 0, 0); return d.getTime(); };\nfunction slug(x) { return String(x).toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '').slice(0, 60); }\nvar FROM = -364, PLAN_T = at(FROM - 9, 20, 15);\n\nvar S = {\n  n1lowerA: { n: 'Lower A: glutes', about: 'Hip thrusts first while I’m fresh. About 55 minutes.', ex: [\n    { h: 'Warm-up' },\n    { n: 'Bike', k: 'cardio', sets: 1, lv: 1, target: '5 min easy', lo: 5, hi: 6 },\n    { n: 'Glute bridges', k: 'reps', sets: 2, target: '2 x 15', lo: 14, hi: 15 },\n    { n: 'Banded lateral walks', k: 'reps', sets: 2, target: '2 x 12 each way', side: 1, lo: 12, hi: 12, how: 'Mini band just above the knees. Stay low in a quarter squat, toes forward, small steps. Don’t let the feet touch.' },\n    { h: 'Strength' },\n    { n: 'Hip thrust', k: 'lift', sets: 4, target: '4 x 8-12', top: 12, how: 'Upper back on the bench edge, bar (with the pad) in the hip crease. Chin tucked, ribs down. Drive through the heels, squeeze at the top for a second, lower slow.' },\n    { n: 'Goblet squat', k: 'lift', sets: 3, target: '3 x 8-12', top: 12, how: 'Hold the dumbbell at your chest, elbows in. Sit back between your heels, chest up, and push the floor away.' },\n    { n: 'Romanian deadlift', k: 'lift', sets: 3, target: '3 x 8-10', top: 10, how: 'Soft knees, push your hips back until you feel the hamstrings, then stand tall. Dumbbells stay close to your legs.' },\n    { n: 'Walking lunges', k: 'lift', sets: 3, target: '3 x 10 each leg', top: 10, side: 1, how: 'Dumbbells at your sides. Long step, back knee almost to the floor, lean a little forward to keep it in the glutes.' },\n    { n: 'Cable kickbacks', k: 'lift', sets: 3, target: '3 x 12-15 each leg', top: 15, side: 1, m: 'cable-stack' },\n    { h: 'Core' },\n    { n: 'Dead bug', k: 'reps', sets: 3, target: '3 x 10 each side', side: 1, lo: 8, hi: 10 },\n    { n: 'Side plank', k: 'time', sets: 2, target: '2 x 30-45 sec each side', side: 1, lo: 30, hi: 45 }] },\n  n2pilates: { n: 'Pilates mat', about: 'The 45-minute class video from the studio, then Juniper’s long loop.', ex: [\n    { n: 'The hundred', k: 'tick', sets: 1, target: '100 pumps' },\n    { n: 'Roll-ups', k: 'reps', sets: 2, target: '2 x 8', lo: 6, hi: 8 },\n    { n: 'Single leg stretch', k: 'reps', sets: 2, target: '2 x 10 each side', side: 1, lo: 10, hi: 10 },\n    { n: 'Criss-cross', k: 'reps', sets: 2, target: '2 x 10 each side', side: 1, lo: 8, hi: 10 },\n    { n: 'Side-lying leg series', k: 'tick', sets: 1, target: 'Front/back, up/down, circles, 10 each' },\n    { n: 'Plank', k: 'time', sets: 3, target: '3 x 40-60 sec', lo: 35, hi: 60 },\n    { n: 'Swan', k: 'tick', sets: 1, target: '5 slow ones' },\n    { n: 'Walk Juniper (the long loop)', k: 'cardio', sets: 1, target: '30-45 min', lo: 30, hi: 48 }] },\n  n3upper: { n: 'Upper body + walk', about: 'Back, shoulders, arms, then the treadmill. Back is the priority (posture from sewing all day).', ex: [\n    { h: 'Warm-up' },\n    { n: 'Band pull-aparts', k: 'reps', sets: 2, target: '2 x 15', lo: 15, hi: 15 },\n    { h: 'Strength' },\n    { n: 'Lat pulldown', k: 'lift', sets: 3, target: '3 x 10-12', top: 12, how: 'Lean back a little, pull the bar to the top of your chest. Think elbows down into your back pockets.' },\n    { n: 'Seated cable row', k: 'lift', sets: 3, target: '3 x 10-12', top: 12, m: 'cable-stack' },\n    { n: 'Dumbbell shoulder press', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n    { n: 'Incline dumbbell press', k: 'lift', sets: 3, target: '3 x 8-10', top: 10 },\n    { n: 'Cable face pulls', k: 'lift', sets: 2, target: '2 x 15', top: 15, m: 'cable-stack', how: 'Rope at forehead height. Pull toward your eyes, elbows high, squeeze between the shoulder blades.' },\n    { n: 'Dumbbell curls', k: 'lift', sets: 2, target: '2 x 10-12', top: 12 },\n    { n: 'Rope triceps pushdown', k: 'lift', sets: 2, target: '2 x 10-12', top: 12, m: 'cable-stack' },\n    { h: 'Cardio' },\n    { n: 'Incline walk', k: 'cardio', sets: 1, lv: 1, target: '20 min, incline 6-8', lo: 18, hi: 25 }] },\n  n4lowerB: { n: 'Lower B: legs', about: 'Machines day. Quads and hamstrings, glutes again at the end.', ex: [\n    { h: 'Warm-up' },\n    { n: 'Bike', k: 'cardio', sets: 1, lv: 1, target: '5 min easy', lo: 5, hi: 6 },\n    { n: 'Glute bridges', k: 'reps', sets: 2, target: '2 x 15', lo: 14, hi: 15 },\n    { h: 'Strength' },\n    { n: 'Leg press', k: 'lift', sets: 3, target: '3 x 10-12', top: 12, how: 'Feet high and hip width on the plate. Lower until your knees are near your chest without the low back lifting, then press through the heels.' },\n    { n: 'Bulgarian split squat', k: 'lift', sets: 3, target: '3 x 8 each leg', top: 8, side: 1, how: 'Back foot laces-down on the bench. Most of the weight on the front heel; go straight down, not forward.' },\n    { n: 'Seated leg curl', k: 'lift', sets: 3, target: '3 x 10-12', top: 12 },\n    { n: 'Step-ups', k: 'lift', sets: 3, target: '3 x 10 each leg', top: 10, side: 1 },\n    { n: 'Hip abduction', k: 'lift', sets: 3, target: '3 x 12-15', top: 15 },\n    { n: 'Calf raises', k: 'lift', sets: 3, target: '3 x 12-15', top: 15 },\n    { h: 'Cooldown' },\n    { n: 'Pigeon stretch', k: 'tick', sets: 1, target: '1 min each side' },\n    { n: 'Couch stretch', k: 'tick', sets: 1, target: '1 min each side' }] },\n  n5hike: { n: 'Saturday hike', about: 'Somewhere with Juniper. Anything over an hour counts.', ex: [\n    { n: 'Hike', k: 'cardio', sets: 1, target: '1-3 hours', lo: 60, hi: 150 },\n    { n: 'Stretch after', k: 'tick', sets: 1, target: 'Calves, hips, hamstrings' }] },\n  n6mobility: { n: 'Mobility + core at home', about: 'For a sore day, a busy day or a hotel room. 25 minutes on the living room rug.', ex: [\n    { n: 'Cat-cow', k: 'tick', sets: 1, target: '10 slow ones' },\n    { n: '90/90 hip switches', k: 'reps', sets: 2, target: '2 x 8 each side', side: 1, lo: 8, hi: 8 },\n    { n: 'Bird dog', k: 'reps', sets: 2, target: '2 x 10 each side', side: 1, lo: 10, hi: 10 },\n    { n: 'Dead bug', k: 'reps', sets: 3, target: '3 x 10 each side', side: 1, lo: 8, hi: 10 },\n    { n: 'Side plank', k: 'time', sets: 2, target: '2 x 30-45 sec each side', side: 1, lo: 30, hi: 45 },\n    { n: 'Glute bridges', k: 'reps', sets: 2, target: '2 x 15', lo: 15, hi: 15 },\n    { n: 'Pigeon stretch', k: 'tick', sets: 1, target: '1 min each side' }] }\n};\nvar DAYS = { '1': 'n1lowerA', '2': 'n2pilates', '3': 'n3upper', '5': 'n4lowerB', '6': 'n5hike' };\nvar RULES = 'Warm up 5 minutes on the bike first.\\nRest about 90 seconds between sets, 2 minutes on hip thrusts.\\nGo up when every set hits the top of the range: 10 lb on hip thrusts and the leg press, 5 lb on everything else.\\nStop any set where my lower back complains.\\nWater bottle, and eat something by 8:30.';\n// first weight and how much it goes up\nvar START = { 'hip-thrust': [95, 10], 'goblet-squat': [25, 5], 'romanian-deadlift': [25, 5], 'walking-lunges': [10, 2.5], 'cable-kickbacks': [10, 2.5],\n  'lat-pulldown': [50, 5], 'seated-cable-row': [45, 5], 'dumbbell-shoulder-press': [10, 2.5], 'incline-dumbbell-press': [15, 2.5], 'cable-face-pulls': [17.5, 2.5],\n  'dumbbell-curls': [10, 2.5], 'rope-triceps-pushdown': [20, 2.5], 'leg-press': [90, 10], 'bulgarian-split-squat': [10, 2.5], 'seated-leg-curl': [45, 5],\n  'step-ups': [10, 2.5], 'hip-abduction': [70, 10], 'calf-raises': [90, 10] };\nvar SLOW = { 'dumbbell-curls': 1, 'rope-triceps-pushdown': 1, 'cable-face-pulls': 1, 'dumbbell-shoulder-press': 1, 'walking-lunges': 1, 'step-ups': 1, 'bulgarian-split-squat': 1, 'incline-dumbbell-press': 1 };\nvar MAIN = { 'hip-thrust': 'hip thrusts', 'goblet-squat': 'goblet squats', 'romanian-deadlift': 'RDLs', 'leg-press': 'the leg press', 'lat-pulldown': 'the pulldown', 'dumbbell-shoulder-press': 'shoulder press', 'bulgarian-split-squat': 'split squats' };\nvar SETUP = { 'hip-thrust': 'Bench by the squat rack, pad from the bin. Bar on the yellow pins to roll under.', 'leg-press': 'Seat on 5, feet high and hip width',\n  'lat-pulldown': 'Thigh pad on 3, wide grip bar', 'cable-stack': 'Cable stack by the window: pin on the 2nd hole for face pulls, bottom for kickbacks (ankle strap in the bin)',\n  'seated-leg-curl': 'Back pad on 3, leg pad on 2, ankle pad just above the heel', 'hip-abduction': 'Seat forward 2, lean forward for the last set',\n  'calf-raises': 'Standing calf machine, shoulder pads on 4', 'incline-dumbbell-press': 'Bench on the 3rd notch' };\n\n// days off the usual: trips, a cold, the holidays (relative to today), deload week\nvar OFF = {}, mark = function (a, b, why) { for (var n = a; n <= b; n++) OFF[n] = why; };\nmark(-153, -146, 'trip');             // Savannah\nmark(-33, -31, 'trip');               // the wedding weekend\nmark(-12, -11, 'work');               // Riverside Makers Market\nmark(-214, -209, 'sick');             // a cold\nmark(-271, -267, 'sick');             // a stomach bug\n(function () { var y = T0.getFullYear() - (T0.getMonth() >= 11 ? 0 : 1); var a = Math.round((new Date(y, 11, 23) - T0) / 864e5); mark(a, a + 4, 'holiday'); })();\nvar DELOAD = [-116, -110];            // a week of lighter weights after the spring push\n\nvar NOTES = ['Squats felt strong. Left hip a little tight on the RDLs.', 'Gym was packed, did the rows on the dumbbell bench instead.', 'Slept badly, kept everything the same.',\n  'Lunges are still the worst. Going slower helped.', 'Felt it in my knees on the step-ups, lower box next time.', 'Juniper pulled the whole loop, extra workout.',\n  'Forgot my bands, did bridges with a plate instead.', 'Great one. Music was perfect.', 'Rushed it before a pickup, skipped the last set of curls.',\n  'Shoulders sore from basting a quilt all weekend. Went light on the press.', 'Kickbacks: left side noticeably weaker, start with the left.', 'Treadmill was taken, did 20 on the bike.',\n  'Pilates video with Ben for once. He did not love the hundred.', 'Hip thrust pad was missing, used a folded towel. Not great.', 'Period week, everything felt heavy. Showed up anyway.',\n  'Lower back fine today. The bracing cue is working.', 'Tried the new incline bench, 3rd notch is better than 4th.', 'Short on time, did the strength part only.',\n  'Felt really good. Could have gone up on the leg press.', 'Rained, so the dog walk was in the garage. Did the plank sets twice.', 'Rows: pause at the chest, much harder.',\n  'Crowded at 9, try 10:30 on Fridays.', 'Calves cramped on the last set. More water.', 'Pulldown felt easy, form check with the mirror: fine.',\n  'Ben spotted me on hip thrusts, finally got the setup right.', 'Hands were tired from cutting fabric all morning.',\n  'New shoes. Much better on the incline walk.', 'Knee felt fine on the split squats for the first time in weeks.'];\nvar HIKES = ['Bent Creek, the Explorer loop', 'Graveyard Fields with Juniper, wet and muddy', 'Max Patch at sunrise with Ben', 'Craggy Gardens, windy up top',\n  'Lake Powhatan loop, easy one', 'Black Balsam Knob, clear day, could see forever', 'Catawba Falls, crowded but worth it', 'Mount Pisgah, steep the whole way',\n  'Carl Sandburg home trails with Priya', 'Looking Glass Rock, legs were dead after', 'DuPont, Triple Falls and High Falls', 'Rattlesnake Lodge trail, quiet',\n  'Arboretum loops, short day', 'Hard Times trail with Juniper', 'Sam Knob, cold at the top', 'Beaver Lake walk only, rainy'];\nvar DELN = 'Deload week: everything about 80%, easy reps. Felt good to back off.';\n\nvar m = {}, st = {}, best = {}, lastHike = 0;\nvar mon = function (n) { var k = 'm-' + dk(n).slice(0, 7); return m[k] || (m[k] = { l: {}, d: {}, w: {} }); };\nvar SW = {};\n// swaps: a missed Friday done Saturday instead of the hike, sore days as mobility, a Thursday make-up, a rest on a busy Monday\n[-341, -298, -244, -187, -131, -73, -40, -19].forEach(function (n) { var x = n; while (day(x).getDay() !== 6) x++; SW[x] = 'n4lowerB'; SW[x - 1] = '-'; });\n[-322, -260, -203, -158, -88, -54].forEach(function (n) { var x = n; while (day(x).getDay() !== 1) x++; SW[x] = 'n6mobility'; });\n[-305, -235, -175, -96, -26].forEach(function (n) { var x = n; while (day(x).getDay() !== 4) x++; SW[x] = 'n3upper'; SW[x - 1] = '-'; });\n[-280, -122, -61].forEach(function (n) { var x = n; while (day(x).getDay() !== 2) x++; SW[x] = '-'; });\n(function () { var x = 0; while (day(x).getDay() !== 3) x--; x -= 21; SW[x] = '-'; })();   // the Wednesday before the wedding weekend (Ben's block had it too)\n\nvar rounds = function (w, inc) { return Math.round(w / inc) * inc; };\nvar notesAt = {};\nfor (var n = FROM; n <= 0; n++) {\n  var dow = String(day(n).getDay()), planned = DAYS[dow] || '', sw = SW[n], id = sw !== undefined ? sw : planned;\n  if (OFF[n] && planned && sw === undefined) { if (OFF[n] !== 'holiday' && wc(0.5)) { mon(n).w[dk(n)] = { t: at(n, 7, 30), v: '-' }; } continue; }\n  if (sw !== undefined) mon(n).w[dk(n)] = { t: at(n - (wc(0.5) ? 1 : 0), 7, wi(0, 50)), v: sw };\n  if (!id || id === '-' || !S[id]) continue;\n  if (n < 0 && sw === undefined && wc(id === 'n5hike' ? 0.22 : 0.09)) continue;     // a day missed\n  var deload = n >= DELOAD[0] && n <= DELOAD[1];\n  var M = mon(n), D = M.l[dk(n)] = {}, hr = id === 'n5hike' ? wi(8, 10) : wi(8, 10), t0 = at(n, hr, wi(0, 40));\n  var ex = S[id].ex.filter(function (e) { return !e.h; }), upto = n === 0 ? Math.min(4, ex.length) : ex.length;\n  if (n < 0 && id !== 'n5hike' && wc(0.04)) upto = ex.length - wi(1, 2);                // cut short, never marked done\n  var news = [];\n  ex.slice(0, upto).forEach(function (e, i) {\n    var k = slug(e.n), sets = [], t = t0 + i * 5 * 60000;\n    if (e.k === 'lift') {\n      var low = e.top - (e.top >= 15 ? 3 : e.top <= 8 ? 2 : 2), inc = START[k][1];\n      var p = st[k] || (st[k] = { w: START[k][0], r: low });\n      if (deload) {\n        var dw = rounds(p.w * 0.8, inc);\n        for (var j = 0; j < e.sets; j++) sets.push({ w: String(dw), r: String(low) });\n      } else {\n        var all = p.r >= e.top;\n        for (var j2 = 0; j2 < e.sets; j2++) sets.push({ w: String(p.w), r: String(all ? e.top : Math.max(low - 2, p.r - (j2 > 0 && wc(0.4) ? 1 : 0) - (j2 > 1 && wc(0.3) ? 1 : 0))) });\n        if (k in MAIN && n > FROM + 28 && (best[k] || 0) < p.w && best[k]) news.push(MAIN[k] + ' at ' + p.w + ' lb for ' + sets.map(function (x) { return x.r; }).join(', '));\n        best[k] = Math.max(best[k] || 0, p.w);\n        if (all) { p.w += inc; p.r = low; }\n        else if (wc(k === 'hip-thrust' || k === 'leg-press' ? 0.4 : SLOW[k] ? 0.15 : 0.32) || (p.s || 0) >= (SLOW[k] ? 5 : 3)) { p.r = Math.min(e.top, p.r + 1); p.s = 0; }\n        else p.s = (p.s || 0) + 1;\n      }\n    } else if (e.k === 'reps') { for (var j3 = 0; j3 < e.sets; j3++) sets.push({ w: '', r: String(wi(e.lo, e.hi)) }); }\n    else if (e.k === 'time') {\n      var grow = Math.round((n - FROM) / 365 * 15);   // planks get longer over the year\n      for (var j4 = 0; j4 < e.sets; j4++) sets.push({ w: '', r: String(Math.min(e.hi + 15, wi(e.lo, e.hi - 10) + grow)) });\n    }\n    else if (e.k === 'cardio') sets.push({ w: e.lv ? String(id === 'n3upper' ? wi(6, 8) : wi(4, 6)) : '', r: String(e.n === 'Hike' ? 5 * wi(e.lo / 5, e.hi / 5) : wi(e.lo, e.hi)) });\n    else sets.push({ w: '', r: 'done' });\n    D[k] = { t: t, s: sets };\n  });\n  var note = '';\n  if (deload && id !== 'n5hike' && id !== 'n2pilates') note = DELN;\n  else if (news.length && wc(0.55)) note = 'New best: ' + news[0] + '.' + (news[1] ? ' And ' + news[1] + '.' : '');\n  else if (id === 'n5hike' && wc(0.75)) note = HIKES[lastHike++ % HIKES.length] + '.';\n  else if (wc(0.14)) note = wp(NOTES);\n  if (n === 0) note = '';\n  if (note) D._n = { t: t0 + 60 * 60000, x: note };\n  if (upto === ex.length) M.d[dk(n)] = t0 + 62 * 60000;\n}\n// the next gym day ahead: its first lift hit the top on every set last time, so it says \"go up a little next time\"\nfor (var a = 1; a <= 7; a++) {\n  var nid = DAYS[String(day(a).getDay())]; if (!nid || !S[nid]) continue;\n  var e0 = S[nid].ex.filter(function (e) { return e.k === 'lift'; })[0]; if (!e0) continue;\n  var k0 = slug(e0.n), last = null;\n  Object.keys(m).sort().forEach(function (mk) { Object.keys(m[mk].l).sort().forEach(function (dd) { if (m[mk].l[dd][k0]) last = m[mk].l[dd][k0]; }); });\n  if (last) last.s.forEach(function (x) { x.r = String(e0.top); });\n  break;\n}\nvar sess = {};\nObject.keys(S).forEach(function (id, i) { sess[id] = Object.assign({ t: PLAN_T + i * 60000 }, S[id]); });\nsess.n2pilates.t = at(-140, 21);   // changed since: the long loop added after the walk\nsess.n3upper.t = at(-60, 20);      // curls and pushdowns added\nvar setup = {}; Object.keys(SETUP).forEach(function (k, i) { setup[k] = { t: at(FROM + 3 + i * 9, 10), x: SETUP[k] }; });\nput('dbkPrivate_workout_demo_person1', { plan: { sess: sess, gone: {}, days: { t: PLAN_T, v: DAYS }, unit: { t: PLAN_T, v: 'lb' }, rules: { t: at(-200, 21), v: RULES } }, s: setup, m: m, dirty: [] });\n\n// --- dinner reminders (meal-notes.js keeps a week back): a few more for each, the past week ticked off and the next two days\n(function () {\n  var sched = {}; try { sched = JSON.parse(out.mealplan_schedule || '{}') || {}; } catch (e) {}\n  var dish = function (n, p) { var x = sched[dk(n)]; x = x && x[p] && x[p].dinner; return x && x.name && !/^typed_/.test(x.id || '') && !/takeout|\\bat\\b|pizza night|eating out/i.test(x.name) ? x.name : ''; };\n  var meat = function (d) { var m = /chicken|salmon|turkey|beef|pork|shrimp|steak|sausage/i.exec(d); return m ? m[0].toLowerCase() : ''; };\n  var TXT = {\n    thaw: function (d) { return meat(d) ? 'Take the ' + meat(d) + ' out to thaw' : ''; },\n    store: function () { return 'Stop at the store'; },\n    slow: function (d) { return /crock|slow|chili/i.test(d) ? 'Start the slow cooker' : 'Prep the veggies after lunch'; },\n    marinate: function (d) { return meat(d) ? 'Marinate the ' + meat(d) + ' tonight' : ''; },\n    rice: function (d) { return /rice|bowl|teriyaki|curry|stir/i.test(d) ? 'Start the rice before Nora gets home' : 'Preheat the oven before Nora gets home'; }\n  };\n  var add = function (k, list) {\n    var l = []; try { l = JSON.parse(out[k] || '[]') || []; } catch (e) {}\n    var have = {}; l.forEach(function (x) { have[x.id] = 1; });\n    list.forEach(function (x, i) {\n      var id = 'mn_wo_' + k.slice(-1) + i; if (have[id]) return;\n      var d = x[2] === 'free' ? '' : dish(x[1], k.slice(-7)), text = x[2] === 'free' ? x[4] : (d ? TXT[x[2]](d) : '');\n      if (!text) return;\n      l.push({ id: id, day: dk(x[0]), text: text, dish: d, time: x[3], done: x[0] < 0, at: at(x[0] < 0 ? x[0] : -1, x[0] < 0 ? 18 : 21, 10) });\n    });\n    put(k, l);\n  };\n  // [reminder's day, dinner's day, kind, time, text for a free one]\n  add('dbkMealNotes_person1', [[-6, -5, 'thaw', '20:00'], [-5, -5, 'store', '16:30'], [-4, -4, 'slow', '12:30'], [-3, -3, 'free', '17:00', 'Pick up tortillas and limes at Ingles'],\n    [-2, -1, 'free', '21:00', 'Soak the black beans overnight'], [1, 2, 'thaw', '19:30'], [2, 2, 'store', '16:00']]);\n  add('dbkMealNotes_person2', [[-5, -4, 'marinate', '20:30'], [-3, -3, 'rice', '17:30'], [1, 1, 'rice', '17:30']]);\n})();\n\n  })();\n\n  // ---------- today.js ----------\n  (function () {\n    // ---------- sample: Today and Habits, a household about 2.5 years in (Nov 2, \"today\" helper) ----------\n    // Nora's habit resources, Back Burner and Inbox; her habits back a full year; the monthly challenge counting from\n    // about 2.5 years ago; a year of the household's calendar and three months ahead; many more reminders; a few more\n    // Recently removed entries. Its own seeded numbers (r3), so nothing else's numbers change.\n    var s3 = 90417;\n    function r3() { s3 |= 0; s3 = s3 + 0x6D2B79F5 | 0; var t = Math.imul(s3 ^ s3 >>> 15, 1 | s3); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n    var c3 = function (p) { return r3() < p; }, p3 = function (a) { return a[Math.floor(r3() * a.length)]; };\n    var get = function (k) { try { return JSON.parse(out[k]); } catch (e) { return null; } };\n    var DAY = 864e5;\n    function offOf(d) { var x = new Date(d); x.setHours(0, 0, 0, 0); return Math.round((x - T0) / DAY); }\n    // the day offsets of a month/day inside [lo, hi]\n    function mdOffs(m, d, lo, hi) { var o = []; for (var y = T0.getFullYear() - 1; y <= T0.getFullYear() + 1; y++) { var n = offOf(new Date(y, m - 1, Math.min(d, daysIn(y, m - 1)))); if (n >= lo && n <= hi) o.push(n); } return o; }\n    function lastOn(m, d) { return mdOffs(m, d, -365, 0)[0]; }\n    function nextOn(m, d) { return mdOffs(m, d, 1, 366)[0]; }\n    function thanks(y) { var d = new Date(y, 10, 1); while (d.getDay() !== 4) d.setDate(d.getDate() + 1); d.setDate(d.getDate() + 21); return offOf(d); }\n    var TGs = [thanks(T0.getFullYear() - 1), thanks(T0.getFullYear())];\n    var TGpast = TGs[1] <= 0 ? TGs[1] : TGs[0], TGnext = TGs[1] > 0 ? TGs[1] : thanks(T0.getFullYear() + 1);\n    var XMpast = lastOn(12, 25), XMnext = nextOn(12, 25);\n    function sat(n) { while (day(n).getDay() !== 6) n++; return n; }\n    function satBefore(n) { while (day(n).getDay() !== 6) n--; return n; }\n\n    // ---------- 1. Nora's habit resources (her favourite videos, meditations, talks, podcasts) ----------\n    var YT = function (q) { return 'https://www.youtube.com/results?search_query=' + q.replace(/ /g, '+'); };\n    var R = function (title, link, note) { return { title: title, link: link || null, note: note || null }; };\n    put('resources_person1', {\n      'Yoga': [\n        R('Yoga With Adriene', 'https://www.youtube.com/@yogawithadriene', 'Start here on any day. Benji cameos make everything better'),\n        R('Yoga for lower back pain (Adriene)', YT('yoga with adriene yoga for lower back pain'), 'The one after a long day at the machine'),\n        R('Morning yoga, 20 minutes', YT('yoga with adriene morning yoga 20 minutes'), null),\n        R('Yoga with Kassandra: yin for hips', YT('yoga with kassandra yin yoga hips'), 'Slow and sleepy, good on Sunday nights'),\n        R('Bedtime yoga for tired shoulders', YT('bedtime yoga shoulders neck'), null),\n        R('Wednesday class at West Asheville Yoga', 'https://www.westashevilleyoga.com', 'The 6 pm flow with Dana is the one'),\n        R('Adriene’s 30 Days of Yoga (January)', YT('yoga with adriene 30 day journey'), 'Did all 30 last January. Try again this year')\n      ],\n      'Pilates': [\n        R('Move With Nicole', YT('move with nicole pilates'), 'My Wednesday mat class when I can’t get to the studio'),\n        R('45 minute full body mat pilates', YT('move with nicole 45 minute full body pilates'), 'The one my workout plan is built around'),\n        R('Blogilates', 'https://www.youtube.com/@blogilates', 'Fun but she talks fast'),\n        R('Pilates for beginners (Jessica Valant)', YT('jessica valant pilates for beginners'), 'Gentle on the back, good form cues'),\n        R('Lottie Murphy: 15 minute core', YT('lottie murphy pilates 15 minute core'), null),\n        R('Wall pilates, 20 minutes', YT('wall pilates 20 minute workout'), 'Tried it. Fine. Not a favourite')\n      ],\n      'Strength': [\n        R('Caroline Girvan', 'https://www.youtube.com/@CarolineGirvan', 'No talking, just work. The EPIC programs are hard'),\n        R('Caroline Girvan: dumbbell lower body', YT('caroline girvan dumbbell legs and glutes'), 'Use the 20s for squats now'),\n        R('Heather Robertson: full body dumbbell', YT('heather robertson full body dumbbell workout'), null),\n        R('Sydney Cummings: 30 minute strength', YT('sydney cummings 30 minute strength'), 'Upbeat, good when I’m dragging'),\n        R('Jeff Nippard on glute training', YT('jeff nippard glute training science'), 'Ben sent this one. Nerdy but useful'),\n        R('How to do a Romanian deadlift', YT('how to do a romanian deadlift dumbbell form'), 'Hips back, soft knees, bar close')\n      ],\n      'Walking workouts': [\n        R('Walk at Home (Leslie Sansone)', YT('walk at home leslie sansone 2 mile'), 'Rainy days with Juniper looking at me sadly'),\n        R('Grow with Jo: walking workout', YT('grow with jo walking workout'), 'Silly, gets me sweaty'),\n        R('Incline treadmill walk, 30 minutes', YT('30 minute incline treadmill walk workout'), null),\n        R('Asheville Greenways map', 'https://www.ashevillenc.gov/department/parks-recreation/greenways/', 'Reed Creek and the French Broad River greenway for long walks'),\n        R('Bent Creek trails', 'https://www.fs.usda.gov/recarea/nfsnc/recarea/?recid=48112', 'Weekend loop with Juniper, about 4 miles')\n      ],\n      'Meditations': [\n        R('Headspace', 'https://www.headspace.com', 'The 10 minute Basics, still'),\n        R('Tara Brach guided meditations', 'https://www.tarabrach.com/guided-meditations/', 'The RAIN one when I’m spiraling'),\n        R('Insight Timer', 'https://insighttimer.com', 'Free. The body scans are lovely'),\n        R('Body scan, 20 minutes (Jon Kabat-Zinn)', YT('jon kabat zinn body scan meditation'), null),\n        R('5 minute breathing for anxiety', YT('5 minute breathing meditation anxiety'), 'Before markets and big calls'),\n        R('Loving-kindness meditation', YT('loving kindness meditation guided 10 minutes'), 'Ben makes fun of it. Works anyway')\n      ],\n      'Sleep': [\n        R('Sleep hygiene basics', 'https://www.sleepfoundation.org/sleep-hygiene', 'Cool room, same wake-up time'),\n        R('Nothing Much Happens (podcast)', 'https://www.nothingmuchhappens.com', 'Asleep before the second telling every time'),\n        R('Calm sleep stories', 'https://www.calm.com/sleep', 'The train one'),\n        R('Get Sleepy (podcast)', 'https://www.getsleepy.com', null),\n        R('Sleep is your superpower (Matt Walker)', 'https://www.ted.com/talks/matt_walker_sleep_is_your_superpower', 'Why I’m strict about 10:30 now'),\n        R('Wind-down playlist', null, 'The one on the kitchen speaker'),\n        R('Rain sounds, 10 hours', YT('rain on a tin roof 10 hours'), 'When the neighbors have a party')\n      ],\n      'Talks that get me going': [\n        R('Your elusive creative genius (Elizabeth Gilbert)', 'https://www.ted.com/talks/elizabeth_gilbert_your_elusive_creative_genius', 'Rewatch when the shop feels like a slog'),\n        R('The power of vulnerability (Brené Brown)', 'https://www.ted.com/talks/brene_brown_the_power_of_vulnerability', null),\n        R('Try something new for 30 days (Matt Cutts)', 'https://www.ted.com/talks/matt_cutts_try_something_new_for_30_days', 'Three minutes. The whole habits idea'),\n        R('The happy secret to better work (Shawn Achor)', 'https://www.ted.com/talks/shawn_achor_the_happy_secret_to_better_work', null),\n        R('Inside the mind of a master procrastinator', 'https://www.ted.com/talks/tim_urban_inside_the_mind_of_a_master_procrastinator', 'The panic monster. So me'),\n        R('Mel Robbins: the 5 second rule', YT('mel robbins 5 second rule'), 'For mornings when I can’t get up'),\n        R('The brain-changing benefits of exercise (Wendy Suzuki)', 'https://www.ted.com/talks/wendy_suzuki_the_brain_changing_benefits_of_exercise', null)\n      ],\n      'Podcasts': [\n        R('We Can Do Hard Things', 'https://momastery.com/podcast/', 'On the long drives to markets'),\n        R('Happier with Gretchen Rubin', 'https://gretchenrubin.com/podcasts/', 'Little ideas I actually try'),\n        R('Ten Percent Happier', 'https://www.tenpercent.com/podcast', null),\n        R('The Mel Robbins Podcast', 'https://www.melrobbins.com/podcast', 'The one about letting them'),\n        R('Hidden Brain', 'https://hiddenbrain.org', 'Ben and I listen together on trips'),\n        R('Making It (Jimmy Diresta, Bob Clagett, David Picciuto)', 'https://www.makingitpodcast.com', 'Makers talking business')\n      ],\n      'Sewing & creative': [\n        R('Missouri Star Quilt Co.', YT('missouri star quilt company tutorial'), 'Jenny’s tutorials. Comfort viewing'),\n        R('Binding by machine', 'https://www.youtube.com/results?search_query=machine+quilt+binding', null),\n        R('Quarter-inch seam tips', null, 'Ask Marie at Mill Supply'),\n        R('Three pages, longhand (The Artist’s Way)', null, 'Doesn’t have to be good'),\n        R('Free-motion quilting for beginners', YT('free motion quilting for beginners'), 'Practice sandwich in the drawer'),\n        R('Big Magic (book)', null, 'Elizabeth Gilbert. Reread every winter'),\n        R('Studio playlist: Folk & Friends', null, 'Spotify. Watchhouse, Gregory Alan Isakov, the Milk Carton Kids')\n      ],\n      'Apps I use': [\n        R('Strava', 'https://www.strava.com', 'Walks with Juniper. Ben gives kudos'),\n        R('Libby', 'https://libbyapp.com', 'Buncombe County library card, audiobooks for sewing'),\n        R('Insight Timer', 'https://insighttimer.com', null),\n        R('AllTrails', 'https://www.alltrails.com', 'Checks which trails allow dogs')\n      ]\n    });\n\n    // ---------- 2. Nora's Back Burner (newest first, as the page adds them) ----------\n    function bb(text, n, done) { var t = day(n); t.setHours(19 + (Math.abs(n) % 4), (Math.abs(n) * 7) % 60, 0, 0); return { id: t.getTime() + 13, text: text, completed: !!done, createdAt: t.toISOString() }; }\n    var BB1 = [\n      ['Repaint the studio door', -120], ['Try the scrappy star pattern', -88], ['Start a shop newsletter', -60], ['Sort the fabric scraps bin', -41, true], ['Frame the Savannah photos', -15],\n      ['Apply to the Southern Highland Craft Guild', -312], ['Make a memory quilt from Grandma Ruth’s aprons', -298], ['Learn to make pie crust from scratch', -281],\n      ['Get our wills done', -266], ['Order business cards with the new logo', -251, true], ['Plant a pollinator bed by the mailbox', -233], ['Weekend in Charleston, just us', -219],\n      ['Look into a SEP IRA for shop income', -204], ['Write up the quilt-as-you-go pattern as a PDF', -188], ['Teach a beginner quilting workshop', -171],\n      ['Clean out the chest freezer', -160, true], ['Photograph every quilt for the website', -143], ['See the synchronous fireflies at Elkmont (lottery opens in April)', -131],\n      ['Get the piano tuned', -112], ['Hike Max Patch at sunrise', -97], ['Dye fabric with black walnuts', -79], ['Build up the emergency fund to six months', -66],\n      ['Repot the fiddle leaf fig', -51], ['Pottery class with Lena', -37], ['Read more fiction, less phone', -24, true], ['A quilt ladder for the market booth', -11], ['Declutter the hall closet', -4]\n    ];\n    put('futureTodos_person1', BB1.sort(function (a, b) { return b[1] - a[1]; }).map(function (x) { return bb(x[0], x[1], x[2]); }));\n\n    // ---------- 3. Nora's Inbox (unsorted notes from the last two weeks, newest first as captured) ----------\n    var inb1 = get('capturedThoughts_person1') || [];\n    [['haircut with Mel next thurs 2pm', 60 * 24 * 3 + 40], ['renew the Costco membership', 60 * 24 * 5], ['Buxton Hall bbq with Jess', 60 * 24 * 6 + 200],\n      ['read Remarkably Bright Creatures', 60 * 24 * 8], ['cumin, limes, cilantro, sour cream', 60 * 24 * 1 + 90], ['weekend in Charleston in the spring', 60 * 24 * 10],\n      ['Sky Top Orchard before the apples are gone', 60 * 24 * 12], ['someday learn to free-motion quilt feathers', 60 * 24 * 13 + 300], ['Ben wants a pizza steel for Christmas', 60 * 24 * 4 + 500]\n    ].forEach(function (a) { var t = Date.now() - a[1] * 60000; inb1.push({ id: t, text: a[0], tag: null, createdAt: new Date(t).toISOString() }); });\n    inb1.sort(function (a, b) { return b.id - a.id; });\n    put('capturedThoughts_person1', inb1);\n\n    // ---------- 5. Nora's habits, back a full year (the app keeps one) ----------\n    (function () {\n      var list = get('person1CustomHabits') || [], log = get('habitLog_person1') || {}, card = get('habitCard_person1') || {}, L = lines(list.length);\n      var sh = function (a) { a = a.slice(); for (var i = a.length - 1; i > 0; i--) { var j = Math.floor(r3() * (i + 1)); var t = a[i]; a[i] = a[j]; a[j] = t; } return a; };\n      // where each habit stood across the year (by days back): January's fresh start, a summer slump, then the levels the\n      // last three months start from\n      var base = { 'Morning pages': [0.55, 0.72, 0.35, 0.25], 'Walk Juniper': [0.85, 0.9, 0.88, 0.92], 'Drink 8 glasses of water': [0.4, 0.65, 0.5, 0.55],\n        'Stretch 10 minutes': [0.3, 0.6, 0.35, 0.45], 'Read before bed': [0.75, 0.7, 0.6, 0.72], 'No phone first 30 min': [0.45, 0.7, 0.5, 0.5],\n        'Cook dinner at home': [0.7, 0.82, 0.65, 0.78], 'Sew for 30 minutes': [0.85, 0.55, 0.6, 0.62], 'In bed by 10:30': [0.35, 0.6, 0.3, 0.48] };\n      var JAN = lastOn(1, 1), trips = [];\n      [[XMpast - 3, XMpast + 2], [TGpast, TGpast + 2], [-252, -247], [-150, -148], [-107, -100], [-33, -31]].forEach(function (x) { trips.push(x); });\n      var sick = [JAN + 17, JAN + 22];   // a January flu\n      function level(h, n) {\n        var b = base[h] || [0.5, 0.5, 0.5, 0.5];\n        // -364 .. JAN: the first value (holiday season and before); JAN .. JAN+60: the fresh start fading;\n        // JAN+60 .. -150: the summer value; -150 .. -90: easing toward where the last three months start\n        if (n < JAN) return b[0];\n        if (n < JAN + 60) return b[1] + (b[2] - b[1]) * (n - JAN) / 60;\n        if (n < -150) return b[2];\n        return b[2] + (b[3] - b[2]) * (n + 150) / 60;\n      }\n      for (var n = -364; n <= -90; n++) {\n        var k = dk(n); if (log[k]) continue;\n        var away = trips.some(function (t) { return n >= t[0] && n <= t[1]; }), ill = n >= sick[0] && n <= sick[1];\n        if (r3() < (away ? 0.45 : ill ? 0.5 : 0.06)) continue;\n        var d = day(n), wk = d.getDay() === 0 || d.getDay() === 6, done = [];\n        list.forEach(function (h) {\n          var p = level(h, n);\n          if (wk) p *= 0.85;\n          if (away) p *= h === 'Walk Juniper' || h === 'Sew for 30 minutes' || h === 'Cook dinner at home' ? 0.1 : 0.55;\n          if (ill) p *= h === 'Read before bed' || h === 'Drink 8 glasses of water' ? 0.9 : 0.15;\n          if (r3() < p) done.push(h);\n        });\n        log[k] = done;\n        // older days keep only their bingos (every habit fits on her 3x3 card, so each day counts them all)\n        var hb = sh(list), bg = L.filter(function (line) { return line.every(function (ix) { return done.indexOf(hb[ix]) !== -1; }); }).length;\n        card[k] = { b: bg };\n      }\n      var sortKeys = function (m) { var o = {}; Object.keys(m).sort().forEach(function (k2) { o[k2] = m[k2]; }); return o; };\n      put('habitLog_person1', sortKeys(log));\n      put('habitCard_person1', sortKeys(card));\n    })();\n\n    // ---------- 6. the household's age and the monthly challenge ----------\n    (function () {\n      var MONTHS = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n      var st = new Date(T0.getFullYear(), T0.getMonth() - 30, 1);\n      put('couple_start_date', ymd(st));\n      // skipped three times over the years: months 7, 15 and 24 (each skip moves the list on one)\n      var SK = [[24, 26, 'Bring your partner to a place that shaped you before they knew you. Tell the stories that live there and let them see that earlier version of you.'],\n        [15, 16, 'Make your greetings intentional this month. Pause. Make eye contact. Say hello like you mean it. It sounds small, but it\\'s often these transitions that shape the tone of everything that follows.'],\n        [7, 7, 'Take a photo of your partner this month when they don\\'t know you\\'re looking. At the end of the month, show it to them and tell them why that moment caught your eye.']];\n      put('lh_skipped_challenges', SK.map(function (s) { var d = new Date(st.getFullYear(), st.getMonth() + s[0], 1); return { challenge: s[2], index: s[1], monthKey: 'M' + s[0] + '_' + s[1], monthLabel: MONTHS[d.getMonth()] + ' ' + d.getFullYear(), completed: false, notes: '' }; }));\n      put('dreams_monthlyChallenge', { month: 'M30', index: 33, next: 34, completed: false, notes: '' });\n    })();\n\n    // ---------- 7a. the calendar: a year back and three months ahead ----------\n    var evs = get('calendarEvents') || [], tdN = 0, mine = [];\n    function tid() { tdN++; return 'td_' + (1690000000000 + tdN * 104729).toString(36) + tdN; }\n    function E(title, n, time, x) {\n      var e = Object.assign({ id: tid(), title: title, date: dk(n), time: time || null, endTime: null, allDay: !time, note: null, location: null, url: null, color: null,\n        isMultiDay: false, eventGroup: null, repeatMode: 'single', recurring: null }, x || {});\n      evs.push(e); mine.push(e); return e;\n    }\n    function Rg(title, a, b, time, x) { var g = 'g' + tid(); for (var n = a; n <= b; n++) E(title, n, time, Object.assign({ isMultiDay: true, eventGroup: g, repeatMode: 'range', allDay: !time }, x || {})); }\n    function Rep(title, offs, time, freq, x) { var g = 'g' + tid(); offs.forEach(function (n) { E(title, n, time, Object.assign({ isMultiDay: true, eventGroup: g, repeatMode: 'recurring', recurring: { freq: freq, endDate: null } }, x || {})); }); }\n    var busy = {};   // days with a trip, so the long runs skip them\n    function trip(title, a, b, x) { Rg(title, a, b, null, x); for (var n = a; n <= b; n++) busy[n] = 1; }\n\n    // trips and holidays\n    trip('Smoky Mountains cabin', -252, -249, { color: 'teal', location: 'Cabin outside Gatlinburg', note: 'Hot tub, bring Juniper’s bed' });\n    trip('Wrightsville Beach with Ben’s family', -107, -102, { color: 'teal', location: 'The Andersons’ rental, Lumina Ave', note: 'Bring the big cooler and beach chairs' });\n    trip('Thanksgiving in Raleigh', TGpast, TGpast + 2, { color: 'rose', location: 'Mom & Dad’s' });\n    trip('Christmas in Knoxville', XMpast - 2, XMpast + 1, { color: 'rose', location: 'Linda & Rick’s', note: 'Gifts wrapped by the 20th' });\n    trip('Thanksgiving in Raleigh', TGnext, TGnext + 2, { color: 'rose', location: 'Mom & Dad’s', note: 'Nora makes the pies, Ben brings the rolls' });\n    trip('Christmas in Knoxville', XMnext - 2, XMnext + 1, { color: 'rose', location: 'Linda & Rick’s' });\n    E('Turkey Trot 5K (Ben)', TGpast, '08:00', { location: 'Pack Square Park', note: 'Then drive to Raleigh' });\n    E('Turkey Trot 5K (Ben)', TGnext, '08:00', { location: 'Pack Square Park', url: 'https://runsignup.com' });\n    [TGpast, TGnext].forEach(function (t) { E('Friendsgiving at Lena & Marco’s', t - 5, '17:00', { note: 'We’re on mac and cheese and a pie' }); });\n    E('Biltmore Candlelight Christmas Evening', XMpast - 10, '17:30', { location: 'Biltmore Estate', url: 'https://www.biltmore.com' });\n    E('Biltmore Candlelight Christmas Evening', XMnext - 12, '18:00', { location: 'Biltmore Estate', url: 'https://www.biltmore.com', note: 'Tickets in Ben’s email' });\n    E('Ugly sweater party at Sam & Ali’s', XMpast - 7, '19:00');\n    E('Ugly sweater party at Sam & Ali’s', XMnext - 8, '19:00');\n    E('New Year’s Eve at the Parkers’', XMpast + 6, '20:00', { note: 'Bring champagne and the cheese board' });\n    E('Fourth of July cookout at Jess & Mike’s', lastOn(7, 4), '16:00', { note: 'Fireworks from their back deck' });\n    E('Easter brunch at Mom & Dad’s', -214, '11:00');\n    // Ben's running: Saturday long runs with the group, a half marathon in the spring, a fall 10K\n    var HALF = satBefore(-196), TENK = satBefore(-55);\n    E('Asheville Half Marathon (Ben)', HALF, '07:00', { location: 'Pack Square start', color: 'teal', note: 'Goal 1:45. Nora at mile 9 with the sign' });\n    E('Packet pickup', HALF - 1, '16:00', { location: 'Jus’ Running, Haywood St.' });\n    E('Bent Creek 10K trail race (Ben)', TENK, '08:00', { location: 'Bent Creek', color: 'teal' });\n    var runs = []; for (var n = sat(-364); n <= 84; n += 7) if (!busy[n] && n !== HALF && n !== TENK && n !== HALF + 7) runs.push(n);\n    Rep('Long run with the Saturday group (Ben)', runs, '07:00', 'weekly', { location: 'Carrier Park', color: 'teal' });\n    // volunteering: MANNA FoodBank every second Saturday of the month\n    var manna = []; for (var m = -13; m <= 3; m++) { var d1 = new Date(T0.getFullYear(), T0.getMonth() + m, 1); while (d1.getDay() !== 6) d1.setDate(d1.getDate() + 1); d1.setDate(d1.getDate() + 7); var o = offOf(d1); if (o >= -364 && o <= 90 && !busy[o]) manna.push(o); }\n    Rep('Volunteer shift at MANNA FoodBank', manna, '09:00', 'monthly', { endTime: '12:00', location: 'MANNA FoodBank, Swannanoa River Rd', color: 'sage', note: 'Closed-toe shoes' });\n    [-201, -64, 26].forEach(function (n) { E('Brother Wolf adoption event (Nora volunteering)', n, '11:00', { location: 'Brother Wolf Animal Rescue', color: 'sage' }); });\n    // the older part of the book club and date nights (before the series already in the calendar started)\n    var bc = []; var b0 = day(-158); for (var mm = 1; mm <= 7; mm++) { var o2 = offOf(new Date(b0.getFullYear(), b0.getMonth() - mm, Math.min(b0.getDate(), daysIn(b0.getFullYear(), b0.getMonth() - mm)))); if (o2 >= -364 && !busy[o2]) bc.push(o2); }\n    Rep('Book club at Priya’s', bc.sort(function (a, b) { return a - b; }), '19:00', 'monthly', { color: 'lavender', note: 'Bring wine or dessert' });\n    var dn = []; for (var n2 = nextDow(5, -172) - 14; n2 >= -364; n2 -= 14) if (!busy[n2]) dn.push(n2);\n    Rep('Date night', dn.sort(function (a, b) { return a - b; }), '18:30', 'biweekly', { color: 'rose' });\n    Rep('Pottery class with Lena', [-141, -134, -127, -120], '18:30', 'weekly', { location: 'Odyssey ClayWorks', color: 'lavender' });\n\n    // birthdays and anniversaries (yearly, all day)\n    function bday(title, m, d, x) { var o3 = mdOffs(m, d, -364, 120); if (o3.length) Rep(title, o3, null, 'yearly', Object.assign({ allDay: true, color: 'gold' }, x || {})); }\n    var lin = day(42), ali = day(12), ann = day(53);\n    bday('Nora’s birthday', 3, 14); bday('Ben’s birthday', 8, 9); bday('Mom’s birthday (Carol)', 12, 3); bday('Dad’s birthday (Jim)', 6, 21);\n    bday('Linda’s birthday (Ben’s mom)', lin.getMonth() + 1, lin.getDate()); bday('Rick’s birthday (Ben’s dad)', 9, 30);\n    bday('Lena’s birthday', 1, 19); bday('Marco’s birthday', 5, 2); bday('Theo’s birthday', 2, 8); bday('Jess’s birthday', 7, 11);\n    bday('Priya’s birthday', 10, 5); bday('Sam’s birthday', 4, 22); bday('Ali’s birthday', ali.getMonth() + 1, ali.getDate());\n    bday('Grandma Ruth’s birthday', 11, 20); bday('Ellie’s birthday (Jess & Mike’s)', 6, 2); bday('Juniper’s gotcha day', 4, 4, { note: 'Pup cup at the Wag Bar' });\n    bday('Our anniversary', ann.getMonth() + 1, ann.getDate(), { color: 'rose' });\n    E('Ali’s 40th', 12, '19:00', { location: 'Highland Brewing rooftop', note: 'Card and the bourbon from the Asheville Distilling shop' });\n    E('Theo’s 5th birthday party', satBefore(mdOffs(2, 8, -364, 0)[0] || -270), '14:00', { location: 'Lena & Marco’s', note: 'Dinosaur theme. Gift: the T. rex excavation kit' });\n    E('Ellie’s 3rd birthday party', satBefore(mdOffs(6, 2, -364, 0)[0] || -150), '10:30', { location: 'Jess & Mike’s', note: 'Splash pad, bring towels' });\n    E('Baby shower for Kat', -173, '13:00', { location: 'The Chop Shop event room' });\n    E('Nora’s birthday dinner', mdOffs(3, 14, -364, 0)[0] || -230, '19:00', { location: 'Cúrate', note: 'Ben booked it in January' });\n    E('Ben’s birthday: tubing on the French Broad', satBefore(mdOffs(8, 9, -364, 0)[0] || -85), '12:00', { location: 'Zen Tubing' });\n\n    // appointments, the dog and the car\n    [[-325, 'Dentist (Nora)', '08:30', 'Brightside Dental'], [-176, 'Dentist (Ben)', '08:00', 'Brightside Dental'], [43, 'Dentist (Nora)', '08:30', 'Brightside Dental'],\n      [-270, 'Eye exam (Nora)', '15:30', 'Asheville Eye Associates'], [68, 'Eye exam (Ben)', '16:00', 'Asheville Eye Associates'], [-232, 'Annual physical (Nora)', '09:00', 'Dr. Patel, MAHEC'],\n      [-209, 'Skin check (Ben)', '10:20', 'Asheville Dermatology'], [-38, 'Flu shots', '17:00', 'Walgreens, Patton Ave'], [-282, 'Juniper’s vaccines', '10:00', 'Riverside Vet'],\n      [83, 'Juniper’s vaccines', '10:00', 'Riverside Vet'], [-344, 'Oil change', '08:00', 'Harmony Motors'], [-254, 'Oil change', '08:00', 'Harmony Motors'],\n      [-152, 'Oil change + tire rotation', '08:00', 'Harmony Motors'], [77, 'Oil change', '08:00', 'Harmony Motors'], [-216, 'New tires on the Subaru', '09:30', 'Discount Tire, Tunnel Rd'],\n      [-349, 'Car inspection', '08:30', 'Harmony Motors'], [-188, 'Plumber: kitchen sink', '13:00', null], [-63, 'Furnace tune-up', '09:00', 'Bullman Heating'], [-12, 'Gutter cleaning', '10:00', null]\n    ].forEach(function (a) { E(a[1], a[0], a[2], { location: a[3] }); });\n    [-339, -291, -244, -199, -154, -108, 14, 58].forEach(function (n) { E('Haircut (Nora)', n, '16:15', { location: 'Mel at Spruce Salon' }); });\n    [-356, -321, -286, -258, -215, -180, -145, -110, -75, -40, 31].forEach(function (n) { E('Haircut (Ben)', n, '17:30', { location: 'Clip Joint' }); });\n    [-331, -271, -211, -155, -76].forEach(function (n) { E('Juniper’s grooming', n, '13:00', { location: 'Wag Bar Grooming' }); });\n\n    // friends, family and going out\n    var SOC = [['Dinner with Jess & Mike', 'Chai Pani'], ['Game night at Sam & Ali’s', null], ['Tacos with the Parkers', 'White Duck Taco'], ['Lena & Marco over for dinner', null],\n      ['Brunch with Jess', 'Sunny Point Café'], ['Pizza night', 'Mellow Mushroom'], ['Trivia', 'Highland Brewing'], ['Cookout at the Parkers’', null], ['Wine night at Priya’s', null],\n      ['Dinner at Mom & Dad’s', null], ['Movie night: Grail Moviehouse', 'Grail Moviehouse'], ['Dinner out', 'Buxton Hall'], ['Drinks with Sam & Ali', 'Wicked Weed Funkatorium'],\n      ['Dinner with Kat & Dev', 'Rhubarb'], ['Hike and lunch with Lena', 'Graveyard Fields']];\n    var socDays = {}; for (var n3 = -360; n3 <= -5; n3 += 11 + Math.floor(r3() * 9)) { var dd = n3; while ([5, 6].indexOf(day(dd).getDay()) === -1) dd++; if (busy[dd] || socDays[dd]) continue; socDays[dd] = 1; var s0 = p3(SOC); E(s0[0], dd, day(dd).getDay() === 6 && c3(0.4) ? '11:00' : '18:30', { location: s0[1] }); }\n    [[7, 'Game night at Sam & Ali’s', '19:00', null], [19, 'Dinner with Jess & Mike', '18:30', 'Rhubarb'], [47, 'Lena & Marco over for dinner', '18:00', null], [64, 'Brunch with Jess', '10:30', 'Sunny Point Café'], [89, 'Wine night at Priya’s', '19:00', null]\n    ].forEach(function (a) { E(a[1], a[0], a[2], { location: a[3] }); });\n    // concerts, festivals and days out\n    [[-300, 'Watchhouse at the Orange Peel', '20:00', 'The Orange Peel'], [-221, 'Asheville Symphony: Beethoven 9', '19:30', 'Thomas Wolfe Auditorium'],\n      [-165, 'Hike Max Patch', '07:30', 'Max Patch trailhead'], [-130, 'Shindig on the Green', '19:00', 'Pack Square Park'], [-123, 'Lake Lure day trip', '09:00', 'Lake Lure'],\n      [-86, 'Gregory Alan Isakov', '19:30', 'Rabbit Rabbit'], [-58, 'Mountain Dance and Folk Festival', '19:00', 'Wortham Center'], [-45, 'Apple picking at Sky Top Orchard', '10:00', 'Sky Top Orchard, Flat Rock'],\n      [-27, 'Craggy Gardens hike for the leaves', '08:30', 'Blue Ridge Parkway, MP 364'], [-6, 'Pumpkin carving at Lena’s', '17:00', null], [40, 'Asheville Symphony Holiday Pops', '19:30', 'Thomas Wolfe Auditorium'],\n      [72, 'Winter Lights at the Arboretum', '18:00', 'NC Arboretum']\n    ].forEach(function (a) { E(a[1], a[0], a[2], { location: a[3] }); });\n    put('calendarEvents', evs);\n    // ticks on the past ones (Today's calendar keeps one tick per day an event is on)\n    var comp = get('eventCompletions') || {};\n    mine.forEach(function (e) { var n4 = offOf(new Date(e.date + 'T00:00:00')); if (n4 < 0 && n4 > -120 && e.time && c3(e.title.indexOf('Long run') === 0 ? 0.8 : 0.45)) comp[e.id + ':' + e.date] = true; });\n    put('eventCompletions', comp);\n\n    // ---------- 7b. reminders: every kind, some done, a few overdue ----------\n    var rems = get('lifeReminders') || [], rN = 0;\n    function RM(o) { rN++; return Object.assign({ id: 'tdr_' + (1690000000000 + rN * 7727).toString(36) + rN, description: null, link: null, phone: null, email: null, lastDone: null, snoozedUntil: null }, o); }\n    var dow0 = T0.getDay();\n    function wkLast(dw, weeksBack) { var n5 = -((dow0 - dw + 7) % 7) - 7 * (weeksBack || 0); return n5; }\n    function wk(title, dw, back, x) { var n6 = wkLast(dw, back); return RM(Object.assign({ title: title, frequency: 'weekly', dayOfWeek: dw, lastDone: iso(n6, 20, 15), lastDoneFor: dk(n6) }, x || {})); }\n    function mo(title, d, back, x) { var f = occ(d, back), n7 = offOf(new Date(f + 'T00:00:00')); return RM(Object.assign({ title: title, frequency: 'monthly', notifyDate: { month: 1, day: d }, lastDoneFor: f, lastDone: iso(n7, 19) }, x || {})); }\n    function yr(title, n, done, x) { var o8 = md(n), r = RM(Object.assign({ title: title, frequency: 'yearly', notifyDate: o8 }, x || {})); if (done) { if (n <= 0) { r.lastDone = iso(n, 12); r.lastDoneFor = dk(n); } else r.lastDone = iso(n - 365, 12); } return r; }\n    function once(title, n, x) { return RM(Object.assign({ title: title, frequency: 'once', notifyDate: dk(n) }, x || {})); }\n    var monthBack = function (d) { return T0.getDate() >= d ? 0 : 1; };\n    rems = rems.concat([\n      // weekly\n      wk('Change the sheets', 0, 0), wk('Plan meals for the week', 6, 0, { description: 'Check the calendar for late nights first' }),\n      wk('Clean the bathrooms', 6, 1), wk('Vacuum and mop downstairs', 3, 0), wk('Call Grandma Ruth', 0, 0, { phone: '828-555-0172', description: 'She’s best before 4' }),\n      wk('Take out the compost', 2, 2, { description: 'Bin goes to the curb Tuesday night' }),\n      // monthly\n      mo('Juniper’s heartworm + flea pill', 1, monthBack(1), { description: 'Simparica Trio, in the pantry' }),\n      mo('Move $400 to savings', 16, monthBack(16), { link: 'https://www.ally.com', description: 'Emergency fund, then the Charleston trip' }),\n      mo('Ben’s student loan payment', 20, 1, { link: 'https://studentaid.gov' }),\n      mo('Clean the dishwasher filter', 10, monthBack(10)), mo('Pick next month’s book club book', 25, 1),\n      mo('Check the bank for odd charges', 28, 1),\n      // every 3 and 6 months\n      RM({ title: 'Swap toothbrush heads', frequency: 'quarterly', notifyDate: md(9), lastDone: iso(-82, 21) }),\n      RM({ title: 'Rotate and flip the mattress', frequency: 'quarterly', notifyDate: md(23), lastDone: iso(-68, 10) }),\n      RM({ title: 'Deep clean the fridge', frequency: 'quarterly', notifyDate: md(11), lastDone: iso(-80, 15) }),\n      RM({ title: 'Test the smoke detectors', frequency: 'twice', notifyDate: md(36), lastDone: iso(-146, 11) }),\n      RM({ title: 'Clean the gutters', frequency: 'twice', notifyDate: md(-12), lastDone: iso(-12, 14), description: 'Done with the Gutter Guys this time' }),\n      RM({ title: 'Book dentist cleanings', frequency: 'twice', notifyDate: md(27), phone: '828-555-0190', description: 'Brightside Dental, ask for Tuesday mornings' }),\n      // yearly\n      yr('Mom’s birthday gift', mdOffs(12, 3, 1, 366)[0] - 7, false, { description: 'Mail by Nov 28. She wants the cozy robe' }),\n      yr('Theo’s birthday card and gift', (mdOffs(2, 8, 1, 366)[0] || 98) - 10), yr('Lena’s birthday', (mdOffs(1, 19, 1, 366)[0] || 78) - 5),\n      yr('Juniper’s annual vaccines', 76, true, { phone: '828-555-0148', description: 'Riverside Vet, rabies is due this year' }),\n      yr('Renew the Costco membership', 19, true, { link: 'https://www.costco.com' }),\n      yr('Flu shots', -40, true), yr('Order Christmas cards', 18, true, { link: 'https://www.minted.com', description: 'Use the photo from the Craggy Gardens hike' }),\n      yr('Renters insurance renewal', 112, true, { link: 'https://www.lemonade.com' }),\n      yr('Sign Ben up for the Turkey Trot', 9, true, { link: 'https://runsignup.com' }),\n      yr('Order the Thanksgiving pies’ pecans', 12, false),\n      yr('Send tax documents to Hollis CPA', 120, true, { email: 'office@holliscpa.com', description: 'W-2s, 1099s, the shop’s summary' }),\n      yr('Check the winter tires and wipers', 16, true), yr('Donate to MANNA’s holiday drive', 30, true, { link: 'https://www.mannafoodbank.org' }),\n      yr('Book the Biltmore Candlelight tickets', -64, true, { link: 'https://www.biltmore.com' }),\n      // one-time: a few overdue, the rest coming up\n      once('Return the sweater to J.Crew', -9, { description: 'Receipt is in the junk drawer' }),\n      once('Call Spectrum about the bill going up', -3, { phone: '833-267-6094' }),\n      once('Pick up Ben’s prescription', -1, { description: 'CVS on Merrimon' }),\n      once('Mail Ali’s 40th card', 8), once('Buy the hostess gift for Friendsgiving', TGnext - 7),\n      once('Get Juniper’s nails trimmed', 6), once('Cancel the Peacock free trial', 4),\n      once('Book the cabin for spring', 21, { link: 'https://www.airbnb.com' }), once('Schedule Ben’s eye exam', 12),\n      once('Drop off donations at Goodwill', 10, { description: 'Three bags in the hall closet' }),\n      once('Pay Lena back for the concert tickets', 2, { description: '$64, Venmo' }),\n      once('Order Grandma Ruth’s flowers', (mdOffs(11, 20, 1, 60)[0] || 18) - 2, { link: 'https://www.ftd.com' })\n    ]);\n    put('lifeReminders', rems);\n\n    // ---------- 8. Recently removed: a few more from the last few days ----------\n    var rr = get('dbkRemoved') || [];\n    function gone(kind, key, items, hours, opts) {\n      opts = opts || {}; var it = items[0];\n      return { id: 'rrtd' + (1700000000 + hours * 3600).toString(36), kind: kind, title: String(it[opts.title || 'title'] || it.text || ''), n: items.length, key: key, idf: opts.id || 'id', items: items, at: Date.now() - hours * 3600000, by: 'person1' };\n    }\n    rr = rr.concat([\n      gone('Today’s Three', 'threeThings_person1', [{ text: 'Call the insurance about the hail claim' }], 40, { id: 'text', title: 'text' }),\n      gone('Reminder', 'lifeReminders', [RM({ title: 'Renew the library hold on The Covenant of Water', frequency: 'once', notifyDate: dk(1) })], 66),\n      gone('Event', 'calendarEvents', [{ id: tid(), title: 'Open studio night at Odyssey', date: dk(5), time: '18:00', endTime: null, allDay: false, note: null, location: 'Odyssey ClayWorks', url: null, color: null, isMultiDay: false, eventGroup: null, repeatMode: 'single', recurring: null }], 92),\n      gone('Back Burner', 'futureTodos_person1', [bb('Learn brush calligraphy for the shop tags', -140)], 108, { title: 'text' })\n    ]).sort(function (a, b) { return b.at - a.at; });\n    put('dbkRemoved', rr);\n\n  })();\n\n  // ---------- lists.js ----------\n  (function () {\n// Lists (our-dreams.html): two and a half years of Nora and Ben's lists. Adds to what the sample made; own ids (1690…).\nvar sL = 4417;\nfunction rL() { sL |= 0; sL = sL + 0x6D2B79F5 | 0; var t = Math.imul(sL ^ sL >>> 15, 1 | sL); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\nfunction iL(a, b) { return a + Math.floor(rL() * (b - a + 1)); }\nvar nL = 0;\n// one thing on a list: n = days ago it was added (negative), by = who added it\nfunction L(o, n, by) {\n  nL++; var id = 1690000000000 + nL * 1009;\n  return Object.assign({ id: id, firebaseId: 'item_' + id, title: '', details: '', notes: '', achieved: false, dateAdded: iso(n == null ? -iL(10, 900) : n, iL(8, 21), iL(0, 59)), by: by || (rL() < 0.55 ? 'person1' : 'person2') }, o);\n}\nfunction get(k) { try { var v = JSON.parse(out[k] || '[]'); return Array.isArray(v) ? v : []; } catch (e) { return []; } }\nfunction add(k, arr) { put(k, get(k).concat(arr)); }\n// fields the earlier part left off its own things (no thing is dropped or renamed)\nfunction patch(k, byTitle) { var a = get(k); a.forEach(function (d) { var p = byTitle[d.title]; if (p) Object.keys(p).forEach(function (f) { if (d[f] == null || d[f] === '') d[f] = p[f]; }); }); put(k, a); }\n\n// ---------- restaurants: to try ----------\nfunction R(t, types, price, occ, pri, det, n, by, extra) { return L(Object.assign({ title: t, restaurantTypes: types, priceRange: price, occasion: occ || '', priority: pri || '', details: det || '' }, extra || {}), n, by); }\nadd('dreams_restaurants', [\n  R('Chai Pani', ['lunch', 'dinner'], '$$', 'friends', 'soon', 'Indian street food downtown. Everyone says the okra fries.', -610, 'person2'),\n  R('Gan Shan Station', ['dinner'], '$$', 'date-night', 'high', 'Old gas station on Charlotte St. Pan-Asian, small plates.', -402, 'person1'),\n  R('Neng Jr.’s', ['dinner'], '$$$', 'special', 'high', 'Filipino, tiny place in West Asheville. Book two weeks out.', -188, 'person1'),\n  R('Tall Pines Smokehouse', ['lunch', 'dinner'], '$$', 'friends', '', 'Out by Weaverville. Marco swears by the brisket.', -351, 'person2'),\n  R('The Hazel Room', ['bar', 'dinner'], '$$$', 'date-night', '', 'Cocktail bar with a short menu, upstairs on Lexington.', -277, 'person1'),\n  R('Rocky’s Hot Chicken Shack', ['lunch'], '$', '', '', 'Ben wants the hot. Nora wants the mild.', -96, 'person2'),\n  R('Sunny Point Café', ['breakfast', 'brunch'], '$$', '', 'soon', 'Huevos rancheros. Go on a weekday, the weekend wait is an hour.', -540, 'person1'),\n  R('Fern & Fable Tea House', ['cafe', 'dessert'], '$', '', '', 'Scones and loose-leaf tea in Black Mountain. Nice after the Lookout Trail.', -133, 'person1'),\n  R('Mama Ruth’s Soul Kitchen', ['lunch'], '$', '', '', 'Food truck near the RAD on Thursdays.', -58, 'person2', { fromInbox: true, details: '' }),\n  R('Copperline Oyster Bar', ['dinner', 'bar'], '$$$', 'date-night', '', 'Raw bar in Hendersonville. Half-price oysters Tuesday.', -244, 'person2'),\n  R('Hole Doughnuts', ['bakery', 'dessert'], '$', '', 'soon', 'Made to order. Go before 10 or they run low.', -30, 'person1'),\n  R('Little Saigon Kitchen', ['lunch', 'dinner'], '$', '', '', 'Banh mi and bun. Jess’s pick for a cheap lunch.', -15, 'person1', { fromInbox: true, details: '' }),\n  R('Ridgeview Supper Club', ['dinner'], '$$$$', 'special', '', 'Prix fixe, six courses. Maybe for Ben’s 40th.', -9, 'person1')\n]);\n// ---------- restaurants: loved (tried, with how it was) ----------\nfunction RL(t, types, price, occ, rating, notes, det, n, by) { return L({ title: t, restaurantTypes: types, priceRange: price, occasion: occ || '', rating: String(rating), notes: notes, details: det || '' }, n, by); }\nadd('dreams_our-restaurants', [\n  RL('White Duck Taco Shop', ['lunch', 'dinner'], '$', '', 5, 'Mole chicken and the duck taco. Patio by the river is the move.', 'River Arts District', -880, 'person2'),\n  RL('Biscuit Head', ['breakfast', 'brunch'], '$', '', 4, 'Cat-head biscuits with the jam bar. Get there before 9 on Saturdays.', 'West Asheville', -840, 'person1'),\n  RL('Cúrate', ['dinner'], '$$$', 'date-night', 5, 'Tapas. Ben’s birthday dinner. The jamón and the fried eggplant with honey.', 'Biltmore Ave', -760, 'person1'),\n  RL('French Broad Chocolate Lounge', ['dessert', 'cafe'], '$$', 'date-night', 5, 'Liquid truffle and a brownie, every single time.', 'Pack Square', -812, 'person1'),\n  RL('Tupelo Honey', ['brunch', 'dinner'], '$$', 'friends', 4, 'Sweet potato pancakes. Took Ben’s parents, they loved it.', 'Downtown', -700, 'person2'),\n  RL('Early Girl Eatery', ['breakfast', 'lunch'], '$', '', 4, 'Good tempeh hash. Easy parking on Wall St.', '', -655, 'person1'),\n  RL('Wicked Weed Funkatorium', ['bar'], '$$', 'friends', 4, 'Sours. Ben liked the peach one, Nora stuck with the cider.', 'South Slope', -590, 'person2'),\n  RL('Rhubarb', ['dinner', 'brunch'], '$$$', 'special', 5, 'Sunday supper was the best meal of the year. Pork belly.', 'Pack Square', -520, 'person1'),\n  RL('Mamacita’s', ['lunch', 'dinner'], '$', '', 4, 'Burritos the size of your arm. Good after soccer.', '', -480, 'person2'),\n  RL('Sovereign Remedies', ['bar', 'dinner'], '$$', 'date-night', 4, 'Cocktails are great, food is fine. Sit at the bar.', '', -430, 'person1'),\n  RL('Strada Italiano', ['dinner'], '$$', 'friends', 3, 'Fine for a group. The rooftop is the reason to go.', 'Downtown', -385, 'person2'),\n  RL('Old Europe Pastries', ['bakery', 'cafe'], '$', '', 5, 'The napoleon. Grab one for Mom when she visits.', 'Battery Park', -350, 'person1'),\n  RL('Luella’s Bar-B-Que', ['lunch', 'dinner'], '$$', 'friends', 4, 'Hush puppies. The banana pudding is a must.', 'North Asheville', -300, 'person2'),\n  RL('Pine Hollow Diner', ['breakfast'], '$', '', 3, 'Okay. Coffee was weak, eggs were good. Close to the trailhead at least.', 'Swannanoa', -262, 'person2'),\n  RL('Mela Indian Restaurant', ['lunch', 'dinner'], '$$', '', 4, 'Lunch buffet on weekdays is a steal. Lamb saag.', '', -210, 'person1'),\n  RL('Burial Beer Co.', ['bar'], '$$', 'friends', 5, 'Forestry Camp with the food truck. Juniper is welcome on the patio.', 'Forestry Camp', -160, 'person2'),\n  RL('Marigold Kitchen & Bar', ['dinner'], '$$$', 'date-night', 3, 'Pretty room, slow service. Not worth the price for what it was.', 'Biltmore Village', -120, 'person1'),\n  RL('Ultra Coffee', ['cafe'], '$', '', 5, 'Nora’s Tuesday work spot. Oat cortado.', 'Woodfin', -74, 'person1'),\n  RL('Vivian', ['dinner'], '$$$', 'special', 5, 'Celebrated the shop’s best month here. The duck, and the chocolate tart.', 'River Arts District', -44, 'person1')\n]);\npatch('dreams_restaurants', { 'Lucia’s Trattoria': { by: 'person1' }, 'Blue Plate Diner': { by: 'person2' }, 'Pho 88': { by: 'person2', details: 'Patton Ave, by the hardware store' }, 'Kumo Ramen': { by: 'person2' } });\n\n// ---------- shows and movies ----------\nfunction S(t, m, gs, st, o, n, by) { return L(Object.assign({ title: t, mediaTypes: [m], genres: gs, streaming: [].concat(st) }, o || {}), n, by); }\nadd('dreams_shows-movies', [\n  S('The Penguin', 'limited-series', ['drama', 'thriller'], 'hbo', { priority: 'soon' }, -330, 'person2'),\n  S('Bad Sisters', 'tv-show', ['comedy', 'thriller'], 'apple', { details: 'Season 2 is out' }, -260, 'person1'),\n  S('Andor', 'tv-show', ['sci-fi', 'drama'], 'disney', { priority: 'high', details: 'Ben says the second season is the best Star Wars ever made' }, -170, 'person2'),\n  S('Pachinko', 'tv-show', ['drama'], 'apple', {}, -610, 'person1'),\n  S('Conclave', 'movie', ['drama', 'thriller'], 'prime', {}, -305, 'person1'),\n  S('The Pitt', 'tv-show', ['drama'], 'hbo', { priority: 'soon' }, -140, 'person2'),\n  S('Paddington in Peru', 'movie', ['comedy', 'animation'], 'netflix', { fromInbox: true }, -95, 'person1'),\n  S('Anatomy of a Fall', 'movie', ['drama', 'thriller'], 'hulu', {}, -500, 'person1'),\n  S('Hacks', 'tv-show', ['comedy'], 'hbo', {}, -420, 'person1'),\n  S('Free Solo', 'documentary', [], 'disney', { details: 'Ben has seen it, wants Nora to' }, -690, 'person2'),\n  S('The Last of Us', 'tv-show', ['drama', 'horror'], 'hbo', {}, -560, 'person2'),\n  S('Wallace & Gromit: Vengeance Most Fowl', 'movie', ['animation', 'comedy'], 'netflix', {}, -48, 'person1'),\n  S('Sinners', 'movie', ['horror', 'drama'], ['hbo'], { priority: 'high', details: 'Missed it in theaters' }, -66, 'person2'),\n  S('Nobody Wants This', 'tv-show', ['comedy', 'romance'], 'netflix', {}, -200, 'person1'),\n  S('Making a Murderer', 'documentary', ['true-crime'], 'netflix', {}, -735, 'person2'),\n  S('The Wild Robot', 'movie', ['animation'], 'peacock', {}, -230, 'person1'),\n  S('Blue Planet II', 'documentary', [], 'prime', { details: 'For a rainy Sunday' }, -820, 'person1'),\n  S('Mickey 17', 'movie', ['sci-fi', 'comedy'], 'hbo', {}, -110, 'person2'),\n  S('The Studio', 'tv-show', ['comedy'], 'apple', {}, -38, 'person2'),\n  S('Wicked: For Good', 'movie', ['romance'], 'theaters', { priority: 'soon', details: 'Opening weekend with Jess and Lena' }, -20, 'person1'),\n  S('Mare of Easttown', 'limited-series', ['drama', 'true-crime'], 'hbo', {}, -12, 'person1')\n]);\nadd('dreams_our-shows-movies', [\n  S('Succession', 'tv-show', ['drama'], 'hbo', { rating: '5', notes: 'Took a whole winter. The finale.' }, -870, 'person2'),\n  S('The White Lotus', 'tv-show', ['drama', 'comedy'], 'hbo', { rating: '4', notes: 'Season 2 (Sicily) was our favorite.' }, -830, 'person1'),\n  S('Barbie', 'movie', ['comedy'], 'hbo', { rating: '4', notes: 'Saw it in the theater in pink.' }, -800, 'person1'),\n  S('Poor Things', 'movie', ['comedy', 'sci-fi'], 'hulu', { rating: '3', notes: 'Strange. Glad we saw it, wouldn’t again.' }, -660, 'person2'),\n  S('Fleabag', 'tv-show', ['comedy', 'drama'], 'prime', { rating: '5', notes: 'Nora’s third time through. Ben finally gets it.' }, -640, 'person1'),\n  S('Reservation Dogs', 'tv-show', ['comedy', 'drama'], 'hulu', { rating: '5', notes: 'Funny and sad at once. All three seasons.' }, -600, 'person2'),\n  S('Baby Reindeer', 'limited-series', ['drama', 'thriller'], 'netflix', { rating: '4', notes: 'Hard to watch, impossible to stop.' }, -545, 'person2'),\n  S('Hit Man', 'movie', ['comedy', 'thriller'], 'netflix', { rating: '4' }, -505, 'person1'),\n  S('The Fall Guy', 'movie', ['action', 'comedy'], 'peacock', { rating: '3', notes: 'Fun Friday movie, nothing more.' }, -470, 'person2'),\n  S('Inside Out 2', 'movie', ['animation', 'comedy'], 'disney', { rating: '5', notes: 'Nora cried at the anxiety part.' }, -440, 'person1'),\n  S('Shrinking', 'tv-show', ['comedy', 'drama'], 'apple', { rating: '5', notes: 'Harrison Ford is the best part.' }, -400, 'person1'),\n  S('Challengers', 'movie', ['drama', 'romance'], 'prime', { rating: '4', notes: 'That soundtrack.' }, -372, 'person2'),\n  S('The Night Agent', 'tv-show', ['thriller', 'action'], 'netflix', { rating: '3', notes: 'Ben’s gym-treadmill show.' }, -340, 'person2'),\n  S('Hundreds of Beavers', 'movie', ['comedy'], 'prime', { rating: '5', notes: 'The funniest thing we’ve seen in years. No words, all slapstick.' }, -310, 'person2'),\n  S('Somebody Feed Phil', 'documentary', ['reality'], 'netflix', { rating: '4', notes: 'Our dinner show. Lisbon and Tokyo made us hungry.' }, -280, 'person1'),\n  S('Black Bird', 'limited-series', ['true-crime', 'drama'], 'apple', { rating: '4' }, -250, 'person2'),\n  S('Wicked', 'movie', ['romance'], 'theaters', { rating: '5', notes: 'Saw it twice. Defying Gravity in the big theater.' }, -215, 'person1'),\n  S('Severance', 'tv-show', ['drama', 'sci-fi'], 'apple', { rating: '5', notes: 'Season 2 finale. We yelled.' }, -175, 'person2'),\n  S('Nickel Boys', 'movie', ['drama'], 'prime', { rating: '4', notes: 'Shot from his eyes. Read the book first.' }, -150, 'person1'),\n  S('Slow Horses', 'tv-show', ['thriller', 'drama'], 'apple', { rating: '5', notes: 'Gary Oldman’s socks. Best spy show on TV.' }, -85, 'person2'),\n  S('The Great Pottery Throw Down', 'tv-show', ['reality'], 'hbo', { rating: '4', notes: 'Nicer than Bake Off. Keith crying is the best part.' }, -55, 'person1')\n]);\npatch('dreams_shows-movies', { 'Slow Horses': { details: 'Season 5 is out' }, 'The Bear': { details: 'Caught up through season 3' } });\n\n// ---------- reading (one shelf for both; finished ones with stars and a line) ----------\nfunction B(t, a, g, p, o, n, by) { return L(Object.assign({ title: t, author: a, bookGenre: g, pages: p }, o || {}), n, by); }\nvar fin = function (r, note) { var o = { achieved: true, rating: String(r) }; if (note) o.notes = note; return o; };\nadd('dreams_reading', [\n  // still to read\n  B('Intermezzo', 'Sally Rooney', 'fiction', 448, { priority: 'soon' }, -70, 'person1'),\n  B('James', 'Percival Everett', 'fiction', 320, { priority: 'soon', details: 'Book club, January' }, -40, 'person1'),\n  B('The Anxious Generation', 'Jonathan Haidt', 'nonfiction', 400, {}, -260, 'person2'),\n  B('Shogun', 'James Clavell', 'history', 1152, { details: 'After the show. It’s enormous.' }, -350, 'person2'),\n  B('Born a Crime', 'Trevor Noah', 'memoir', 304, {}, -480, 'person2'),\n  B('The Women', 'Kristin Hannah', 'fiction', 480, {}, -220, 'person1'),\n  B('Iron Flame', 'Rebecca Yarros', 'fantasy', 640, {}, -90, 'person1'),\n  B('Endurance', 'Alfred Lansing', 'history', 282, { priority: 'high', details: 'Ben’s nightstand book. Slow going, a chapter a night.' }, -205, 'person2'),\n  B('Good Energy', 'Casey Means', 'selfhelp', 368, {}, -150, 'person2'),\n  B('The Ministry of Time', 'Kaliane Bradley', 'fantasy', 352, {}, -112, 'person1'),\n  B('Funny Story', 'Emily Henry', 'romance', 400, { priority: 'soon', fromInbox: true }, -64, 'person1'),\n  B('How to Read a Book', 'Mortimer Adler', 'nonfiction', 426, {}, -700, 'person2'),\n  B('The God of the Woods', 'Liz Moore', 'mystery', 496, { priority: 'soon' }, -33, 'person1'),\n  B('Wandering Stars', 'Tommy Orange', 'fiction', 336, {}, -180, 'person1'),\n  B('Into Thin Air', 'Jon Krakauer', 'memoir', 368, {}, -560, 'person2'),\n  B('Piranesi', 'Susanna Clarke', 'fantasy', 272, {}, -410, 'person1'),\n  B('Bewilderment', 'Richard Powers', 'fiction', 288, {}, -500, 'person2'),\n  B('Quilting Modern', 'Jacquie Gering', 'other', 160, { details: 'Library has it. For new block ideas.' }, -18, 'person1'),\n  // finished, oldest first (the newest shows first under Finished)\n  B('Where the Crawdads Sing', 'Delia Owens', 'fiction', 384, fin(4, 'The marsh parts were the best.'), -895, 'person1'),\n  B('Educated', 'Tara Westover', 'memoir', 352, fin(5, 'Read it in two days.'), -870, 'person1'),\n  B('Born to Run', 'Christopher McDougall', 'nonfiction', 304, fin(4, 'Why Ben started running again.'), -850, 'person2'),\n  B('The Midnight Library', 'Matt Haig', 'fiction', 304, fin(3, 'Nice idea, a bit sweet.'), -820, 'person1'),\n  B('Thinking, Fast and Slow', 'Daniel Kahneman', 'nonfiction', 499, fin(3, 'Took months. Skimmed the last third.'), -790, 'person2'),\n  B('Circe', 'Madeline Miller', 'fantasy', 393, fin(5, 'Book club’s favorite of the year.'), -760, 'person1'),\n  B('Shoe Dog', 'Phil Knight', 'memoir', 400, fin(5, 'Best business book Ben’s read.'), -735, 'person2'),\n  B('The Seven Husbands of Evelyn Hugo', 'Taylor Jenkins Reid', 'fiction', 400, fin(4), -705, 'person1'),\n  B('The Silent Patient', 'Alex Michaelides', 'mystery', 336, fin(3, 'Saw the twist coming.'), -680, 'person2'),\n  B('Killers of the Flower Moon', 'David Grann', 'history', 352, fin(5, 'Then watched the movie. Book is better.'), -650, 'person2'),\n  B('Remarkably Bright Creatures', 'Shelby Van Pelt', 'fiction', 368, fin(5, 'Marcellus the octopus.'), -625, 'person1'),\n  B('A Gentleman in Moscow', 'Amor Towles', 'fiction', 462, fin(5, 'Slow start, perfect ending.'), -600, 'person1'),\n  B('The Body Keeps the Score', 'Bessel van der Kolk', 'nonfiction', 464, fin(4), -575, 'person1'),\n  B('Hatchet', 'Gary Paulsen', 'fiction', 195, fin(4, 'Reread from middle school. Still holds up.'), -550, 'person2'),\n  B('The Martian', 'Andy Weir', 'fantasy', 387, fin(5, 'Read it after Project Hail Mary.'), -525, 'person2'),\n  B('Crying in H Mart', 'Michelle Zauner', 'memoir', 256, fin(5, 'Made Nora call her mom.'), -500, 'person1'),\n  B('Happy Place', 'Emily Henry', 'romance', 400, fin(4, 'Beach read on the Outer Banks trip.'), -470, 'person1'),\n  B('Same as Ever', 'Morgan Housel', 'selfhelp', 240, fin(4), -445, 'person2'),\n  B('The Covenant of Water', 'Abraham Verghese', 'fiction', 724, fin(5, 'Took all summer. Worth it.'), -415, 'person1'),\n  B('Four Thousand Weeks', 'Oliver Burkeman', 'selfhelp', 288, fin(5, 'Both read it. Changed how we plan weekends.'), -390, 'person2'),\n  B('The Lincoln Highway', 'Amor Towles', 'fiction', 576, fin(3), -362, 'person1'),\n  B('Spare', 'Prince Harry', 'memoir', 416, fin(3, 'Audiobook on the drive to Chicago.'), -335, 'person2'),\n  B('Yellowface', 'R. F. Kuang', 'fiction', 336, fin(4, 'Uncomfortable in a good way.'), -308, 'person1'),\n  B('The Women of the Copper Country', 'Mary Doria Russell', 'history', 336, fin(4), -280, 'person1'),\n  B('Tress of the Emerald Sea', 'Brandon Sanderson', 'fantasy', 384, fin(5, 'Ben’s gateway to Sanderson.'), -255, 'person2'),\n  B('The Boys in the Boat', 'Daniel James Brown', 'history', 404, fin(5, 'Couldn’t stop telling Nora about it.'), -228, 'person2'),\n  B('Kitchen Confidential', 'Anthony Bourdain', 'memoir', 312, fin(4), -200, 'person2'),\n  B('Beach Read', 'Emily Henry', 'romance', 361, fin(4), -176, 'person1'),\n  B('Mistborn: The Final Empire', 'Brandon Sanderson', 'fantasy', 541, fin(5, 'On to book two.'), -150, 'person2'),\n  B('North Woods', 'Daniel Mason', 'fiction', 384, fin(4, 'One house, four hundred years.'), -125, 'person1'),\n  B('Outlive', 'Peter Attia', 'selfhelp', 496, fin(3, 'Useful parts on zone 2. Long.'), -98, 'person2'),\n  B('The Thursday Murder Club', 'Richard Osman', 'mystery', 382, fin(4, 'Cozy. Will read the next one.'), -72, 'person1'),\n  B('Orbital', 'Samantha Harvey', 'fiction', 207, fin(4, 'Short and lovely. Read it in one evening.'), -46, 'person1'),\n  B('The Well of Ascension', 'Brandon Sanderson', 'fantasy', 590, fin(4), -22, 'person2')\n]);\npatch('dreams_reading', { 'Tomorrow, and Tomorrow, and Tomorrow': { by: 'person1', details: 'Halfway. Sam and Sadie’s game.' }, 'The Wager': { by: 'person2' }, 'Project Hail Mary': { bookGenre: 'fantasy', pages: 476, by: 'person2' }, 'Atomic Habits': { bookGenre: 'selfhelp', pages: 320, by: 'person2' }, 'Demon Copperhead': { bookGenre: 'fiction', pages: 560, by: 'person1' } });\n// \"The Thursday Murder Club\" was on the shelf to read: it's been read now, so the copy still on the shelf goes to Finished\n(function () { var a = get('dreams_reading'), seen = 0; a.forEach(function (d) { if (d.title === 'The Thursday Murder Club' && !d.achieved && !seen) { seen = 1; d.title = 'The Man Who Died Twice'; d.details = 'Next in the Thursday Murder Club books'; d.pages = 432; } }); put('dreams_reading', a); })();\n\n// ---------- places around here ----------\nfunction P(t, types, o, n, by) { return L(Object.assign({ title: t, placeTypes: types }, o || {}), n, by); }\nadd('dreams_places', [\n  P('Max Patch at sunrise', ['nature'], { priority: 'high', details: 'Two hours out. Leave at 4:30, bring the thermos.' }, -540, 'person2'),\n  P('Shindig on the Green', ['concert', 'festival'], { details: 'Saturday nights in summer, Pack Square. Bring chairs.' }, -300, 'person1'),\n  P('Folk Art Center', ['museum', 'shopping'], { priority: 'soon', details: 'Parkway milepost 382. Quilt show in the spring.' }, -260, 'person1'),\n  P('Carl Sandburg Home', ['historic', 'nature'], { details: 'Flat Rock. The goat barn.' }, -380, 'person1'),\n  P('Mount Mitchell summit', ['nature'], { details: 'Highest point east of the Mississippi. Clear day only.' }, -610, 'person2'),\n  P('Harvest Records', ['shopping'], { details: 'West Asheville, for Ben’s vinyl hunt' }, -150, 'person2'),\n  P('Mountain Dance and Folk Festival', ['festival', 'concert'], { details: 'First weekend in August' }, -90, 'person1'),\n  P('Graveyard Fields blueberry picking', ['nature', 'park'], { fromInbox: true }, -45, 'person2'),\n  P('Asheville Pinball Museum', ['entertainment'], { details: 'One price, play all afternoon' }, -16, 'person2'),\n  P('Chimney Rock', ['nature', 'park'], { priority: 'soon', details: 'Reopened after the storm. Check trail status first.' }, -8, 'person1')\n]);\nadd('dreams_our-places', [\n  P('Looking Glass Falls', ['nature'], { rating: '5', notes: 'Right off the road. Cold even in July.', details: 'Pisgah, near Brevard' }, -860, 'person1'),\n  P('DuPont State Forest', ['nature', 'park'], { rating: '5', notes: 'Triple Falls and Hooker Falls loop. Juniper’s favorite.' }, -790, 'person2'),\n  P('NC Arboretum', ['nature', 'park'], { rating: '4', notes: 'Bonsai garden. Winter lights in December are worth it.' }, -700, 'person1'),\n  P('Grove Arcade', ['shopping', 'historic'], { rating: '4', notes: 'Rainy-day stop. The map shop upstairs.' }, -630, 'person1'),\n  P('The Orange Peel', ['concert'], { rating: '5', notes: 'Saw Watchhouse there. Stand by the soundboard.' }, -560, 'person2'),\n  P('Malaprop’s Bookstore', ['bookstore'], { rating: '5', notes: 'Every visit ends with a book and a coffee next door.' }, -505, 'person1'),\n  P('Biltmore Candlelight Christmas', ['historic', 'festival'], { rating: '4', notes: 'Pricey but magical once. Book early.' }, -330, 'person1'),\n  P('Craggy Gardens', ['nature'], { rating: '5', notes: 'Rhododendrons in June. Short hike, huge view.' }, -515, 'person2'),\n  P('Sliding Rock', ['nature'], { rating: '3', notes: 'Freezing and crowded. Did it once, that’s enough.' }, -470, 'person2'),\n  P('Asheville Art Museum', ['museum'], { rating: '4', notes: 'Free first Wednesday. The rooftop view.' }, -240, 'person1'),\n  P('Hot Springs, NC', ['nature', 'historic'], { rating: '5', notes: 'Tubs by the river at night, then a cabin. Go back in winter.' }, -190, 'person2'),\n  P('Western North Carolina Farmers Market', ['market'], { rating: '4', notes: 'Apples by the half-bushel in the fall.' }, -100, 'person1')\n]);\n\n// ---------- travel: trips with a plan ----------\nfunction D(id, title, stops) { return { id: id, title: title, stops: stops.map(function (s, i) { return { id: id + 's' + i, name: s[0], time: s[1] || '', notes: s[2] || '', link: s[3] || '' }; }) }; }\n// the spring trip: Charleston, starting a Thursday in mid-April\nvar yC = T0.getFullYear() + (T0.getMonth() >= 3 ? 1 : 0), dC = new Date(yC, 3, 16); while (dC.getDay() !== 4) dC.setDate(dC.getDate() + 1);\nvar nC = Math.round((dC - T0) / 86400000);\nvar charleston = { start: dk(nC), days: [\n  D('lc1', 'Drive down', [['Leave Asheville', '08:00', 'Juniper to Lena’s the night before'], ['Lunch stop in Columbia', '11:45', 'Lizard’s Thicket, if it’s open'], ['Check in, Wraggborough', '15:00', 'Code comes the morning of'], ['Walk the Battery at sunset', '19:15'], ['Dinner at Leon’s Oyster Shop', '20:00', 'Fried chicken and oysters. No reservations.']]),\n  D('lc2', 'Downtown', [['Coffee at Harken', '08:30'], ['Walking tour of the old city', '10:00', 'Meets at the Old Exchange', 'https://www.oldexchange.org'], ['Lunch at Dave’s Carry-Out', '13:00'], ['Gibbes Museum of Art', '14:30'], ['Rest before dinner', '17:00'], ['Dinner at FIG', '19:30', 'Reservation for 2 under Nora. Booked 6 weeks out.']]),\n  D('lc3', 'Islands', [['Morris Island lighthouse walk', '09:00', 'Low tide is better'], ['Folly Beach, lunch at Lost Dog Cafe', '12:00'], ['Bike Sullivan’s Island', '14:30', 'Rentals by the gas station'], ['Sunset drinks at the Dewberry rooftop', '19:00']]),\n  D('lc4', 'Gardens and home', [['Magnolia Plantation gardens', '09:30', 'Go for the azaleas, skip the house tour'], ['Brunch on King Street', '12:30', 'Jess’s pick: ask her the name again'], ['Drive home', '14:30', 'About 4 hours. Pick up Juniper by 7.']])\n],\n  ideas: [{ id: 'lci1', name: 'Angel Oak Tree' }, { id: 'lci2', name: 'Fabric shop on King Street (Nora)' }, { id: 'lci3', name: 'Holy City Brewing' }, { id: 'lci4', name: 'Boone Hall farmers market' }, { id: 'lci5', name: 'Kayak tour in Shem Creek', notes: 'Dolphins, supposedly' }, { id: 'lci6', name: 'Rainbow Row photo' }],\n  stays: [{ id: 'lch1', name: 'Carriage house in Wraggborough', when: '3 nights', notes: 'Free parking, walk to King Street. $612 total, paid.', link: 'https://www.airbnb.com' }, { id: 'lch2', name: 'Backup: Hampton Inn Historic District', when: 'if the Airbnb falls through', notes: '', link: '' }],\n  packing: [['Walking shoes', 0], ['Sundresses + a light jacket', 0], ['Bike shorts', 0], ['Sunscreen', 1], ['Phone chargers + car charger', 0], ['Reservation confirmations', 0], ['Book for the beach', 0], ['Reusable water bottles', 1], ['Juniper’s food for Lena', 0], ['Rain jackets, just in case', 0], ['Cash for tips and parking', 0]].map(function (p, i) { return { id: 'lcp' + i, text: p[0], done: !!p[1] }; }),\n  notes: 'Budget about $1,800 with gas and food. Savings goal covers it.\\nFIG confirms 48 hours ahead: answer the text.\\nLeave Thursday early so we’re not on I-26 at rush hour.' };\n// a summer trip last year, all done\nvar obx = { start: dk(-472), days: [\n  D('lo1', 'Drive', [['Leave at 6', '06:00', 'Long day, split the driving'], ['Lunch in Raleigh', '11:30'], ['Groceries in Kitty Hawk', '16:00'], ['Check in, beach house', '17:00']]),\n  D('lo2', 'Beach day', [['Beach all morning', '09:00'], ['Fish tacos at Mama Kwan’s', '13:00'], ['Sunset at Jockey’s Ridge', '19:30', 'Sand dunes, bring water']]),\n  D('lo3', 'Lighthouses', [['Bodie Island Lighthouse', '10:00'], ['Drive to Hatteras', '12:00'], ['Climb Cape Hatteras Lighthouse', '14:00', '257 steps'], ['Dinner at Dinky’s', '19:00']]),\n  D('lo4', 'Rest', [['Nothing planned. Books and the porch.', '']]),\n  D('lo5', 'Wright Brothers and home', [['Wright Brothers Memorial', '09:00'], ['Drive home', '11:00']])\n],\n  ideas: [{ id: 'loi1', name: 'Wild horses tour in Corolla' }, { id: 'loi2', name: 'Ocracoke ferry' }],\n  stays: [{ id: 'loh1', name: 'Beach house in Nags Head', when: '4 nights', notes: 'With Marco and Jess, split four ways', link: '' }],\n  packing: ['Beach towels', 'Sunscreen', 'Boogie boards', 'Books', 'Cooler', 'Juniper’s bed', 'Bug spray', 'Hats'].map(function (t, i) { return { id: 'lop' + i, text: t, done: true }; }),\n  notes: 'Next time: a week, not four nights. Bring the bigger cooler.' };\n\nfunction TR(t, types, best, o, n, by) { return L(Object.assign({ title: t, tripTypes: types, bestTime: best || '' }, o || {}), n, by); }\nadd('dreams_travel', [\n  TR('Charleston long weekend', ['weekend', 'road-trip', 'domestic'], 'spring', { priority: 'high', details: 'Four days in April. Azaleas, FIG, the islands.', trip: charleston }, -210, 'person1'),\n  TR('Iceland ring road', ['road-trip', 'international'], 'summer', { priority: 'soon', details: 'Ten days, a camper van. Midnight sun.' }, -720, 'person2'),\n  TR('Lisbon and Porto', ['international'], 'fall', { details: 'Saw it on Somebody Feed Phil. Pastéis de nata.' }, -280, 'person1'),\n  TR('Glacier National Park', ['domestic', 'camping'], 'summer', { details: 'Going-to-the-Sun Road opens in July. Book Many Glacier early.' }, -600, 'person2'),\n  TR('New Orleans for Jazz Fest', ['domestic'], 'spring', { details: 'Last weekend of April. Ben’s been wanting this forever.' }, -330, 'person2'),\n  TR('Mackinac Island', ['domestic'], 'summer', { details: 'No cars, fudge, bikes around the island' }, -160, 'person1'),\n  TR('Cumberland Island camping', ['camping', 'domestic'], 'fall', { details: 'Wild horses, ferry from St. Marys. Permits fill fast.' }, -52, 'person2'),\n  TR('Highlands and Cashiers day trip', ['day-trip'], 'fall', { details: 'Waterfall road, leaves peak late October' }, -24, 'person1'),\n  TR('Christmas markets in Germany', ['international'], 'holiday', { details: 'Nuremberg and Rothenburg. Someday.' }, -900, 'person1')\n]);\nadd('dreams_our-travel', [\n  TR('Outer Banks', ['road-trip', 'domestic'], 'summer', { rating: '5', notes: 'Four nights with Marco and Jess. Hatteras lighthouse climb.', trip: obx }, -540, 'person1'),\n  TR('Nashville', ['weekend', 'domestic'], 'fall', { rating: '4', notes: 'Bluebird Cafe was the highlight. Broadway is a lot.' }, -770, 'person2'),\n  TR('Asheville to Boone on the Parkway', ['day-trip', 'road-trip'], 'fall', { rating: '5', notes: 'Linn Cove Viaduct in peak color.' }, -690, 'person1'),\n  TR('Mexico City', ['international'], 'winter', { rating: '5', notes: 'Tacos al pastor every day, Frida’s house, Chapultepec.' }, -420, 'person1'),\n  TR('Washington, DC', ['weekend', 'domestic'], 'spring', { rating: '4', notes: 'Cherry blossoms, the Smithsonian quilt collection. Too crowded at the Tidal Basin.' }, -250, 'person1'),\n  TR('Gatlinburg cabin, the second time', ['weekend', 'domestic'], 'winter', { rating: '3', notes: 'Rained the whole time. The hot tub saved it.' }, -110, 'person2')\n]);\npatch('dreams_travel', { 'Highlands long weekend': { tripTypes: ['weekend', 'domestic'], by: 'person1' }, 'Portland, Maine': { tripTypes: ['domestic'], by: 'person1' }, 'Kyoto': { tripTypes: ['international'], by: 'person1' }, 'Tybee Island': { tripTypes: ['weekend', 'domestic'], by: 'person2' } });\npatch('dreams_our-travel', { 'Savannah': { tripTypes: ['weekend', 'road-trip', 'domestic'], bestTime: 'spring' }, 'Chicago': { tripTypes: ['domestic'], bestTime: 'summer' }, 'Smoky Mountains cabin': { tripTypes: ['weekend', 'domestic'], bestTime: 'spring' } });\n\n// ---------- wishlists ----------\nfunction W(t, o, n, by) { return L(Object.assign({ title: t }, o || {}), n, by); }\nvar got = function (from, n, note) { var o = { achieved: true, givenBy: from, givenOn: dk(n) }; if (note) o.notes = note; return o; };\nadd('dreams_person1-wishlist', [\n  W('Rotary cutter, 60mm', { link: 'https://www.olfa.com', details: 'The ergonomic one' }, -40, 'person1'),\n  W('Thread rack for the studio wall', { priority: 'soon', details: 'Holds 60 spools' }, -130, 'person1'),\n  W('Wool dryer balls', { fromInbox: true }, -12, 'person1'),\n  W('Le Creuset braiser', { details: 'Sea salt color', link: 'https://www.lecreuset.com' }, -300, 'person1'),\n  W('Fancy olive oil sampler', {}, -60, 'person1'),\n  W('Rain boots', { details: 'Size 8, dark green' }, -95, 'person1'),\n  W('Kindle Paperwhite', { priority: 'soon' }, -210, 'person1'),\n  W('Pottery class for two', { details: 'Odyssey ClayWorks, the 6-week one' }, -155, 'person2'),\n  W('Tickets to see Watchhouse again', {}, -25, 'person1'),\n  W('Warm robe', { achieved: true, givenBy: 'Mom', givenOn: dk(-312), notes: 'Christmas' }, -380, 'person1'),\n  W('AirPods', got('Ben', -680, 'Birthday'), -750, 'person1'),\n  W('Cutting mat, 24 x 36', got('Myself', -540), -600, 'person1'),\n  W('Linen sheets', got('Ben', -310, 'Christmas'), -420, 'person1'),\n  W('Bernina presser feet set', got('Ben', -315, 'Christmas'), -500, 'person1'),\n  W('Good umbrella', got('Jess', -160), -230, 'person1')\n]);\nadd('dreams_person2-wishlist', [\n  W('Trail running shoes', { priority: 'soon', details: 'Hoka Speedgoat, size 11' }, -45, 'person2'),\n  W('Smoker', { details: 'Pellet, something under $600', link: 'https://www.traeger.com' }, -260, 'person2'),\n  W('Hammock for the deck', {}, -120, 'person2'),\n  W('Headlamp', { fromInbox: true }, -18, 'person2'),\n  W('Fly fishing lesson', { details: 'Davidson River guides' }, -340, 'person2'),\n  W('Good chef’s knife', { priority: 'soon', details: 'Something Japanese, 8 inch' }, -190, 'person2'),\n  W('Vinyl: Kind of Blue', {}, -70, 'person2'),\n  W('Carhartt jacket', { details: 'Brown, large' }, -30, 'person2'),\n  W('Bike rack for the car', { link: 'https://www.thule.com' }, -410, 'person2'),\n  W('Wool hiking socks', got('Nora', -312, 'Stocking'), -360, 'person2'),\n  W('Camp stove', got('Myself', -600), -640, 'person2'),\n  W('Foam roller', got('Myself', -420), -450, 'person2'),\n  W('Bluetooth speaker for the garage', got('Nora', -320, 'Christmas'), -500, 'person2'),\n  W('Hydro Flask', got('His dad', -680, 'Birthday'), -720, 'person2'),\n  W('Garmin heart rate strap', got('Nora', -230, 'Birthday'), -280, 'person2'),\n  W('Tickets to a Tourists game', got('Marco', -150), -200, 'person2')\n]);\n\n// ---------- lists they made ----------\nvar Q = function (t, o, n) { return L(Object.assign({ title: t }, o || {}), n); };\nadd('dreams_cl-gifts-nb1', [\n  Q('Dad: fly-tying kit', { details: 'He asked for the beginner one' }, -95),\n  Q('Lena: Malaprop’s gift card', {}, -70),\n  Q('Marco and Jess: a nice bottle for the housewarming', {}, -44),\n  Q('Ben’s mom: beach photo', { details: 'The Outer Banks one, framed' }, -210),\n  Q('Priya: candle from the farmers market', {}, -33),\n  Q('Juniper: a new rope toy', { details: 'She ate the last one' }, -6),\n  Q('Nora’s sister: quilted table runner', { details: 'Nora makes it. Blue and rust.' }, -120),\n  Q('Neighbors: cookie tins', { details: 'The Harts and the Okafors' }, -20),\n  Q('Mom’s birthday: the spa day at Sunburst', { achieved: true }, -300),\n  Q('Ben’s dad: Father’s Day grill tools', { achieved: true }, -170),\n  Q('Lena: the plant she liked', { achieved: true }, -250),\n  Q('Jess: baby blanket (handmade)', { achieved: true }, -400),\n  Q('Marco: Tourists jersey', { achieved: true }, -350),\n  Q('Book club Secret Santa: tea sampler', { achieved: true }, -330),\n  Q('Mom: Christmas photo book', { achieved: true }, -320)\n]);\nadd('dreams_cl-house-nb2', [\n  Q('Fix the dripping kitchen faucet', { details: 'Probably the cartridge. Moen 1225.' }, -14),\n  Q('Clean the gutters', { details: 'Before the leaves really drop' }, -9),\n  Q('Raised bed for the side yard', {}, -160),\n  Q('Hang the big mirror in the hall', {}, -48),\n  Q('Replace the porch light with a motion one', {}, -75),\n  Q('Get a quote on the crawlspace', { details: 'Two companies, compare' }, -200),\n  Q('Caulk the upstairs tub', {}, -30),\n  Q('Paint the front door', { details: 'Dark green. Pick a dry weekend.' }, -240),\n  Q('Organize the garage shelves', {}, -110),\n  Q('Plant tulip bulbs', { details: 'By Thanksgiving' }, -5),\n  Q('New ceiling fan in the bedroom', { achieved: true }, -380),\n  Q('Smoke detector batteries', { achieved: true }, -330),\n  Q('Pressure wash the deck', { achieved: true }, -220),\n  Q('Build the studio cutting table', { achieved: true }, -480),\n  Q('Insulate the attic hatch', { achieved: true }, -300),\n  Q('Window film on the studio window', { achieved: true }, -140)\n]);\nadd('dreams_cl-dates-nb3', [\n  Q('Dollar Thursday at the Tourists', {}, -60),\n  Q('Hot Springs tubs at night', {}, -200),\n  Q('Comedy night at the Grey Eagle', {}, -45),\n  Q('Cooking class at the Chop Shop', { details: 'Butchery basics. Ben is in.' }, -90),\n  Q('Breakfast at the top of Mount Pisgah', {}, -150),\n  Q('Board game café on a rainy night', {}, -25),\n  Q('Dance lesson', { details: 'Swing, Wednesday nights' }, -7),\n  Q('Sunset paddle on Lake Julian', { achieved: true }, -260),\n  Q('Movie in the park', { achieved: true }, -180),\n  Q('Wine tasting at Biltmore', { achieved: true }, -300),\n  Q('Stargazing at Pisgah Astronomical', { achieved: true }, -120),\n  Q('Bowling and burgers', { achieved: true }, -80),\n  Q('Picnic at the Arboretum', { achieved: true }, -50),\n  Q('Make pasta from scratch together', { achieved: true }, -35)\n]);\n// two more lists: Ben's podcasts, and this year's Christmas\nvar xmasY = T0.getFullYear() + (T0.getMonth() === 11 && T0.getDate() > 26 ? 1 : 0);\nvar cl = get('dreams_custom-lists');\ncl.push({ id: 1690009000001, firebaseId: 'list_pods-ls1', title: 'Podcasts to try', key: 'cl-pods-ls1', dateAdded: iso(-330, 21), by: 'person2' });\ncl.push({ id: 1690009000002, firebaseId: 'list_xmas-ls2', title: 'Christmas ' + xmasY, key: 'cl-xmas-ls2', dateAdded: iso(-19, 20), by: 'person1' });\nput('dreams_custom-lists', cl);\nput('dreams_cl-pods-ls1', [\n  Q('Hard Fork', { details: 'Tech news, Fridays' }, -310), Q('Search Engine', {}, -280), Q('Heavyweight', { details: 'Lena’s favorite' }, -250),\n  Q('The Rest Is History', {}, -200), Q('Dolly Parton’s America', { details: 'Nora wants this one for a drive' }, -170), Q('Huberman Lab', {}, -130),\n  Q('You’re Wrong About', {}, -95), Q('Planet Money', {}, -60), Q('Song Exploder', {}, -40), Q('Normal Gossip', { details: 'Jess says start with season 1' }, -11),\n  Q('Serial, season 1', { achieved: true }, -320), Q('Radiolab', { achieved: true }, -290), Q('Ologies', { achieved: true }, -240),\n  Q('How I Built This', { achieved: true }, -210), Q('Revisionist History', { achieved: true }, -160), Q('Smartless', { achieved: true }, -100), Q('Science Vs', { achieved: true }, -50)\n].map(function (d) { d.by = 'person2'; return d; }));\nput('dreams_cl-xmas-ls2', [\n  Q('Order photo cards', { details: 'Use the Craggy Gardens picture' }, -18), Q('Get the tree from the farm in Fairview', {}, -18), Q('Cookie swap at Priya’s', {}, -16),\n  Q('Ship gifts to Ben’s parents by Dec 15', {}, -16), Q('Wrap everything', {}, -15), Q('Stocking stuffers', { details: 'Socks, chapstick, a book each' }, -14),\n  Q('Plan Christmas Eve dinner', { details: 'Ben’s chili or the lasagna?' }, -12), Q('Book the candlelight tickets at the Arboretum', {}, -10),\n  Q('Holiday market booth for the shop', { details: 'Second Saturday, Grove Arcade' }, -9), Q('Tip the mail carrier', {}, -6),\n  Q('Donate to the toy drive', {}, -4), Q('Ugly sweater party at Marco and Jess’s', { details: 'Dec 13. Bring the dip.' }, -3), Q('Mail the box to Nora’s sister', {}, -3), Q('Bake Grandma’s ginger cookies', {}, -2), Q('Watch Elf and Home Alone', {}, -1), Q('Get the lights down from the attic', { achieved: true }, -17), Q('Make the gift list', { achieved: true }, -19),\n  Q('Set the budget: $600', { achieved: true }, -19)\n]);\n\n  })();\n\n  // ---------- work.js ----------\n  (function () {\n    /* Work, filled in like two and a half years of daily use (Nov 2, \"work\" part): the shop's older posts with their\n       numbers (so What's working has real patterns and a few that took off), more ideas, pieces in progress, sparks,\n       Home Base, Waiting to be paid history, the shop's events and reminders over the last year and the next two\n       months, Ben's Work's Three (he has the Work page too, and it was empty), and the shop's costs in Money (Work's\n       This month said \"$0 out\" early in a month: Pirate Ship labels and ad spend come out on the 1st and 2nd).\n       Its own seeded random, so nothing else in the sample changes. */\n    var ws = 9157;\n    function wr0() { ws |= 0; ws = ws + 0x6D2B79F5 | 0; var t = Math.imul(ws ^ ws >>> 15, 1 | ws); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }\n    function wpick(a) { return a[Math.floor(wr0() * a.length)]; }\n    function wint(a, b) { return a + Math.floor(wr0() * (b - a + 1)); }\n    function wmoney(a, b) { return Math.round((a + wr0() * (b - a)) * 100) / 100; }\n    var wn = 0; function wid(p) { wn++; return 'wk' + p + '_' + (1690000000000 + wn * 6113).toString(36) + wn; }\n    var START = -915;   // when they started using the Work page\n\n    var W = JSON.parse(out['wr:data']), BZ = 'biz_willow_thread';\n    W.businesses[0].created = iso(START, 9);\n\n    // ---------- posted: the older posts ----------\n    // [title, format, angle, pillar, hook, body, platforms (first counts), month (1-12) for a seasonal one]\n    var OLD = [\n      ['Hello from the garage studio', 'photo', 'personal', 'Studio life', 'Hi, I’m Nora. I make quilts in a garage.', 'Welcome to the new account. Quilts, napkins and a dog named Juniper. Say hi below.', ['ig', 'fb']],\n      ['First market of the season', 'photo', 'personal', 'Studio life', 'Market season starts Saturday.', 'Find me by the coffee truck at the Saturday market, 8 to noon.', ['ig', 'fb'], 4],\n      ['How I press seams', 'reel', 'educational', 'Process', 'Press, don’t iron. Here’s the difference.', 'Lift and press, never slide. Seams to the dark side unless the block says otherwise.', ['ig', 'tt']],\n      ['Scrappy star block, step by step', 'carousel', 'educational', 'Process', '8 steps to a scrappy star block.', 'The block I make with every leftover. Save it for your scrap bin.', ['ig', 'pi']],\n      ['New napkins: Fieldstone', 'photo', 'promotional', 'New work', 'Fieldstone is in the shop.', 'Grey-blue cotton-linen, sets of 4, $36.', ['ig', 'fb']],\n      ['Which binding color?', 'story', 'engagement', 'Studio life', '', '', ['ig']],\n      ['A quilt for Grandma Ruth', 'reel', 'personal', 'Studio life', 'The first quilt I ever made was for her.', 'She kept it on the back of her couch for 20 years. This one is a thank-you.', ['ig', 'fb']],\n      ['Rotary cutter safety, please', 'reel', 'educational', 'Process', 'Close the blade. Every. Single. Time.', 'Three habits that keep your fingers where they belong.', ['tt', 'ig']],\n      ['Pot holders, round two', 'photo', 'promotional', 'New work', 'They sold out in a day last time.', 'Twelve more, $14 each. Heat-safe batting inside.', ['ig', 'fb']],\n      ['Why I prewash every fabric', 'carousel', 'hottake', 'Quilt care', 'Yes, I prewash. Fight me.', 'Shrinking, bleeding dye and finishes: here’s why I always wash first.', ['ig']],\n      ['The design wall, explained', 'reel', 'educational', 'Process', 'A flannel sheet on the wall changed everything.', 'How I lay out a quilt before sewing a single seam.', ['ig', 'tt']],\n      ['Spring custom quilt spots', 'photo', 'promotional', 'New work', 'Four custom spots for spring.', 'Baby quilts and throws, 6 to 8 weeks. DM or use the form in bio.', ['ig', 'fb'], 2],\n      ['Half-square triangles, the fast way', 'pin', 'educational', 'Process', 'Eight at once.', 'The 8-at-a-time half-square triangle method with the cut sizes.', ['pi']],\n      ['Half-square triangle size chart', 'pin', 'educational', 'Process', 'Every size, one chart.', 'Finished size, cut size, and how many you get. Pin it next to the machine.', ['pi']],\n      ['Quilt label ideas', 'pin', 'educational', 'Quilt care', 'Sign your quilts.', 'Four ways to label a quilt so the story stays with it.', ['pi']],\n      ['Market haul: what sold', 'story', 'personal', 'Studio life', '', '', ['ig']],\n      ['How long a napkin set really takes', 'reel', 'educational', 'Process', 'Two hours for four napkins. Here’s where it goes.', 'Cutting, mitered corners, pressing, labels. Sped up, but honest.', ['ig', 'tt']],\n      ['Shop update: summer colors', 'photo', 'promotional', 'New work', 'Lemon, sea glass and coral.', 'Summer napkins and runners are in the shop.', ['ig', 'fb'], 6],\n      ['Rainbow scrap quilt timelapse', 'reel', 'personal', 'Process', 'Four years of scraps, one quilt.', 'Every scrap from four years of napkins, sorted by color. 30 hours in 30 seconds.', ['tt', 'ig', 'yt']],\n      ['Studio cleanout before the holidays', 'reel', 'personal', 'Studio life', 'This is what the studio looks like in October. Yikes.', '', ['ig', 'tt'], 10],\n      ['Holiday order deadlines', 'photo', 'promotional', 'New work', 'Order by Dec 15 to get it in time.', 'Napkins, runners and pot holders ship in 2 days. Custom quilts are booked until spring.', ['ig', 'fb'], 11],\n      ['Gift sets are back', 'photo', 'promotional', 'New work', 'Gift sets, wrapped in linen.', 'A napkin set and two pot holders, $56. Ships by Dec 15.', ['ig', 'fb'], 11],\n      ['My favorite thread (not sponsored)', 'carousel', 'educational', 'Process', 'The thread I’ve used for six years.', '50-weight cotton for piecing, 40 for quilting. Why weight matters.', ['ig', 'pi']],\n      ['What I wish I knew at my first quilt', 'carousel', 'educational', 'Process', '7 things I wish someone told me.', 'A quarter inch is everything. So is a new needle.', ['ig', 'pi']],\n      ['Christmas Eve in the studio', 'story', 'personal', 'Studio life', '', '', ['ig'], 12],\n      ['Year in quilts', 'reel', 'personal', 'Studio life', '23 quilts this year.', 'Every quilt that left the studio this year, in order. Thank you.', ['ig', 'fb', 'tt'], 12],\n      ['Mitered napkin corners', 'reel', 'educational', 'Process', 'The cleanest napkin corner there is.', 'Fold, press, fold, trim. That’s the whole trick.', ['ig', 'tt', 'yt']],\n      ['Hand quilting a heirloom', 'video', 'educational', 'Process', 'Six hours of hand quilting, with me.', 'Sit and stitch with me: big-stitch hand quilting on a throw.', ['yt']],\n      ['Studio tour (the old one)', 'video', 'personal', 'Studio life', 'Before the garage: quilting at the kitchen table.', '', ['yt']],\n      ['How to wash a quilt', 'video', 'educational', 'Quilt care', 'Everything about washing a quilt, in eight minutes.', 'Cold water, color catchers, low heat. And what to do about a stain.', ['yt']],\n      ['Quilt care in winter', 'newsletter', 'educational', 'Quilt care', 'Keep your quilts cozy all winter', 'A short one: where quilts like to live in winter, and the one thing to avoid.', ['ss'], 1],\n      ['Studio letter: a new year', 'newsletter', 'personal', 'Studio life', 'What’s coming in the studio this year', 'Spring custom spots, a new colorway and a market schedule.', ['ss'], 1],\n      ['Studio letter: market season', 'newsletter', 'personal', 'Studio life', 'Where to find me this summer', 'The market schedule, and the new runners.', ['ss'], 5],\n      ['Studio letter: why prices went up', 'newsletter', 'personal', 'Studio life', 'A note about prices', 'Fabric costs went up 18% this year. Here’s what I changed, and what I didn’t.', ['ss']],\n      ['Studio letter: the holiday shop', 'newsletter', 'promotional', 'New work', 'The holiday shop is open', 'Gift sets, napkins and the last custom spot of the year.', ['ss'], 11],\n      ['Storing quilts for summer', 'newsletter', 'educational', 'Quilt care', 'Putting quilts away for the warm months', 'Fold loosely, cotton bags, no attic.', ['ss'], 5],\n      ['Machine maintenance Monday', 'reel', 'educational', 'Process', 'Clean the bobbin case. Right now.', 'Lint is the number one reason a machine skips. Thirty seconds, once a week.', ['ig', 'tt']],\n      ['Quilts aren’t just for beds', 'carousel', 'hottake', 'Quilt care', 'Your quilt is wasted in a closet.', 'Picnics, the couch, the car, the wall. Use it.', ['ig']],\n      ['Wall hanging vs throw', 'carousel', 'educational', 'Process', 'What size quilt do you actually want?', 'Baby, throw, twin, queen, wall: the sizes in inches, side by side.', ['ig', 'pi']],\n      ['Quilt size chart', 'pin', 'educational', 'Process', 'Every quilt size in inches.', 'Crib to king, with the batting size for each.', ['pi']],\n      ['Fabric scrap sorting system', 'pin', 'educational', 'Studio life', 'Sort scraps by size, not color.', 'Strips, squares, crumbs. Bins that make sense.', ['pi']],\n      ['Free napkin pattern', 'pin', 'educational', 'Process', 'Mitered napkins, free pattern.', 'Cut sizes for 18\" and 20\" napkins.', ['pi']],\n      ['Juniper inspects the new batting', 'photo', 'personal', 'Studio life', 'Quality control has arrived.', '', ['ig', 'fb']],\n      ['A day of cutting', 'story', 'personal', 'Process', '', '', ['ig']],\n      ['Poll: next colorway', 'story', 'engagement', 'New work', '', '', ['ig']],\n      ['This or that: fabric edition', 'story', 'engagement', 'Studio life', '', '', ['ig']],\n      ['Ask me anything: quilting', 'story', 'engagement', 'Studio life', '', '', ['ig']],\n      ['Packing orders on a Monday', 'reel', 'personal', 'Studio life', 'Monday is shipping day.', 'Twelve orders, one dog supervising.', ['ig', 'tt']],\n      ['Why a custom quilt costs $400', 'reel', 'hottake', 'Studio life', 'You’re not paying for fabric.', 'Thirty hours. Here’s the math, out loud.', ['tt', 'ig']],\n      ['Stop buying cheap batting', 'reel', 'hottake', 'Quilt care', 'Cheap batting is why your quilt went flat.', 'Cotton or 80/20, and why polyester pills.', ['tt', 'ig']],\n      ['Meet the new machine', 'reel', 'personal', 'Studio life', 'She’s here. She has a name.', 'A Juki TL-2010Q. Her name is Mabel.', ['ig', 'tt', 'yt']],\n      ['Free motion quilting for beginners', 'reel', 'educational', 'Process', 'Your first free motion stitch.', 'Feed dogs down, darning foot on, move your hands slower than you think.', ['ig', 'tt', 'yt']],\n      ['Free motion quilting, a whole class', 'video', 'educational', 'Process', 'Free motion quilting from zero.', 'A 20-minute lesson: setup, practice sandwich, meanders, loops.', ['yt']],\n      ['Table runner from start to finish', 'video', 'educational', 'Process', 'Make a table runner in an afternoon.', 'A beginner project with every cut and seam.', ['yt']],\n      ['Market setup, the long version', 'video', 'personal', 'Studio life', 'What it takes to do a market.', '', ['yt']],\n      ['New colorway: Harbor', 'photo', 'promotional', 'New work', 'Meet Harbor.', 'Deep navy and sand. Napkins and runners in the shop.', ['ig', 'fb']],\n      ['Thanksgiving table, styled', 'photo', 'promotional', 'New work', 'Our Thanksgiving table this year.', 'Rust runner, Harbor napkins. Both in the shop.', ['ig', 'fb', 'pi'], 11],\n      ['Back to school pencil pouches', 'photo', 'promotional', 'New work', 'Pencil pouches for back to school.', 'Zip pouches from scraps, $16.', ['ig', 'fb'], 8],\n      ['Summer picnic quilt', 'photo', 'promotional', 'New work', 'A picnic quilt with a waterproof back.', '$140, one of a kind.', ['ig', 'fb'], 7],\n      ['How I photograph my quilts', 'carousel', 'educational', 'Studio life', 'No fancy camera. Just a porch and morning light.', 'Phone, porch rail, 9 am, a white sheet. That’s it.', ['ig', 'pi']],\n      ['Pricing your handmade work', 'carousel', 'hottake', 'Studio life', 'Stop charging for fabric only.', 'Materials + time x a real hourly rate + fees. The formula I use.', ['ig']],\n      ['Fabric shops worth the drive', 'carousel', 'personal', 'Studio life', 'My favorite fabric shops within two hours.', 'Mill Supply, plus three more worth a Saturday.', ['ig']],\n      ['Binding by machine, start to finish', 'reel', 'educational', 'Process', 'Machine binding that looks hand-done.', 'Glue baste, stitch in the ditch, done.', ['ig', 'tt', 'yt']],\n      ['The ladder stitch', 'reel', 'educational', 'Process', 'The invisible stitch.', 'For binding and closing pillows. Slow motion so you can follow.', ['tt', 'ig']],\n      ['Quilt sandwich basting, three ways', 'reel', 'educational', 'Process', 'Pins, spray or thread?', 'I tried all three on the same quilt.', ['ig', 'tt']],\n      ['Removing a stain from an old quilt', 'reel', 'educational', 'Quilt care', 'A coffee stain on a 1940s quilt.', 'Cold water, a bit of gentle soap, patience. It came out.', ['ig', 'tt']],\n      ['Sun fading: what to do', 'carousel', 'educational', 'Quilt care', 'Why your quilt faded on one side.', 'Windows, rotation and which fabrics fade fastest.', ['ig', 'pi']],\n      ['Moths and quilts', 'carousel', 'educational', 'Quilt care', 'Something has been eating your quilt.', 'Cedar, cotton bags and a twice-a-year shake.', ['ig', 'pi']],\n      ['Wool vs cotton batting', 'carousel', 'educational', 'Quilt care', 'Wool or cotton? Depends on the bed.', 'Warmth, weight, washing and price.', ['ig', 'pi']],\n      ['Shop restock Friday', 'story', 'promotional', 'New work', '', '', ['ig']],\n      ['Last day for holiday shipping', 'story', 'promotional', 'New work', '', '', ['ig'], 12],\n      ['Market rain day', 'story', 'personal', 'Studio life', '', '', ['ig'], 9],\n      ['A quilt for Theo’s nursery', 'photo', 'personal', 'New work', 'For baby Theo, in sage and butter.', 'Custom quilts open again in the spring.', ['ig', 'fb']],\n      ['Memory quilt from dad’s shirts', 'reel', 'personal', 'Process', 'Twelve of her dad’s flannel shirts.', 'A memory quilt for a customer. I cried, she cried.', ['ig', 'fb', 'tt']],\n      ['The quilt that took a year', 'reel', 'personal', 'Process', 'This one took me a year.', 'Hand pieced, hand quilted, finished on New Year’s Eve.', ['ig', 'tt']],\n      ['Pressing station makeover', 'reel', 'personal', 'Studio life', 'A $40 pressing station.', 'Plywood, batting, canvas, staples.', ['ig', 'tt', 'pi']],\n      ['Big pressing board DIY', 'pin', 'educational', 'Studio life', 'Make a big pressing board.', 'Plywood, cotton batting, canvas. Under $40.', ['pi']],\n      ['10 minute mug rug', 'pin', 'educational', 'Process', 'A mug rug in 10 minutes.', 'The fastest scrap project I know.', ['pi']],\n      ['Zipper pouch tutorial', 'pin', 'educational', 'Process', 'Zipper pouches without fear.', 'Step-by-step with photos.', ['pi']],\n      ['Spring cleaning your sewing machine', 'pin', 'educational', 'Quilt care', 'Your machine wants a spring clean.', 'Lint, oil, new needle.', ['pi'], 3],\n      ['Valentine pot holders', 'photo', 'promotional', 'New work', 'Pot holders with hearts on.', 'A small batch for Valentine’s Day, $15.', ['ig', 'fb'], 2],\n      ['Easter table runner', 'photo', 'promotional', 'New work', 'Soft pastels for spring tables.', 'Runners in butter and sky.', ['ig', 'fb', 'pi'], 3],\n      ['Mother’s Day gift sets', 'photo', 'promotional', 'New work', 'For mom, wrapped.', 'Order by May 6 to ship in time.', ['ig', 'fb'], 4],\n      ['Shop is closed for a week', 'story', 'personal', 'Studio life', '', '', ['ig'], 7],\n      ['Back from vacation, orders shipping', 'story', 'personal', 'Studio life', '', '', ['ig'], 7],\n      ['Our first wholesale order', 'photo', 'personal', 'Studio life', 'Twenty-four napkin sets for a shop.', 'Our first wholesale order went out today. Proud and very tired.', ['ig', 'fb']],\n      ['Fabric haul from Mill Supply', 'reel', 'personal', 'Studio life', 'A fabric haul you didn’t ask for.', 'Linen, linen and more linen.', ['ig', 'tt']],\n      ['Cutting fabric for 40 napkins', 'reel', 'personal', 'Process', 'Satisfying? Or stressful?', 'One bolt, 40 napkins, one long morning.', ['tt', 'ig']],\n      ['Answering your binding questions', 'reel', 'educational', 'Process', 'You asked about binding. A lot.', 'Strip width, joining seams, and the corner.', ['ig', 'tt']],\n      ['The tools under $20 that matter', 'carousel', 'educational', 'Process', 'Five tools under $20.', 'Seam ripper, wonder clips, a 6\" ruler, marking pen, thread snips.', ['ig', 'pi']],\n      ['Quilt block of the month: log cabin', 'carousel', 'educational', 'Process', 'The log cabin block, step by step.', 'A beginner block that never goes out of style.', ['ig', 'pi']],\n      ['Quilt block of the month: flying geese', 'carousel', 'educational', 'Process', 'Flying geese, no waste.', 'Four at a time, with the cut sizes.', ['ig', 'pi']],\n      ['Quilt block of the month: churn dash', 'carousel', 'educational', 'Process', 'The churn dash, an old favorite.', 'Half-square triangles and rectangles.', ['ig', 'pi']],\n      ['Quilt block of the month: Ohio star', 'carousel', 'educational', 'Process', 'The Ohio star in 8 steps.', 'Quarter-square triangles, explained.', ['ig', 'pi']],\n      ['Handmade is not a hobby price', 'reel', 'hottake', 'Studio life', '“I could make that.” You could!', 'And it would take you 30 hours. That’s the price.', ['tt', 'ig']],\n      ['The truth about Etsy fees', 'carousel', 'hottake', 'Studio life', 'What Etsy takes from a $38 sale.', 'Listing, transaction, processing, ads. Line by line.', ['ig']],\n      ['Your favorite napkin color?', 'story', 'engagement', 'New work', '', '', ['ig']],\n      ['Guess how many hours', 'reel', 'engagement', 'Studio life', 'Guess how long this quilt took.', 'Comment your guess. Answer in the next post.', ['ig', 'tt']],\n      ['The answer: 41 hours', 'reel', 'personal', 'Studio life', 'You guessed 12. It was 41.', 'Every hour, broken down.', ['ig', 'tt']],\n      ['Workshop recap: beginner quilting', 'photo', 'personal', 'Studio life', 'Eight new quilters at the library.', 'Thank you to everyone at the beginner workshop. Next one in the fall.', ['ig', 'fb']],\n      ['Workshop sign-ups open', 'photo', 'promotional', 'New work', 'Learn to quilt in three hours.', 'Beginner workshop at the library, $65, all supplies.', ['ig', 'fb']],\n      ['Fall colors sneak peek', 'story', 'promotional', 'New work', '', '', ['ig'], 8],\n      ['Fall runners are back', 'photo', 'promotional', 'New work', 'Rust, mustard, deep green.', 'Fall runners, $46. Small batch.', ['ig', 'fb'], 9],\n      ['Leaf peeping picnic', 'photo', 'personal', 'Studio life', 'Blue Ridge Parkway, one quilt, one dog.', 'The picnic quilt earning its keep.', ['ig', 'fb'], 10],\n      ['Halloween pot holders', 'photo', 'promotional', 'New work', 'Spooky pot holders, a tiny batch.', 'Six of them. Go.', ['ig'], 10],\n      ['Behind the booth at the holiday market', 'reel', 'personal', 'Studio life', 'Twelve hours at the holiday market.', 'What sold, what didn’t, and the hot cocoa.', ['ig', 'tt'], 12],\n      ['Shop talk: slow season', 'newsletter', 'personal', 'Studio life', 'What January is like in a tiny business', 'Quiet, cold, and the best month for new ideas.', ['ss'], 1],\n      ['Studio letter: the long-arm fund', 'newsletter', 'personal', 'Studio life', 'Saving for a long-arm machine', 'Why, how much, and how long.', ['ss']],\n      ['Studio letter: what I learned at markets', 'newsletter', 'educational', 'Studio life', 'Ten markets, ten lessons', 'Bring weights. Price everything. Bring snacks.', ['ss'], 10],\n      ['Quilt care card, printable', 'pin', 'educational', 'Quilt care', 'A care card for every quilt.', 'Print it and tuck it in with a gift.', ['pi']],\n      ['Holiday gift guide for quilters', 'pin', 'promotional', 'Process', 'Gifts for the quilter in your life.', 'Tools, books and fabric they’ll actually use.', ['pi'], 11],\n      ['Scrap bunting in an evening', 'pin', 'educational', 'Process', 'Party bunting from scraps.', 'Triangles, bias tape, done.', ['pi']],\n      ['Big news: wholesale', 'reel', 'promotional', 'New work', 'You can buy our napkins in town now.', 'Old Town Gift Shop carries napkins and runners.', ['ig', 'fb']],\n      ['Napkin folding, three ways', 'reel', 'educational', 'New work', 'Three ways to fold a napkin for the table.', 'Pocket, simple fold, and the knot.', ['ig', 'tt', 'pi']],\n      ['How I fold a quilt for shipping', 'reel', 'educational', 'Quilt care', 'Fold a quilt so it never creases.', 'Roll, don’t fold, if you can.', ['ig', 'tt']],\n      ['A whole year of pot holders', 'reel', 'personal', 'New work', '210 pot holders this year.', 'Every color, in one minute.', ['ig', 'tt'], 12],\n      ['Studio before and after', 'carousel', 'personal', 'Studio life', 'The garage, before and after.', 'Insulation, shelves, a door that closes.', ['ig', 'fb']]\n    ];\n    function anchor(mo, dd) { for (var y = 1; y <= 3; y++) { var d = new Date(T0.getFullYear() - y, mo - 1, dd); var n = Math.round((d - T0) / 864e5); if (n <= -156 && n >= START + 10) { if (wr0() < 0.5 || y >= 2) return n; var d2 = new Date(T0.getFullYear() - y - 1, mo - 1, dd), n2 = Math.round((d2 - T0) / 864e5); return n2 >= START + 10 ? n2 : n; } } return null; }\n    var free = OLD.filter(function (p) { return !p[7]; }), fixed = OLD.filter(function (p) { return p[7]; });\n    var slots = [], step = (-156 - (START + 8)) / free.length;\n    free.forEach(function (p, i) { slots.push([p, Math.round(START + 8 + i * step + wr0() * step * 0.7)]); });\n    fixed.forEach(function (p) { var n = anchor(p[7], wint(3, 24)); if (n != null) slots.push([p, n]); });\n    // a post's numbers: its format, angle and pillar, how big the account was then, and the day's luck\n    var BASE = { reel: 4200, carousel: 2300, photo: 680, story: 430, video: 2600, pin: 1700, newsletter: 340 };\n    var TTB = 2700, ANG = { educational: 1.2, hottake: 1.15, personal: 1, promotional: 0.68, engagement: 0.8 }, PIL = { 'Quilt care': 1.15, 'Process': 1.1, 'Studio life': 1, 'New work': 0.8 };\n    var LIKE = { reel: 0.065, carousel: 0.08, photo: 0.058, story: 0.022, video: 0.05, pin: 0.02, newsletter: 0.06 };\n    var BIG = { 'Rainbow scrap quilt timelapse': 47200, 'Half-square triangle size chart': 38400 };\n    var added = [];\n    slots.forEach(function (sl) {\n      var p = sl[0], n = sl[1], f = p[1], plat = p[6][0];\n      var grow = 0.32 + 0.68 * Math.pow((n - START) / (-START), 1.3);   // the account grew over the years\n      var hour = f === 'photo' || f === 'story' ? wpick([18, 19, 20]) : f === 'newsletter' ? 10 : wpick([8, 9, 9, 9, 12]);\n      var v = Math.round((plat === 'tt' ? TTB : BASE[f]) * (ANG[p[2]] || 1) * (PIL[p[3]] || 1) * grow * (0.68 + wr0() * 0.75) * (hour <= 9 && f === 'reel' ? 1.15 : 1));\n      if (BIG[p[0]]) v = BIG[p[0]];\n      v = v > 1000 ? Math.round(v / 10) * 10 : v;\n      var res;\n      if (wr0() > 0.08) {   // a few never had their numbers typed in\n        var saveR = (p[2] === 'educational' ? (f === 'carousel' || f === 'pin' ? 0.075 : 0.04) : 0.006) * (0.7 + wr0() * 0.6);\n        var comR = (p[2] === 'hottake' ? 0.016 : p[2] === 'engagement' ? 0.02 : 0.007) * (0.6 + wr0() * 0.8);\n        res = { views: v, likes: Math.round(v * LIKE[f] * (0.75 + wr0() * 0.5)), comments: f === 'pin' ? Math.round(v * 0.0008) : Math.round(v * comR), saves: f === 'story' || f === 'video' || f === 'newsletter' ? 0 : Math.round(v * saveR),\n          shares: f === 'newsletter' ? 0 : Math.round(v * (f === 'reel' ? 0.012 : 0.004) * (0.5 + wr0())), at: iso(n + wint(2, 5), 20) };\n      }\n      var c = { id: wid('p'), bizId: BZ, text: p[0], hook: p[4] || '', body: p[5] || '', cta: '', type: p[2], stage: 'posted', created: iso(n - wint(4, 20), 9), rating: 0,\n        postedDate: iso(n, hour, wint(0, 50)), scheduledDate: dk(n), platforms: p[6], format: f, outline: '', shots: '', hashtags: '', notes: '', steps: f === 'reel' || f === 'video' ? { film: true, edit: true } : { create: true }, pillar: p[3], results: res };\n      if (p[5] && f !== 'story') c.cta = wpick(['Save this for later', 'Link in bio', 'Tell me in the comments', 'Send this to a quilter friend', 'Shop the link in bio', 'Follow for more']);\n      if (p[5] && wr0() < 0.6) c.hashtags = wpick(['#handmadequilt #quiltersofinstagram #slowmade', '#makersmarket #shopsmall #handmadegifts', '#tablelinens #handmadehome', '#sewingtips #quilting #quiltbinding', '#quiltcare #handmadequilt']);\n      if (f === 'story') c.outline = 'Frame 1: ' + p[0].toLowerCase() + '\\nFrame 2: a close-up\\nFrame 3: ' + (p[2] === 'engagement' ? 'poll sticker' : 'link sticker');\n      added.push(c);\n    });\n    // a couple of recent ones the older sample didn't have, in the same weeks\n    W.content = added.concat(W.content);\n\n    // ---------- in progress, ready and ideas ----------\n    function piece2(text, stage, n, o) { return Object.assign({ id: wid('c'), bizId: BZ, text: text, hook: '', body: '', cta: '', type: '', stage: stage, created: iso(n, wint(8, 21)), rating: 0, postedDate: null, scheduledDate: null, platforms: [], format: '', outline: '', shots: '', hashtags: '', notes: '', steps: {} }, o || {}); }\n    W.content.push(\n      piece2('Napkin gift wrap, the furoshiki way', 'ready', -6, { format: 'reel', platforms: ['ig', 'tt'], type: 'educational', pillar: 'New work', scheduledDate: dk(6), hook: 'Wrap a gift in a napkin. Then the napkin is a gift too.', outline: 'Napkin flat, gift in the middle\\nTwo corners over\\nTie the other two\\nThe finished knot', steps: { film: true, edit: true }, body: 'No paper, no tape. The napkin is part of the gift.', cta: 'Save this for gift season', hashtags: '#giftwrap #handmadegifts #zerowaste' }),\n      piece2('Small Business Saturday: 15% off', 'develop', -5, { format: 'photo', platforms: ['ig', 'fb'], type: 'promotional', pillar: 'New work', steps: { create: true }, notes: 'Photo of the gift sets stacked on the porch. Caption still to write; code SMALLSAT15.' }),\n      piece2('Quilt care card printable', 'develop', -11, { format: 'pin', platforms: ['pi'], type: 'educational', pillar: 'Quilt care', body: 'A printable care card to tuck in with a handmade quilt. Wash cold, tumble low, use it every day.' }),\n      piece2('What 41 hours of quilting looks like', 'develop', -9, { format: 'reel', platforms: ['ig', 'tt'], type: 'personal', pillar: 'Process', hook: 'This is what 41 hours looks like.', notes: 'Use the timelapse clips from the winter quilt. Script next.' }),\n      piece2('Studio letter: the year in the studio', 'develop', -3, { format: 'newsletter', platforms: ['ss'], type: 'personal', pillar: 'Studio life', outline: 'The binding video\\nWholesale\\nThe long-arm fund\\nWhat’s next for spring', body: 'This was the year a 60-second video changed the shop. Here’s what happened after…' }),\n      piece2('Winter colorway reveal', 'develop', -2, { format: 'story', platforms: ['ig'], type: 'promotional', pillar: 'New work', notes: 'Pine, snow, cranberry. Shoot when the fabric comes Friday.' })\n    );\n    [['Fat quarter friendly patterns', -60, 'carousel', 'Ideas from the myths post comments'], ['Market booth tour', -55, 'reel', ''], ['How I price custom work', -51, '', 'Careful with the numbers. Maybe a newsletter?'],\n     ['Day in the life: shipping day', -47, 'reel', ''], ['Quilt shops in Asheville', -44, 'carousel', 'River Arts District, plus the one in Black Mountain'], ['Ironing vs pressing, part 2', -40, '', ''],\n     ['Juniper’s favorite quilt', -36, 'photo', 'Easy one for a slow week'], ['Mending a customer’s baby quilt', -33, 'reel', 'Ask the Hendersons if I can film'], ['Fabric I’m loving this season', -30, 'carousel', ''],\n     ['Napkins vs paper towels: the cost', -27, 'carousel', 'Hot take? A year of paper napkins vs one set'], ['Hand-finishing the binding (long version)', -22, 'video', 'For YouTube, 15 minutes'], ['Unboxing the new fabric order', -19, 'reel', ''],\n     ['Setting up a sewing space in a closet', -14, 'pin', ''], ['Thank you for 10k', -11, 'story', 'Almost there after the binding reel'], ['Gifts for quilters under $25', -8, 'pin', ''],\n     ['What I’d tell a new maker', -5, 'carousel', ''], ['Quilting with kids', -2, '', 'Lena’s kids at the workshop: ask first'], ['January workshop announcement', -1, 'photo', '']].forEach(function (x) {\n      W.content.push(piece2(x[0], 'capture', x[1], { format: x[2], notes: x[3] }));\n    });\n\n    // ---------- Spark File: ideas for the business over the years ----------\n    var SP = [['Sell quilt kits', 'Pre-cut fabric + pattern, $48', 'high', 'high', -880], ['Etsy shop alongside the markets', '', 'high', 'medium', -860], ['Monogrammed napkins', '', 'low', 'medium', -820],\n      ['Booth at the Grove Arcade holiday market', 'Applications open in August', 'high', 'low', -790], ['Bulk fabric from Robert Kaufman wholesale', 'Need a resale certificate first', 'medium', 'medium', -760],\n      ['Quilted dog beds', 'Juniper would approve', 'medium', 'medium', -735], ['Napkin subscription, 4 a year', 'One set a season', 'medium', 'high', -700], ['Sell at the River Arts District studio stroll', '', 'high', 'medium', -665],\n      ['Teach at the community college', 'Continuing ed, spring term', 'medium', 'high', -640], ['Matching pot holder + towel sets', '', 'medium', 'low', -610], ['Corporate gifts for realtors', 'Closing gifts: a napkin set with a card', 'high', 'medium', -580],\n      ['Quilt restoration service', 'People keep asking at markets', 'high', 'high', -545], ['Printed pattern booklets', '', 'low', 'high', -515], ['Pinterest ads for the napkins', 'Try $5 a day for a month', 'medium', 'low', -480],\n      ['Collab with Blue Ridge Candle Co.', 'Gift box: candle + napkins', 'medium', 'low', -450], ['Wedding guest book quilt', 'Guests sign squares', 'high', 'medium', -420], ['Shop page on my own website', 'Lower fees than Etsy', 'medium', 'high', -390],\n      ['YouTube channel, for real', 'Long tutorials do well', 'high', 'high', -355], ['Wholesale line sheet', '', 'medium', 'low', -330], ['Sewing retreat weekend', 'Rent a cabin in Black Mountain, 8 people', 'high', 'high', -300],\n      ['Baby quilt gift registry', '', 'medium', 'medium', -270], ['Long-arm quilting for other quilters', 'Once the machine is paid off', 'high', 'high', -240], ['Holiday ornament kits', '', 'low', 'low', -210],\n      ['Instagram Live sew-alongs', 'Monthly, Sunday afternoons', 'medium', 'low', -180], ['Etsy Star Seller push', '', 'low', 'medium', -150], ['Pet quilts with the pet’s name', '', 'medium', 'medium', -120],\n      ['Sell offcut bundles', 'Scraps in 1 lb bags, $12', 'high', 'low', -95], ['Patreon for patterns', '', 'low', 'high', -62], ['Booth at Craft Fair of the Southern Highlands', 'Jury deadline in February', 'high', 'medium', -48],\n      ['Gift cards', 'Easy holiday add-on', 'medium', 'low', -29], ['Apprentice for summer', 'A sewing student, 10 hours a week', 'medium', 'high', -15]];\n    SP.forEach(function (s) { W.sparks.push({ id: wid('s'), bizId: BZ, title: s[0], note: s[1], excitement: s[2], effort: s[3], impact: '', created: iso(s[4], wint(7, 22)) }); });\n\n    // ---------- Home Base ----------\n    var HB = W.homebase[BZ];\n    HB.faqs = (HB.faqs || []).concat(['Do you take custom orders?', 'Where can I buy in person?', 'Do you do wholesale?', 'What’s the difference between a throw and a twin?', 'Can you repair an old quilt?']);\n    HB.hashtags = (HB.hashtags || []).concat([{ name: 'Tutorials', tags: '#sewingtips #quilting #quiltersofinstagram #learntoquilt' }, { name: 'Holidays', tags: '#handmadegifts #holidaygifts #giftsforher #shopsmall' }]);\n    HB.customLinks = (HB.customLinks || []).concat([{ label: 'Pirate Ship', url: 'https://ship.pirateship.com' }, { label: 'NC sales tax (NCDOR)', url: 'https://www.ncdor.gov/file-pay' }, { label: 'Substack', url: 'https://willowandthread.substack.com' }, { label: 'YouTube Studio', url: 'https://studio.youtube.com' }]);\n    HB.postUrls = Object.assign({}, HB.postUrls || {}, { tt: 'https://www.tiktok.com/tiktokstudio/upload', yt: 'https://studio.youtube.com', fb: 'https://business.facebook.com/latest/composer', ss: 'https://willowandthread.substack.com/publish/post' });\n    HB.ein = HB.ein || '88-4127365'; HB.stateId = HB.stateId || 'NC SOS ID 2219847';\n    W.offers[BZ] = W.offers[BZ].concat([{ name: 'Memory quilt from clothing', price: '$520', description: 'From 12 to 20 shirts, 8 weeks', status: 'active' }, { name: 'Quilt repair', price: 'from $60', description: 'Binding, patches, re-quilting. Quote first.', status: 'active' },\n      { name: 'Scrappy star pattern (PDF)', price: '$12', description: 'Throw and baby sizes', status: 'active' }, { name: 'Mug rugs, set of 2', price: '$18', description: '', status: 'active' },\n      { name: 'Fieldstone napkins', price: '$36', description: '', status: 'retired' }, { name: 'Pencil pouches', price: '$16', description: 'Back to school only', status: 'retired' }, { name: 'Picnic quilt, waterproof back', price: '$140', description: '', status: 'retired' }]);\n    W.brandColors[BZ] = W.brandColors[BZ].concat([{ hex: '#d9b44a', label: 'Mustard' }, { hex: '#3e4a5c', label: 'Harbor' }]);\n    var longD = function (d) { return d.toLocaleDateString('en-US', { month: 'long', day: 'numeric', year: 'numeric' }); };\n    var nxt = function (mo, d) { var x = new Date(T0.getFullYear(), mo - 1, d); if (x < T0) x = new Date(T0.getFullYear() + 1, mo - 1, d); return x; };\n    W.bizDates[BZ] = W.bizDates[BZ].concat([{ label: 'Small Business Saturday', date: longD(nxt(11, 28)) }, { label: 'Craft Fair of the Southern Highlands jury deadline', date: longD(nxt(2, 15)) }, { label: 'Market season opens', date: longD(nxt(4, 4)) }]);\n\n    // ---------- Waiting to be paid: a few open, the year's paid ones ----------\n    var M = JSON.parse(out.dbkSampleMoney);\n    function mAdd(n, desc, amt, extra) {\n      var d = day(n), m = ym(d), doc = M['financeTx/' + m]; if (!doc) return null;\n      if (n > 0) return null;\n      var t = Object.assign({ id: wid('t'), date: ymd(d), desc: desc, amount: amt, cat: 'business', source: 'simplefin', acct: 'a3', catSet: true }, extra || {});\n      doc.items.push(t); return t;\n    }\n    W.waiting.push({ id: wid('w'), bizId: BZ, client: 'The Hendersons', amount: 180, due: dk(10), note: 'Baby quilt repair: new binding and two patches', addedAt: dk(-6), by: 'person1', notIds: [] });\n    [['Grove Park Inn gift shop', 528, -330, 'Wholesale: 24 napkin sets'], ['Kelsey Moran', 520, -290, 'Memory quilt, balance'], ['Black Mountain Library', 250, -240, 'Spring workshop'],\n     ['Old Town Gift Shop', 462, -200, 'Wholesale reorder, invoice #1031'], ['Priya Shah', 225, -165, 'Wedding quilt, half'], ['Mountain Realty Group', 396, -120, '12 closing gift sets'],\n     ['Old Town Gift Shop', 528, -78, 'Wholesale, invoice #1038'], ['Laurel Henderson', 95, -50, 'Quilt repair']].forEach(function (x) {\n      var paidN = x[2] + wint(12, 32), t = mAdd(paidN, x[0].toUpperCase().indexOf('SHOP') >= 0 || x[0].indexOf('Library') >= 0 || x[0].indexOf('Group') >= 0 ? 'CHECK DEPOSIT ' + x[0].toUpperCase() : 'ZELLE FROM ' + x[0].toUpperCase(), x[1], { memo: x[3] });\n      var w = { id: wid('w'), bizId: BZ, client: x[0], amount: x[1], due: dk(x[2] + 30), note: x[3], addedAt: dk(x[2]), by: 'person1', notIds: [], gone: 'paid', goneAt: iso(paidN, 19) };\n      if (t) { w.paidTx = t.id; w.paidOn = t.date; W.waitUsed.push({ id: t.id, at: iso(paidN, 19) }); }\n      W.waiting.push(w);\n    });\n    put('wr:data', W);\n\n    // ---------- the shop's costs in Money (the 1st and 2nd too, so This month has money out from the start) ----------\n    Object.keys(M).filter(function (k) { return /^financeTx\\/\\d{4}-\\d{2}$/.test(k); }).sort().forEach(function (k) {\n      var m = k.slice(10), y = +m.slice(0, 4), mo = +m.slice(5) - 1, dim = daysIn(y, mo), cur = m === ym(T0), last = cur ? T0.getDate() : dim, items = M[k].items;\n      var add = function (d, desc, amt, extra) { d = Math.min(d, dim); if (d > last) return; items.push(Object.assign({ id: wid('t'), date: m + '-' + ('0' + d).slice(-2), desc: desc, amount: Math.round(amt * 100) / 100, cat: 'business', source: 'simplefin', acct: 'a3', catSet: true }, extra || {})); };\n      var busy = mo >= 9 ? 1.4 : mo <= 1 ? 0.7 : 1;\n      add(1, 'Pirate Ship, postage', -wmoney(24, 58) * busy);\n      add(2, 'Meta ads, Instagram boost', -wmoney(25, 60) * busy);\n      add(3, 'Etsy listing fees', -wmoney(31, 74) * busy);\n      add(15, 'Pirate Ship, postage', -wmoney(30, 70) * busy);\n      if (mo % 2 === 0) add(wint(5, 25), 'Uline, mailers and tissue', -wmoney(62, 148));\n      if (wr0() < 0.55) add(wint(4, 26), wpick(['Hawthorne Supply Co., fabric', 'Superior Threads', 'Spoonflower, printed fabric', 'Batting, Warm Company']), -wmoney(38, 165));\n      if (mo % 3 === 0) add(wint(8, 20), 'Sticker Mule, labels', -wmoney(48, 96));\n      if (mo >= 3 && mo <= 9) add(wint(1, 10), 'Saturday market booth', -60);\n      if (mo === 10 || mo === 11) add(wint(5, 18), 'Holiday market booth fee', -wpick([125, 150, 175]));\n      if (mo === 0) add(9, 'NC Secretary of State, LLC annual report', -200);\n      if (mo === 6) add(12, 'Blue Ridge Sewing, Juki service', -129);\n      items.sort(function (a, b) { return a.date.localeCompare(b.date); });\n    });\n    put('dbkSampleMoney', M);\n\n    // ---------- Work events over the last year and the next two months ----------\n    var E = JSON.parse(out.calendarEvents);\n    function wev(title, n, time, x) { E.push(Object.assign({ id: wid('e'), title: title, date: dk(n), time: time || null, endTime: null, allDay: !time, note: null, location: null, url: null, color: 'gold',\n      isMultiDay: false, eventGroup: null, repeatMode: 'single', recurring: null, space: 'work', spaceBy: 'person1' }, x || {})); }\n    function wrange(title, a, b, time, x) { var g = wid('g'); for (var n = a; n <= b; n++) wev(title, n, time, Object.assign({ isMultiDay: true, eventGroup: g, repeatMode: 'range', allDay: !time }, x || {})); }\n    // last year's market season, Saturdays April to October (this year's is already there)\n    var g1 = wid('g'), s0 = nextDow(6, -395);\n    for (var n = s0; n <= s0 + 7 * 28; n += 7) wev('Saturday farmers market booth', n, '07:30', { location: 'Main St. lot', isMultiDay: true, eventGroup: g1, repeatMode: 'recurring', recurring: { freq: 'weekly', endDate: dk(s0 + 7 * 28) } });\n    // supplier call, every other Wednesday\n    var g2 = wid('g'), w0 = nextDow(3, -360);\n    for (n = w0; n <= 60; n += 14) wev('Cut fabric for the week', n, '09:00', { color: null, isMultiDay: true, eventGroup: g2, repeatMode: 'recurring', recurring: { freq: 'biweekly', endDate: null }, note: 'Napkins first, then custom work' });\n    [[-358, 'Holiday market at the Grove Arcade', 2, '10:00', 'Grove Arcade'], [-330, 'Product photos: winter napkins', 0, '09:30', 'Back porch'], [-300, 'Supplier call: Hawthorne wholesale', 0, '14:00'],\n     [-286, 'Library workshop: beginner quilting', 0, '10:00', 'Riverbend Library, community room'], [-262, 'Meet with Mountain Realty about closing gifts', 0, '11:30', 'Their office on Haywood Rd'],\n     [-245, 'Drop off wholesale order at Old Town', 0, '15:00', 'Old Town Gift Shop'], [-232, 'Taxes with Marcy (CPA)', 0, '13:00', 'Ridgeline Accounting'], [-221, 'Spring product shoot', 0, '09:00', 'Back porch'],\n     [-205, 'Craft Fair of the Southern Highlands (shopping, not selling)', 0, '10:00', 'Harrah’s Cherokee Center'], [-190, 'Black Mountain Library workshop', 0, '10:00', 'Black Mountain Library'],\n     [-176, 'Juki service appointment', 0, '11:00', 'Blue Ridge Sewing'], [-168, 'Grove Park Inn: wholesale meeting', 0, '14:30', 'Grove Park Inn gift shop'], [-150, 'Etsy shop refresh day', 0, null],\n     [-135, 'Call with Kelsey: memory quilt', 0, '16:00'], [-118, 'River Arts District studio stroll', 1, '11:00', 'River Arts District'], [-89, 'Summer product shoot', 0, '08:30', 'Beaver Lake'],\n     [-70, 'Wholesale delivery: Old Town', 0, '15:00', 'Old Town Gift Shop'], [-58, 'Pitch call: Asheville Made', 0, '10:30'], [-41, 'Fall product shoot', 0, '09:00', 'Back porch'],\n     [-27, 'Library workshop: beginner quilting', 0, '10:00', 'Riverbend Library, community room'], [-16, 'Supplier call: Robert Kaufman rep', 0, '13:30'],\n     [2, 'Post office run: holiday orders', 0, '16:00', 'Riverbend post office'], [5, 'Holiday gift set photo shoot', 0, '09:30', 'Back porch'], [8, 'Deliver Old Town reorder', 0, '14:00', 'Old Town Gift Shop'],\n     [15, 'Call with the Hendersons: repair pickup', 0, '17:00'], [26, 'Small Business Saturday pop-up', 0, '10:00', 'Blue Door Bakery'], [31, 'Grove Arcade holiday market', 1, '10:00', 'Grove Arcade'],\n     [40, 'Last shipping day for the holidays', 0, null], [45, 'Holiday market at the library', 0, '09:00', 'Riverbend Library'], [52, 'Order spring fabric', 0, '10:00'], [58, 'Year-end inventory count', 0, '09:00']\n    ].forEach(function (x) { if (x[2]) wrange(x[1], x[0], x[0] + x[2], x[3], { location: x[4] || null }); else wev(x[1], x[0], x[3], { location: x[4] || null, color: /shoot|photo/i.test(x[1]) ? null : 'gold' }); });\n    put('calendarEvents', E);\n\n    // ---------- Work reminders ----------\n    var R = JSON.parse(out.lifeReminders);\n    function wrem(o) { return Object.assign({ id: wid('r'), description: null, link: null, phone: null, email: null, lastDone: null, snoozedUntil: null, space: 'work', spaceBy: 'person1' }, o); }\n    function mday(dd, back) { var d = new Date(T0.getFullYear(), T0.getMonth() - back, Math.min(dd, daysIn(T0.getFullYear(), T0.getMonth() - back))); return ymd(d); }\n    var mon = function (n) { var d = day(n); return { month: d.getMonth() + 1, day: d.getDate() }; };\n    var Q = [1, 4, 7, 10].map(function (mo) { return mo; });\n    R = R.concat([\n      wrem({ title: 'NC sales tax return', frequency: 'quarterly', notifyDate: { month: 1, day: 20 }, description: 'File and pay on NCDOR (E-500)', link: 'https://www.ncdor.gov/file-pay', lastDoneFor: ymd(new Date(T0.getFullYear(), 9, 20)), lastDone: iso(-13, 20) }),\n      wrem({ title: 'Send the studio letter', frequency: 'monthly', notifyDate: { month: 1, day: 10 }, lastDoneFor: mday(10, T0.getDate() >= 10 ? 0 : 1), lastDone: iso(-23, 10), link: 'https://willowandthread.substack.com/publish/post' }),\n      wrem({ title: 'Type in last week’s post numbers', frequency: 'weekly', dayOfWeek: 0, lastDone: iso(-T0.getDay() - (T0.getDay() === 0 ? 7 : 0), 20), description: 'Views, likes, comments, saves, shares, from each app' }),\n      wrem({ title: 'Restock the Etsy listings', frequency: 'weekly', dayOfWeek: 5, lastDone: iso(-((T0.getDay() - 5 + 7) % 7) - 7, 15) }),\n      wrem({ title: 'Back up product photos', frequency: 'monthly', notifyDate: { month: 1, day: 28 }, lastDoneFor: mday(28, 1), lastDone: iso(-6, 21) }),\n      wrem({ title: 'Oil and clean the Juki', frequency: 'monthly', notifyDate: { month: 1, day: 1 }, lastDoneFor: mday(1, 0), lastDone: iso(-1, 9) }),\n      wrem({ title: 'Apply to the Craft Fair of the Southern Highlands', frequency: 'yearly', notifyDate: { month: 2, day: 1 }, link: 'https://www.craftguild.org' }),\n      wrem({ title: 'Grove Arcade booth fee due', frequency: 'once', notifyDate: dk(7), description: '$150, pay online' }),\n      wrem({ title: 'Invoice Old Town for the reorder', frequency: 'once', notifyDate: dk(8) }),\n      wrem({ title: 'Order Uline mailers before December', frequency: 'once', notifyDate: dk(12), link: 'https://www.uline.com' }),\n      wrem({ title: 'Renew Etsy Plus', frequency: 'yearly', notifyDate: mon(71) }),\n      wrem({ title: 'Send 1099 info to Marcy', frequency: 'yearly', notifyDate: { month: 1, day: 25 }, description: 'Ridgeline Accounting', email: 'marcy@ridgeline.example' })\n    ]);\n    put('lifeReminders', R);\n\n    // ---------- Ben's Work's Three (he has the Work page too; it was empty) ----------\n    put('workThree_person2', { items: [{ text: 'Cut the boards for the market shelves', done: true, t: Date.parse(iso(0, 7, 40)) }, { text: 'Reconcile ' + day(-T0.getDate()).toLocaleDateString('en-US', { month: 'long' }) + ' in the shop’s account', done: false, t: Date.parse(iso(0, 7, 42)) }, { text: 'Drop the Old Town reorder at the post office', done: false, t: Date.parse(iso(0, 7, 45)) }], updatedAt: iso(0, 7, 45) });\n\n  })();\n\n  // ---------- welcome.js ----------\n  (function () {\n// a household 2.5 years in has seen the getting-started cards long ago\nput('dbkWelcomeSeen_person1', String(day(-900).getTime()));\nput('dbkWelcomeSeen_person2', String(day(-895).getTime()));\n\n  })();\n\n  window.dbkDemoData = out;\n  // which version of the sample this is: a browser holding an older one gets this one by itself (dbk-frame.js DEMO_VER,\n  // the same value; a test keeps them equal). Change both whenever the sample changes.\n  window.dbkDemoVersion = '2026-11-02b';\n})();\n\n\nvar D=window.dbkDemoData||{};Object.keys(D).forEach(function(k){set(k,D[k])});try{var M=JSON.parse(D.dbkSampleMoney||\"null\");if(M)Object.keys(M).forEach(function(p){set(\"sf:\"+(p.indexOf(\"/\")>0?p:p+\"/data\"),M[p])})}catch(e){}set(\"userLocation\",{lat:35.5951,lon:-82.5515,name:\"Asheville, NC\"});set(\"timezone\",\"America/New_York\");base();try{S.setItem(\"dbkSample\",SEED)}catch(e){}})();\n","sample-config.js":"window.DAYBOOK_CONFIG={\"schemaVersion\":1,\"app\":{\"name\":\"2daysBook\",\"shortName\":\"2daysBook\",\"accent\":\"#2e241f\"},\"people\":[{\"id\":\"p1\",\"name\":\"Nora\"},{\"id\":\"p2\",\"name\":\"Ben\"}],\"spaces\":[\"personal\",\"work\"],\"modules\":{\"habits\":{\"enabled\":true},\"journal\":{\"enabled\":false},\"meals\":{\"enabled\":true},\"us\":{\"enabled\":true},\"travel\":{\"enabled\":true},\"work\":{\"enabled\":true,\"for\":[\"p1\"]},\"finance\":{\"enabled\":true,\"bankSync\":\"none\"},\"moon\":{\"enabled\":false}},\"notifications\":{\"enabled\":false}};\n","sample-theme.css":"html{scrollbar-width:none}::-webkit-scrollbar{display:none}#dbkRoleHelp{display:none!important}\n\n/* the phone on the website adds room under the capture bar for its rounded corners, so leave that much space under the last card */\nhtml[data-dbk],html{--dbk-capbar-h:86px}\n\n/* the arrow after the page title shows in full (the app clips its right half at phone width) */\n.nav-links{overflow:visible!important}\n","gate.js":"(function(){var ENT=window.HEARTH_ENTITLEMENTS||{partner:false,aiMeals:false};var page=(window.__dbkPath||location.pathname).split(\"/\").pop().replace(\".html\",\"\")||\"index\";function onReady(fn){if(document.readyState!==\"loading\")fn();else document.addEventListener(\"DOMContentLoaded\",fn)}if(!ENT.partner&&page===\"person2-hub\"){__dbkLoc.href=\"index.html\";return}onReady(function(){if(!ENT.partner){if(page===\"our-dreams\"){var sections=document.querySelectorAll(\".section\");sections.forEach(function(sec){var title=sec.querySelector(\".landing-section-title\");if(!title)return;var text=title.textContent.trim();if(text===\"Weekly Prompt\"||text===\"Monthly Challenge\"){sec.style.display=\"none\"}})}if(page===\"meal-plan\"){}if(page===\"setup\"){var partnerToggle=document.getElementById(\"inp-partnerMode\");if(partnerToggle){partnerToggle.checked=false;var toggleRow=partnerToggle.closest(\".toggle-row\");if(toggleRow)toggleRow.style.display=\"none\"}var partnerFields=document.getElementById(\"partnerFields\");if(partnerFields)partnerFields.style.display=\"none\";if(window.wizardData)window.wizardData.partnerMode=false;var tipCards=document.querySelectorAll(\".tip-card\");tipCards.forEach(function(card){var title=card.querySelector(\".tip-card-title\");if(title&&title.textContent.trim()===\"Relationship Prompts\"){card.style.display=\"none\"}})}}if(!ENT.aiMeals){if(page===\"meal-plan\"){var genTabBtn=document.querySelector(`[onclick=\"switchTab('generate')\"]`);if(genTabBtn)genTabBtn.style.display=\"none\";var genView=document.getElementById(\"generate-view\");if(genView)genView.style.display=\"none\";window._originalCallAI=window.callAI;window.callAI=async function(){throw new Error(\"AI meal generation requires the AI Meal Generator add-on.\")}}}var CHECKOUT_URL=window.HEARTH_ENTITLEMENTS?.checkoutUrl||\"\";if(CHECKOUT_URL){let makeUpgradeCard2=function(title,desc,addOnKey){var card=document.createElement(\"div\");card.style.cssText=\"background:rgba(212,145,158,0.04);border:1px solid rgba(212,145,158,0.12);border-radius:14px;padding:20px 22px;margin:16px 0;text-align:center;\";card.innerHTML='<div style=\"font-size:0.88rem;color:var(--lh-text,#e0d2d0);margin-bottom:6px;font-weight:500;\">'+title+'</div><div style=\"font-size:0.78rem;color:var(--lh-text-muted,rgba(var(--lh-text-rgb),0.6));margin-bottom:14px;line-height:1.5;\">'+desc+`</div><button onclick=\"purchaseAddOn('`+addOnKey+`')\" style=\"background:var(--lh-accent,#d4919e);color:var(--lh-accent-on-text,#1e1816);border:none;padding:10px 24px;border-radius:10px;font-family:inherit;font-size:0.85rem;cursor:pointer;\">Unlock</button>`;return card};var makeUpgradeCard=makeUpgradeCard2;if(page===\"settings\"){if(!ENT.partner||!ENT.aiMeals){setTimeout(function(){var lastSection=document.querySelectorAll(\".settings-section\");var target=lastSection.length?lastSection[lastSection.length-1]:null;if(!target)return;var wrap=document.createElement(\"div\");wrap.className=\"settings-section\";wrap.style.cssText=\"margin-top:20px;\";wrap.innerHTML='<div class=\"section-header\"><h2 class=\"section-title\">Available Add-ons</h2></div><div class=\"section-body\" id=\"upgradeCards\"></div>';target.parentNode.insertBefore(wrap,target.nextSibling);var container=document.getElementById(\"upgradeCards\");if(!ENT.partner){container.appendChild(makeUpgradeCard2(\"2daysBook for Two\",\"Add a partner hub with their own habits, journal, and routines. Unlocks relationship prompts, monthly challenges, and shared features.\",\"partner\"))}if(!ENT.aiMeals){container.appendChild(makeUpgradeCard2(\"AI Meal Generator\",\"Generate personalized meal plans based on your goals and preferences. New plans anytime, for life.\",\"aiMeals\"))}},300)}}}});window.purchaseAddOn=async function(addOnKey){var ent=window.HEARTH_ENTITLEMENTS||{};var checkoutUrl=ent.checkoutUrl;if(!checkoutUrl){alert(\"Upgrade is not available right now. Please contact support.\");return}try{var response=await fetch(checkoutUrl,{method:\"POST\",headers:{\"Content-Type\":\"application/json\"},body:JSON.stringify({isUpgrade:true,addOns:[addOnKey],netlifySiteId:ent.siteId||\"\",stripeCustomerId:ent.customerId||\"\",returnUrl:window.location.origin})});var data=await response.json();if(data.url)__dbkLoc.href=data.url;else alert(\"Something went wrong. Please try again.\")}catch(e){alert(\"Something went wrong. Please try again or contact support.\")}}})();\n","entitlements.js":"// 2daysbook: what this copy of the app has, and the Firebase project it talks to.\n// firebaseConfig stays empty in the template: on the buyer's own Firebase Hosting it is read from\n// /__/firebase/init.json below, so nobody pastes keys; elsewhere the setup wizard asks for it.\nwindow.HEARTH_ENTITLEMENTS = {\n  partner:  false,    // two people in this household (set from config.js below)\n  workroom: false,    // the Work module is on\n  firebaseConfig: null\n};\n\n(function () {\n  var C = window.DAYBOOK_CONFIG; if (!C) return;\n  var M = C.modules || {}, E = window.HEARTH_ENTITLEMENTS;\n  E.partner = (C.people || []).length > 1;\n  E.workroom = !!(M.work && M.work.enabled);\n})();\n\n// ── Firebase Hosting auto-connect ──\n// When the app is served from the buyer's own Firebase Hosting, Firebase publishes that project's\n// web settings at /__/firebase/init.json. Reading it here means nobody ever pastes keys by hand:\n// the app simply connects to the project it is hosted in. Elsewhere (local testing, other hosts)\n// the request fails quietly and the setup wizard asks for the settings as before.\n(function () {\n  try {\n    if (window.HEARTH_ENTITLEMENTS.firebaseConfig) return;\n    var cur = null; try { cur = JSON.parse(localStorage.getItem('firebaseConfig') || 'null'); } catch (e) {}\n    if (cur && cur.apiKey && cur.projectId) return;\n    if (!/^https?:$/.test(location.protocol)) return;\n    var x = new XMLHttpRequest();\n    x.open('GET', '/__/firebase/init.json', false); // once, on a phone's very first open\n    x.send(null);\n    if (x.status !== 200) return;\n    var c = JSON.parse(x.responseText);\n    if (c && c.apiKey && c.projectId) {\n      window.HEARTH_ENTITLEMENTS.firebaseConfig = {\n        apiKey: c.apiKey, authDomain: c.authDomain, projectId: c.projectId,\n        storageBucket: c.storageBucket, messagingSenderId: c.messagingSenderId, appId: c.appId\n      };\n    }\n  } catch (e) {}\n})();\n\n// ── Seed the Firebase config on this phone when one is known ──\n(function () {\n  try {\n    var fc = window.HEARTH_ENTITLEMENTS && window.HEARTH_ENTITLEMENTS.firebaseConfig;\n    if (fc && fc.apiKey && fc.projectId) {\n      // also replaces a config left over from an older project on this phone\n      var cur = null; try { cur = JSON.parse(localStorage.getItem('firebaseConfig') || 'null'); } catch (e) {}\n      if (!cur || cur.projectId !== fc.projectId) {\n        localStorage.setItem('firebaseConfig', JSON.stringify(fc));\n      }\n      if (!localStorage.getItem('setupComplete')) {\n        localStorage.setItem('setupComplete', 'true');\n      }\n    }\n  } catch (e) {}\n})();\n","modules.js":"/* 2daysbook modules: shows only what this buyer has, minus what they've put away.\n   Reads window.DAYBOOK_CONFIG (config.js). The build script already leaves out the files of modules that\n   are off; this hides every link, tile, tab and section that would point at them, and sends anyone who\n   lands on a page that isn't part of this build back to Home. The menu itself is drawn by daybook-theme.js\n   from the same answers (window.dbkModule). Loaded on every page.\n\n   Archive: Settings > What shows lets the household put away any page and the main sections of every page\n   (Today's sections are listed there too, by daybook-theme.js). The list is one setting ('archived', synced with the other settings), so every phone\n   sees the same app. Putting something away hides it everywhere it is reachable from (menu, tiles, links;\n   opening a put-away page goes to Today) and never deletes its data; turning it back on brings it straight back. */\n(function () {\n  var C = window.DAYBOOK_CONFIG || { people: [{ id: 'p1' }, { id: 'p2' }], modules: {} };\n  var M = C.modules || {};\n  var people = (C.people || []).length || 1;\n  function on(name) { return !!(M[name] && M[name].enabled); }\n  function forPerson(name, p) { var m = M[name]; if (!m || !m.enabled) return false; return !m.for || m.for.indexOf(p) !== -1; }\n  // the person using this phone, as the settings file names them (p1 / p2)\n  function me() { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'p2' : 'p1'; } catch (e) { return 'p1'; } }\n\n  // ---- the archive ------------------------------------------------------------------------------\n  function readRaw() { try { var a = JSON.parse(localStorage.getItem('archived') || '[]'); return Array.isArray(a) ? a : []; } catch (e) { return []; } }\n  /* Parts that start put away (Kasey, Oct 25: the daily routine \"have it turned off and make it optional in settings. the\n     focus of that page will just be habits and the monthly challenge\"): away unless someone switched it on in Settings >\n     What shows, which saves '+<key>' in the same synced list. Nothing saved is changed or removed; the routine's steps stay. */\n  var START_AWAY = ['habits:routine'];\n  // what's away: the saved list, plus the parts that start away and weren't switched on (the '+' marks themselves left out)\n  function readArchived() {\n    var raw = readRaw(), out = raw.filter(function (k) { return k.charAt(0) !== '+'; });\n    START_AWAY.forEach(function (k) { if (raw.indexOf('+' + k) === -1 && out.indexOf(k) === -1) out.push(k); });\n    return out;\n  }\n  var archived = readArchived();\n  function isArchived(key) { return archived.indexOf(key) !== -1; }\n  function setArchived(key, away) {\n    var raw = readRaw();\n    var i = raw.indexOf(key);\n    if (away && i === -1) raw.push(key);\n    if (!away && i !== -1) raw.splice(i, 1);\n    if (START_AWAY.indexOf(key) !== -1) { var j = raw.indexOf('+' + key); if (away && j !== -1) raw.splice(j, 1); if (!away && j === -1) raw.push('+' + key); }\n    try { localStorage.setItem('archived', JSON.stringify(raw)); localStorage.setItem('_settingsLastSaved', String(Date.now())); } catch (e) {}\n    archived = readArchived();\n    markAway();\n    // (named, so switching something back on isn't taken for an old cloud copy and undone; see dbkSettings in shared.js)\n    if (window.dbkSettings && window.dbkSettings.save) { try { window.dbkSettings.save(['archived']); } catch (e) {} }\n    else if (typeof window.syncSettingsToFirebase === 'function') { try { window.syncSettingsToFirebase(); } catch (e) {} }\n    run();\n  }\n  // everything that can be put away in this build, in the order Settings lists it\n  function catalogue() {\n    var g = [];\n    var pages = [];\n    if (on('habits')) pages.push(['page:habits', 'Habits']);\n    if (on('meals')) pages.push(['page:meals', 'Meals']);\n    if (on('us')) pages.push(['page:us', 'Lists']);\n    else if (on('travel')) pages.push(['page:us', 'Travel']);\n    // Work can be for one person only; only they get to put it (or its views) away\n    if (forPerson('work', me())) pages.push(['page:work', 'Work']);\n    if (on('finance')) pages.push(['page:finance', 'Money']);\n    if (pages.length) g.push({ name: 'Pages', note: 'A page that is off leaves the menu. Nothing on it is deleted.', items: pages });\n    if (on('us') || on('travel')) {\n      var us = [];\n      if (on('us')) us.push(['us:restaurants', 'Restaurants'], ['us:places', 'Places to go'], ['us:wishlists', 'Wishlists']);\n      if (on('travel')) us.push(['us:travel', 'Travel']);\n      if (on('us')) us.push(['us:shows-movies', 'TV and movies'], ['us:reading', 'Reading list']);\n      g.push({ name: on('us') ? 'Lists page' : 'Travel page', items: us });\n    }\n    // the monthly challenge lives on Habits now; it keeps its old put-away key (us:challenges)\n    if (on('habits')) g.push({ name: 'Habits page', items: [['habits:board', 'Habits Bingo'], ['us:challenges', 'Monthly challenge'], ['habits:routine', 'Routine'], ['habits:workouts', 'Workouts'], ['hub:resources', 'Habit resources']] });\n    if (on('meals')) g.push({ name: 'Meals page', items: [['meals:recipes', 'Recipes'], ['meals:grocery', 'Grocery'], ['meals:journal', 'Food journal']] });\n    // the Work page as it is now: the overview's own parts (Work's Three, this month's business money, what's working),\n    // then Content, the Spark File and Home Base\n    if (forPerson('work', me())) {\n      var wk = [['work:three', 'Work’s Three']];\n      if (on('finance')) wk.push(['work:money', 'Business money']);\n      wk.push(['work:content', 'Content'], ['work:sparkfile', 'Spark File'], ['work:wins', 'What’s working'], ['work:homebase', 'Home Base']);\n      g.push({ name: 'Work page', items: wk });\n    }\n    if (on('finance')) g.push({ name: 'Money page', items: [['money:budget', 'Budget'], ['money:accounts', 'Accounts'], ['money:bills', 'Bills'], ['money:spending', 'Spending']] });\n    return g;\n  }\n  // the Work page is on for the person using this phone (and not put away): Personal / Work choices and Work tags show\n  function workOn() { archived = readArchived(); return forPerson('work', me()) && !isArchived('page:work'); }\n  window.dbkModule = { on: on, forPerson: forPerson, me: me, people: people, archived: isArchived, setArchived: setArchived, catalogue: catalogue, workOn: workOn };\n  // the Us page's sections, by the tile/section name the page uses\n  var US_SECTION = { restaurants: 'us:restaurants', places: 'us:places', wishlists: 'us:wishlists', travel: 'us:travel', 'shows-movies': 'us:shows-movies', tvmovies: 'us:shows-movies', reading: 'us:reading', challenges: 'us:challenges', history: 'us:challenges', challenge: 'us:challenges' };\n\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html');\n  // pages that only exist for a module: landing on one that's off goes Home\n  var PAGE_OWNER = {\n    'workroom.html': function () { return forPerson('work', me()); },\n    'finance.html': function () { return on('finance'); },\n    'person2-hub.html': function () { return people > 1 && on('habits'); },\n    'person1-hub.html': function () { return on('habits'); },\n    'our-dreams.html': function () { return on('us') || on('travel'); }\n  };\n  // the Meals page also holds sign-in and first-time setup, so it always ships; without Meals,\n  // someone who is already signed in goes Home instead of seeing meal planning\n  if (page === 'meal-plan.html' && !on('meals')) {\n    window.addEventListener('firebaseReady', function () {\n      if (window.firebaseUser) { if (window.__dbkLoc) window.__dbkLoc.replace('index.html'); else location.replace('index.html'); }\n    });\n  }\n  // Meals: a put-away tab that was open last time falls back to the plan (read before the page restores it)\n  if (page === 'meal-plan.html') {\n    var mt = null; try { mt = localStorage.getItem('lastTab'); } catch (e) {}\n    if (mt && isArchived('meals:' + mt)) { try { localStorage.setItem('lastTab', 'plan'); } catch (e) {} }\n  }\n  // A page that is put away, or isn't for the person on this phone, goes to Today instead of opening\n  // empty or with no name. Inside the app frame only the page being opened does this: a page the app is\n  // quietly loading in the background must not pull the screen away from the page you're on.\n  function myP() { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'p2' : 'p1'; } catch (e) { return 'p1'; } }\n  function pageAway() {\n    if (page === 'workroom.html') return isArchived('page:work') || !forPerson('work', myP());\n    if (page === 'finance.html') return isArchived('page:finance');\n    if (page === 'our-dreams.html') return isArchived('page:us');\n    if (page === 'meal-plan.html') return isArchived('page:meals');\n    if (/^person[12]-hub\\.html$/.test(page)) return isArchived('page:habits') || !forPerson('habits', page.indexOf('person2') === 0 ? 'p2' : 'p1');\n    return false;\n  }\n  function beingOpened() {\n    try {\n      if (window.parent === window || !window.frameElement) return true;\n      if (window.frameElement.classList.contains('on')) return true;\n      return (window.parent.location.hash || '').slice(1).split('#')[0].split('?')[0] === page;\n    } catch (e) { return true; }\n  }\n  function goToday() { if (window.__dbkLoc) window.__dbkLoc.replace('index.html#today'); else location.replace('index.html#today'); }\n  function leaveIfAway() {\n    archived = readArchived();\n    if (!pageAway() || !beingOpened()) return false;\n    if (page === 'meal-plan.html') {\n      // Meals also holds sign-in and first-time setup: only someone already set up and signed in leaves\n      var cfg = null; try { cfg = localStorage.getItem('firebaseConfig'); } catch (e) {}\n      var setUp = false; try { setUp = !!localStorage.getItem('htSetupComplete'); } catch (e) {}\n      if (!setUp) return false;\n      if (!cfg) { goToday(); return true; }\n      var check = function () { var a = window.firebaseAuth; if (window.firebaseUser || (a && a.currentUser)) goToday(); };\n      window.addEventListener('firebaseReady', function () { check(); setTimeout(check, 1500); setTimeout(check, 4000); }, { once: true });\n      return false;\n    }\n    goToday(); return true;\n  }\n  // a page kept loaded in the app is shown again (Back, a link): check again, things may have been put away since\n  window.addEventListener('dbk-show', function () { if (pageAway()) goToday(); });\n\n  if (page === 'person2-hub.html' && people < 2) { if (window.__dbkLoc) window.__dbkLoc.replace('index.html'); else location.replace('index.html'); return; }\n  if (PAGE_OWNER[page] && !PAGE_OWNER[page]()) {\n    if (!beingOpened()) return;\n    var to = 'index.html';\n    if (window.__dbkLoc) window.__dbkLoc.replace(to); else location.replace(to);\n    return;\n  }\n  if (leaveIfAway()) return;\n\n  // which module a link belongs to; null = always shown\n  function owner(href) {\n    if (!href) return null;\n    var f = href.split('#')[0].split('?')[0], h = (href.split('#')[1] || '');\n    if (f === 'workroom.html') return forPerson('work', me()) && !isArchived('page:work') ? null : 'off';\n    if (f === 'finance.html') return on('finance') && !isArchived('page:finance') ? null : 'off';\n    if (f === 'meal-plan.html') {\n      if (!on('meals') || isArchived('page:meals')) return 'off';\n      return h && isArchived('meals:' + h) ? 'off' : null;\n    }\n    if (f === 'our-dreams.html') {\n      if (isArchived('page:us')) return 'off';\n      if (h === 'travel') return on('travel') && !isArchived('us:travel') ? null : 'off';\n      if (h && US_SECTION[h] && isArchived(US_SECTION[h])) return 'off';\n      return on('us') ? null : 'off';\n    }\n    if (/^person[12]-hub\\.html$/.test(f)) {\n      var p = f.indexOf('person2') === 0 ? 'p2' : 'p1';\n      if (p === 'p2' && people < 2) return 'off';\n      if (isArchived('page:habits')) return 'off';\n      if (h && isArchived('hub:' + h)) return 'off';\n      return forPerson('habits', p) ? null : 'off';\n    }\n    return null;\n  }\n  // a Meals menu entry switches tabs with onclick instead of a hash\n  function mealsTabOf(a) {\n    var m = /switchTab\\('([a-z]+)'\\)/.exec(a.getAttribute('onclick') || '');\n    return m ? m[1] : '';\n  }\n\n  // menu styles say display !important, so the hide has to as well\n  function hideEl(el) { if (el && !el.hasAttribute('data-dbk-off')) { el.setAttribute('data-dbk-off', ''); el.hidden = true; el.style.setProperty('display', 'none', 'important'); } }\n  function showEl(el) { if (el && el.hasAttribute('data-dbk-off')) { el.removeAttribute('data-dbk-off'); el.hidden = false; el.style.removeProperty('display'); } }\n  // tiles sit in a grid whose borders are counted by position, so a tile that is away leaves the grid\n  // for real (kept aside, put back in its place when it comes back) instead of being hidden where it stands\n  var parked = [];\n  function parkEl(el) {\n    if (!el || !el.parentNode) return;\n    var anchor = document.createComment('dbk-away');\n    el.parentNode.insertBefore(anchor, el); el.parentNode.removeChild(el);\n    parked.push({ el: el, anchor: anchor });\n  }\n  function unparkAll(test) {\n    parked = parked.filter(function (p) {\n      if (test(p.el)) return true;\n      if (p.anchor.parentNode) { p.anchor.parentNode.insertBefore(p.el, p.anchor); p.anchor.parentNode.removeChild(p.anchor); }\n      return false;\n    });\n  }\n\n  function tidyMenus() {\n    // links anywhere on the page (Settings' quiet links, hub shortcuts) that point at something off or put away\n    document.querySelectorAll('a[href]').forEach(function (a) {\n      var href = a.getAttribute('href');\n      var tab = (page === 'meal-plan.html' && /^javascript:/.test(href || '')) ? mealsTabOf(a) : '';\n      var off = tab ? isArchived('meals:' + tab) : owner(href) === 'off';\n      if (off) hideEl(a); else showEl(a);\n    });\n    // the Us page: sections that belong to a module that's off, or that were put away\n    if (page === 'our-dreams.html') {\n      var usOff = function (k) {\n        if (k === 'travel' ? !on('travel') : !on('us')) return true;\n        return !!(US_SECTION[k] && isArchived(US_SECTION[k]));\n      };\n      unparkAll(function (el) { return el.matches('.landing-tile') && usOff(el.getAttribute('data-dream-section')); });\n      document.querySelectorAll('[data-dream-section]').forEach(function (s) {\n        var k = s.getAttribute('data-dream-section');\n        if (s.matches('.landing-tile')) { if (usOff(k)) parkEl(s); return; }\n        if (usOff(k)) hideEl(s); else showEl(s);\n      });\n      if (people < 2) document.querySelectorAll('[data-dream-person=\"person2\"]').forEach(hideEl);\n      if (!on('us') && on('travel')) document.title = 'Travel';\n    }\n    // personal hubs: habit tabs that are off or put away; a put-away tab that was open falls back to habits\n    var hubP = page === 'person1-hub.html' ? 'p1' : (page === 'person2-hub.html' ? 'p2' : null);\n    if (hubP) {\n      if (!forPerson('habits', hubP)) ['bingo-tab', 'resources-tab'].forEach(function (id) { hideEl(document.getElementById(id)); });\n      else if (isArchived('hub:resources')) {\n        var rt = document.getElementById('resources-tab'), bt = document.getElementById('bingo-tab');\n        if (rt && rt.classList.contains('active') && bt) { rt.classList.remove('active'); bt.classList.add('active'); }\n        try { if (localStorage.getItem(hubP === 'p2' ? 'person2Hub_activeTab' : 'person1Hub_activeTab') === 'resources') localStorage.removeItem(hubP === 'p2' ? 'person2Hub_activeTab' : 'person1Hub_activeTab'); } catch (e) {}\n        if (location.hash === '#resources') { try { history.replaceState(null, '', '#bingo'); } catch (e) {} }\n      }\n    }\n    // the Us page: a deep link to a section that is away does nothing\n    if (page === 'our-dreams.html' && typeof window.switchToSection === 'function' && !window.switchToSection._dbk) {\n      var orig = window.switchToSection;\n      var wrapped = function (sec) { if (sec && US_SECTION[sec] && isArchived(US_SECTION[sec])) return; return orig.apply(this, arguments); };\n      wrapped._dbk = 1; window.switchToSection = wrapped;\n    }\n    // Settings sections for modules that are off\n    // (and for pages this person doesn't have, or that are put away)\n    if (page === 'settings.html') {\n      var sm = document.getElementById('sec-meals'), sw = document.getElementById('sec-work');\n      if (!on('meals') || isArchived('page:meals')) hideEl(sm); else showEl(sm);\n      if (!forPerson('work', myP()) || isArchived('page:work')) hideEl(sw); else showEl(sw);\n      // the settings file turned notifications off for this copy\n      if (C.notifications && C.notifications.enabled === false) hideEl(document.getElementById('sec-notify'));\n    }\n    if (page === 'settings.html') { appNameHint(); showSettings(); }\n    // one login bought: the setup wizard never offers a partner login (the server refuses one anyway)\n    if (page === 'meal-plan.html' && people < 2) {\n      var ps = document.getElementById('htwiz-partner-login-section');\n      if (ps) ps.parentNode.removeChild(ps);\n    }\n    if (window.dbkPaintNav) { try { window.dbkPaintNav(); } catch (e) {} }\n  }\n\n  // Settings > Names > App name: the name inside the app changes right away; the label under the\n  // Home Screen icon is set by the phone when the app is added, so say how to update it\n  function appNameHint() {\n    var input = document.getElementById('appName');\n    if (!input || input._dbkHint) return;\n    input._dbkHint = true;\n    var tip = document.createElement('div');\n    tip.className = 'dbk-appname-tip'; tip.hidden = true;\n    tip.style.cssText = 'font-size:.82rem;opacity:.75;margin-top:6px;line-height:1.4';\n    tip.textContent = 'To change the name under the Home Screen icon too: press and hold the icon, remove it, then open the app\\u2019s link in Safari, tap Share \\u2192 Add to Home Screen and type the new name. Nothing in the app is lost.';\n    var row = input.closest('.setting-row') || input.parentNode;\n    row.parentNode.insertBefore(tip, row.nextSibling);\n    input.addEventListener('input', function () { tip.hidden = false; });\n  }\n\n  // Settings > What shows: one list of everything that can be put away in this build\n  function showSettings() {\n    var box = document.getElementById('dbkShowSet'); if (!box) return;\n    var groups = catalogue();\n    if (!groups.length) { box.hidden = true; return; }\n    var html = '';\n    groups.forEach(function (g) {\n      html += '<p class=\"dbk-set-note dbk-set-gap\">' + g.name + '</p>';\n      g.items.forEach(function (it) {\n        var away = isArchived(it[0]);\n        html += '<div class=\"dbk-set-row' + (away ? ' off' : '') + '\" data-archive=\"' + it[0] + '\"><label class=\"dbk-set-check\"><input type=\"checkbox\"' + (away ? '' : ' checked') + '><span>' + it[1] + '</span></label></div>';\n      });\n    });\n    if (on('habits') && people > 1) {   // (a one-person copy has only the one-person challenges)\n      var cur = challengeSetName();\n      html += '<p class=\"dbk-set-note dbk-set-gap\">Monthly challenge</p>';\n      [['couple', 'Written for the two of us'], ['solo', 'Written for me']].forEach(function (o) {\n        html += '<div class=\"dbk-set-row\"><label class=\"dbk-set-check\"><input type=\"radio\" name=\"dbkChallengeSet\" value=\"' + o[0] + '\"' + (cur === o[0] ? ' checked' : '') + '><span>' + o[1] + '</span></label></div>';\n      });\n    }\n    if (box.innerHTML !== html) box.innerHTML = html;\n    if (box._dbk) return; box._dbk = 1;\n    box.addEventListener('change', function (e) {\n      if (e.target.name === 'dbkChallengeSet') {\n        try { localStorage.setItem('challengeSet', e.target.value); localStorage.setItem('_settingsLastSaved', String(Date.now())); } catch (x) {}\n        if (window.dbkSettings && window.dbkSettings.save) { try { window.dbkSettings.save(['challengeSet']); } catch (x) {} }\n        else if (typeof window.syncSettingsToFirebase === 'function') { try { window.syncSettingsToFirebase(); } catch (x) {} }\n        return;\n      }\n      var r = e.target.closest('[data-archive]'); if (!r) return;\n      r.classList.toggle('off', !e.target.checked);\n      setArchived(r.getAttribute('data-archive'), !e.target.checked);\n    });\n  }\n  // which monthly challenge set this household reads (monthly-challenge.js uses the same rule)\n  function challengeSetName() {\n    var v = null; try { v = localStorage.getItem('challengeSet'); } catch (e) {}\n    if (v !== 'solo' && v !== 'couple') v = people < 2 ? 'solo' : 'couple';\n    return v;\n  }\n\n  // Sections that are put away are hidden by CSS keyed to one attribute on <html>, so a section the page\n  // draws later (Resources, the week of habits) is hidden too. A Work view that is away opens Overview.\n  var AWAY_CSS = {\n    'habits:board': '#bingoSectionWrap', 'us:challenges': '#dbkChallenge', 'habits:routine': '#scheduleSectionWrap, #scheduleUpNext', 'habits:workouts': '#dbkWorkout', 'hub:resources': '#dbkResLink, #resources-tab',\n    'money:accounts': 'section[aria-labelledby=\"finAcctTitle\"]', 'money:budget': 'section[aria-labelledby=\"finBudgetTitle\"]',\n    'money:bills': 'section[aria-labelledby=\"finBillsTitle\"]', 'money:spending': 'section[aria-labelledby=\"finTxTitle\"]',\n    'work:content': '#content-tab', 'work:homebase': '#homebase-tab', 'work:sparkfile': '#sparkfile-tab'\n  };\n  (function () {\n    var st = document.createElement('style');\n    st.textContent = Object.keys(AWAY_CSS).map(function (k) { return AWAY_CSS[k].split(',').map(function (sel) { return 'html[data-dbk-away~=\"' + k + '\"] ' + sel.trim(); }).join(', ') + ' { display: none !important; }'; }).join('\\n');\n    (document.head || document.documentElement).appendChild(st);\n  })();\n  function markAway() { document.documentElement.setAttribute('data-dbk-away', archived.join(' ')); }\n  function workAway() {\n    if (page !== 'workroom.html') return;\n    var h = (location.hash || '').replace('#', '').split('=')[0];\n    if (h && isArchived('work:' + h)) { try { history.replaceState(null, '', '#today'); } catch (e) {} if (window.dbkModeShow) { try { window.dbkModeShow('today'); } catch (e) {} } }\n  }\n  markAway();\n  window.addEventListener('hashchange', workAway);\n  function run() { archived = readArchived(); markAway(); workAway(); try { tidyMenus(); } catch (e) {} }\n  window.addEventListener('storage', function (e) { if (e.key === 'archived') run(); });\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();\n  window.addEventListener('load', run);\n})();\n","dbk-merge.js":"/* 2daysbook: one way to merge a list both people edit (Oct 20, data-loss fixes).\n   A phone never sends \"my whole list\" any more. It keeps a note of what IT changed (added, edited, removed,\n   item by item), and every save applies only that note onto the cloud's newest copy. So a slow or offline\n   phone, or two phones saving at the same moment, can't wipe out what the other one did.\n   Pure functions only (no storage, no cloud): used by daybook-theme.js (shared lists), app.bundle.js (Meals plan\n   and recipes), and tested in functions/test/merge.test.mjs. */\n(function (root) {\n  var J = function (x) { try { return JSON.stringify(x); } catch (e) { return String(x); } };\n  var clone = function (x) { try { return JSON.parse(JSON.stringify(x)); } catch (e) { return x; } };\n  var has = function (o, k) { return Object.prototype.hasOwnProperty.call(o, k); };\n\n  // an item's key: its id (firebaseId, id or lifeHubId, or the field given), else its content; the same content\n  // twice (two plain \"milk\" rows) gets #1, #2 so both are kept\n  function keysOf(list, field) {\n    var seen = {}, out = [];\n    (list || []).forEach(function (x) {\n      var k = null;\n      if (x && typeof x === 'object') {\n        var v = field ? x[field] : (x.firebaseId != null ? x.firebaseId : (x.id != null ? x.id : x.lifeHubId));\n        if (v != null && v !== '') k = 'k' + v;\n      }\n      if (k === null) { var j = 'j' + J(x); seen[j] = (seen[j] || 0) + 1; k = j + '#' + seen[j]; }\n      else if (seen[k]) k = null;              // the same id twice: the first one counts\n      else seen[k] = 1;\n      out.push(k);\n    });\n    return out;\n  }\n\n  // what this phone changed between what it knew (base) and what it has now (local).\n  // base null = it never knew the cloud's copy: everything it has is offered as \"add if it isn't there\" (soft),\n  // never as an edit or a removal\n  function diff(base, local, field, now) {\n    now = now || Date.now();\n    var ops = { up: {}, soft: {}, del: {}, ord: [] };\n    var lk = keysOf(local, field);\n    if (base == null) {\n      (local || []).forEach(function (x, i) { var k = lk[i]; if (k === null) return; ops.up[k] = clone(x); ops.soft[k] = 1; ops.ord.push(k); });\n      return ops;\n    }\n    var bk = keysOf(base, field), bm = {};\n    base.forEach(function (x, i) { if (bk[i] !== null) bm[bk[i]] = J(x); });\n    var inLocal = {}, bo = {};\n    base.forEach(function (x, i) { if (bk[i] !== null && !has(bo, bk[i])) bo[bk[i]] = x; });\n    (local || []).forEach(function (x, i) {\n      var k = lk[i]; if (k === null) return;\n      inLocal[k] = 1; ops.ord.push(k);\n      if (!has(bm, k) || bm[k] !== J(x)) {\n        ops.up[k] = clone(x);\n        // an item that was already there: what it was before, so only the fields this phone changed go up (fieldwise\n        // in apply). Oct 26: one phone renaming a grocery item while the other ticked it lost one of the two.\n        if (has(bm, k) && isObj(bo[k]) && isObj(x)) { ops.b = ops.b || {}; ops.b[k] = clone(bo[k]); }\n      }\n    });\n    Object.keys(bm).forEach(function (k) { if (!inLocal[k]) ops.del[k] = now; });\n    // moved around only (dragged into a new order): that counts as a change too\n    if (J(bk.filter(function (k) { return k !== null && inLocal[k]; })) !== J(ops.ord.filter(function (k) { return has(bm, k); }))) ops.reord = 1;\n    return ops;\n  }\n\n  // a newer note on top of an older one (the newer one wins, item by item)\n  function addOps(pend, ops) {\n    var p = pend ? clone(pend) : { up: {}, soft: {}, del: {}, ord: [] };\n    p.up = p.up || {}; p.soft = p.soft || {}; p.del = p.del || {};\n    Object.keys(ops.up || {}).forEach(function (k) {\n      var wasHard = has(p.up, k) && !p.soft[k];\n      // the item's \"before\" is from this phone's FIRST unsent change to it; an item this phone added (or an older note\n      // with no \"before\") keeps going up whole\n      var onTop = false;\n      if (!has(p.up, k)) { if (ops.b && has(ops.b, k)) { p.b = p.b || {}; p.b[k] = ops.b[k]; } else if (p.b) delete p.b[k]; }\n      else if (ops.soft && ops.soft[k]) { if (p.b) delete p.b[k]; }\n      // an unsent change to this item is already in the note, and this one says what it saw before it: only the fields\n      // it changed go on top (Oct 31 review: Done on the Work page, then an edit on Today, whose copy still had the item\n      // as it was before the Done, replaced the noted item whole and the Done was lost). A page's own edits one after\n      // another saw the item as already noted (their \"before\" is the noted one), so the newer one is taken as it is.\n      // The first \"before\" stays: it's what the cloud's copy is compared with when the note is sent.\n      else if (ops.b && has(ops.b, k) && isObj(p.up[k]) && isObj(ops.up[k])) { p.up[k] = merge3(p.up[k], ops.b[k], ops.up[k], 1); onTop = true; }\n      if (!onTop) p.up[k] = ops.up[k];\n      if (ops.soft && ops.soft[k] && !wasHard) p.soft[k] = 1; else delete p.soft[k];\n      delete p.del[k];\n    });\n    Object.keys(ops.del || {}).forEach(function (k) { delete p.up[k]; delete p.soft[k]; if (p.b) delete p.b[k]; p.del[k] = ops.del[k]; });\n    if (p.b && !Object.keys(p.b).length) delete p.b;\n    if (ops.ord && ops.ord.length) p.ord = ops.ord.slice();\n    if (ops.reord) p.reord = 1;\n    return p;\n  }\n\n  function isEmpty(p) { return !p || (!p.reord && !Object.keys(p.up || {}).length && !Object.keys(p.del || {}).length); }\n\n  // the cloud's list with this phone's note applied. gone: keys removed in the last 30 days (by either phone), so a\n  // phone that never knew an item was removed can't bring it back with a \"soft\" add. Returns { items, gone }.\n  function apply(server, pend, field, gone, now) {\n    now = now || Date.now();\n    var g = clone(gone || {}), cut = now - 30 * 864e5;\n    Object.keys(g).forEach(function (k) { if (!(g[k] > cut)) delete g[k]; });\n    server = server || [];\n    if (isEmpty(pend)) return { items: clone(server), gone: g };\n    var up = pend.up || {}, soft = pend.soft || {}, del = pend.del || {}, bf = pend.b || {};\n    var sk = keysOf(server, field), val = {}, sOrder = [];\n    server.forEach(function (x, i) {\n      var k = sk[i]; if (k === null) return;\n      if (has(del, k)) { if (k.charAt(0) === 'k') g[k] = del[k] || now; return; }   // only items with an id are remembered (keeps the list small)\n      // an edit to an item that was there: field by field onto the cloud's copy (the other phone's change to another\n      // field stays); with no \"before\", the whole item as this phone has it\n      val[k] = has(up, k) && !soft[k] ? (has(bf, k) && isObj(x) ? merge3(x, bf[k], up[k], 1) : clone(up[k])) : clone(x);\n      if (has(up, k) && !soft[k]) delete g[k];\n      sOrder.push(k);\n    });\n    Object.keys(up).forEach(function (k) {\n      if (has(val, k)) return;\n      if (soft[k] && has(g, k)) return;          // removed on purpose before; a phone that didn't know doesn't revive it\n      val[k] = clone(up[k]); if (!soft[k]) delete g[k];\n    });\n    // order: this phone's order for what it has, the other phone's new things where that phone put them\n    var ord = (pend.ord || []).filter(function (k) { return has(val, k); }), placed = {};\n    ord.forEach(function (k) { placed[k] = 1; });\n    var out = ord.slice();\n    var prev = null;\n    sOrder.forEach(function (k) {\n      if (placed[k]) { prev = k; return; }\n      var at = prev === null ? 0 : out.indexOf(prev) + 1;\n      out.splice(at, 0, k); placed[k] = 1; prev = k;\n    });\n    Object.keys(val).forEach(function (k) { if (!placed[k]) { out.push(k); placed[k] = 1; } });\n    // keep a tombstone list small: newest 500\n    var gk = Object.keys(g); if (gk.length > 500) { gk.sort(function (a, b) { return g[b] - g[a]; }).slice(500).forEach(function (k) { delete g[k]; }); }\n    return { items: out.map(function (k) { return val[k]; }), gone: g };\n  }\n\n  // after a save went through: drop from the note what was sent (unless it changed again meanwhile)\n  function settle(pendNow, pendSent) {\n    if (!pendNow) return null;\n    var p = clone(pendNow);\n    Object.keys((pendSent && pendSent.up) || {}).forEach(function (k) {\n      if (has(p.up, k) && J(p.up[k]) === J(pendSent.up[k]) && !!p.soft[k] === !!pendSent.soft[k]) { delete p.up[k]; delete p.soft[k]; if (p.b) delete p.b[k]; }\n    });\n    if (p.b && !Object.keys(p.b).length) delete p.b;\n    Object.keys((pendSent && pendSent.del) || {}).forEach(function (k) { if (has(p.del, k) && p.del[k] === pendSent.del[k]) delete p.del[k]; });\n    if (p.reord && pendSent && pendSent.reord && J(p.ord) === J(pendSent.ord)) delete p.reord;\n    return isEmpty(p) ? null : p;\n  }\n\n  // ---- keyed maps (the Meals plan: one entry per day) ----\n  // which keys differ between two maps (added, edited or removed)\n  function changedKeys(a, b) {\n    a = a || {}; b = b || {}; var out = [];\n    Object.keys(a).forEach(function (k) { if (!has(b, k) || J(a[k]) !== J(b[k])) out.push(k); });\n    Object.keys(b).forEach(function (k) { if (!has(a, k)) out.push(k); });\n    return out;\n  }\n  // the cloud's map with this phone's changed keys (dirty) taken from this phone (removed if this phone removed them)\n  function overlayMap(remote, local, dirty) {\n    var out = clone(remote || {}); local = local || {};\n    Object.keys(dirty || {}).forEach(function (k) { if (has(local, k)) out[k] = clone(local[k]); else delete out[k]; });\n    return out;\n  }\n  // a list keyed by id with this phone's changed ids (dirty) taken from this phone\n  function overlayList(remote, local, dirty, field) {\n    var lk = keysOf(local, field), p = { up: {}, soft: {}, del: {}, ord: lk.filter(function (k) { return k !== null; }) }, inLocal = {};\n    (local || []).forEach(function (x, i) { var k = lk[i]; if (k === null) return; inLocal[k] = 1; if (dirty && has(dirty, k)) p.up[k] = clone(x); });\n    Object.keys(dirty || {}).forEach(function (k) { if (!inLocal[k]) p.del[k] = 1; });\n    return apply(remote, p, field).items;\n  }\n  // One item both people may have changed (a Meals day, a recipe; Oct 24 audit): what this phone changed since base,\n  // part by part, onto the cloud's copy; every part this phone didn't touch stays as the cloud has it. depth: how far\n  // down to go (a day: 2 = person, then meal slot; a recipe: 1 = each field). Empty values (null, missing, [] or {})\n  // count as the same. Taking the whole item from the phone lost the partner's dinner on a night both planned, and the\n  // partner's heart on a recipe both hearted.\n  function slim(x) {\n    if (x === null || x === undefined) return undefined;\n    if (Array.isArray(x)) { if (!x.length) return undefined; return x.map(function (v) { var s = slim(v); return s === undefined ? null : s; }); }\n    if (typeof x === 'object') { var o = {}, n = 0; Object.keys(x).sort().forEach(function (k) { var v = slim(x[k]); if (v !== undefined) { o[k] = v; n++; } }); return n ? o : undefined; }\n    return x;\n  }\n  function merge3(cloud, base, local, depth) {\n    var same = function (a, b) { return J(slim(a)) === J(slim(b)); };\n    // nothing differs: this phone's copy exactly as it is (same keys, same order), so nothing reads it as a change\n    if (same(cloud, local)) return clone(local);\n    if (depth > 0 && isObj(cloud) && isObj(local) && (base == null || isObj(base))) {\n      base = base || {};\n      var out = {}, ks = [];\n      [local, cloud, base].forEach(function (x) { Object.keys(x).forEach(function (k) { if (ks.indexOf(k) < 0) ks.push(k); }); });\n      ks.forEach(function (k) { var v = merge3(cloud[k], base[k], local[k], depth - 1); if (v !== undefined) out[k] = v; });\n      return out;\n    }\n    return clone(same(local, base) ? cloud : local);\n  }\n  // which ids differ between two lists\n  function changedIds(a, b, field) {\n    var am = {}, bm = {}, ak = keysOf(a, field), bk = keysOf(b, field), out = {};\n    (a || []).forEach(function (x, i) { if (ak[i] !== null) am[ak[i]] = J(x); });\n    (b || []).forEach(function (x, i) { if (bk[i] !== null) bm[bk[i]] = J(x); });\n    Object.keys(am).forEach(function (k) { if (am[k] !== bm[k]) out[k] = 1; });\n    Object.keys(bm).forEach(function (k) { if (!has(am, k)) out[k] = 1; });\n    return out;\n  }\n\n  // ---- one document made of parts (the Work page: workroom/data, Oct 23) ----\n  // The document is a set of named parts: lists (ideas and posts, sparks, businesses...), maps of maps (Home Base,\n  // offers and dates per business) and plain values. A note of changes ('dn') holds, by path (names joined with '|'):\n  //   l: { path: list note (as above, item by item) }   v: { path: { v: value } | { d: 1 } removed | { v: {}, s: 1 } made if missing }\n  // so two phones adding, editing or removing different things in the same part both keep what they did.\n  var SEP = '|';\n  var isObj = function (x) { return !!x && typeof x === 'object' && !Array.isArray(x); };\n  var depth = function (p) { return p.split(SEP).length; };\n  function diffDoc(base, local, now) {\n    now = now || Date.now();\n    var out = { l: {}, v: {} };\n    var walk = function (b, l, path) {\n      var ks = {}; Object.keys(b || {}).forEach(function (k) { ks[k] = 1; }); Object.keys(l || {}).forEach(function (k) { ks[k] = 1; });\n      Object.keys(ks).forEach(function (k) {\n        var p = path ? path + SEP + k : k, bv = b ? b[k] : undefined, lv = l ? l[k] : undefined;\n        if (lv === undefined) { if (bv !== undefined) out.v[p] = { d: 1 }; return; }\n        if (Array.isArray(lv) && (bv === undefined || Array.isArray(bv))) {\n          var ops = diff(bv || [], lv, null, now);\n          if (!isEmpty(ops)) out.l[p] = ops;\n          return;\n        }\n        if (isObj(lv) && (bv === undefined || isObj(bv))) {\n          if (bv === undefined) out.v[p] = { v: {}, s: 1 };\n          walk(bv, lv, p);\n          return;\n        }\n        if (J(bv) !== J(lv)) out.v[p] = { v: clone(lv) };\n      });\n    };\n    walk(isObj(base) ? base : {}, isObj(local) ? local : {}, '');\n    return out;\n  }\n  function isEmptyDoc(p) {\n    if (!p) return true;\n    if (Object.keys(p.v || {}).length) return false;\n    return !Object.keys(p.l || {}).some(function (k) { return !isEmpty(p.l[k]); });\n  }\n  var under = function (x, p) { return x === p || x.indexOf(p + SEP) === 0; };\n  // a newer note on top of an older one: the newer wins, path by path\n  function addDocOps(older, newer) {\n    var p = older ? clone(older) : { l: {}, v: {} };\n    p.l = p.l || {}; p.v = p.v || {};\n    if (!newer) return p;\n    Object.keys(newer.v || {}).sort(function (a, b) { return depth(a) - depth(b); }).forEach(function (path) {\n      var nv = newer.v[path];\n      if (nv.s) {\n        if (p.v[path] && p.v[path].d) { p.v[path] = { v: clone(nv.v) }; return; }   // removed, then made again: start it empty\n        if (!p.v[path]) p.v[path] = clone(nv);\n        return;\n      }\n      Object.keys(p.v).forEach(function (x) { if (under(x, path)) delete p.v[x]; });\n      Object.keys(p.l).forEach(function (x) { if (under(x, path)) delete p.l[x]; });\n      p.v[path] = clone(nv);\n    });\n    Object.keys(newer.l || {}).forEach(function (path) {\n      var held = p.v[path];\n      if (held && !held.d && Array.isArray(held.v)) { held.v = apply(held.v, newer.l[path]).items; return; }\n      p.l[path] = addOps(p.l[path], newer.l[path]);\n    });\n    return p;\n  }\n  var getAt = function (o, path) { var ks = path.split(SEP), cur = o; for (var i = 0; i < ks.length; i++) { if (!isObj(cur)) return undefined; cur = cur[ks[i]]; } return cur; };\n  var setAt = function (o, path, val, del) {\n    var ks = path.split(SEP), cur = o;\n    for (var i = 0; i < ks.length - 1; i++) { if (!isObj(cur[ks[i]])) { if (del) return; cur[ks[i]] = {}; } cur = cur[ks[i]]; }\n    if (del) delete cur[ks[ks.length - 1]]; else cur[ks[ks.length - 1]] = val;\n  };\n  // the cloud's document with this phone's note on top. gone: removals remembered per list path. Returns { items, gone }\n  function applyDoc(server, pend, gone, now) {\n    now = now || Date.now();\n    var out = isObj(server) ? clone(server) : {}, g = isObj(gone) ? clone(gone) : {};\n    if (!pend) return { items: out, gone: g };\n    var v = pend.v || {}, l = pend.l || {};\n    Object.keys(v).sort(function (a, b) { return depth(a) - depth(b); }).forEach(function (path) {\n      var x = v[path];\n      if (x.d) setAt(out, path, null, true);\n      else if (x.s) { if (!isObj(getAt(out, path))) setAt(out, path, clone(x.v)); }\n      else setAt(out, path, clone(x.v));\n    });\n    Object.keys(l).forEach(function (path) {\n      if (isEmpty(l[path])) return;\n      var cur = getAt(out, path), r = apply(Array.isArray(cur) ? cur : [], l[path], null, g[path], now);\n      setAt(out, path, r.items);\n      if (Object.keys(r.gone).length) g[path] = r.gone; else delete g[path];\n    });\n    return { items: out, gone: g };\n  }\n  // after a save went through: drop from the note what was sent (unless it changed again meanwhile)\n  function settleDoc(pendNow, pendSent) {\n    if (!pendNow) return null;\n    var p = clone(pendNow); p.l = p.l || {}; p.v = p.v || {};\n    Object.keys((pendSent && pendSent.v) || {}).forEach(function (k) { if (has(p.v, k) && J(p.v[k]) === J(pendSent.v[k])) delete p.v[k]; });\n    Object.keys((pendSent && pendSent.l) || {}).forEach(function (k) { if (!has(p.l, k)) return; var s = settle(p.l[k], pendSent.l[k]); if (s) p.l[k] = s; else delete p.l[k]; });\n    return isEmptyDoc(p) ? null : p;\n  }\n\n\n  // ---- a short list of fixed lines (Today's Three, Work's Three): each line keeps its own time ----\n  // Two devices of one person save the same document. Whole-list \"newest wins\" lost the other device's line when both\n  // saved within a few seconds (overnight audit, Oct 23). Each line carries t (when it last changed); a line taken off\n  // keeps the words it took off in `was`, so it never takes off something else the other device put there meanwhile.\n  // Older copies without t count each line at the copy's own time.\n  function lineNorm(items, at, n) {\n    var out = [];\n    for (var i = 0; i < (n || 3); i++) {\n      var x = (items || [])[i] || {}, o = { text: String(x.text || ''), done: !!x.done, t: typeof x.t === 'number' ? x.t : (+at || 0) };\n      if (!o.text && x.was) o.was = String(x.was);\n      out.push(o);\n    }\n    return out;\n  }\n  // what changed against base gets the time now; the rest keeps its time\n  function lineStamp(base, items, now, n) {\n    var b = lineNorm(base, 0, n), out = [];\n    for (var i = 0; i < (n || 3); i++) {\n      var x = (items || [])[i] || {}, text = String(x.text || ''), done = !!x.done && !!text, o;\n      if (text === b[i].text && done === b[i].done) { o = { text: text, done: done, t: b[i].t }; if (!text && b[i].was) o.was = b[i].was; }\n      else { o = { text: text, done: done, t: now }; if (!text && b[i].text) o.was = b[i].text; }\n      out.push(o);\n    }\n    return out;\n  }\n  function lineMerge(a, b, n) {\n    var out = [];\n    for (var i = 0; i < (n || 3); i++) {\n      var x = a[i] || { text: '', done: false, t: 0 }, y = b[i] || { text: '', done: false, t: 0 };\n      // newer wins; the same time is settled the same way on every device\n      var w = x.t > y.t || (x.t === y.t && J(x) > J(y)) ? x : y, l = w === x ? y : x;\n      // an emptied line only empties what it saw there\n      if (!w.text && w.was !== undefined && l.text && l.text !== w.was) w = l;\n      out.push(clone(w));\n    }\n    return out;\n  }\n\n  root.dbkMerge = { keysOf: keysOf, diff: diff, addOps: addOps, isEmpty: isEmpty, apply: apply, settle: settle,\n    changedKeys: changedKeys, overlayMap: overlayMap, overlayList: overlayList, changedIds: changedIds, merge3: merge3,\n    diffDoc: diffDoc, addDocOps: addDocOps, applyDoc: applyDoc, settleDoc: settleDoc, isEmptyDoc: isEmptyDoc,\n    lineNorm: lineNorm, lineStamp: lineStamp, lineMerge: lineMerge };\n})(typeof window !== 'undefined' ? window : globalThis);\n","dbk-split.js":"/* 2daysbook: \"just mine\" kept in each person's own place (Nov 1, security, slice C of the private-lock plan).\n   Kasey chose \"just mine\" truly private between partners. Until now a private calendar event, reminder or Recently\n   removed entry stayed in the shared list (calendarEvents/data, lifeReminders/data, dbkRemoved/data) with an owner mark,\n   and only the partner's PHONE hid it: the partner's login could read it. Now such an item lives only in that person's\n   own document, own_calendar_<person>/data, own_reminders_<person>/data, own_removed_<person>/data (firestore.rules\n   `personal`: only their login reads or writes it), same shape { items, _gone } (+ the server's _in and _dup).\n   Pages keep asking for the shared list: the sync layer in daybook-theme.js reads both places and hands the page one\n   list (shared + this person's own), and a save sends each change where it belongs (combine / splitNote below).\n   Existing items are moved by the SERVER (functions/private-move.js), never by a phone: one admin transaction per list.\n   Pure parts only; tested in functions/test/private-split.test.mjs, and homeOf is kept equal to the server's twin\n   (functions/private-items.js homeOf) by that test. */\n(function (root) {\n  var LISTS = {\n    calendarEvents: { own: 'own_calendar_', area: 'calendar' },\n    lifeReminders: { own: 'own_reminders_', area: 'reminders' },\n    dbkRemoved: { own: 'own_removed_', area: null }\n  };\n  // the areas a Recently removed entry's list belongs to (dbk-sharing.js AREAS cols)\n  var AREA_OF = { calendarEvents: 'calendar', lifeReminders: 'reminders', groceries: 'groceries', mealGroceries: 'groceries',\n    finance_bills: 'money', finance_accounts: 'money', mealplan_recipes: 'recipes' };\n  var PEOPLE = { person1: 1, person2: 1 };\n  function colOf(p) { return String(p || '').split('/')[0]; }\n  // 'calendarEvents/data' (or the phone key 'calendarEvents') is one of the lists kept in two places\n  function isSplit(p) { var s = String(p || '').split('/'); return !!LISTS[s[0]] && (s.length === 1 || (s.length === 2 && s[1] === 'data')); }\n  function ownPath(p, person) { return LISTS[colOf(p)].own + person + '/data'; }\n  // 'own_calendar_person1/data' -> { shared: 'calendarEvents/data', person: 'person1' } (null: not one of these)\n  function ownOf(path) {\n    var m = /^(own_[a-z]+_)(person[12])\\/data$/.exec(String(path || '')); if (!m) return null;\n    for (var c in LISTS) if (LISTS[c].own === m[1]) return { shared: c + '/data', person: m[2], col: c };\n    return null;\n  }\n  // an item's key, the same as dbk-merge.js keysOf with no key field (firebaseId, id or lifeHubId), null without one\n  function keyOf(x) {\n    if (!x || typeof x !== 'object') return null;\n    var v = x.firebaseId != null ? x.firebaseId : (x.id != null ? x.id : x.lifeHubId);\n    return v != null && v !== '' ? 'k' + v : null;\n  }\n  /* whose own place an item belongs in right now: 'person1' | 'person2', or null (the shared list).\n     ownerOf(x, area, privBy) is the \"just mine\" rule (dbk-sharing.js / functions/private-items.js ownerOf).\n     A Recently removed entry goes with what it holds: the first item someone keeps just for themselves decides (its own\n     `by` is who removed it, so that never counts). Items with no id never move (nothing could follow them). */\n  function homeOf(x, col, privBy, ownerOf) {\n    if (!x || typeof x !== 'object' || !LISTS[col] || keyOf(x) === null) return null;\n    if (col === 'dbkRemoved') {\n      var a = AREA_OF[String(x.key || '')]; if (!a || !Array.isArray(x.items)) return null;\n      for (var i = 0; i < x.items.length; i++) { var o = ownerOf(x.items[i], a, privBy); if (PEOPLE[o]) return o; }\n      return null;\n    }\n    var w = ownerOf(x, LISTS[col].area, privBy);\n    return PEOPLE[w] ? w : null;\n  }\n  // the one list a page sees: the shared items (without any this person's own place also holds), then the own ones\n  function combine(shared, own) {\n    if (!Array.isArray(own) || !own.length) return shared;\n    var have = {}; own.forEach(function (x) { var k = keyOf(x); if (k !== null) have[k] = 1; });\n    var out = (Array.isArray(shared) ? shared : []).filter(function (x) { var k = keyOf(x); return k === null || !have[k]; });\n    return out.concat(own);\n  }\n  var clone = function (x) { return JSON.parse(JSON.stringify(x)); };\n  var has = function (o, k) { return !!o && Object.prototype.hasOwnProperty.call(o, k); };\n  /* A note of this phone's changes (dbk-merge.js diff/addOps: { up, soft, b, del, ord, reord, extra }) split in two:\n     - an edit goes where the item is now (this person's own place first, then the shared list): never moved by an edit\n     - a new item (in neither) goes to this person's own place when toOwn(item) says so (they keep it just theirs), else\n       to the shared list (an item for the OTHER person's place goes to the shared list: a phone can't write there, and\n       the server's sweep moves it)\n     - a removal goes where the item is (one in neither to the shared list)\n     - the order to both; anything else of the document (extra) to the shared list only. */\n  // (An edit of an item that is in neither place goes to the shared list, exactly as on a list kept in one place: an edit\n  // made offline before another device deleted the item brings it back, \"an edit wins over a delete\", data-safety review 2.\n  // One that had moved into the other person's own place meanwhile is then seen by the server's sweep, which keeps their\n  // copy and files this one for them in their own Recently removed: never dropped silently.)\n  function splitNote(pd, sharedItems, ownItems, toOwn) {\n    var S = { up: {}, soft: {}, del: {}, ord: [] }, O = { up: {}, soft: {}, del: {}, ord: [] };\n    if (!pd) return { shared: S, own: O };\n    var inOwn = {}, inShared = {};\n    (ownItems || []).forEach(function (x) { var k = keyOf(x); if (k !== null) inOwn[k] = 1; });\n    (sharedItems || []).forEach(function (x) { var k = keyOf(x); if (k !== null) inShared[k] = 1; });\n    Object.keys(pd.up || {}).forEach(function (k) {\n      var it = pd.up[k];\n\n      var mine = inOwn[k] ? true : inShared[k] ? false : (k.charAt(0) === 'k' && !!toOwn(it));\n      var T = mine ? O : S;\n      T.up[k] = clone(it);\n      if (pd.soft && pd.soft[k]) T.soft[k] = 1;\n      if (pd.b && has(pd.b, k)) { T.b = T.b || {}; T.b[k] = clone(pd.b[k]); }\n    });\n    // (where it is; one in neither goes to the shared list, which remembers it in its _gone if it turns up there)\n    Object.keys(pd.del || {}).forEach(function (k) { if (inOwn[k]) O.del[k] = pd.del[k]; if (inShared[k] || !inOwn[k]) S.del[k] = pd.del[k]; });\n    if (Array.isArray(pd.ord)) { S.ord = pd.ord.slice(); O.ord = pd.ord.slice(); }\n    if (pd.reord) { S.reord = 1; O.reord = 1; }\n    if (pd.extra) S.extra = clone(pd.extra);\n    return { shared: S, own: O };\n  }\n  // Does this look like a thing the app itself makes for that list, dated where its person would see it? (third and\n  // fourth reviews, Nov 1; functions/private-items.js realLooking is the server's twin.) Only such things are ever moved\n  // into someone's own place.\n  var DAY_RE = /^\\d{4}-\\d{2}-\\d{2}/;\n  function dayWindow(now) { var iso = function (t) { return new Date(t).toISOString().slice(0, 10); }; return { lo: iso(now - 400 * 864e5), hi: iso(now + 25 * 365.25 * 864e5) }; }\n  function inWin(d, w) { return typeof d === 'string' && DAY_RE.test(d) && d.slice(0, 10) >= w.lo && d.slice(0, 10) <= w.hi; }\n  function eventDays(x) {\n    var out = []; if (!x || typeof x !== 'object') return out;\n    ['date', 'startDate', 'endDate'].forEach(function (f) { if (typeof x[f] === 'string') out.push(x[f]); });\n    if (Array.isArray(x.dates)) x.dates.forEach(function (d) { if (typeof d === 'string') out.push(d); });\n    return out;\n  }\n  function realLooking(col, x, now) {\n    if (!x || typeof x !== 'object' || Array.isArray(x)) return false;\n    now = now || Date.now();\n    var t = function (v) { return typeof v === 'string' && v.trim().length > 0; }, w = dayWindow(now);\n    if (col === 'calendarEvents') return t(x.title) && eventDays(x).some(function (d) { return inWin(d, w); });\n    if (col === 'lifeReminders') {\n      if (!t(x.title)) return false;\n      if (typeof x.notifyDate === 'string') return inWin(x.notifyDate, w) || !DAY_RE.test(x.notifyDate) && t(x.frequency);\n      return (x.notifyDate != null && typeof x.notifyDate === 'object') || t(x.frequency);\n    }\n    if (col === 'dbkRemoved') return t(x.key) && Array.isArray(x.items) && x.items.length > 0 && typeof x.at === 'number';\n    return false;\n  }\n  /* A person's own list is up to three documents (fourth review, Nov 1): own_<list>_<person>/data, data2 and data3, read\n     as one list (joinOwn); a thing stays in the one it's in, a new one goes to the first with room (splitOwn); the\n     list's _gone and _in stay in data. The server's twins are in functions/private-move.js (kept equal by test). */\n  var OWN_DOCS = ['data', 'data2', 'data3'], OWN_CAPS = [850000, 880000, 880000];\n  function ownPaths(p, person) { var b = LISTS[colOf(p)].own + person + '/'; return OWN_DOCS.map(function (d) { return b + d; }); }\n  function joinOwn(parts) {\n    var ps = Array.isArray(parts) ? parts : [], d0 = {}, seen = {}, items = [], where = {}, any = false;\n    if (ps[0] && typeof ps[0] === 'object') for (var f in ps[0]) if (f !== 'items') d0[f] = ps[0][f];\n    ps.forEach(function (d, i) {\n      if (d && typeof d === 'object') any = true;\n      (d && Array.isArray(d.items) ? d.items : []).forEach(function (x) {\n        // (sixth review: a key twice is kept twice, never dropped; where it lives is the first one's)\n        var k = keyOf(x);\n        if (k !== null && !seen[k]) { seen[k] = 1; where[k] = i; }\n        items.push(x);\n      });\n    });\n    d0.items = items;\n    return { doc: any ? d0 : null, where: where };\n  }\n  function splitOwn(out, where, parts) {\n    var ps = Array.isArray(parts) ? parts : [], lists = OWN_DOCS.map(function () { return []; }), base = {}, fresh = [];\n    for (var f in (out || {})) if (f !== 'items') base[f] = out[f];\n    var size = OWN_DOCS.map(function (d, i) { return i === 0 ? JSON.stringify(base).length : 40; });\n    ((out && Array.isArray(out.items)) ? out.items : []).forEach(function (x) {\n      var k = keyOf(x), i = k !== null && where && where[k] !== undefined ? where[k] : -1;\n      if (i >= 0) { lists[i].push(x); size[i] += JSON.stringify(x).length + 1; } else fresh.push(x);\n    });\n    fresh.forEach(function (x) {\n      var c = JSON.stringify(x).length + 1, i = -1;\n      for (var j = 0; j < OWN_DOCS.length; j++) if (size[j] + c <= OWN_CAPS[j]) { i = j; break; }\n      if (i < 0) i = OWN_DOCS.length - 1;\n      lists[i].push(x); size[i] += c;\n    });\n    return OWN_DOCS.map(function (d, i) {\n      var next = {}, cur = ps[i] && typeof ps[i] === 'object' ? ps[i] : null;\n      if (i === 0) { for (var b in base) next[b] = base[b]; } else if (cur) { for (var c0 in cur) next[c0] = cur[c0]; }\n      next.items = lists[i];\n      if (!cur && !lists[i].length && !(i === 0 && Object.keys(base).length)) return null;\n      return cur && JSON.stringify(cur) === JSON.stringify(next) ? null : next;\n    });\n  }\n  // a note part with nothing in it\n  function emptyPart(p) { return !p || (!p.reord && !Object.keys(p.up || {}).length && !Object.keys(p.del || {}).length); }\n\n  var api = { LISTS: LISTS, AREA_OF: AREA_OF, isSplit: isSplit, ownPath: ownPath, ownOf: ownOf, keyOf: keyOf, homeOf: homeOf,\n    combine: combine, splitNote: splitNote, emptyPart: emptyPart, realLooking: realLooking,\n    OWN_DOCS: OWN_DOCS, ownPaths: ownPaths, joinOwn: joinOwn, splitOwn: splitOwn };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  root.dbkSplit = api;\n})(typeof window !== 'undefined' ? window : globalThis);\n","dbk-moon.js":"/* 2daysbook — the Moon, worked out from real astronomy (one function for the whole app and its add-ons).\n\n   window.dbkMoon(date, { tz }) → {\n     name       'New Moon' … 'Waning Crescent', the way weather apps say it: the four main phases (New Moon,\n                First Quarter, Full Moon, Last Quarter) only on the day that holds the exact moment, in the\n                household's time zone (Settings > Time zone, `timezone`; none = the phone's own)\n     fraction   how much of the Moon is lit at that moment, 0–1;  illum: the same as a whole percent\n     angle      the Moon's distance from the Sun along the sky, 0–360° (0 new, 90 first quarter, 180 full, 270 last)\n     cycle      angle / 360 (0 new, 0.5 full), for drawing;  waxing: true while it grows (lit on the right, from the north)\n     age        days since the last new moon;  lastNew, nextNew, nextFull, nextFirst, nextLast: Dates (the next ones are\n                the first on or after today, so on the day of the full moon nextFull is today's)\n     moment     the exact time of today's main phase (only on those four days)\n     longitude, sign, degrees: where the Moon is in the zodiac (tropical)\n   }\n\n   The maths is Jean Meeus, \"Astronomical Algorithms\" (2nd ed.): the Moon's place from chapter 47 (the main\n   periodic terms of ELP-2000/82, good to about 10 arc-seconds), the Sun's from chapter 25, the lit part from\n   chapter 48. The moments of the phases are found from the same positions (where the Moon is exactly 0°, 90°,\n   180° or 270° from the Sun), so the name, the percent and the dates always agree. Within a couple of minutes of\n   the US Naval Observatory's tables (functions/test/moon.test.mjs). Nothing is looked up; no outside service. */\n(function (root) {\n  var RAD = Math.PI / 180;\n  function norm(x) { x = x % 360; return x < 0 ? x + 360 : x; }\n  // Terrestrial Time runs about 69 seconds ahead of clock time in the 2020s (the Earth's turning slows a little)\n  function deltaT(jd) {\n    var y = 2000 + (jd - 2451545) / 365.25;\n    if (y >= 2005 && y < 2050) { var t = y - 2000; return 62.92 + 0.32217 * t + 0.005589 * t * t - 6; }\n    var u = (y - 1820) / 100; return -20 + 32 * u * u;\n  }\n\n  // Table 47.A: D, M, M', F, longitude (1e-6 °), distance (1e-3 km)\n  var LR = [\n    [0, 0, 1, 0, 6288774, -20905355], [2, 0, -1, 0, 1274027, -3699111], [2, 0, 0, 0, 658314, -2955968],\n    [0, 0, 2, 0, 213618, -569925], [0, 1, 0, 0, -185116, 48888], [0, 0, 0, 2, -114332, -3149],\n    [2, 0, -2, 0, 58793, 246158], [2, -1, -1, 0, 57066, -152138], [2, 0, 1, 0, 53322, -170733],\n    [2, -1, 0, 0, 45758, -204586], [0, 1, -1, 0, -40923, -129620], [1, 0, 0, 0, -34720, 108743],\n    [0, 1, 1, 0, -30383, 104755], [2, 0, 0, -2, 15327, 10321], [0, 0, 1, 2, -12528, 0],\n    [0, 0, 1, -2, 10980, 79661], [4, 0, -1, 0, 10675, -34782], [0, 0, 3, 0, 10034, -23210],\n    [4, 0, -2, 0, 8548, -21636], [2, 1, -1, 0, -7888, 24208], [2, 1, 0, 0, -6766, 30824],\n    [1, 0, -1, 0, -5163, -8379], [1, 1, 0, 0, 4987, -16675], [2, -1, 1, 0, 4036, -12831],\n    [2, 0, 2, 0, 3994, -10445], [4, 0, 0, 0, 3861, -11650], [2, 0, -3, 0, 3665, 14403],\n    [0, 1, -2, 0, -2689, -7003], [2, 0, -1, 2, -2602, 0], [2, -1, -2, 0, 2390, 10056],\n    [1, 0, 1, 0, -2348, 6322], [2, -2, 0, 0, 2236, -9884], [0, 1, 2, 0, -2120, 5751],\n    [0, 2, 0, 0, -2069, 0], [2, -2, -1, 0, 2048, -4950], [2, 0, 1, -2, -1773, 4130],\n    [2, 0, 0, 2, -1595, 0], [4, -1, -1, 0, 1215, -3958], [0, 0, 2, 2, -1110, 0],\n    [3, 0, -1, 0, -892, 3258], [2, 1, 1, 0, -810, 2616], [4, -1, -2, 0, 759, -1897],\n    [0, 2, -1, 0, -713, -2117], [2, 2, -1, 0, -700, 2354], [2, 1, -2, 0, 691, 0],\n    [2, -1, 0, -2, 596, 0], [4, 0, 1, 0, 549, -1423], [0, 0, 4, 0, 537, -1117],\n    [4, -1, 0, 0, 520, -1571], [1, 0, -2, 0, -487, -1739], [2, 1, 0, -2, -399, 0],\n    [0, 0, 2, -2, -381, -4421], [1, 1, 1, 0, 351, 0], [3, 0, -2, 0, -340, 0],\n    [4, 0, -3, 0, 330, 0], [2, -1, 2, 0, 327, 0], [0, 2, 1, 0, -323, 1165],\n    [1, 1, -1, 0, 299, 0], [2, 0, 3, 0, 294, 0], [2, 0, -1, -2, 0, 8752]\n  ];\n  // Table 47.B (the larger terms): D, M, M', F, latitude (1e-6 °)\n  var B = [\n    [0, 0, 0, 1, 5128122], [0, 0, 1, 1, 280602], [0, 0, 1, -1, 277693], [2, 0, 0, -1, 173237],\n    [2, 0, -1, 1, 55413], [2, 0, -1, -1, 46271], [2, 0, 0, 1, 32573], [0, 0, 2, 1, 17198],\n    [2, 0, 1, -1, 9266], [0, 0, 2, -1, 8822], [2, -1, 0, -1, 8216], [2, 0, -2, -1, 4324],\n    [2, 0, 1, 1, 4200], [2, 1, 0, -1, -3359], [2, -1, -1, 1, 2463], [2, -1, 0, 1, 2211],\n    [2, -1, -1, -1, 2065], [0, 1, -1, -1, -1870], [4, 0, -1, -1, 1828], [0, 1, 0, 1, -1794],\n    [0, 0, 0, 3, -1749], [0, 1, -1, 1, -1565], [1, 0, 0, 1, -1491], [0, 1, 1, 1, -1475],\n    [0, 1, 1, -1, -1410], [0, 1, 0, -1, -1344], [1, 0, 0, -1, -1335], [0, 0, 3, 1, 1107],\n    [4, 0, 0, -1, 1021], [4, 0, -1, 1, 833]\n  ];\n\n  // the Sun and the Moon as seen from the Earth's centre, at a Julian Ephemeris Day\n  function place(jde) {\n    var T = (jde - 2451545) / 36525, T2 = T * T, T3 = T2 * T, T4 = T3 * T;\n    var Lp = norm(218.3164477 + 481267.88123421 * T - 0.0015786 * T2 + T3 / 538841 - T4 / 65194000);\n    var D = norm(297.8501921 + 445267.1114034 * T - 0.0018819 * T2 + T3 / 545868 - T4 / 113065000);\n    var M = norm(357.5291092 + 35999.0502909 * T - 0.0001536 * T2 + T3 / 24490000);\n    var Mp = norm(134.9633964 + 477198.8675055 * T + 0.0087414 * T2 + T3 / 69699 - T4 / 14712000);\n    var F = norm(93.2720950 + 483202.0175233 * T - 0.0036539 * T2 - T3 / 3526000 + T4 / 863310000);\n    var A1 = norm(119.75 + 131.849 * T), A2 = norm(53.09 + 479264.290 * T), A3 = norm(313.45 + 481266.484 * T);\n    var E = 1 - 0.002516 * T - 0.0000074 * T2, sl = 0, sr = 0, sb = 0, i, t, a, e;\n    for (i = 0; i < LR.length; i++) {\n      t = LR[i]; a = (t[0] * D + t[1] * M + t[2] * Mp + t[3] * F) * RAD;\n      e = t[1] === 0 ? 1 : (Math.abs(t[1]) === 1 ? E : E * E);\n      sl += t[4] * e * Math.sin(a); sr += t[5] * e * Math.cos(a);\n    }\n    for (i = 0; i < B.length; i++) {\n      t = B[i]; a = (t[0] * D + t[1] * M + t[2] * Mp + t[3] * F) * RAD;\n      e = t[1] === 0 ? 1 : (Math.abs(t[1]) === 1 ? E : E * E);\n      sb += t[4] * e * Math.sin(a);\n    }\n    sl += 3958 * Math.sin(A1 * RAD) + 1962 * Math.sin((Lp - F) * RAD) + 318 * Math.sin(A2 * RAD);\n    sb += -2235 * Math.sin(Lp * RAD) + 382 * Math.sin(A3 * RAD) + 175 * Math.sin((A1 - F) * RAD) + 175 * Math.sin((A1 + F) * RAD)\n      + 127 * Math.sin((Lp - Mp) * RAD) - 115 * Math.sin((Lp + Mp) * RAD);\n    var moonLon = norm(Lp + sl / 1e6), moonLat = sb / 1e6, moonKm = 385000.56 + sr / 1000;\n    // the Sun (chapter 25): true longitude, less the 20.5\" of aberration (nutation is left out of both, it cancels)\n    var Ms = norm(357.52911 + 35999.05029 * T - 0.0001537 * T2), L0 = norm(280.46646 + 36000.76983 * T + 0.0003032 * T2);\n    var ecc = 0.016708634 - 0.000042037 * T - 0.0000001267 * T2;\n    var C = (1.914602 - 0.004817 * T - 0.000014 * T2) * Math.sin(Ms * RAD) + (0.019993 - 0.000101 * T) * Math.sin(2 * Ms * RAD) + 0.000289 * Math.sin(3 * Ms * RAD);\n    var sunLon = norm(L0 + C - 0.00569), nu = (Ms + C) * RAD;\n    var sunKm = 149597870.7 * 1.000001018 * (1 - ecc * ecc) / (1 + ecc * Math.cos(nu));\n    return { moonLon: moonLon, moonLat: moonLat, moonKm: moonKm, sunLon: sunLon, sunKm: sunKm };\n  }\n  function jdOf(d) { return d.getTime() / 86400000 + 2440587.5; }\n  function dateOf(jd) { return new Date(Math.round((jd - 2440587.5) * 86400000)); }\n  function elong(jdUT) { var p = place(jdUT + deltaT(jdUT) / 86400); return norm(p.moonLon - p.sunLon); }\n\n  // the exact moment the Moon is `target`° from the Sun, near a clock-time Julian Day guess\n  function solve(guess, target) {\n    var jd = guess;\n    for (var n = 0; n < 12; n++) {\n      var f = norm(elong(jd) - target + 180) - 180;\n      jd -= f / 12.190749;\n      if (Math.abs(f) < 1e-6) break;\n    }\n    return jd;\n  }\n  var CACHE = {};\n  // every main phase from a little before jd0 to a little after jd1: [{ q: 0 new | 1 first | 2 full | 3 last, jd }]\n  function phases(jd0, jd1) {\n    var out = [], SYN = 29.530588861, k = Math.floor((jd0 - 2451550.1) / SYN) - 1;\n    for (; ; k++) {\n      var base = 2451550.09766 + SYN * k;\n      if (base - 2 > jd1) break;\n      for (var q = 0; q < 4; q++) {\n        var key = k + ':' + q, jd = CACHE[key];\n        if (jd === undefined) { jd = solve(base + SYN * q / 4 - deltaT(base) / 86400, q * 90); CACHE[key] = jd; }\n        if (jd >= jd0 - 1 && jd <= jd1 + 1) out.push({ q: q, jd: jd });\n      }\n    }\n    return out.sort(function (a, b) { return a.jd - b.jd; });\n  }\n\n  function zone(opts) {\n    if (opts && opts.tz) return opts.tz;\n    try { var z = root.localStorage && root.localStorage.getItem('timezone'); if (z) return z; } catch (e) {}\n    return undefined;   // the phone's own\n  }\n  var FMT = {};\n  // \"2026-10-26\" for the day a moment falls on, in the household's time zone\n  function dayKey(d, tz) {\n    var f = FMT[tz || ''];\n    if (!f) {\n      try { f = new Intl.DateTimeFormat('en-CA', { timeZone: tz, year: 'numeric', month: '2-digit', day: '2-digit' }); }\n      catch (e) { f = new Intl.DateTimeFormat('en-CA', { year: 'numeric', month: '2-digit', day: '2-digit' }); }\n      FMT[tz || ''] = f;\n    }\n    var p = {}; f.formatToParts(d).forEach(function (x) { p[x.type] = x.value; });\n    return p.year + '-' + p.month + '-' + p.day;\n  }\n\n  var MAIN = ['New Moon', 'First Quarter', 'Full Moon', 'Last Quarter'];\n  var SIGNS = ['Aries', 'Taurus', 'Gemini', 'Cancer', 'Leo', 'Virgo', 'Libra', 'Scorpio', 'Sagittarius', 'Capricorn', 'Aquarius', 'Pisces'];\n\n  function dbkMoon(date, opts) {\n    var d = date instanceof Date ? date : new Date(date == null ? Date.now() : date);\n    var tz = zone(opts), jd = jdOf(d), p = place(jd + deltaT(jd) / 86400);\n    var angle = norm(p.moonLon - p.sunLon);\n    // the lit part (chapter 48): the angle Sun–Moon–Earth\n    var psi = Math.acos(Math.cos(p.moonLat * RAD) * Math.cos((p.moonLon - p.sunLon) * RAD));\n    var phaseAngle = Math.atan2(p.sunKm * Math.sin(psi), p.moonKm - p.sunKm * Math.cos(psi));\n    var fraction = (1 + Math.cos(phaseAngle)) / 2;\n    var today = dayKey(d, tz), list = phases(jd - 32, jd + 34), name = null, moment = null, lastNew = null, i;\n    var next = [null, null, null, null];\n    for (i = 0; i < list.length; i++) {\n      var ph = list[i], when = dateOf(ph.jd), k = dayKey(when, tz);\n      if (k === today) { name = MAIN[ph.q]; moment = when; }\n      if (ph.q === 0 && ph.jd <= jd) lastNew = when;\n      if (!next[ph.q] && k >= today) next[ph.q] = when;\n    }\n    if (!name) name = angle < 90 ? 'Waxing Crescent' : angle < 180 ? 'Waxing Gibbous' : angle < 270 ? 'Waning Gibbous' : 'Waning Crescent';\n    var lon = p.moonLon;\n    return {\n      name: name, fraction: fraction, illum: Math.round(fraction * 100), angle: angle, cycle: angle / 360,\n      phaseAngle: phaseAngle / RAD, waxing: angle < 180,\n      age: lastNew ? (d - lastNew) / 86400000 : angle / 360 * 29.530588861,\n      lastNew: lastNew, nextNew: next[0], nextFirst: next[1], nextFull: next[2], nextLast: next[3], moment: moment,\n      longitude: lon, sign: SIGNS[Math.floor(lon / 30) % 12], degrees: Math.floor(lon % 30), day: today\n    };\n  }\n  // the exact moments of the main phases between two dates (for tests and calendars): [{ name, date }]\n  dbkMoon.phases = function (from, to) {\n    return phases(jdOf(from), jdOf(to)).filter(function (x) { return x.jd >= jdOf(from) && x.jd <= jdOf(to); })\n      .map(function (x) { return { name: MAIN[x.q], date: dateOf(x.jd) }; });\n  };\n  dbkMoon.place = function (d) { var jd = jdOf(d); return place(jd + deltaT(jd) / 86400); };\n\n  if (typeof module !== 'undefined' && module.exports) module.exports = dbkMoon;\n  else root.dbkMoon = dbkMoon;\n})(typeof window !== 'undefined' ? window : this);\n","daybook-theme.js":"/* What this device is, so notes can say \"this phone\", \"this tablet\" or \"this computer\" */\nwindow.dbkDevice = (function () {\n  try {\n    var ua = navigator.userAgent || '';\n    if (/iPad/.test(ua) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1) || /Tablet|Android(?!.*Mobi)/i.test(ua)) return 'tablet';\n    if (/Mobi|iPhone|iPod|Android/i.test(ua)) return 'phone';\n    return 'computer';\n  } catch (e) { return 'device'; }\n})();\n/* A page never puts you back halfway down where it was (the designer: \"should always be taken to the top\"); the app's own\n   reload-in-place keeps its spot itself (restoreScroll) */\ntry { if ('scrollRestoration' in history) history.scrollRestoration = 'manual'; } catch (e) {}\n/* Phones: opening a pop-up doesn't pop the keyboard up. It opens when you tap into a box.\n   A script's focus() on a text box is skipped unless the keyboard is already up (moving from one box to the next,\n   or the box redrawn right after you pressed Enter), so typing several things in a row still works. */\n(function () {\n  try {\n    if (!(window.matchMedia && matchMedia('(pointer: coarse)').matches)) return;\n    var lastText = 0;\n    var isText = function (el) {\n      if (!el || !el.tagName) return false;\n      if (el.isContentEditable || el.tagName === 'TEXTAREA') return true;\n      return el.tagName === 'INPUT' && !/^(checkbox|radio|button|submit|reset|range|color|file|hidden|image)$/i.test(el.type || 'text');\n    };\n    document.addEventListener('focusout', function (e) { if (isText(e.target)) lastText = Date.now(); }, true);\n    // a box the person just tapped to edit (window.dbkTapFocus stamped in that tap) still gets the keyboard\n    var held = function (el) { if (Date.now() - (window.dbkTapFocus || 0) < 800) return false; return isText(el) && !isText(document.activeElement) && Date.now() - lastText > 1000; };\n    var focus0 = HTMLElement.prototype.focus;\n    HTMLElement.prototype.focus = function () { if (held(this)) return; return focus0.apply(this, arguments); };\n    var select0 = HTMLInputElement.prototype.select;\n    HTMLInputElement.prototype.select = function () { if (held(this)) return; return select0.apply(this, arguments); };\n  } catch (e) {}\n})();\n/* Weather only exists where the US National Weather Service covers the saved location (the 50 states and US\n   territories). Decided before the page paints, from the saved location and the NWS's remembered answer for it,\n   so weather never shows up and then disappears. html.dbk-no-wx: not covered, weather is gone everywhere.\n   html.dbk-wx-wait: a new location the NWS hasn't answered for yet, so weather stays out of sight until it does. */\n(function () {\n  function inUS(lat, lon) {\n    var box = function (a, b, c, d) { return lat >= a && lat <= b && lon >= c && lon <= d; };\n    return box(24.3, 49.5, -125, -66.8) || box(51, 72, -180, -129) || box(51, 54, 172, 180) || box(18.5, 22.6, -161, -154.5) ||\n      box(17.5, 18.7, -67.5, -64.4) || box(13, 21, 144, 146.5) || box(-14.7, -10.8, -171.2, -168);\n  }\n  window.dbkWxState = function () {\n    var l = null; try { l = JSON.parse(localStorage.getItem('userLocation') || 'null'); } catch (e) {}\n    if (!l || !l.lat || !l.lon) return 'none';\n    var key = (+l.lat).toFixed(4) + ',' + (+l.lon).toFixed(4), c = null;\n    try { c = JSON.parse(localStorage.getItem('dbkNwsPoint') || 'null'); } catch (e) {}\n    if (c && c.key === key) return c.outside ? 'off' : 'on';\n    return inUS(+l.lat, +l.lon) ? 'wait' : 'off';\n  };\n  // a saved place's name, showing only what the app knows: never \"undefined\", \"null\" or an empty piece\n  // (an older location search saved names like \"Boone County, undefined\")\n  window.dbkLocName = function (n) {\n    return String(n == null ? '' : n).split(',').map(function (x) { return x.trim(); })\n      .filter(function (x) { return x && !/^(undefined|null|nan)$/i.test(x); }).join(', ');\n  };\n  window.dbkWxMark = function () {\n    var st = window.dbkWxState(), r = document.documentElement, was = r.className;\n    r.classList.toggle('dbk-no-wx', st === 'off'); r.classList.toggle('dbk-wx-wait', st === 'wait');\n    if (r.className !== was) { try { window.dispatchEvent(new Event('dbk-wx')); } catch (e) {} }\n    return st;\n  };\n  try { window.dbkWxMark(); } catch (e) {}\n})();\n/* 2daysbook theme: picks the look (Person 1's or Person 2's) before the page paints,\n   loads the fonts, and adds the small drawn ornaments. */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html').toLowerCase();\n  var role = null;\n  try { role = localStorage.getItem('myPersonRole'); } catch (e) {}\n  // who this page was drawn as: a page that started before the sign-in check knew (or before it changed) is drawn as\n  // the wrong person, so it may not save anything personal, and it starts over once the check answers (resolveRole)\n  window.__dbkBootRole = role === 'person1' || role === 'person2' ? role : null;\n  var v;\n  if (page === 'person1-hub.html') v = 'p1';\n  else if (page === 'person2-hub.html') v = 'p2';\n  else v = role === 'person2' ? 'p2' : 'p1';\n  // the person's chosen look (Settings > Look) decides light or dark; dbk-look.js does the rest\n  // (nobody known yet on this phone, or their look not here yet: the look this phone last showed, dbk-frame.js)\n  try { var _C = window.dbkLookCarry, _lp = page === 'person1-hub.html' ? 'person1' : page === 'person2-hub.html' ? 'person2' : (role === 'person2' || role === 'person1' ? role : ((_C && _C.who()) || 'person1')); var _lk = _C ? _C.lookFor(_lp) : JSON.parse(localStorage.getItem('dbkLook_' + _lp) || 'null'); if (_lk && (_lk.fam === 'p1' || _lk.fam === 'p2')) v = _lk.fam; } catch (e) {}\n  var root = document.documentElement;\n  root.setAttribute('data-dbk', v);\n  // pages run inside the app frame, so ask the frame whether this is the home screen app\n  try {\n    var _sa = function (w) { return w.navigator.standalone || (w.matchMedia && w.matchMedia('(display-mode: standalone)').matches); };\n    var _top = window; try { if (window.parent && window.parent !== window && window.parent.dbkShell) _top = window.parent; } catch (e) {}\n    if (_sa(window) || _sa(_top)) root.classList.add('dbk-standalone');\n  } catch (e) {}\n  root.setAttribute('data-dbk-page', page.replace('.html', ''));\n  if (/^(index|person1-hub|person2-hub|our-dreams|meal-plan|settings|workroom|finance)$/.test(page.replace('.html', '')) || page === '') root.classList.add('dbk-has-hero');\n  window.DAYBOOK_THEME = v;\n  if (v === 'p2') { try { var tc = document.querySelector('meta[name=\"theme-color\"]'); if (tc) tc.setAttribute('content', '#06080b'); } catch (e) {} }\n  // each of you only sees your own page: hide the other person's links, and send you to yours\n  // which Habits link to show: yours. Before the app knows who you are, go by the hub you last opened.\n  var hubGuess = page === 'person1-hub.html' ? 'person1' : page === 'person2-hub.html' ? 'person2' : null;\n  try { if (hubGuess) localStorage.setItem('dbkLastHub', hubGuess); } catch (e) {}\n  if (role !== 'person1' && role !== 'person2') { var lh = null; try { lh = localStorage.getItem('dbkLastHub'); } catch (e) {} root.setAttribute('data-dbk-me', hubGuess || lh || 'person1'); }\n  if (role === 'person1' || role === 'person2') {\n    root.setAttribute('data-dbk-me', role);\n    var otherHub = role === 'person1' ? 'person2-hub.html' : 'person1-hub.html';\n    // (a copy of the other person's page loaded ahead out of sight, before this phone knew who's here: the app lets go\n    // of it instead of moving to Habits by itself; it did right after signing in as Person 2, Oct 25)\n    if (page === otherHub) {\n      try { var _fe = window.frameElement, _sh = window.parent.dbkShell; if (_fe && _sh && _sh.drop && !_fe.classList.contains('on') && window.parent.document.querySelector('iframe.dbk-layer.on')) { _sh.drop(window); return; } } catch (e) {}\n      __dbkLoc.replace(role + '-hub.html' + location.hash); return;\n    }\n  }\n  // Coming back to the app within a few hours picks up in the mode you were in; after that it starts fresh on Home.\n  // Moving between pages inside the app isn't \"away\" (each page notes the time as it hands over to the next).\n  var RESUME_MS = 3 * 60 * 60 * 1000;\n  try {\n    var standalone = window.navigator.standalone || (window.matchMedia && matchMedia('(display-mode: standalone)').matches);\n    var onHome = page === 'index.html' || page === '';\n    // (no record = never been away: a new home-screen app's first open. It counted as away forever, so the Meals sign-in\n    // shown before it had finished loading on a weak signal sent the app back to Today the moment its script ran, and\n    // the Sign in tap seemed to do nothing; Charlie, Oct 29)\n    var awayFor = function () { var t = +localStorage.getItem('dbkAway') || 0; return t ? Date.now() - t : 0; };\n    // (only the page on screen, or the first one the app opens: a page loaded ahead or reloading out of sight sent the app\n    // to Today by itself, three times on a new home-screen app's first open, which has no 'dbkAway' yet)\n    var behind = function () { try { var fe = window.frameElement; return !!(fe && window.parent.dbkShell && !fe.classList.contains('on') && window.parent.document.querySelector('iframe.dbk-layer.on')); } catch (e) { return false; } };\n    if (standalone) {\n      if (!onHome && awayFor() > RESUME_MS && !behind()) { setTimeout(function () { __dbkLoc.replace('index.html'); }, 0); }\n      document.addEventListener('visibilitychange', function () {\n        if (document.visibilityState === 'visible' && !onHome && awayFor() > RESUME_MS && !behind()) __dbkLoc.replace('index.html');\n      });\n    }\n  } catch (e) {}\n  // Opening the app on Home after a long time away always lands on Today (the greeting, reminders, calendar and lists)\n  try {\n    var homePage = page === 'index.html' || page === '';\n    var homeHash = function () { var h = (location.hash || '').replace('#', ''); return !h || h === 'home'; };\n    if (homePage && homeHash()) { try { history.replaceState(null, '', 'index.html#today'); } catch (e) {} }\n    window.addEventListener('pagehide', function () { try { localStorage.setItem('dbkAway', String(Date.now())); } catch (e) {} });\n    document.addEventListener('visibilitychange', function () {\n      if (document.visibilityState === 'hidden') { try { localStorage.setItem('dbkAway', String(Date.now())); } catch (e) {} return; }\n      var t = +localStorage.getItem('dbkAway') || 0;\n      if (homePage && t && Date.now() - t > RESUME_MS && window.dbkGoHome) window.dbkGoHome(true);\n    });\n  } catch (e) {}\n  // hold the page content until the layout and fonts are in place, so nothing reshuffles on load\n  // only the first page of a visit waits for fonts; moving between pages shows the new page straight away\n  // the whole page (menu included) stays hidden until it's fully laid out, then appears at once;\n  // the phone keeps showing the page you came from until then, so there's no blank or half-built frame\n  root.classList.add('dbk-loading');\n  var reveal = function () { root.classList.remove('dbk-loading'); };\n  var _navAt = Date.now(); try { _navAt = (performance.timing && performance.timing.navigationStart) || _navAt; } catch (e) {}\n  var lastResort = function () { if ((window.__dbkRoleHeld && Date.now() < (window.__dbkRoleUntil || 0)) || (fresh && Date.now() - _navAt < 11500)) { setTimeout(lastResort, 250); return; } reveal(); };   // (fresh: just signed in, below)\n  setTimeout(lastResort, 3200); // last resort if something below breaks (or the sign-in check's hold, at most 9 seconds)\n  // the page stays hidden until its saved data has actually come back from the cloud, so there's no\n  // first draw from old copies that then changes. Every page reads through window.firestoreImports,\n  // so each read and the first real (not cached) answer of each live listener is counted here.\n  var gate = window.__dbkGate = { pending: 0, poke: function () {} };\n  // just signed in on this phone (dbkSignedInGo, the last 30s): the page is out of sight behind \"Opening your app…\",\n  // and a new phone has no copy of anything yet, so it waits for the cloud's first answers longer (up to about 11s in\n  // all, under the frame's 15s hold) instead of showing an empty Today that fills in over the next seconds\n  var fresh = false; try { var _fi = +sessionStorage.getItem('dbkFreshIn') || 0; fresh = !!_fi && Date.now() - _fi < 30000 && window.top !== window; } catch (e) {}\n  gate.fresh = fresh;\n  var loading = function () { return root.classList.contains('dbk-loading'); };\n  var track = function () {\n    if (!loading()) return function () {};\n    gate.pending++; var d = false;\n    return function () { if (d) return; d = true; gate.pending--; gate.poke(); };\n  };\n  // Signed in, but this phone hasn't yet confirmed which person this login is (its first visit, or just after joining):\n  // the page stays hidden until the sign-in check answers, so it never shows one person's things as the other person\n  // (resolveRole lets go; after 9 seconds it shows anyway, and still saves nothing personal until the check answers)\n  (function () {\n    var sIn = null, uid = null; try { sIn = localStorage.getItem('dbkSignedIn'); uid = localStorage.getItem('dbkRoleUid'); } catch (e) {}\n    if (sIn !== '1' || (uid && window.__dbkBootRole)) return;\n    var done = track(), at = Date.now(), t = null;\n    var free = window.__dbkRoleFree = function () { if (!window.__dbkRoleHeld) return; window.__dbkRoleHeld = false; clearTimeout(t); done(); };\n    window.__dbkRoleHeld = true; window.__dbkRoleUntil = at + 9000;\n    t = setTimeout(free, 9000);\n  })();\n  // ---- shared lists: a save adds this phone's changes to what's in the cloud, it never replaces it ----\n  // Every shared list is saved whole (the full list of reminders, events, groceries...). If one phone\n  // was asleep and missed the other's addition, its next save used to wipe that addition out.\n  // Oct 20 (data-loss fixes): each save now keeps a note, on this phone, of what THIS phone changed (item by item,\n  // removals included), and applies only that note onto the cloud's newest copy, in one database transaction.\n  // A slow answer, no signal, or a phone that's signed out never replaces the cloud's list: the note waits on the\n  // phone ('dbkPend:<list>') and is applied when the cloud answers. The merge itself is public/dbk-merge.js.\n  var SHARED = /^(lifeReminders|calendarEvents|groceries|capturedThoughts|capturedThoughts_person[12]|routine_person[12]|futureTodos_person[12]|mealGroceries|finance_bills|finance_budgets|finance_accounts|finance_subs|finance_loans|finance_rules|finance_savings|dbkRemoved)\\/data$|^dreams\\/[^\\/]+$|^financeTx\\/\\d{4}-\\d{2}$/;\n  var KEYF = { 'finance_budgets/data': 'cat' };   // budgets have no id: one per category\n  // financeTx/<YYYY-MM> (Money's transactions, one document per month) is shared item by item too, so an edit made with\n  // no signal is applied transaction by transaction once back, never as the whole month (Oct 23 audit)\n  var sync = window.__dbkSync = { base: {}, cbs: {}, refs: {}, q: {}, wrote: {}, dt: {}, rt: {}, big: {} };\n  var pathOf = function (ref) { try { return ref && typeof ref.path === 'string' ? ref.path : null; } catch (e) { return null; } };\n  var shared = function (p) { return !!p && SHARED.test(p); };\n  var clone = function (x) { try { return JSON.parse(JSON.stringify(x)); } catch (e) { return x; } };\n  var MG = function () { return window.dbkMerge; };\n  var itemsOf = function (snap) {\n    try { if (snap && snap.exists && snap.exists()) { var d = snap.data(); return d && Array.isArray(d.items) ? d.items : null; } } catch (e) {}\n    return null;\n  };\n  var docOf = function (snap) { try { return snap && snap.exists && snap.exists() ? snap.data() : null; } catch (e) { return null; } };\n  // this phone's note of changes not yet in the cloud\n  var PEND = 'dbkPend:';\n  // When the phone's storage for the app is full even after letting go of its copies of the cloud (dbk-frame.js), the\n  // note is kept in memory instead (Oct 25 audit: it was dropped without a word, so the change never reached the\n  // cloud and was gone after a reload). It's sent like any other; it only can't outlast the app being closed.\n  var memPend = sync.mem = sync.mem || {};\n  var pendOf = function (p) { if (memPend[p]) return memPend[p]; try { return JSON.parse(localStorage.getItem(PEND + p) || 'null'); } catch (e) { return null; } };\n  var pendPut = function (p, v) {\n    var none = !v || !MG() || MG().isEmpty(v);\n    try {\n      if (none) { localStorage.removeItem(PEND + p); delete memPend[p]; return; }\n      var j = JSON.stringify(v); localStorage.setItem(PEND + p, j);\n      // a full phone skips the write without an error (dbk-frame.js): look that it's there\n      if (localStorage.getItem(PEND + p) !== j) throw new Error('full');\n      delete memPend[p];\n    } catch (e) { if (none) delete memPend[p]; else { memPend[p] = v; try { localStorage.removeItem(PEND + p); } catch (x) {} storageFull(); } }\n  };\n  // said once a visit, the first time something can't be kept on the phone\n  var storageFull = window.dbkStorageFullNote = function () {\n    if (sync.fullSaid) return; sync.fullSaid = true;\n    var msg = 'This ' + (window.dbkDevice || 'phone') + ' is out of room for the app. Your changes still save online, but one made with no signal is only kept until the app is closed.';\n    setTimeout(function () { try { if (window.dbkNotice && window.dbkNotice.banner) window.dbkNotice.banner(msg); else if (window.lhToast) window.lhToast(msg, 'warning'); } catch (e) {} }, 0);\n  };\n  window.addEventListener('dbkStorageFull', storageFull);\n  // a list as this phone should show it: the cloud's copy with this phone's unsent changes on top, without what the\n  // other person keeps just for themselves (Settings > Sharing: an owner mark on each item, dbk-sharing.js). Pages only\n  // ever get this, so a save never lists the other person's private items, and the merge leaves them as they are.\n  var SH = function () { return window.dbkSharing && window.dbkSharing.visibleAt ? window.dbkSharing : null; };\n  var unhid = function (p, items) { var S = SH(); return S && Array.isArray(items) ? S.visibleAt(p, items) : items; };\n  // ---- (Nov 1, security, slice C) lists kept in two places: calendar, reminders, Recently removed ----\n  // What a person keeps just for themselves there lives only in their own document (own_calendar_<person>/data...,\n  // public/dbk-split.js; the server moves what was already in the shared list, functions/private-move.js). Pages keep\n  // asking for the shared list: this layer reads this person's own document too and hands the page one list (withOwn), and\n  // a save sends each change where it belongs (flushSplit). Only in a copy for two people, and only for the person this\n  // phone has confirmed is signed in.\n  var SP = function () { return window.dbkSplit || null; };\n  var splitOn = function (p) { var S = window.dbkSharing; return !!(SP() && SP().isSplit(p) && /\\/data$/.test(p || '') && S && S.people && S.people() > 1); };\n  var ownPathFor = function (p) {\n    if (!splitOn(p)) return null;\n    try { var r = localStorage.getItem('myPersonRole'); if (!localStorage.getItem('dbkRoleUid') || (r !== 'person1' && r !== 'person2')) return null; return SP().ownPath(p, r); } catch (e) { return null; }\n  };\n  // ...read from the cloud only as the login this phone confirmed (else a page started before the check, or after another\n  // login signed in, would ask for the wrong person's: refused anyway)\n  var ownLiveFor = function (p) {\n    var op = ownPathFor(p); if (!op) return null;\n    var u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n    try { return u && u.uid === localStorage.getItem('dbkRoleUid') ? op : null; } catch (e) { return null; }\n  };\n  // (fourth review: a person's own list is up to three documents, data, data2, data3, read as one: dbk-split.js joinOwn)\n  var allOwn = function (op) { return [op, op.replace(/\\/data$/, '/data2'), op.replace(/\\/data$/, '/data3')]; };\n  // (fifth review) the own documents as this page last heard them, kept in memory: the phone's copies (dbkSnap:) can be let\n  // go of to make room (snapTrim, a full phone), and then her private things would be missing from her own view\n  var ownMem = {}, OWN_P = /^own_(calendar|reminders|removed)_person[12]\\/data[23]?$/;\n  var ownJoined = function (op) { return SP().joinOwn(allOwn(op).map(function (q) { var d = Object.prototype.hasOwnProperty.call(ownMem, q) ? ownMem[q] : (window.dbkSnapDoc ? window.dbkSnapDoc(q) : null); return d && typeof d === 'object' ? d : null; })); };\n  var withOwn = function (p, items) {\n    if (!Array.isArray(items)) return items;\n    var op = ownPathFor(p); if (!op) return items;\n    var od = ownJoined(op).doc, oi = od && Array.isArray(od.items) ? od.items : null;\n    return oi && oi.length ? SP().combine(items, oi) : items;\n  };\n  // (what this person's own place holds is theirs: never hidden from them, whatever the other person's choices say,\n  // security review Nov 1: a forged choice of the partner's could otherwise hide her own unmarked things from her)\n  var ownKeysOf = function (p) {\n    var op = ownPathFor(p), od = op && window.dbkSnapDoc ? ownJoined(op).doc : null, o = {};\n    (od && Array.isArray(od.items) ? od.items : []).forEach(function (x) { var k = SP().keyOf(x); if (k !== null) o[k] = 1; });\n    return o;\n  };\n  window.dbkOwnKeysOf = ownKeysOf;\n  var unhidMine = function (p, list) {\n    var v = unhid(p, list); if (v === list || !Array.isArray(list) || !ownPathFor(p)) return v;\n    var ok = {}, ks = ownKeysOf(p); (v || []).forEach(function (x) { var k = SP().keyOf(x); if (k !== null) ok[k] = 1; });\n    var out = list.filter(function (x, i) { var k = SP().keyOf(x); return k === null ? v.indexOf(x) >= 0 : (ok[k] || ks[k]); });\n    return out.length === list.length ? list : out;\n  };\n  var view = function (p, items) {\n    items = withOwn(p, items);\n    var pd = shared(p) && MG() ? pendOf(p) : null;\n    return unhidMine(p, pd && !MG().isEmpty(pd) ? MG().apply(items || [], pd, KEYF[p]).items : items);\n  };\n  var remember = function (p, snap) {\n    if (!shared(p)) return;\n    var it = itemsOf(snap);\n    if (it) sync.base[p] = clone(view(p, it));\n    else { try { if (snap && snap.exists && !snap.exists()) sync.base[p] = clone(view(p, [])); } catch (e) {} }\n  };\n  var fakeSnap = function (p, items, doc) {\n    var d = {}; if (doc) for (var k in doc) if (k !== '_gone') d[k] = doc[k];\n    d.items = items;\n    return { exists: function () { return true; }, data: function () { return clone(d); }, id: p.split('/').pop(), metadata: { fromCache: false, hasPendingWrites: false } };\n  };\n  // the same answer, with this phone's unsent changes on top (so a page never draws them away)\n  var overlaySnap = function (p, s) {\n    var pd = shared(p) && MG() ? pendOf(p) : null;\n    if (!pd || MG().isEmpty(pd)) {\n      var it0 = itemsOf(s);\n      // (no shared list in the cloud yet, but this person's own place has things: those)\n      if (!it0) { var none = false; try { none = !!(s && s.exists && !s.exists()); } catch (e) {} var w0 = none ? withOwn(p, []) : null; return w0 && w0.length ? fakeSnap(p, unhidMine(p, w0), null) : s; }\n      var v0 = unhidMine(p, withOwn(p, it0)); return v0 !== it0 ? fakeSnap(p, v0, docOf(s)) : s;\n    }\n    var it = itemsOf(s), d = docOf(s);\n    if (!it) { try { if (!(s && s.exists && !s.exists())) return s; } catch (e) { return s; } it = []; }\n    return fakeSnap(p, view(p, it), d);\n  };\n  // hand the merged list to the page (after its own \"I just saved\" pause, so it doesn't ignore it)\n  var deliver = function (p, items, doc) {\n    clearTimeout(sync.dt[p]);\n    var wait = Math.max(0, (sync.wrote[p] || 0) + 3300 - Date.now());\n    sync.dt[p] = setTimeout(function () { var v = view(p, items); sync.base[p] = clone(v); (sync.cbs[p] || []).forEach(function (cb) { try { cb(fakeSnap(p, v, doc)); } catch (e) {} }); }, wait);\n  };\n  // ---- the phone's own copy of everything it last read from or saved to the cloud ----\n  // Pages draw from this straight away and catch up with the cloud quietly after, instead of every page\n  // waiting on a fresh connection, the sign-in check and a cloud fetch before anything shows.\n  var SNAP = 'dbkSnap:';\n  var hasSnap = function (p) { try { return !!p && localStorage.getItem(SNAP + p) !== null; } catch (e) { return false; } };\n  // Oct 25 audit: these copies grew with every page opened (a year of heavy use: calendar, lists, habits, Money's months)\n  // until the phone's storage for the app was full. They're kept to 1.2 million characters in all; the ones used least\n  // recently go first (when, by path, in 'dbkSnapUse'). Firebase's own copy on the phone still opens a page quickly.\n  var SNAP_ALL = 1200000, SNAP_ONE = 950000;\n  var snapUse = function () { try { var u = JSON.parse(localStorage.getItem('dbkSnapUse') || '{}'); return u && typeof u === 'object' ? u : {}; } catch (e) { return {}; } };\n  var snapTrim = function (keep) {\n    try {\n      var all = [], tot = 0, u = snapUse();\n      for (var i = 0; i < localStorage.length; i++) { var k = localStorage.key(i); if (k && k.indexOf(SNAP) === 0) { var n = (localStorage.getItem(k) || '').length; tot += n; all.push([k, n, u[k.slice(SNAP.length)] || 0]); } }\n      if (tot <= SNAP_ALL) return;\n      // (the own documents of the lists kept in two places go last: memory holds them too, ownMem)\n      all.sort(function (a, b) { var oa = /^dbkSnap:own_(calendar|reminders|removed)_/.test(a[0]) ? 1 : 0, ob = /^dbkSnap:own_(calendar|reminders|removed)_/.test(b[0]) ? 1 : 0; return oa - ob || a[2] - b[2]; });\n      for (var j = 0; j < all.length && tot > SNAP_ALL; j++) { if (all[j][0] === SNAP + keep) continue; localStorage.removeItem(all[j][0]); delete u[all[j][0].slice(SNAP.length)]; tot -= all[j][1]; }\n      localStorage.setItem('dbkSnapUse', JSON.stringify(u));\n    } catch (e) {}\n  };\n  // (Nov 1, slice C) a list kept in two places is kept on this phone without what the other person keeps just for\n  // themselves (an older copy from before the server moved it held it in readable form: cleanSnaps below). Only once\n  // this phone knows who it is: before that its own private things could look like someone else's.\n  var snapView = function (p, data) {\n    if (!data || !Array.isArray(data.items) || !splitOn(p)) return data;\n    var S = SH(); if (!S || !S.seer || !S.seer()) return data;\n    var v = unhid(p, data.items); if (v === data.items) return data;\n    var c = {}; for (var k in data) c[k] = data[k]; c.items = v; return c;\n  };\n  var putSnap = function (p, data) {\n    if (!p) return;\n    if (OWN_P.test(p)) ownMem[p] = data;\n    try {\n      data = snapView(p, data);\n      var j = data == null ? 'null' : JSON.stringify(data);\n      if (j.length > SNAP_ONE) { localStorage.removeItem(SNAP + p); return; }\n      localStorage.setItem(SNAP + p, j);\n      var u = snapUse(); u[p] = Date.now(); localStorage.setItem('dbkSnapUse', JSON.stringify(u));\n      snapTrim(p);\n    } catch (e) {}\n  };\n  var snapOf = function (p, s) { try { if (s && s.exists) putSnap(p, s.exists() ? s.data() : null); } catch (e) {} };\n  // (Nov 1, slice C) this phone's older copies of the lists kept in two places, without what is hidden from it now: a copy\n  // saved before the server moved the other person's private things (or before this phone heard their choice) held them\n  // readable. Run once this phone knows who it is, and whenever a choice changes.\n  var cleanSnaps = window.dbkCleanSnaps = function () {\n    var X = SP(); if (!X) return;\n    Object.keys(X.LISTS).forEach(function (c) {\n      var p = c + '/data';\n      try { var raw = localStorage.getItem(SNAP + p); if (!raw || raw === 'null') return; var d = JSON.parse(raw), v = snapView(p, d); if (v !== d) localStorage.setItem(SNAP + p, JSON.stringify(v)); } catch (e) {}\n    });\n  };\n  setTimeout(cleanSnaps, 0);\n  window.addEventListener('dbkRoleOk', function () { setTimeout(cleanSnaps, 0); });\n  window.dbkSnapItems = function (col) {\n    var raw = null; try { raw = localStorage.getItem(SNAP + col + '/data'); } catch (e) {}\n    if (raw === null) { var pd0 = pendOf(col + '/data'), w1 = withOwn(col + '/data', []); return (pd0 && MG() && !MG().isEmpty(pd0)) || (w1 && w1.length) ? view(col + '/data', []) : undefined; }\n    try { var d = JSON.parse(raw); return d && d.items !== undefined ? (Array.isArray(d.items) ? view(col + '/data', d.items) : d.items) : null; } catch (e) { return undefined; }\n  };\n  window.dbkSnapDoc = function (path) { try { var raw = localStorage.getItem(SNAP + path); return raw === null ? undefined : JSON.parse(raw); } catch (e) { return undefined; } };\n  // a page that has no copy yet holds its first draw for the cloud\n  window.dbkGateHold = function () { return track(); };\n  // One person's own data (anything named ..._person1 or ..._person2) is only saved to the cloud once this phone has\n  // checked which person is signed in. Before that check a phone can think it's Person 1 and would write over\n  // Person 1's things (that wiped Today's Three and the Back Burner on a partner's first visit).\n  // (Oct 31: the rules now refuse the partner's login every one of these, firestore.rules `personal`. A page of the other\n  // person's left on this phone, e.g. their Habits loaded ahead before the check, never sends theirs: refused anyway,\n  // and its note would be tried again forever. personOfPath: whose a path is, null = shared)\n  var personOfPath = function (p) { var m = /^[^\\/]*_(person[12])(\\/|$)/.exec(p || '') || /^(person[12])[A-Z][^\\/]*(\\/|$)/.exec(p || '') || /^(?:dreams|appData)\\/.+_(person[12])$/.exec(p || ''); return m ? m[1] : null; };\n  var otherPersons = function (p) { var o = personOfPath(p); if (!o) return false; try { return !!localStorage.getItem('dbkRoleUid') && localStorage.getItem('myPersonRole') !== o; } catch (e) { return false; } };\n  var roleOkBase = function (p) {\n    if (!/_person[12](\\/|$)/.test(p || '')) return true;\n    var u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n    // no one signed in: fine (nothing goes to the cloud), except while the sign-in answer is still on its way (the\n    // database is open, so a write now would go out as whoever turns out to be signed in)\n    if (!u) return !(window.db && !window.firebaseReady && window.firebaseConfigEmpty === false);\n    // ...and only from a page drawn as that person: one that started before the check (it defaulted to Person 1) or\n    // before the person changed could still hold the other person's things, and reloads when the check answers\n    try { return localStorage.getItem('dbkRoleUid') === u.uid && window.__dbkBootRole === localStorage.getItem('myPersonRole'); } catch (e) { return false; }\n  };\n  var roleOkFor = function (p) { return !otherPersons(p) && roleOkBase(p); };\n  // (what the rules would answer, said here at once: never a quiet \"saved\" for something that wasn't)\n  var notYours = function () { var e = new Error('Missing or insufficient permissions.'); e.code = 'permission-denied'; return e; };\n  window.dbkRoleOk = function () { return roleOkBase('x_person1/data'); };\n  // note what this phone changed, compared with what it holds from the cloud (works signed out too)\n  var note = function (p, data) {\n    if (!MG()) return;\n    var base = sync.base[p];\n    var sd = window.dbkSnapDoc(p);\n    if (base === undefined) base = sd && Array.isArray(sd.items) ? view(p, sd.items) : null;\n    // an item added while that list is \"just mine\" gets its owner mark; an edit that dropped the mark gets it back\n    var S = SH(); if (S && S.stampAt) {\n      var orig = data.items, st = S.stampAt(p, orig, [base, sd && sd.items]);\n      // the page's own things get the marks too (Oct 25 audit: Today kept its new event unmarked, and another page's\n      // tidy-up then took it for the partner's private one)\n      if (st !== orig && Array.isArray(st) && st.length === orig.length) st.forEach(function (x, i) {\n        var o = orig[i]; if (!o || o === x || typeof o !== 'object' || !x || typeof x !== 'object') return;\n        ['mine', 'mineAt', 'mineIn', 'by'].forEach(function (f) { if (x[f] !== undefined && o[f] === undefined) o[f] = x[f]; });\n      });\n      data.items = st;\n    }\n    var pd = MG().addOps(pendOf(p), MG().diff(base, data.items, KEYF[p]));\n    var extra = {}; for (var k in data) if (k !== 'items' && k !== '_gone') extra[k] = data[k];\n    pd.extra = extra;\n    pendPut(p, pd);\n    sync.base[p] = clone(data.items);\n    // (a list kept in two places: the page's list holds this person's own things too, so the phone's copy of the shared\n    // list stays the cloud's, and what the page sees is that with the own place and this note on top, view)\n    if (!ownPathFor(p)) putSnap(p, data);\n  };\n  // a list that was saved while this phone wasn't signed in (or before the sign-in check finished): noted, and\n  // added to the cloud copy item by item once signed in (never sent as a whole list)\n  window.dbkPendNote = function (col, items) {\n    var p = col + '/data'; if (!shared(p) || !Array.isArray(items) || !roleOkFor(p)) return;\n    // one person's own list: only when this phone has already confirmed, signed in, that it is that person\n    var pm = /_person([12])\\//.exec(p);\n    if (pm) { try { if (!localStorage.getItem('dbkRoleUid') || localStorage.getItem('myPersonRole') !== 'person' + pm[1]) return; } catch (e) { return; } }\n    note(p, { items: items });\n  };\n  // One thing added to a shared list, noted on its own (Oct 25 audit: Inbox > Back Burner in the first seconds after\n  // opening, before this visit's sign-in answer, was never noted and was lost). Only that item, as \"add or change\", so an\n  // older copy of the rest of the list can never come back with it; a person's own list only on a phone that already\n  // confirmed it is that person and drew the page as them.\n  window.dbkPendAdd = function (col, item) {\n    var p = col + '/data'; if (!shared(p) || !MG() || !item || typeof item !== 'object') return false;\n    var pm = /_person([12])\\//.exec(p);\n    if (pm) { try { if (!localStorage.getItem('dbkRoleUid') || localStorage.getItem('myPersonRole') !== 'person' + pm[1] || window.__dbkBootRole !== 'person' + pm[1]) return false; } catch (e) { return false; } }\n    var k = MG().keysOf([item], KEYF[p])[0]; if (k === null) return false;\n    var ops = { up: {}, soft: {}, del: {}, ord: [] }; ops.up[k] = clone(item);\n    pendPut(p, MG().addOps(pendOf(p), ops));\n    return true;\n  };\n  // Changes to single items of a shared list, from a page that doesn't own the list (the Work page's Done on a\n  // reminder, its tax dates; Oct 31 review): each item is noted on its own in the list's shared note, the same note the\n  // owning page (Today) writes, as \"this item is now that, it was this\" (field by field onto the cloud's copy, like\n  // diff) or \"this item is gone\", and the note is sent as usual. Nothing else of the list is written: not the page's\n  // own copy (Today would adopt it whole), not the phone's copy of the cloud. list: [{ before, after }] (after null =\n  // taken off; before null = added). False: not noted.\n  window.dbkPendChange = function (col, list) {\n    var p = col + '/data'; if (!shared(p) || !MG() || !Array.isArray(list) || !list.length || /_person[12]\\//.test(p)) return false;\n    var ops = { up: {}, soft: {}, del: {}, ord: [] }, now = Date.now(), any = false;\n    list.forEach(function (c) {\n      var it = c && (c.after || c.before); if (!it || typeof it !== 'object') return;\n      var k = MG().keysOf([it], KEYF[p])[0]; if (k === null || k.charAt(0) !== 'k') return;   // (items with an id only)\n      if (c.after) { ops.up[k] = clone(c.after); if (c.before) { ops.b = ops.b || {}; ops.b[k] = clone(c.before); } }\n      else ops.del[k] = now;\n      any = true;\n    });\n    if (!any) return false;\n    pendPut(p, MG().addOps(pendOf(p), ops));\n    setTimeout(function () { try { if (window.dbkFlushPending) window.dbkFlushPending(); } catch (e) {} }, 0);\n    return true;\n  };\n  // A note typed into the capture bar with no signal, going to the Inbox (Oct 25 audit, found on real Firestore): it is\n  // added only if it isn't there, and never if it was removed meanwhile (sent to the calendar, deleted) on this phone\n  // or another (the list's _gone). The capture bar used to write the whole Inbox back with its queued notes in it,\n  // which put back a note that had just been sent on. False: not noted (the queue keeps it for later).\n  window.dbkPendSoftAdd = function (col, item) {\n    var p = col + '/data'; if (!shared(p) || !MG() || !item || typeof item !== 'object') return false;\n    var pm = /_person([12])\\//.exec(p);\n    if (pm) { try { if (!localStorage.getItem('dbkRoleUid') || localStorage.getItem('myPersonRole') !== 'person' + pm[1]) return false; } catch (e) { return false; } }\n    var k = MG().keysOf([item], KEYF[p])[0]; if (k === null) return false;\n    var pd = pendOf(p);\n    if (pd && pd.del && pd.del[k]) return true;            // removed here before it was ever sent: nothing to add\n    if (pd && pd.up && pd.up[k]) return true;              // already noted\n    var ops = { up: {}, soft: {}, del: {}, ord: [] }; ops.up[k] = clone(item); ops.soft[k] = 1;\n    pendPut(p, MG().addOps(pd, ops));\n    return true;\n  };\n  // a list too big for one cloud document (Firestore's limit is 1MB): it stays on this phone, and the person is told\n  var NAMES = { lifeReminders: 'Your reminders list', calendarEvents: 'Your calendar', groceries: 'Your grocery list', mealGroceries: 'Your Meals grocery list',\n    capturedThoughts: 'Your Inbox', routine: 'Your routine', workroom: 'Your Work page', finance: 'Your Money list', financeTx: 'Your Money list', dbkRemoved: 'Recently removed', dreams: 'This list' };\n  window.dbkTooBig = function (col) {\n    var n = String(col).split('/')[0].replace(/_person[12]$/, '');\n    var name = NAMES[n] || NAMES[n.replace(/_.*$/, '')] || 'This list';\n    var t = 0; try { t = +localStorage.getItem('dbkBigAt:' + col) || 0; } catch (e) {}\n    if (sync.big[col] || Date.now() - t < 10 * 60000) return;\n    sync.big[col] = 1; try { localStorage.setItem('dbkBigAt:' + col, String(Date.now())); } catch (e) {}\n    var msg = name + ' is too big to save online, so changes stay on this ' + (window.dbkDevice || 'phone') + ' for now. Removing some old items lets it save again.';\n    try { if (window.dbkNotice && window.dbkNotice.banner) window.dbkNotice.banner(msg); else if (window.lhToast) window.lhToast(msg, 'warning'); } catch (e) {}\n  };\n  var LIMIT = 900000;\n  var wrapFs = function (fi) {\n    if (!fi || typeof fi !== 'object' || fi.__dbk) return fi;\n    var w = {}; for (var k in fi) w[k] = fi[k];\n    w.__dbk = true;\n    w.__raw = fi;   // (the library as it is, unfiltered: what a login could read without this layer; tests read with it)\n    ['getDoc', 'getDocs'].forEach(function (n) {\n      if (typeof fi[n] !== 'function') return;\n      w[n] = function (ref) {\n        var p = fi[n].apply(this, arguments);\n        var path = pathOf(ref);\n        if (loading() && !(n === 'getDoc' && hasSnap(path))) { var done = track(); Promise.resolve(p).then(done, done); }\n        if (n === 'getDoc' && shared(path)) {\n          // (a list kept in two places: this person's own document is read alongside, and the page is handed both)\n          var op0 = ownLiveFor(path);\n          return Promise.all([Promise.resolve(p), op0 ? ownRead(op0) : null]).then(function (r) { var s = r[0]; snapOf(path, s); remember(path, s); return overlaySnap(path, s); });\n        }\n        if (n === 'getDoc') Promise.resolve(p).then(function (s) { snapOf(path, s); }, function () {});\n        return p;\n      };\n    });\n    // apply this phone's note onto the cloud's newest copy (one transaction: read, merge, write)\n    var docRef = function (p) { var parts = p.split('/'); return fi.doc.apply(null, [window.db].concat(parts)); };\n    // this person's own document of a list kept in two places, read into the phone's copy (a refused or slow read leaves\n    // the copy as it was: it never counts as \"empty\")\n    var ownRead = function (op) {\n      var t = null;\n      return Promise.race([\n        Promise.all(allOwn(op).map(function (q) { return Promise.resolve(fi.getDoc(docRef(q))).then(function (s) { snapOf(q, s); }); })),\n        new Promise(function (r) { t = setTimeout(r, 6000); })\n      ]).then(function () { clearTimeout(t); }, function () { clearTimeout(t); });\n    };\n    // the own document changed: the page gets its list again (once the shared list has been heard, which brings it along)\n    var ownL = sync.ownL = sync.ownL || {};\n    var ownHeard = function (p) {\n      var d = window.dbkSnapDoc(p); if (!d || !Array.isArray(d.items) || !(sync.cbs[p] || []).length) return;\n      if (JSON.stringify(view(p, d.items)) !== JSON.stringify(sync.base[p])) deliver(p, d.items, d);\n    };\n    var ownListen = function (p) {\n      var op = ownLiveFor(p); if (!op || typeof fi.onSnapshot !== 'function') return;\n      allOwn(op).forEach(function (q) {\n        if (ownL[q]) return; ownL[q] = 1;\n        try { fi.onSnapshot(docRef(q), function (s) { snapOf(q, s); ownHeard(p); }, function () { delete ownL[q]; }); } catch (e) { delete ownL[q]; }\n      });\n    };\n    // try again in 4s, 8s, 16s... (at most a minute); coming back online or to the app tries straight away\n    var retry = function (p) {\n      var o = sync.rt[p] = sync.rt[p] || { n: 0, t: null };\n      if (o.t) return;\n      o.t = setTimeout(function () { o.t = null; flush(p); }, Math.min(60000, 4000 * Math.pow(2, o.n++)));\n    };\n    // A list kept in two places (Nov 1, slice C): one transaction reads the shared list and this person's own document and\n    // applies the note split by item (dbk-split.js splitNote): an edit where the item is, a new item into the own document\n    // when this person keeps it just theirs, else the shared list. Only once this phone has confirmed who is signed in (a\n    // new private item must never go to the shared list for want of knowing whose it is): until then the note waits.\n    var flushSplit = async function (p) {\n      var pd = pendOf(p); if (!MG() || !pd || MG().isEmpty(pd)) return;\n      if (!window.firebaseReady || window.firebaseConfigEmpty || !window.db || typeof fi.doc !== 'function') return;\n      var op = ownLiveFor(p);\n      if (!op || !roleOkBase('x_person1/data')) { retry(p); return; }\n      var me = /_person2\\//.test(op) ? 'person2' : 'person1', col = p.split('/')[0], S = window.dbkSharing, X = SP();\n      // (rolled back, the server says: nothing new goes to the own place, own_sharing splitOff, dbk-sharing.js offSeen)\n      // (and as their own place says, read in the same transaction: a device offline across the rollback, data-safety\n      // review 2, would otherwise put a new one in the place the sweep had just emptied)\n      var off = false; try { off = localStorage.getItem('dbkPrivate_splitOff_' + me) === '1'; } catch (e) {}\n      var toOwn = function (it) { return !off && !!S && !!S.ownerOf && X.homeOf(it, col, null, function (x, area) { return S.ownerOf(area, x); }) === me; };\n      var shRef = docRef('own_sharing_' + me + '/data'), mvRef = docRef('own_sharing_' + me + '/moved'), mvWas = 0;\n      // (seventh review: 300KB per 30 days, so the partner's junk marked hers can't use it up for good; `stuck` = her\n      // real-looking things this phone had to leave in the shared list for want of room, shown in Settings > Sharing)\n      var MV_DAYS = 30, mvSince = 0, mvStuck = 0;\n      var heardMv = function (s) {\n        var d = docOf(s), now0 = Date.now();\n        mvSince = d && typeof d.since === 'number' && d.since <= now0 ? d.since : 0;\n        mvStuck = d && typeof d.stuck === 'number' ? d.stuck : 0;\n        mvWas = d && typeof d.bytes === 'number' && d.bytes > 0 ? d.bytes : 0;\n        if (!mvSince || now0 - mvSince > MV_DAYS * 864e5) { mvWas = 0; mvSince = now0; }\n      };\n      var heardOff = function (s) { var d = docOf(s); if (d && d.splitOff) { off = true; try { localStorage.setItem('dbkPrivate_splitOff_' + me, '1'); } catch (e) {} } };\n      // (the own list is three documents, read as one and written back where each thing is: dbk-split.js joinOwn/splitOwn)\n      var ref = sync.refs[p] || docRef(p), opaths = allOwn(op), orefs = opaths.map(docRef), key = KEYF[p], sd = null, od = null, oparts = [], owhere = {};\n      var build = function (ss, oss) {\n        pd = pendOf(p); if (!pd || MG().isEmpty(pd)) return null;\n        sd = docOf(ss); oparts = oss.map(docOf); var jo = X.joinOwn(oparts); od = jo.doc; owhere = jo.where;\n        var server = sd && Array.isArray(sd.items) ? sd.items : [], mine = od && Array.isArray(od.items) ? od.items : [];\n        var parts = X.splitNote(pd, server, mine, toOwn), r = { s: null, o: null };\n        if (!X.emptyPart(parts.shared)) {\n          var res = MG().apply(server, parts.shared, key, sd && sd._gone);\n          var out = {}, ex = parts.shared.extra || {}; for (var k in ex) out[k] = ex[k];\n          if (typeof out.updatedAt === 'number') out.updatedAt = Date.now();\n          out.items = res.items; if (Object.keys(res.gone).length) out._gone = res.gone;\n          r.s = out;\n        }\n        if (!X.emptyPart(parts.own)) {\n          // (the server's notes in the own document, _in and _dup, stay as they are)\n          var reso = MG().apply(mine, parts.own, key, od && od._gone), oo = {};\n          if (od) for (var k2 in od) oo[k2] = od[k2];\n          oo.items = reso.items; if (Object.keys(reso.gone).length) oo._gone = reso.gone; else delete oo._gone;\n          r.o = oo;\n        }\n        // (third review) things marked as this person's that their OLDER devices added to the shared list after the server\n        // first saw their choice: the server leaves those (it moves only what was there then), so this phone, their own\n        // login, moves a few real-looking ones with each save (20) while their place is small (300KB: such things are few,\n        // the older devices update themselves within minutes, and anything the partner adds marked as theirs can never fill\n        // their place this way). Only for an area this person's own choice keeps just theirs; never one marked as the other's.\n        // (fourth review: only things dated where she would see them, nearest today first; her own Recently removed entries\n        // too, when everything they hold is hers. What the partner adds marked hers is bounded by the same: 20 a save, 300KB)\n        if (!off && S && S.ownerMark && S.areaKept && X.LISTS[col]) {\n          var srv2 = r.s ? r.s.items : server, mine2 = r.o ? r.o.items : mine, have = {}, pick = [], nowT = Date.now();\n          mine2.forEach(function (x) { var k = X.keyOf(x); if (k !== null) have[k] = 1; });\n          // (sixth review: 300KB of what THIS person's phones have moved, own_sharing_<person>/moved, not of her whole\n          // place: a heavy user's place is far over that, and nothing would ever move)\n          var room = 300000 - mvWas, took = 0, left = 0;\n          var A0 = X.AREA_OF, ownerFn = function (x, ar) { return S.ownerOf(ar, x); };\n          // (fifth review: also a thing with no mark, when her own trusted choice says it's hers and the other person\n          // doesn't keep that area just theirs at all, so the server's tie rule could never give it to them)\n          // (only once this phone has the other person's choices from the household's settings: not knowing them isn't\n          // knowing they keep nothing just theirs)\n          var other = me === 'person1' ? 'person2' : 'person1', knowsOther = false;\n          try { knowsOther = !!window.dbkSettingsHeard || localStorage.getItem('dbkPriv_' + other) !== null; } catch (eK) {}\n          var mineHere = function (y, a) {\n            var m = S.ownerMark(y, a); if (m) return m === me;\n            return knowsOther && !S.areaKept(a, other) && S.ownerOf(a, y) === me;\n          };\n          var hers = function (x) {\n            if (col === 'dbkRemoved') {\n              var ar = A0[String(x.key || '')]; if (!ar || !Array.isArray(x.items) || !x.items.length || !S.areaKept(ar, me)) return false;\n              return x.items.every(function (y) { return mineHere(y, ar); });\n            }\n            var a = x.mineIn && S.areas && S.areas[x.mineIn] ? x.mineIn : (col === 'lifeReminders' && (x.fromFinance || x.fromSubs) ? 'money' : X.LISTS[col].area);\n            return S.areaKept(a, me) && mineHere(x, a);\n          };\n          var far = function (x) {\n            var ds = []; ['date', 'startDate', 'endDate', 'notifyDate'].forEach(function (f) { if (typeof x[f] === 'string') ds.push(x[f]); });\n            (Array.isArray(x.dates) ? x.dates : []).forEach(function (d) { if (typeof d === 'string') ds.push(d); });\n            var best = 1e12; ds.forEach(function (d) { var t = Date.parse(d.slice(0, 10)); if (isFinite(t)) best = Math.min(best, Math.abs(t - nowT)); });\n            // (an entry dated ahead counts as furthest away: a time no device of hers would write goes last)\n            return col === 'dbkRemoved' ? (+x.at > nowT ? 1e13 : nowT - (+x.at || 0)) : best;\n          };\n          // (sixth review: a key the shared list holds more than once is left there, every copy: moving them under one key\n          // would lose a date)\n          var nK = {}; srv2.forEach(function (x) { var k = X.keyOf(x); if (k !== null) nK[k] = (nK[k] || 0) + 1; });\n          srv2.filter(function (x) { var k = X.keyOf(x); return k !== null && nK[k] === 1 && !have[k] && X.realLooking(col, x, nowT) && hers(x); })\n            .sort(function (u, v) { return far(u) - far(v); })\n            .forEach(function (x) {\n              if (pick.length >= 20) return;\n              var k = X.keyOf(x), c = JSON.stringify(x).length + 2; if (c > room) { left++; return; } room -= c; took += c;\n              pick.push(k); have[k] = 1;\n            });\n          if (pick.length) {\n            var pk = {}; pick.forEach(function (k) { pk[k] = 1; });\n            var so = r.s || (function () { var o = {}; if (sd) for (var k3 in sd) o[k3] = sd[k3]; return o; })();\n            var moved = srv2.filter(function (x) { return pk[X.keyOf(x)]; });\n            so.items = srv2.filter(function (x) { return !pk[X.keyOf(x)]; });\n            var g = {}; if (so._gone) for (var g0 in so._gone) g[g0] = so._gone[g0]; pick.forEach(function (k) { g[k] = Date.now(); }); so._gone = g;\n            var oo2 = r.o || (function () { var o = {}; if (od) for (var k4 in od) o[k4] = od[k4]; return o; })();\n            oo2.items = mine2.concat(moved);\n            r.s = so; r.o = oo2;\n          }\n          // (what this phone moved, and what it had to leave: written only when either changed)\n          if (took || left !== mvStuck) r.mv = { bytes: mvWas + took, since: mvSince, stuck: left, at: Date.now() };\n        }\n        return r;\n      };\n      var big = false, out = null;\n      // (the joined own list back into its documents)\n      var place = function (o) { o.od = o.o ? X.splitOwn(o.o, owhere, oparts) : [null, null, null]; return o; };\n      var tooBig = function (o) { return (o.s && JSON.stringify(o.s).length > LIMIT) || o.od.some(function (d) { return d && JSON.stringify(d).length > LIMIT; }); };\n      try {\n        if (typeof fi.runTransaction === 'function') {\n          out = await fi.runTransaction(window.db, async function (t) {\n            var a = await t.get(ref), bs = []; for (var i = 0; i < orefs.length; i++) bs.push(await t.get(orefs[i])); heardOff(await t.get(shRef)); heardMv(await t.get(mvRef));\n            var o = build(a, bs); if (!o) return 'none';\n            place(o); if (tooBig(o)) { big = true; return null; }\n            if (o.s) t.set(ref, o.s); o.od.forEach(function (d, i) { if (d) t.set(orefs[i], d); }); if (o.mv) t.set(mvRef, o.mv); return o;\n          });\n        } else {\n          var a1 = await fi.getDoc(ref), b1 = []; for (var i1 = 0; i1 < orefs.length; i1++) b1.push(await fi.getDoc(orefs[i1])); heardOff(await fi.getDoc(shRef)); heardMv(await fi.getDoc(mvRef));\n          if ((a1 && a1.metadata && a1.metadata.fromCache) || b1.some(function (b) { return b && b.metadata && b.metadata.fromCache; })) throw new Error('offline');\n          out = build(a1, b1); if (!out) out = 'none';\n          else { place(out); if (tooBig(out)) { big = true; out = null; } else { if (out.s) await fi.setDoc(ref, out.s); for (var i2 = 0; i2 < orefs.length; i2++) if (out.od[i2]) await fi.setDoc(orefs[i2], out.od[i2]); if (out.mv) await fi.setDoc(mvRef, out.mv); } }\n        }\n      } catch (e) { retry(p); return; }\n      if (big) { window.dbkTooBig(p); return; }\n      if (out === 'none' || !out) return;\n      if (sync.rt[p]) { clearTimeout(sync.rt[p].t); delete sync.rt[p]; }\n      delete sync.big[p];\n      pendPut(p, MG().settle(pendOf(p), pd));\n      var sNow = out.s || sd || { items: [] };\n      putSnap(p, sNow); opaths.forEach(function (q, i) { putSnap(q, out.od[i] || oparts[i] || { items: [] }); });\n      var shownS = view(p, sNow.items || []);\n      if (JSON.stringify(shownS) !== JSON.stringify(sync.base[p])) deliver(p, sNow.items || [], sNow);\n      else clearTimeout(sync.dt[p]);\n    };\n    var flushNow = async function (p) {\n      if (splitOn(p)) return flushSplit(p);\n      var pd = pendOf(p); if (!MG() || !pd || MG().isEmpty(pd)) return;\n      if (!window.firebaseReady || window.firebaseConfigEmpty || !window.db || typeof fi.doc !== 'function') return;  // signed out: kept for later\n      // (the other person's list: kept on this phone as it is, sent only if they sign in here again)\n      if (!roleOkFor(p)) { if (!otherPersons(p)) retry(p); return; }\n      var ref = sync.refs[p] || docRef(p), key = KEYF[p];\n      var build = function (s) {\n        // the note as it is NOW: on a real phone a transaction started with no signal waits until the signal is back\n        // and only then runs, and the note read when it started could be minutes old (Oct 25 audit, real Firestore: a\n        // note captured offline then sent to the calendar came back, the waiting save still carried its add)\n        // (nothing left: another save sent it all meanwhile, so this one writes nothing)\n        pd = pendOf(p); if (!pd || MG().isEmpty(pd)) return null;\n        var d = docOf(s), server = d && Array.isArray(d.items) ? d.items : [];\n        var res = MG().apply(server, pd, key, d && d._gone);\n        var out = {}, ex = pd.extra || {}; for (var k in ex) out[k] = ex[k];\n        // a list that carries its own \"last changed\" time (the Meals grocery list) gets a fresh one, so both phones take the merge\n        if (typeof out.updatedAt === 'number') out.updatedAt = Date.now();\n        out.items = res.items; if (Object.keys(res.gone).length) out._gone = res.gone;\n        return out;\n      };\n      var big = false, out = null;\n      try {\n        if (typeof fi.runTransaction === 'function') {\n          out = await fi.runTransaction(window.db, async function (t) {\n            var o = build(await t.get(ref)); if (!o) return 'none';\n            if (JSON.stringify(o).length > LIMIT) { big = true; return null; }\n            t.set(ref, o); return o;\n          });\n        } else {\n          var s = await fi.getDoc(ref);\n          if (s && s.metadata && s.metadata.fromCache) throw new Error('offline');   // only the phone's old copy answered\n          out = build(s); if (!out) out = 'none';\n          else if (JSON.stringify(out).length > LIMIT) { big = true; out = null; } else await fi.setDoc(ref, out);\n        }\n      } catch (e) { retry(p); return; }\n      if (big) { window.dbkTooBig(p); return; }\n      if (out === 'none') return;\n      if (sync.rt[p]) { clearTimeout(sync.rt[p].t); delete sync.rt[p]; }\n      delete sync.big[p];\n      pendPut(p, MG().settle(pendOf(p), pd));\n      putSnap(p, out);\n      var shown = view(p, out.items);\n      if (JSON.stringify(shown) !== JSON.stringify(sync.base[p])) deliver(p, out.items, out);\n      // the cloud's answer is the newest copy and the page already shows it: a copy held back during the save's pause is\n      // older, so it's dropped. Handed over late, it put back on the page what this save had just taken off (overnight\n      // audit, Oct 23: Meals grocery \"Added … · Undo\" left the things on screen)\n      else clearTimeout(sync.dt[p]);\n    };\n    var flush = function (p) {\n      var prev = sync.q[p] || Promise.resolve();\n      var cur = prev.then(function () { return flushNow(p); }, function () { return flushNow(p); });\n      sync.q[p] = cur.catch(function () {});\n      return cur;\n    };\n    var flushAll = function () {\n      try { if (typeof window.wrFlush === 'function') window.wrFlush(); } catch (e) {}   // the Work page's own note (workroom.html)\n      try { for (var i = 0; i < localStorage.length; i++) { var k = localStorage.key(i); if (k && k.indexOf(PEND) === 0 && shared(k.slice(PEND.length))) flush(k.slice(PEND.length)); } } catch (e) {}\n      Object.keys(memPend).forEach(function (p) { if (shared(p)) flush(p); });\n    };\n    // A write to one person's own list made before this phone confirmed who is signed in (about a second on a phone's\n    // first visit) used to be dropped. It is held here and made once the check confirms that same person; if the\n    // check finds someone else, it's dropped (it was made as the wrong person, the reason for the wait).\n    var roleWait = [], roleTimer = null;\n    var personOf = function (p) { var m = /_(person[12])(\\/|$)/.exec(p || ''); return m ? m[1] : null; };\n    var replayRoleWait = function () {\n      if (!roleWait.length) return;\n      if (!roleOkBase('x_person1/data')) return;\n      var me = null; try { me = localStorage.getItem('myPersonRole'); } catch (e) {}\n      var q = roleWait.splice(0);\n      q.forEach(function (x) {\n        if (personOf(x.p) !== me) return;\n        try { if (x.del) w.deleteDoc(x.ref); else w.setDoc.apply(null, [x.ref, x.data].concat(x.opts ? [x.opts] : [])); } catch (e) {}\n      });\n    };\n    var holdForRole = function (ref, data, opts, del) {\n      roleWait.push({ p: pathOf(ref), ref: ref, data: data, opts: opts, del: !!del });\n      if (!roleTimer) {\n        var n = 0;\n        roleTimer = setInterval(function () { replayRoleWait(); if (!roleWait.length || ++n > 120) { clearInterval(roleTimer); roleTimer = null; } }, 1000);\n      }\n      return Promise.resolve();\n    };\n    window.addEventListener('dbkRoleOk', replayRoleWait);\n    window.addEventListener('storage', function (e) { if (e.key === 'dbkRoleUid' || e.key === 'myPersonRole') setTimeout(replayRoleWait, 0); });\n    if (typeof fi.setDoc === 'function') w.setDoc = function (ref, data, opts) {\n      var p = pathOf(ref), args = arguments, self = this;\n      if (otherPersons(p)) return Promise.reject(notYours());\n      if (!roleOkFor(p)) return holdForRole(ref, data, opts);\n      if (roleWait.length) replayRoleWait();   // the held ones first, so an older write never lands after a newer one\n      if (!shared(p) || opts || !data || !Array.isArray(data.items) || !MG()) {\n        try { if (opts && opts.merge) { var cur0 = window.dbkSnapDoc(p) || {}; var po = function (x) { return !!x && typeof x === 'object' && !Array.isArray(x); }; for (var k0 in data) { if (po(cur0[k0]) && po(data[k0])) { var mm = {}; for (var a0 in cur0[k0]) mm[a0] = cur0[k0][a0]; for (var b0 in data[k0]) mm[b0] = data[k0][b0]; cur0[k0] = mm; } else cur0[k0] = data[k0]; } putSnap(p, cur0); } else putSnap(p, data); } catch (e) {}   // a merge keeps a map's other entries (as Firestore does), e.g. one event tick\n        return fi.setDoc.apply(self, args);\n      }\n      sync.wrote[p] = Date.now(); sync.refs[p] = sync.refs[p] || ref;\n      note(p, data);\n      // the page sees its own save straight away, as it would from the database itself\n      var echo = clone(data.items);\n      setTimeout(function () { (sync.cbs[p] || []).forEach(function (cb) { try { cb(fakeSnap(p, echo, data)); } catch (e) {} }); }, 0);\n      // the page ignores incoming lists until its own save has answered and a moment after (isWriting): on a real\n      // phone that answer can take seconds, longer than the pause counted from the start, so a list that came in then\n      // was ignored by the page but counted here as shown, and its next save took off what it never drew (Oct 25\n      // audit, real Firestore: the other person's new event vanished). The pause now also runs from the answer.\n      var fl = flush(p);\n      Promise.resolve(fl).then(function () { sync.wrote[p] = Date.now(); }, function () { sync.wrote[p] = Date.now(); });\n      return fl;\n    };\n    if (typeof fi.deleteDoc === 'function') w.deleteDoc = function (ref) { if (otherPersons(pathOf(ref))) return Promise.reject(notYours()); if (!roleOkFor(pathOf(ref))) return holdForRole(ref, null, null, true); putSnap(pathOf(ref), null); return fi.deleteDoc.apply(this, arguments); };\n    if (typeof fi.onSnapshot === 'function') w.onSnapshot = function () {\n      var a = [].slice.call(arguments), ref = a[0], path = pathOf(ref), isShared = shared(path);\n      var gating = loading() && !(ref && ref.type !== 'query' && ref.type !== 'collection' && hasSnap(path));\n      var done = gating ? track() : function () {}, got = false, server = !gating;\n      var cap = gating ? setTimeout(done, fresh ? 8000 : 2000) : null;\n      var fin = function () { if (gating && got && server) { clearTimeout(cap); setTimeout(done, 60); } };\n      var onData = function (s) {\n        if (ref && ref.type !== 'query' && ref.type !== 'collection') snapOf(path, s);\n        if (isShared) {\n          // while this page is in its \"I just saved\" pause it ignores incoming lists, so hand this one over\n          // again after the pause; it only counts as known once the page has actually taken it\n          if (Date.now() - (sync.wrote[path] || 0) < 3300) { var it = itemsOf(s); if (it && JSON.stringify(view(path, it)) !== JSON.stringify(sync.base[path])) deliver(path, it, docOf(s)); }\n          else remember(path, s);\n        }\n        got = true; if (!(s && s.metadata && s.metadata.fromCache)) server = true; fin();\n      };\n      var onErr = function () { if (cap) clearTimeout(cap); done(); };\n      if (gating) {\n        // ask the cloud for the same thing; once that answers, the listener has had the real data too\n        try {\n          var check = ref && ref.type === 'document' ? fi.getDoc : fi.getDocs;\n          if (typeof check === 'function') Promise.resolve(check(ref)).then(function () { server = true; fin(); }, onErr);\n          else server = true;\n        } catch (e) { server = true; }\n      }\n      var fnSeen = 0;\n      for (var i = 1; i < a.length; i++) {\n        if (typeof a[i] === 'function') {\n          (function (f, first) {\n            if (first && isShared) { (sync.cbs[path] = sync.cbs[path] || []).push(f); sync.refs[path] = ref; ownListen(path); }\n            a[i] = function () {\n              var args2 = [].slice.call(arguments);\n              if (first && isShared) args2[0] = overlaySnap(path, args2[0]);\n              try { return f.apply(this, args2); } finally { if (first) onData(arguments[0]); else onErr(); }\n            };\n          })(a[i], fnSeen++ === 0);\n        } else if (a[i] && typeof a[i] === 'object' && (typeof a[i].next === 'function' || typeof a[i].error === 'function')) {\n          var ob = a[i], o2 = {};\n          for (var kk in ob) o2[kk] = ob[kk];\n          if (ob.next) {\n            if (isShared) { (sync.cbs[path] = sync.cbs[path] || []).push(function (s) { return ob.next.call(ob, s); }); sync.refs[path] = ref; ownListen(path); }\n            o2.next = function (s) { try { return ob.next.call(ob, isShared ? overlaySnap(path, s) : s); } finally { onData(s); } };\n          }\n          o2.error = function () { try { if (ob.error) return ob.error.apply(ob, arguments); } finally { onErr(); } };\n          a[i] = o2; fnSeen++;\n        }\n      }\n      try { return fi.onSnapshot.apply(this, a); } catch (e) { onErr(); throw e; }\n    };\n    // coming back to the app: ask the cloud again right away, in case the phone slept through a change,\n    // and send anything this phone noted while it had no signal\n    var refresh = function () {\n      flushAll();\n      Object.keys(sync.cbs).forEach(function (p) {\n        var ref = sync.refs[p]; if (!ref) return;\n        var op = ownLiveFor(p);\n        Promise.all([fi.getDoc(ref), op ? ownRead(op) : null]).then(function (r0) {\n          var s = r0[0];\n          var it = itemsOf(s); if (!it) return;\n          if (Date.now() - (sync.wrote[p] || 0) < 3300) deliver(p, it, docOf(s));\n          else { var v = view(p, it); sync.base[p] = clone(v); (sync.cbs[p] || []).forEach(function (cb) { try { cb(fakeSnap(p, v, docOf(s))); } catch (e) {} }); }\n        }, function () {});\n      });\n    };\n    // someone's \"just mine\" choice changed (here or on the other phone), or this phone just found out who is signed in:\n    // each open list is handed over again as it should now show\n    var reshow = function () {\n      Object.keys(sync.cbs).forEach(function (p) { ownListen(p); });\n      cleanSnaps();\n      Object.keys(sync.cbs).forEach(function (p) {\n        var d = window.dbkSnapDoc(p); if (!d || !Array.isArray(d.items)) return;\n        if (JSON.stringify(view(p, d.items)) !== JSON.stringify(sync.base[p])) deliver(p, d.items, d);\n      });\n    };\n    // (a list kept in two places: once signed in, its own document is listened to too)\n    window.addEventListener('firebaseReady', function () { setTimeout(function () { Object.keys(sync.cbs).forEach(function (p) { ownListen(p); }); }, 0); });\n    if (!sync.privOn) {\n      sync.privOn = true;\n      window.addEventListener('storage', function (e) { if (e.key && /^dbkPriv_person[12]$|^dbkPrivate_sharing_person[12]$|^myPersonRole$|^dbkRoleUid$/.test(e.key)) setTimeout(reshow, 0); });\n      window.addEventListener('dbkRoleOk', function () { setTimeout(reshow, 0); });\n    }\n    if (!sync.resumeOn) {\n      sync.resumeOn = true;\n      document.addEventListener('visibilitychange', function () { if (document.visibilityState === 'visible') refresh(); });\n      window.addEventListener('online', refresh);\n      window.addEventListener('pageshow', function (e) { if (e.persisted) refresh(); });\n    }\n    // on load (once signed in): send what an earlier visit couldn't (no signal, signed out, a too-slow sign-in)\n    window.dbkFlushPending = flushAll;   // Settings > Account > Sign out sends these first (dbk-account.js)\n    var startFlush = function () { setTimeout(flushAll, 1500); };\n    if (window.firebaseReady && !window.firebaseConfigEmpty) startFlush(); else window.addEventListener('firebaseReady', function () { if (!window.firebaseConfigEmpty) startFlush(); }, { once: true });\n    return w;\n  };\n  try {\n    var fsDesc = Object.getOwnPropertyDescriptor(window, 'firestoreImports');\n    var fsVal = fsDesc && 'value' in fsDesc ? fsDesc.value : undefined, fsWrapped = null, fsFrom = null;\n    var fsRaw = function () { return fsDesc && fsDesc.get ? fsDesc.get.call(window) : fsVal; };\n    Object.defineProperty(window, 'firestoreImports', {\n      configurable: true, enumerable: true,\n      get: function () { var r = fsRaw(); if (r !== fsFrom) { fsFrom = r; fsWrapped = wrapFs(r); } return fsWrapped; },\n      set: function (v) { if (fsDesc && fsDesc.set) fsDesc.set.call(window, v); else fsVal = v; }\n    });\n  } catch (e) {}\n  // warm up the next page the moment a link is touched, so tapping through the app feels instant\n  var warmed = {};\n  var warm = function (e) {\n    var a = e.target && e.target.closest && e.target.closest('a[href]'); if (!a) return;\n    var u; try { u = new URL(a.getAttribute('href'), location.href); } catch (x) { return; }\n    if (u.origin !== location.origin || !/\\.html$/.test(u.pathname) || u.pathname === (window.__dbkPath||location.pathname) || warmed[u.pathname]) return;\n    warmed[u.pathname] = 1;\n    var l = document.createElement('link'); l.rel = 'prefetch'; l.href = u.pathname; document.head.appendChild(l);\n  };\n  document.addEventListener('touchstart', warm, { passive: true, capture: true });\n  document.addEventListener('mouseover', warm, { passive: true, capture: true });\n  // Chrome can render the main pages ahead of time while you're on one\n  try {\n    if (HTMLScriptElement.supports && HTMLScriptElement.supports('speculationrules')) {\n      var sr = document.createElement('script'); sr.type = 'speculationrules';\n      sr.textContent = JSON.stringify({ prerender: [{ source: 'document', where: { href_matches: '/*.html' }, eagerness: 'moderate' }] });\n      document.head.appendChild(sr);\n    }\n  } catch (x) {}\n\n\n  /* one moon for the whole app: days since the actual new moon (Meeus) */\n  function newMoonJDE(k) {\n    var r = Math.PI / 180, T = k / 1236.85, T2 = T * T, T3 = T2 * T, T4 = T3 * T;\n    var jde = 2451550.09766 + 29.530588861 * k + 0.00015437 * T2 - 0.00000015 * T3 + 0.00000000073 * T4;\n    var E = 1 - 0.002516 * T - 0.0000074 * T2;\n    var M = (2.5534 + 29.1053567 * k - 0.0000014 * T2 - 0.00000011 * T3) * r;\n    var Mp = (201.5643 + 385.81693528 * k + 0.0107582 * T2 + 0.00001238 * T3 - 0.000000058 * T4) * r;\n    var F = (160.7108 + 390.67050284 * k - 0.0016118 * T2 - 0.00000227 * T3 + 0.000000011 * T4) * r;\n    var Om = (124.7746 - 1.56375588 * k + 0.0020672 * T2 + 0.00000215 * T3) * r;\n    var s = Math.sin;\n    return jde - 0.4072 * s(Mp) + 0.17241 * E * s(M) + 0.01608 * s(2 * Mp) + 0.01039 * s(2 * F) + 0.00739 * E * s(Mp - M)\n      - 0.00514 * E * s(Mp + M) + 0.00208 * E * E * s(2 * M) - 0.00111 * s(Mp - 2 * F) - 0.00057 * s(Mp + 2 * F)\n      + 0.00056 * E * s(2 * Mp + M) - 0.00042 * s(3 * Mp) + 0.00042 * E * s(M + 2 * F) + 0.00038 * E * s(M - 2 * F)\n      - 0.00024 * E * s(2 * Mp - M) - 0.00017 * s(Om);\n  }\n  function moonAge(d) {\n    var jd = d.getTime() / 86400000 + 2440587.5;\n    var k = Math.floor((jd - 2451550.09766) / 29.530588861);\n    while (newMoonJDE(k) > jd) k--;\n    while (newMoonJDE(k + 1) <= jd) k++;\n    var a = newMoonJDE(k), b = newMoonJDE(k + 1);\n    return (jd - a) * 29.530588861 / (b - a);\n  }\n  // days since the last new moon: from dbk-moon.js (the whole moon, worked out from the Sun's and Moon's places) when the page\n  // loads it, else these new-moon times\n  window.dbkMoonAge = function (d) { return window.dbkMoon ? window.dbkMoon(d).age : moonAge(d); };\n\n  var pageKey = page.replace('.html', '');\n  function names() {\n    var n = {};\n    try { n = JSON.parse(localStorage.getItem('userNames') || '{}'); } catch (e) {}\n    return { a: n.name1 || 'Person 1', b: n.name2 || 'Person 2' };\n  }\n  function heroFor(key) {\n    var n = names();\n    switch (key) {\n      case 'person1-hub': return [n.a, 'Habits & Wellness'];\n      case 'person2-hub': return [n.b, 'Habits & Wellness'];\n      case 'our-dreams': return [n.a + ' & ' + n.b, ''];\n      case 'meal-plan': return ['Meal Plan', ''];\n      case 'settings': return ['Settings', ''];\n      case 'workroom': return ['Workroom', ''];\n      default: return null;\n    }\n  }\n  /* keep the first block flush under the menu bar, whatever its real height\n     (phones add a status-bar inset on top of the 52px row) */\n  function snapUnder(el) {\n    var run = function () {\n      var nav = document.querySelector('nav.top-nav'); if (!nav || !el) return;\n      var navBottom = nav.getBoundingClientRect().bottom;\n      var cur = parseFloat(getComputedStyle(el).marginTop) || 0;\n      // page position, not screen position, so it stays right even when you're scrolled down\n      var top = el.getBoundingClientRect().top + (window.scrollY || window.pageYOffset || 0);\n      var want = cur + (navBottom - top);\n      if (Math.abs(want - cur) > 0.5) el.style.setProperty('margin-top', want + 'px', 'important');\n    };\n    run(); setTimeout(run, 150); setTimeout(run, 600); window.addEventListener('load', run); window.addEventListener('resize', run);\n    window.addEventListener('orientationchange', function () { setTimeout(run, 300); });\n  }\n  function ready() {\n    if (pageKey === 'index') { root.classList.add('dbk-has-hero'); var hm = document.querySelector('.hm'); if (hm) snapUnder(hm); return; }\n    var h = heroFor(pageKey);\n    if (!h || document.querySelector('.dbk-hero')) return;\n    root.classList.add('dbk-has-hero');\n    var hero = document.createElement('header');\n    hero.className = 'dbk-hero';\n    hero.innerHTML = '<div class=\"dbk-hero-text\"><div class=\"dbk-title\"></div>' + (h[1] ? '<div class=\"dbk-sub\"></div>' : '') + '</div>';\n    hero.querySelector('.dbk-title').textContent = h[0];\n    if (h[1]) hero.querySelector('.dbk-sub').textContent = h[1];\n    var nav = document.querySelector('nav.top-nav');\n    if (nav && nav.parentNode) nav.parentNode.insertBefore(hero, nav.nextSibling);\n    else document.body.insertBefore(hero, document.body.firstChild);\n    snapUnder(hero);\n    var bands = {\n      'person1-hub': [['#bingoSectionWrap', 'pink'], ['#dbkChallenge', 'sage'], ['#scheduleSectionWrap', 'sand'], ['#resources-tab > .section', 'sand']],\n      'our-dreams': [['#landing-tab', 'pink-wrap'], ['.section[data-dream-section=\"challenges\"]', 'sage'], ['.section[data-dream-section=\"history\"]', 'sand']]\n    };\n    bands['person2-hub'] = bands['person1-hub'];\n    (bands[pageKey] || []).forEach(function (b) {\n      document.querySelectorAll(b[0]).forEach(function (el) {\n        if (b[1] === 'pink-wrap') return;\n        el.classList.add('dbk-sec', 'dbk-' + b[1] + 'b');\n      });\n    });\n    /* wrap a run of siblings (first..last) into one full-width band */\n    function wrapRun(firstSel, lastSel, color, title) {\n      var a = document.querySelector(firstSel); if (!a) return null;\n      var b = lastSel ? document.querySelector(lastSel) : a; if (!b || b.parentNode !== a.parentNode) b = a;\n      var sec = document.createElement('section'); sec.className = 'dbk-sec dbk-' + color + 'b';\n      a.parentNode.insertBefore(sec, a);\n      if (title) { var h = document.createElement('h2'); h.className = 'section-title'; h.textContent = title; sec.appendChild(h); }\n      var n = a, stop = b.nextSibling;\n      while (n && n !== stop) { var nx = n.nextSibling; sec.appendChild(n); n = nx; }\n      return sec;\n    }\n    function band(sel, color) { document.querySelectorAll(sel).forEach(function (el) { el.classList.add('dbk-sec', 'dbk-' + color + 'b'); }); }\n    if (pageKey === 'person1-hub' || pageKey === 'person2-hub') habitsLinks();\n    function habitsLinks() {\n      var bt = document.getElementById('bingo-tab'), rt = document.getElementById('resources-tab');\n      if (bt && rt && !document.getElementById('dbkResLink')) {\n        // Resources lives on the Habits page itself, under the schedule: the categories open in place,\n        // and adding a category or a resource happens in a pop-up\n        var me = role === 'person2' ? 'person2' : 'person1';\n        try { if (localStorage.getItem(me + 'Hub_activeTab') === 'resources') localStorage.setItem(me + 'Hub_activeTab', 'bingo'); } catch (e) {}\n        var d = document.createElement('section'); d.id = 'dbkResLink'; d.className = 'dbk-res-sec dbk-sec dbk-pinkb';\n        d.innerHTML = '<h2 class=\"dbk-res-h\">Resources</h2>';\n        var cats = document.getElementById('resourceCategories'), addRow = rt.querySelector('.add-category-row');\n        if (cats) d.appendChild(cats);\n        var more = document.createElement('div'); more.className = 'dbk-res-more'; more.innerHTML = '<button type=\"button\" class=\"dbk-res-all\" id=\"dbkAddCat\">+ Add a category</button>';\n        d.appendChild(more);\n        if (addRow) { addRow.hidden = true; d.appendChild(addRow); }\n        // the resource form and its backdrop become a true pop-up\n        ['resourceFormOverlay', 'resourceForm'].forEach(function (id) { var el = document.getElementById(id); if (el) document.body.appendChild(el); });\n        bt.appendChild(d);\n        rt.id = 'dbkResourcesRetired'; rt.hidden = true;\n        var hb = document.getElementById('dbkHabBack'); if (hb) hb.remove();\n        // the resource pop-up says what it's for\n        var rfT = function (txt) {\n          var f = document.querySelector('#resourceForm form'); if (!f) return;\n          var h = f.querySelector('.dbk-rf-title'); if (!h) { h = document.createElement('h3'); h.className = 'dbk-rf-title'; f.insertBefore(h, f.firstChild); }\n          h.textContent = txt;\n        };\n        var wrapRF = function () { ['showAddResourceForm', 'editResource'].forEach(function (fn) {\n          var orig = window[fn]; if (typeof orig !== 'function' || orig.__dbkT) return;\n          var w = function (cat) {\n            var r = orig.apply(this, arguments);\n            var nice = typeof window.resourceCategoryName === 'function' ? window.resourceCategoryName(cat) : String(cat || '').charAt(0).toUpperCase() + String(cat || '').slice(1).replace(/_/g, ' ');\n            rfT(fn === 'editResource' ? 'Edit resource' : (nice ? 'Add to ' + nice : 'New resource'));\n            return r;\n          };\n          w.__dbkT = true; window[fn] = w;\n        }); };\n        wrapRF(); setTimeout(wrapRF, 800); setTimeout(wrapRF, 2500);\n        // add or rename a category: a small pop-up with one box. save(value) returns true, or a note to show\n        var catPop = function (title, value, saveLabel, placeholder, save) {\n          var o = document.createElement('div'); o.className = 'dbk-infopop dbk-catpop';\n          o.style.cssText = 'position:fixed;inset:0;z-index:99999;display:flex;justify-content:center;';\n          o.innerHTML = '<form class=\"dbk-infocard dbk-catcard\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"dbkCatT\"><button type=\"button\" class=\"dbk-info-x\" aria-label=\"Close\">&times;</button>' +\n            '<h3 class=\"dbk-info-title\" id=\"dbkCatT\"></h3><input type=\"text\" id=\"dbkCatName\" autocomplete=\"off\">' +\n            '<div class=\"dbk-cat-act\"><button type=\"button\" class=\"dbk-cat-cancel\">Cancel</button><button type=\"submit\" class=\"dbk-cat-save\"></button></div></form>';\n          o.querySelector('#dbkCatT').textContent = title; o.querySelector('.dbk-cat-save').textContent = saveLabel;\n          var box = o.querySelector('input'); box.value = value || ''; if (placeholder) box.placeholder = placeholder;\n          var close = function () { o.remove(); };\n          o.addEventListener('click', function (e) { if (e.target === o || e.target.closest('.dbk-info-x, .dbk-cat-cancel')) close(); });\n          o.querySelector('form').addEventListener('submit', function (e) {\n            e.preventDefault(); var v = box.value.trim(); if (!v) return;\n            var r = true; try { r = save(v); } catch (x) {}\n            // the page says why it can't (a category with that name already exists): keep the pop-up open and say so\n            if (typeof r === 'string') {\n              var note = o.querySelector('.dbk-cat-note');\n              if (!note) { note = document.createElement('p'); note.className = 'dbk-cat-note'; note.setAttribute('role', 'alert'); note.style.cssText = 'margin:8px 0 0;font-size:14px;'; box.insertAdjacentElement('afterend', note); }\n              note.textContent = r; box.focus(); return;\n            }\n            close();\n          });\n          document.body.appendChild(o); setTimeout(function () { box.focus(); try { var n = box.value.length; box.setSelectionRange(n, n); } catch (x) {} }, 60);\n        };\n        document.getElementById('dbkAddCat').addEventListener('click', function () {\n          catPop('New category', '', 'Add', 'Sleep, movement, reading...', function (v) {\n            var inp = document.getElementById('newCategoryInput'); if (!inp) return true;\n            inp.value = v; var r = addResourceCategory(); if (typeof r === 'string') inp.value = ''; return r;\n          });\n        });\n        window.dbkRenameResCat = function (cat, nice) {\n          catPop('Rename category', nice || cat, 'Save', '', function (v) { return typeof window.renameResourceCategory === 'function' ? window.renameResourceCategory(cat, v) : true; });\n        };\n        // anything that still points at #resources lands here\n        var toRes = function () {\n          if (location.hash !== '#resources') return;\n          try { history.replaceState(null, '', '#bingo'); } catch (e) {}\n          document.querySelectorAll('.hub-tab').forEach(function (t) { t.classList.toggle('active', t.id === 'bingo-tab'); });\n          setTimeout(function () { d.scrollIntoView({ block: 'start', behavior: 'smooth' }); }, 120);\n        };\n        window.addEventListener('hashchange', toRes); window.addEventListener('dbk-show', toRes); setTimeout(toRes, 300);\n      }\n      var later = function () { if (location.hash === '#backburner') { try { __dbkLoc.replace('index.html#later'); } catch (e) {} } };\n      later(); window.addEventListener('hashchange', later); window.addEventListener('dbk-show', later);\n    }\n    if (pageKey === 'workroom') {\n      // the Workroom sits on one plain ground: no colored bands\n      // settings lives as a quiet link under the business switcher instead of up top\n      // Work's settings moved into Settings > Work; an old link to workroom.html#settings goes there\n      var wrSet = function () {\n        if (location.hash !== '#settings') return;\n        try { __dbkLoc.replace('settings.html#sec-work'); } catch (e) { location.replace('settings.html#sec-work'); }\n      };\n      setTimeout(wrSet, 400); window.addEventListener('hashchange', wrSet); window.addEventListener('dbk-show', function () { setTimeout(wrSet, 50); });\n      // its views (Overview, Content, Home Base, Spark File) are picked from the menu only\n    }\n    if (pageKey === 'settings') {\n      wrapRun('#sec-branding', '#sec-about', 'pink');\n    }\n    if (pageKey === 'meal-plan') {\n      // meal settings live in Settings > Meals now; the old settings view on this page sends you there\n      var toSettings = function () {\n        var last = null; try { last = localStorage.getItem('lastTab'); } catch (e) {}\n        if (location.hash === '#settings' || last === 'settings') {\n          try { localStorage.setItem('lastTab', 'plan'); } catch (e) {}\n          if (location.hash === '#settings') { try { __dbkLoc.replace('settings.html#sec-meals'); } catch (e) { location.replace('settings.html#sec-meals'); } }\n        }\n      };\n      toSettings(); window.addEventListener('hashchange', toSettings);\n      // the week and its days sit together in one band\n      wrapRun('#week-nav', '#dual-goals', 'sage');\n      band('#day-detail', 'pink');\n      [['#recipes-view', 'linen'], ['#grocery-view', 'pink'], ['#journal-view', 'celadon'], ['#settings-view', 'linen']].forEach(function (s) { band(s[0], s[1]); });\n      var views = { plan: 'plan-view', recipes: 'recipes-view', grocery: 'grocery-view', journal: 'journal-view' };\n      // Meals' sections live in the top menu (see modeItems); the page follows the menu through the address\n      var mealView = function () {\n        var k; for (k in views) { var a = document.getElementById(views[k]); if (a && a.classList.contains('active')) return k; }\n        for (k in views) { var el = document.getElementById(views[k]); if (el && el.offsetParent !== null) return k; } return 'plan';\n      };\n      window.dbkModeView = mealView;\n      var mealShow = window.dbkModeShow = function (k) { if (!views[k]) return; try { if (mealView() !== k) window.switchTab(k); } catch (e) {} try { window.scrollTo({ top: 0, left: 0, behavior: 'instant' }); } catch (e) { window.scrollTo(0, 0); } };   // instantly: Meals scrolls smoothly, which slid the page up and could stop halfway\n      window.addEventListener('hashchange', function () { mealShow((location.hash || '').replace('#', '')); });\n      var mh = (location.hash || '').replace('#', '');\n      if (views[mh]) { mealShow(mh); setTimeout(function () { mealShow(mh); }, 300); }\n      // one row of tabs at the top of the page (the menu shows just \"Meals\"); a section put away in Settings has no tab\n      var pv = document.getElementById('plan-view');\n      if (pv && !document.getElementById('dbkMealTabs')) {\n        var Mm = window.dbkModule, gone = function (k) { return !!(Mm && Mm.archived && Mm.archived('meals:' + k)); };\n        var mt = document.createElement('div'); mt.id = 'dbkMealTabs'; mt.className = 'dbk-mealtabs'; mt.setAttribute('role', 'tablist'); mt.setAttribute('aria-label', 'Meals');\n        mt.innerHTML = [['plan', 'Plan'], ['recipes', 'Recipes'], ['grocery', 'Grocery'], ['journal', 'Journal']].filter(function (x) { return x[0] === 'plan' || !gone(x[0]); })\n          .map(function (x) { return '<button type=\"button\" role=\"tab\" data-k=\"' + x[0] + '\">' + x[1] + '</button>'; }).join('');\n        var top = pv; while (top.parentNode && top.parentNode !== document.body && !top.parentNode.querySelector(':scope > #recipes-view, :scope > * #recipes-view') ) top = top.parentNode;\n        var holder = top.parentNode || document.body; holder.insertBefore(mt, top);\n        var paintTabs = function () { var v = mealView(); [].forEach.call(mt.children, function (b) { var on = b.getAttribute('data-k') === v; b.classList.toggle('on', on); b.setAttribute('aria-selected', on ? 'true' : 'false'); }); };\n        mt.addEventListener('click', function (e) {\n          var b = e.target.closest('button[data-k]'); if (!b) return; var k = b.getAttribute('data-k');\n          if (('#' + k) !== location.hash) location.hash = k; else mealShow(k);\n          setTimeout(paintTabs, 30); setTimeout(paintTabs, 300);\n        });\n        window.addEventListener('hashchange', function () { setTimeout(paintTabs, 30); });\n        paintTabs(); setTimeout(paintTabs, 350); setTimeout(paintTabs, 1200);\n        window.dbkMealTabsPaint = paintTabs;\n        // any jump between sections (Make the grocery list, a link inside the page) lights that tab and puts it\n        // in the address too, so the page reopens there and never shows one section under another tab's name\n        var hookTabs = function (n) {\n          var st = window.switchTab; if (typeof st !== 'function') { if ((n || 0) < 60) setTimeout(function () { hookTabs((n || 0) + 1); }, 150); return; }\n          if (st._dbkTabs) return;\n          var w = function (k) {\n            var r = st.apply(this, arguments);\n            if (views[k] && location.hash !== '#' + k) { try { history.replaceState(history.state, '', '#' + k); } catch (e) {} }\n            paintTabs(); return r;\n          };\n          w._dbkTabs = true; window.switchTab = w;\n        };\n        hookTabs(0);\n      }\n    }\n    if (pageKey === 'person1-hub' || pageKey === 'person2-hub') {\n      var bs = document.getElementById('bingoSectionWrap'), un = document.getElementById('scheduleUpNext');\n      if (bs && un) { bs.parentNode.insertBefore(un, bs); un.classList.add('dbk-upnext'); }\n      var mt = bs && bs.querySelector('.main-title'); if (mt) mt.textContent = 'Habits Bingo';\n    }\n    if (pageKey === 'our-dreams') {\n      var tiles = document.getElementById('sectionTiles');\n      if (tiles && !tiles.parentNode.classList.contains('dbk-sec')) {\n        var w = document.createElement('section'); w.className = 'dbk-sec dbk-pinkb';\n        var h = document.createElement('h2'); h.className = 'section-title'; h.textContent = 'Lists';\n        tiles.parentNode.insertBefore(w, tiles); w.appendChild(h); w.appendChild(tiles);\n      }\n    }\n    // plain section headings where the old layout relied on tabs or none at all\n    var heads = [];\n    heads.forEach(function (h) {\n      var el = document.querySelector(h[0]);\n      if (el && !el.querySelector(':scope > .dbk-h')) { var d = document.createElement('div'); d.className = 'dbk-h'; d.textContent = h[1]; el.insertBefore(d, el.firstChild); }\n    });\n    if (pageKey === 'person1-hub' || pageKey === 'person2-hub') {\n      var sub = hero.querySelector('.dbk-sub'); if (sub) sub.remove();\n    }\n  }\n  /* Home: this week's strip and event list, drawn from the shared calendar */\n  /* Home: this week's strip. Tap a day to see what's on it; tap it again to see the whole week. */\n  var hmSel = null;\n  function hmFmtTime(t) {\n    var m = /^(\\d{1,2}):(\\d{2})/.exec(t || ''); if (!m) return '';\n    var h = +m[1], ap = h >= 12 ? 'PM' : 'AM'; h = h % 12 || 12; return h + ':' + m[2] + ' ' + ap;\n  }\n  /* Home calendar: Week or Month, tap a day to see it underneath. One calendar, nothing else. */\n  var hc = { view: 'week', anchor: null, sel: null };\n  try { hc.view = localStorage.getItem('dbkCalView') === 'month' ? 'month' : 'week'; } catch (e) {}\n  // Leaving Today and coming back (another page, or the app put away for 5 minutes or more): the calendar is on today\n  // again, week or month (Kasey, Oct 25: \"Shouldn't open again in a month that isn't current\"). A search result or a new\n  // event that shows its own day does so after this (they come by the address, which is read after the page shows).\n  (function () {\n    var away = 0, back = function () { if (!document.getElementById('hmWeek') || !hc.anchor) return; hc.sel = null; hc.anchor = null; try { hmWeek(); } catch (e) {} };\n    window.addEventListener('dbk-show', back);\n    document.addEventListener('visibilitychange', function () { if (document.hidden) { away = Date.now(); return; } if (away && Date.now() - away >= 5 * 60000) back(); away = 0; });\n  })();\n  /* Calendars on a computer: the arrow keys move through the dates (the designer). One helper for every calendar grid.\n     Left/Right a day, Up/Down a week, Home/End the start/end of the week, PageUp/PageDown a month. Moving past what's\n     shown moves the calendar along. Enter or Space opens the day (the day is a button, so that's the same as a click).\n     Only while a day itself has focus: typing anywhere else never moves the dates.\n     opts: cell (selector), dateOf(cell) -> Date, go(date) -> shows that date (may re-render; may return a Promise;\n           false = can't go there), find(date) -> the day's button or null, ws -> first day of the week (0 Sun, 1 Mon),\n           always -> call go() even when the day is already shown (when moving also chooses the day) */\n  window.dbkCalKeys = function (grid, opts) {\n    if (!grid || grid._dbkCalKeys) return; grid._dbkCalKeys = true;\n    // the day the keys are on: if the calendar is drawn again (new data arriving), the keys stay on that day\n    var kb = null;\n    grid.addEventListener('focusout', function (e) { if (e.relatedTarget && !grid.contains(e.relatedTarget)) kb = null; });\n    new MutationObserver(function () {\n      if (!kb) return; var a = document.activeElement;\n      if (!a || a === document.body || !document.contains(a)) focusOn(kb, 60);\n    }).observe(grid, { childList: true, subtree: true });\n    var focusOn = function (date, tries) {\n      kb = date;\n      var c = opts.find(date);\n      if (c) {\n        grid.querySelectorAll(opts.cell).forEach(function (b) { if (b !== c && b.getAttribute('tabindex') !== '-1') b.setAttribute('tabindex', '-1'); });\n        c.setAttribute('tabindex', '0');\n        try { c.focus({ preventScroll: true }); } catch (e) { c.focus(); }\n        return;\n      }\n      // a month that's still loading draws a moment later: keep looking for up to about 3 seconds\n      if ((tries || 0) < 60) setTimeout(function () { focusOn(date, (tries || 0) + 1); }, 50);\n    };\n    grid.addEventListener('keydown', function (e) {\n      if (e.altKey || e.ctrlKey || e.metaKey || e.shiftKey) return;\n      var c = e.target.closest && e.target.closest(opts.cell); if (!c || !grid.contains(c)) return;\n      var d = opts.dateOf(c); if (!d) return;\n      var n = new Date(d.getFullYear(), d.getMonth(), d.getDate()), ws = typeof opts.ws === 'function' ? opts.ws() : (opts.ws || 0), k = e.key;\n      if (k === 'ArrowLeft') n.setDate(n.getDate() - 1);\n      else if (k === 'ArrowRight') n.setDate(n.getDate() + 1);\n      else if (k === 'ArrowUp') n.setDate(n.getDate() - 7);\n      else if (k === 'ArrowDown') n.setDate(n.getDate() + 7);\n      else if (k === 'Home') n.setDate(n.getDate() - ((n.getDay() - ws + 7) % 7));\n      else if (k === 'End') n.setDate(n.getDate() + (6 - (n.getDay() - ws + 7) % 7));\n      else if (k === 'PageUp' || k === 'PageDown') { var day = n.getDate(); n = new Date(n.getFullYear(), n.getMonth() + (k === 'PageUp' ? -1 : 1), 1); n.setDate(Math.min(day, new Date(n.getFullYear(), n.getMonth() + 1, 0).getDate())); }\n      else return;\n      e.preventDefault();\n      if (opts.find(n) && !opts.always) { focusOn(n); return; }\n      Promise.resolve(opts.go(n)).then(function (ok) { if (ok !== false) focusOn(n); });\n    });\n  };\n  function hmWeek() {\n    var sec = document.getElementById('calendarSection'), grid = document.getElementById('hmWeek'), panel = document.getElementById('hmEvents');\n    if (!sec || !grid || !panel) return;\n    var evs = [], matcher = null;\n    try { evs = (calendarEvents || []).concat(window.dbkPosts || [], addons().events || []); } catch (e) { evs = []; }\n    try { matcher = calendarEventMatchesDate; } catch (e) { matcher = null; }\n    var ws = 0; try { var wsv = localStorage.getItem('weekStart'); ws = (wsv === 'monday' || wsv === '1') ? 1 : 0; } catch (e) {}\n    var today = new Date(); today.setHours(0, 0, 0, 0);\n    var key = function (d) { return d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2); };\n    var fromKey = function (k) { var p = k.split('-'); return new Date(+p[0], +p[1] - 1, +p[2]); };\n    var weekOf = function (d) { var f = new Date(d); f.setDate(d.getDate() - ((d.getDay() - ws + 7) % 7)); return f; };\n    var MON = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n    var MS = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n    var FULL = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n    var L = ['S', 'M', 'T', 'W', 'T', 'F', 'S'];\n    var nCal = 0; try { nCal = (calendarEvents || []).length; } catch (e) { nCal = 0; }\n    // an event's tick is saved under its id (old events with no id: their place in the list, as the old full calendar did)\n    // an add-on's own event can be ticked too when it says so (tick: true and an id; Our2daybook's client visits, Oct 23)\n    var evDid = function (e, ix) { if (e && e.tick === true && e.id != null && e.id !== '') return String(e.id); if (!(ix >= 0 && ix < nCal) || e.isPost || typeof e.open === 'function') return null; return e.id != null && e.id !== '' ? e.id : ix; };\n    var on = function (d) { return evs.filter(function (e) { try { if (matcher) return matcher(e, d); var p = (e.date || '').split('-'); return +p[0] === d.getFullYear() && +p[1] === d.getMonth() + 1 && +p[2] === d.getDate(); } catch (x) { return false; } }).sort(function (a, b) { return (a.time || '99').localeCompare(b.time || '99'); }); };\n    // Reminders on their days (Kasey, Oct 25: \"I have a reminder missing from the calendar\"): the calendar only ever\n    // showed the next reminder due, on today's line, so a reminder on any other day was nowhere on it. Each reminder's\n    // dates for the next 13 months (its next date, then every week / month / 3 or 6 months / year after it) put a dot\n    // on the day and a line in that day's list. A one-time reminder that's been done isn't shown.\n    var remDays = {};\n    try {\n      var remShown = typeof psdGetFeatures === 'function' ? psdGetFeatures().reminders !== false : true;\n      if (remShown && typeof lifeReminders !== 'undefined' && Array.isArray(lifeReminders) && typeof getNextNotifyDate === 'function') {\n        var until = new Date(today); until.setDate(until.getDate() + 400);\n        lifeReminders.forEach(function (r) {\n          if (!r || !r.title || (r.frequency === 'once' && r.lastDone)) return;\n          var d0 = getNextNotifyDate(r); if (!(d0 instanceof Date) || isNaN(d0)) return; d0 = new Date(d0); d0.setHours(0, 0, 0, 0);\n          // (the day it was saved for, not the first date's: a monthly one on the 31st is Nov 30 and then Dec 31, never\n          // Dec 30; Oct 26)\n          var day = d0.getDate(); if (typeof r.notifyDate === 'string') { var pd = +r.notifyDate.split('-')[2]; if (pd) day = pd; } else if (r.notifyDate && +r.notifyDate.day >= day && r.frequency !== 'weekly' && !r.snoozedUntil) day = +r.notifyDate.day;\n          var months = { monthly: 1, quarterly: 3, twice: 6, yearly: 12 }[r.frequency] || 0, step = 0;\n          for (var d = d0, n = 0; d <= until && n < 60; n++) {\n            var k0 = key(d); (remDays[k0] = remDays[k0] || []).push(r);\n            if (r.frequency === 'weekly') { d = new Date(d); d.setDate(d.getDate() + 7); }\n            else if (months) { step += months; var y = d0.getFullYear(), mo = d0.getMonth() + step; d = new Date(y, mo, Math.min(day, new Date(y, mo + 1, 0).getDate())); }\n            else break;\n          }\n        });\n      }\n    } catch (x) { remDays = {}; }\n    if (hc.day && hc.day !== key(today)) { hc.sel = null; hc.anchor = null; } // left open past midnight: back to the new today\n    hc.day = key(today);\n    if (!hc.sel) hc.sel = key(today);\n    // the week's first day changed (Settings > Week starts, on this phone or the other): the week shown starts again on\n    // that day, around the day picked (it kept the old week's dates under the new day letters, M over a Sunday)\n    if (hc.anchor && hc.ws !== undefined && hc.ws !== ws && hc.view === 'week') hc.anchor = weekOf(fromKey(hc.sel));\n    hc.ws = ws;\n    if (!hc.anchor) hc.anchor = hc.view === 'week' ? weekOf(today) : new Date(today.getFullYear(), today.getMonth(), 1);\n    // the top: arrows, what you're looking at, and Week / Month\n    var head = sec.querySelector('.hc-head');\n    if (!head) {\n      var h3 = sec.querySelector('.hm-h'); if (h3) h3.remove();\n      head = document.createElement('div'); head.className = 'hc-head';\n      head.innerHTML = '<button type=\"button\" class=\"hc-arrow\" data-go=\"-1\" aria-label=\"Back\">&#8249;</button><button type=\"button\" class=\"hc-label\" data-go=\"0\"></button><button type=\"button\" class=\"hc-arrow\" data-go=\"1\" aria-label=\"Forward\">&#8250;</button>';\n      var seg = document.createElement('div'); seg.className = 'dbk-seg hc-seg'; seg.setAttribute('role', 'tablist');\n      seg.innerHTML = '<button type=\"button\" role=\"tab\" data-v=\"week\">Week</button><button type=\"button\" role=\"tab\" data-v=\"month\">Month</button>';\n      sec.insertBefore(seg, sec.firstChild); sec.insertBefore(head, sec.firstChild);\n      var step = function (g) {\n        var today = new Date(); today.setHours(0, 0, 0, 0);\n        if (g === 0) { hc.sel = key(today); hc.anchor = null; }\n        else if (hc.view === 'week') { hc.anchor.setDate(hc.anchor.getDate() + 7 * g); hc.sel = key(hc.anchor.getTime() <= today.getTime() && today.getTime() < hc.anchor.getTime() + 7 * 864e5 ? today : hc.anchor); }\n        else { hc.anchor = new Date(hc.anchor.getFullYear(), hc.anchor.getMonth() + g, 1); hc.sel = key(hc.anchor.getMonth() === today.getMonth() && hc.anchor.getFullYear() === today.getFullYear() ? today : hc.anchor); }\n        hmWeek();\n      };\n      head.addEventListener('click', function (e) { var b = e.target.closest('[data-go]'); if (!b) return; step(+b.getAttribute('data-go')); });\n      // phones: swipe the days left or right for the next or previous week (or month). Only a clearly sideways\n      // swipe counts, so scrolling the page still works, and a swipe from the very left edge stays the app's Back.\n      var sx = null;\n      var swipeZone = [grid, head];\n      swipeZone.forEach(function (z) {\n        z.addEventListener('touchstart', function (e) { if (e.touches.length !== 1) { sx = null; return; } var t = e.touches[0]; sx = t.clientX < 30 ? null : { x: t.clientX, y: t.clientY, t: Date.now() }; }, { passive: true });\n        z.addEventListener('touchend', function (e) {\n          if (!sx) return; var s = sx; sx = null; var t = e.changedTouches && e.changedTouches[0]; if (!t) return;\n          var dx = t.clientX - s.x, dy = t.clientY - s.y;\n          if (Math.abs(dx) < 50 || Math.abs(dx) < Math.abs(dy) * 1.5 || Date.now() - s.t > 800) return;\n          grid._dbkSwiped = Date.now();\n          var g = dx < 0 ? 1 : -1;\n          step(g);\n          var gg = grid.querySelector('.hc-grid'); if (gg) { gg.classList.remove('hc-in-l', 'hc-in-r'); void gg.offsetWidth; gg.classList.add(g > 0 ? 'hc-in-l' : 'hc-in-r'); }\n        }, { passive: true });\n        z.addEventListener('touchcancel', function () { sx = null; }, { passive: true });\n      });\n      seg.addEventListener('click', function (e) {\n        var b = e.target.closest('[data-v]'); if (!b) return; var v = b.getAttribute('data-v'); if (v === hc.view) return;\n        hc.view = v; try { localStorage.setItem('dbkCalView', v); } catch (x) {}\n        var sd = fromKey(hc.sel); hc.anchor = v === 'week' ? weekOf(sd) : new Date(sd.getFullYear(), sd.getMonth(), 1);\n        hmWeek();\n      });\n      grid.addEventListener('click', function (e) { if (Date.now() - (grid._dbkSwiped || 0) < 450) return; var c = e.target.closest('[data-date]'); if (!c) return; hc.sel = c.getAttribute('data-date'); hmWeek(); });\n      // on a computer the arrow keys move the chosen day (and the week or month along with it)\n      var hcWs = function () { try { var v = localStorage.getItem('weekStart'); return (v === 'monday' || v === '1') ? 1 : 0; } catch (x) { return 0; } };\n      window.dbkCalKeys(grid, {\n        cell: '.hc-day', always: true, ws: hcWs,\n        dateOf: function (c) { return fromKey(c.getAttribute('data-date')); },\n        find: function (d) { return grid.querySelector('.hc-day[data-date=\"' + key(d) + '\"]'); },\n        go: function (d) {\n          var w0 = hcWs(), wk = new Date(d); wk.setDate(d.getDate() - ((d.getDay() - w0 + 7) % 7));\n          if (hc.view === 'week') { if (!hc.anchor || hc.anchor.getTime() !== wk.getTime()) hc.anchor = wk; }\n          else if (!hc.anchor || hc.anchor.getMonth() !== d.getMonth() || hc.anchor.getFullYear() !== d.getFullYear()) hc.anchor = new Date(d.getFullYear(), d.getMonth(), 1);\n          hc.sel = key(d); hmWeek();\n        }\n      });\n    }\n    sec.querySelectorAll('.hc-seg [data-v]').forEach(function (b) { var is = b.getAttribute('data-v') === hc.view; if (b.classList.contains('on') !== is) b.classList.toggle('on', is); b.setAttribute('aria-selected', is ? 'true' : 'false'); });\n    var label, cells = '';\n    var cell = function (d, out) {\n      var k = key(d), has = on(d).length || (remDays[k] || []).length;\n      return '<button type=\"button\" class=\"hc-day' + (out ? ' out' : '') + (has ? ' ev' : '') + (d.getTime() === today.getTime() ? ' today' : '') + (k === hc.sel ? ' sel' : '') + '\" data-date=\"' + k + '\" tabindex=\"' + (k === hc.sel ? '0' : '-1') + '\" aria-pressed=\"' + (k === hc.sel ? 'true' : 'false') + '\"' + (d.getTime() === today.getTime() ? ' aria-current=\"date\"' : '') + '><span class=\"hc-n\">' + d.getDate() + '</span></button>';\n    };\n    var heads = ''; for (var i = 0; i < 7; i++) heads += '<span class=\"hc-l\">' + L[(i + ws) % 7] + '</span>';\n    if (hc.view === 'week') {\n      var a = hc.anchor, z = new Date(a); z.setDate(a.getDate() + 6);\n      label = MS[a.getMonth()] + ' ' + a.getDate() + ' – ' + (z.getMonth() !== a.getMonth() ? MS[z.getMonth()] + ' ' : '') + z.getDate();\n      for (var w = 0; w < 7; w++) { var d = new Date(a); d.setDate(a.getDate() + w); cells += cell(d, false); }\n    } else {\n      var m = hc.anchor, f = weekOf(m), last = new Date(m.getFullYear(), m.getMonth() + 1, 0);\n      label = MON[m.getMonth()] + (m.getFullYear() !== today.getFullYear() ? ' ' + m.getFullYear() : '');\n      var d2 = new Date(f);\n      while (d2 <= last || (d2.getDay() - ws + 7) % 7 !== 0) { cells += cell(d2, d2.getMonth() !== m.getMonth()); d2 = new Date(d2); d2.setDate(d2.getDate() + 1); }\n    }\n    var lab = head.querySelector('.hc-label'); if (lab.textContent !== label) lab.textContent = label;\n    var gh = '<div class=\"hc-grid hc-' + hc.view + '\">' + heads + cells + '</div>';\n    if (grid._dbkHtml !== gh) { grid.innerHTML = gh; grid._dbkHtml = gh; }\n    // the day you tapped (today to start)\n    var sd = fromKey(hc.sel), list = on(sd);\n    // a reminder that's due is the first line of today's calendar (the big Reminder band is gone)\n    var remOn = typeof psdGetFeatures === 'function' ? psdGetFeatures().reminders !== false : true, rem = null, calWrap = sec.closest('[data-sortkey=\"calendar\"]');\n    var calShown = !calWrap || getComputedStyle(calWrap).display !== 'none';\n    if (remOn && calShown && sd.getTime() === today.getTime()) { try { var up = getUpcomingReminders(90); if (up.length) rem = up[Math.min(typeof currentReminderIndex === 'number' ? currentReminderIndex : 0, up.length - 1)]; } catch (x) { rem = null; } }\n    document.documentElement.classList.toggle('dbk-rem-in-cal', !!(remOn && calShown));\n    // work events and reminders get a small Work tag under the time (only where the Work page is on for this person)\n    var workTag = false; try { workTag = !!(window.dbkModule && window.dbkModule.workOn && window.dbkModule.workOn()); } catch (x) {}\n    var remDue = rem ? (typeof formatDueText === 'function' ? formatDueText(rem.daysUntil) : '') : '';\n    // the reminder's link (saved from the reminder forms), its own small button so tapping it never ticks the reminder\n    var remLink = function (r) {\n      var v = String((r && r.link) || '').trim(), u = /^https?:\\/\\//i.test(v) ? v : (!/^[a-z][a-z0-9+.-]*:/i.test(v) && /^[^\\s\\/]+\\.[a-z]{2,}([\\/?#]\\S*)?$/i.test(v) ? 'https://' + v : '');\n      if (!u || /\\s/.test(u)) return '';\n      return '<a class=\"dbk-remlink\" href=\"' + u.replace(/&/g, '&amp;').replace(/\"/g, '&quot;').replace(/</g, '&lt;') + '\" target=\"_blank\" rel=\"noopener noreferrer\" aria-label=\"Open the link\"><svg viewBox=\"0 0 24 24\" width=\"18\" height=\"18\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M10 14a4.5 4.5 0 0 0 6.4 0l3-3a4.5 4.5 0 0 0-6.4-6.4l-1 1\"/><path d=\"M14 10a4.5 4.5 0 0 0-6.4 0l-3 3a4.5 4.5 0 0 0 6.4 6.4l1-1\"/></svg></a>';\n    };\n    var remLk = rem ? remLink(rem) : '';\n    var remHtml = rem ? '<div class=\"hc-rem' + (remLk ? ' hc-rem-lk' : '') + '\"><span class=\"hc-rem-l\">Reminder' + (rem.space === 'work' && workTag ? '<span class=\"dbk-wtag\">Work</span>' : '') + '</span><button type=\"button\" class=\"hc-rem-main\" data-remedit><span class=\"hc-rem-name\"></span><span class=\"hc-rem-when' + (rem.daysUntil < 0 ? ' late' : '') + '\"></span></button>' + remLk + '<button type=\"button\" class=\"hm-link\" data-remdone>Done</button></div>' : '';\n    // cooking heads-ups from Meals (meal-cookplan.js): thaw tonight, start the slow cooker at 11:45...\n    var cook = [];\n    if (calShown && sd.getTime() === today.getTime() && window.dbkCookToday) { try { cook = window.dbkCookToday.list(); } catch (x) { cook = []; } }\n    var cookHtml = cook.length ? window.dbkCookToday.html(cook) : '';\n    var dayRems = (remOn && calShown ? remDays[key(sd)] || [] : []).filter(function (r) { return !rem || String(r.id) !== String(rem.id); });\n    var hesc = function (t) { return String(t == null ? '' : t).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); };\n    var dayRemHtml = dayRems.map(function (r) { var lk = remLink(r); return '<div class=\"hc-rem hc-rem-day' + (lk ? ' hc-rem-lk' : '') + '\"><span class=\"hc-rem-l\">Reminder' + (r.space === 'work' && workTag ? '<span class=\"dbk-wtag\">Work</span>' : '') + '</span><button type=\"button\" class=\"hc-rem-main\" data-remid=\"' + hesc(r.id) + '\"><span class=\"hc-rem-name\">' + hesc(r.title) + '</span></button>' + lk + '</div>'; }).join('');\n    var ph = cookHtml + remHtml + dayRemHtml + (list.length ? list.map(function (e) { var ix = evs.indexOf(e), did = evDid(e, ix), dn = did != null && window.dbkEvDone && window.dbkEvDone.is(did, hc.sel);\n      // the household's own events get a round tick on the right (like the reminder above): only the tick ticks, the words still open the event\n      var ev = '<button type=\"button\" class=\"hc-ev' + (e.isPost ? ' is-post' : '') + '\" data-i=\"' + ix + '\"><span class=\"hc-t\">' + (hmFmtTime(e.time) || 'All day') + (e.space === 'work' && workTag ? '<span class=\"dbk-wtag\">Work</span>' : '') + '</span><span class=\"hc-title\"></span></button>';\n      // an event's link (its Link box): the same small link button as a reminder's, so tapping it never ticks or opens the event\n      var lk = e.isPost || typeof e.open === 'function' ? '' : remLink({ link: e.url });\n      if (did == null || !window.dbkEvDone) return lk ? '<div class=\"hc-evw hc-evw-lk hc-evw-nock\">' + ev + lk + '</div>' : ev;\n      return '<div class=\"hc-evw' + (lk ? ' hc-evw-lk' : '') + (dn ? ' is-done' : '') + '\">' + ev + lk + '<button type=\"button\" class=\"hc-ev-ck' + (dn ? ' is-ticked' : '') + '\" data-dbk-icon=\"tick\" data-evdone=\"' + ix + '\" aria-pressed=\"' + (dn ? 'true' : 'false') + '\">Done</button></div>'; }).join('') : (rem || cook.length || dayRems.length ? '' : '<div class=\"hc-empty\">Nothing planned.</div>')) +\n      '<div class=\"hc-add\"><button type=\"button\" class=\"hm-link\" data-add>Add to ' + (sd.getTime() === today.getTime() ? 'today' : FULL[sd.getDay()]) + '</button>' +\n      (typeof psdGetFeatures === 'function' && psdGetFeatures().reminders !== false && typeof openReminderModal === 'function' ? ' <span class=\"hm-sep\" aria-hidden=\"true\">·</span> <button type=\"button\" class=\"hm-link\" data-rem>All reminders</button>' : '') + '</div>';\n    var sig = hc.sel + '|' + ph + '|' + list.map(function (e) { return e.title; }).join('|') + '|' + (rem ? rem.id + '|' + rem.title + '|' + remDue + '|' + (rem.link || '') : '');\n    if (panel._dbkHtml !== sig) {\n      panel.innerHTML = ph; panel._dbkHtml = sig;\n      panel.querySelectorAll('.hc-ev').forEach(function (b, n) { b.querySelector('.hc-title').textContent = list[n].title || ''; });\n      panel.querySelectorAll('.hc-ev-ck').forEach(function (b) { var x = evs[+b.getAttribute('data-evdone')]; b.setAttribute('aria-label', 'Done: ' + ((x && x.title) || 'event')); });\n      if (rem) { panel.querySelector('.hc-rem:not(.hc-cook) .hc-rem-name').textContent = rem.title || ''; var rw = panel.querySelector('.hc-rem:not(.hc-cook) .hc-rem-when'); rw.textContent = remDue ? remDue.charAt(0).toLowerCase() + remDue.slice(1) : ''; }\n      panel.onclick = function (e) {\n        if (e.target.closest('[data-add]')) { window.dbkAddToDay(fromKey(hc.sel)); return; }\n        if (e.target.closest('[data-remdone]')) { Promise.resolve(markCurrentReminderDone()).then(hmWeek, hmWeek); return; }\n        var rd = e.target.closest('[data-remid]'); if (rd) { try { editReminder(rd.getAttribute('data-remid')); } catch (x) {} return; }\n        var cx = e.target.closest('[data-cookx]');\n        if (cx && window.dbkCookToday && window.dbkCookToday.remove) { var gone = window.dbkCookToday.remove(cx.getAttribute('data-cookx')); hmWeek(); if (gone && window.dbkUndo) window.dbkUndo('Dinner reminder removed', function () { window.dbkCookToday.restore(gone); hmWeek(); }); return; }\n        var ck = e.target.closest('[data-cookdone], [data-cookundo]');\n        if (ck && window.dbkCookToday) { var cd = ck.hasAttribute('data-cookdone'); window.dbkCookToday.done(ck.getAttribute(cd ? 'data-cookdone' : 'data-cookundo'), cd); hmWeek(); return; }\n        var cg = e.target.closest('[data-cookgo]');\n        // open Meals on its Plan page; Tonight's plan opens over it (a hash Meals doesn't know left the page blank behind it)\n        if (cg) { if (cg.getAttribute('data-cookgo') === 'tonight') { try { sessionStorage.setItem('dbkOpenTonight', '1'); } catch (x) {} } __dbkLoc.href = 'meal-plan.html#plan'; return; }\n        // the reminder on the line opens its own Edit reminder (Kasey, Oct 23); All reminders opens the whole list\n        if (e.target.closest('[data-remedit]')) { var rid = rem && rem.id; try { if (rid != null && lifeReminders.some(function (r) { return r && String(r.id) === String(rid); })) editReminder(rid); else openReminderModal(); } catch (x) {} return; }\n        if (e.target.closest('[data-rem]')) { try { openReminderModal(); } catch (x) {} return; }\n        var dk = e.target.closest('[data-evdone]');\n        if (dk) { var dx = +dk.getAttribute('data-evdone'), de = evs[dx], dd = de ? evDid(de, dx) : null; if (dd != null && window.dbkEvDone) window.dbkEvDone.toggle(dd, hc.sel); hmWeek(); return; }\n        var b = e.target.closest('.hc-ev'); if (!b) return;\n        var ix = +b.getAttribute('data-i'), ev = evs[ix]; if (!(ix >= 0) || !ev) return;\n        if (ev.isPost) { __dbkLoc.href = 'workroom.html#post=' + encodeURIComponent(ev.contentId); return; }\n        if (typeof ev.open === 'function') { try { ev.open(ev); } catch (x) {} return; }\n        window.dbkEditEvent(ev, ix);\n      };\n    }\n    // a tick shows only what's saved (ticked = crossed off), whatever touched it\n    panel.querySelectorAll('.hc-ev-ck').forEach(function (b) { var w = b.closest('.hc-evw'), on = !!(w && w.classList.contains('is-done')); if (b.classList.contains('is-ticked') !== on) b.classList.toggle('is-ticked', on); });\n  }\n  /* Edit event (Kasey, Oct 22: one form for new and edit): the New event pop-up itself, filled in from the event and\n     titled \"Edit event\", with Delete beside Save. Used by Today's calendar and the Work page (which opens it over\n     itself: work-spaces.js dbkWorkForm). false when it isn't one of the household's events.\n     A one-off event can move to another day; one of several dates (a range, repeating, picked dates) keeps its date and\n     the change is to that date only, as before. Saving changes the same event (its id, Work mark and ticks stay). */\n  function evFind(ev, at0) {\n    var ix = -1; try { ix = calendarEvents.indexOf(ev); } catch (x) { return -1; }\n    if (ix < 0 && ev && ev.id != null && ev.id !== '') ix = calendarEvents.findIndex(function (x) { return x && x.id === ev.id; });\n    if (ix < 0 && at0 >= 0 && at0 < calendarEvents.length && (!ev || ev.id == null || ev.id === '')) ix = at0;\n    return ix;\n  }\n  function evSingle(ev) { return !!ev && !ev.isMultiDay && (!ev.repeatMode || ev.repeatMode === 'single') && !ev.recurring && !(Array.isArray(ev.dates) && ev.dates.length > 1) && /^\\d{4}-\\d{2}-\\d{2}$/.test(ev.date || ''); }\n  var evEdit = null;   // { ev, id } while the form is editing\n  // how many dates an event's group has (a range, repeating or picked dates: one saved event per date, one eventGroup)\n  function evGroupSize(ev) {\n    if (!ev || !ev.isMultiDay || !ev.eventGroup) return 1;\n    try { return calendarEvents.filter(function (x) { return x && x.eventGroup === ev.eventGroup; }).length; } catch (x) { return 1; }\n  }\n  function evDayText(k) { try { return new Date(k + 'T12:00:00').toLocaleDateString('en-US', { weekday: 'short', month: 'short', day: 'numeric' }); } catch (x) { return k; } }\n  /* Delete one date or all of them: the app's small two-button pop-up (the same box and buttons as dbkConfirm), over the\n     form. \"This date\" is the filled one; tapping outside or Escape closes the choice and leaves the form as it was. */\n  function evAskDates(ev, n, cb) {\n    var old = document.querySelector('.dbk-confirm.dbk-evdates'); if (old) old.remove();\n    var o = document.createElement('div'); o.className = 'dbk-confirm dbk-evdates';\n    o.innerHTML = '<div class=\"dbk-confirm-card\" role=\"alertdialog\" aria-modal=\"true\" aria-labelledby=\"dbkEvDatesMsg\"><div class=\"dbk-confirm-msg\" id=\"dbkEvDatesMsg\"></div><div class=\"dbk-evdates-sub\"></div>' +\n      '<div class=\"dbk-confirm-act\" role=\"group\"><button type=\"button\" class=\"dbk-confirm-no\" data-evdates=\"all\"></button><button type=\"button\" class=\"dbk-confirm-yes\" data-evdates=\"one\">This date</button></div></div>';\n    o.querySelector('.dbk-confirm-msg').textContent = 'Delete ' + (ev.title ? '“' + ev.title + '”' : 'this event');\n    o.querySelector('.dbk-evdates-sub').textContent = evDayText(ev.date) + ' is one of ' + n + ' dates.';\n    o.querySelector('[data-evdates=\"all\"]').textContent = 'All ' + n + ' dates';\n    var done = function (v) { if (!o.parentNode) return; o.remove(); document.removeEventListener('keydown', esc, true); cb(v); };\n    var esc = function (k) { if (k.key === 'Escape') { k.stopPropagation(); k.preventDefault(); done(null); } };\n    o.addEventListener('click', function (k) { var b = k.target.closest('[data-evdates]'); if (b) done(b.getAttribute('data-evdates')); else if (k.target === o) done(null); });\n    document.addEventListener('keydown', esc, true);\n    document.body.appendChild(o);\n    try { if (window.dbkQuietFocus) window.dbkQuietFocus(o.querySelector('.dbk-confirm-yes')); } catch (x) {}\n  }\n  function evFormSetup() {\n    var ov = document.getElementById('addEventModalOverlay'); if (!ov || ov._dbkEdit) return; ov._dbkEdit = true;\n    var acts = ov.querySelector('.form-actions');\n    if (acts && !document.getElementById('dbkEvDel')) {\n      var d = document.createElement('button'); d.type = 'button'; d.id = 'dbkEvDel'; d.className = 'dbk-rem-delbtn'; d.textContent = 'Delete';\n      acts.insertBefore(d, acts.firstChild);\n      d.onclick = function () {\n        var e = evEdit; if (!e) return;\n        var at = evFind(e.ev, -1), n = at < 0 ? 0 : evGroupSize(calendarEvents[at]);\n        var go = function (which) {\n          var at2 = evFind(e.ev, -1);\n          try { calendarHideAddForm(); } catch (x) {}\n          if (at2 < 0) { hmWeek(); return; }\n          Promise.resolve(calendarDeleteEvent(at2, which)).then(hmWeek, hmWeek);\n        };\n        // one of several dates (Kasey, Oct 24: \"Should Delete offer 'just this date'?\" \"YES\"): This date or All dates,\n        // each at once with Undo; tapping outside the choice keeps the form open as it was\n        if (n > 1) evAskDates(calendarEvents[at], n, function (which) { if (which && evEdit === e) go(which); });\n        else go('all');\n      };\n    }\n    // closing in any way ends the edit, so the next New event starts fresh\n    var hide = window.calendarHideAddForm;\n    if (typeof hide === 'function' && !hide._dbkEd) {\n      window.calendarHideAddForm = function () {\n        evEdit = null; ov.classList.remove('dbk-ev-editing', 'dbk-ev-group');\n        var ask = document.querySelector('.dbk-confirm.dbk-evdates'); if (ask) ask.remove();\n        var r = hide.apply(this, arguments);\n        var t = document.getElementById('addEventModalTitle'); if (t) t.textContent = 'New Event';\n        var sb = ov.querySelector('.form-actions [type=submit]'); if (sb) sb.textContent = 'Save Event';\n        return r;\n      };\n      window.calendarHideAddForm._dbkEd = true;\n    }\n    var add = window.calendarAddEvent;\n    if (typeof add === 'function' && !add._dbkEd) {\n      window.calendarAddEvent = function (e) { if (!evEdit) return add.apply(this, arguments); if (e && e.preventDefault) e.preventDefault(); return evSave(); };\n      window.calendarAddEvent._dbkEd = true;\n    }\n  }\n  async function evSave() {\n    var E = evEdit; if (!E) return;\n    var $v = function (id) { var el = document.getElementById(id); return el ? String(el.value || '').trim() : ''; };\n    var title = $v('calendarEventTitle'); if (!title) { try { showToast('Please enter an event title'); } catch (x) {} return; }\n    var ix = evFind(E.ev, -1);\n    if (ix < 0) { try { calendarHideAddForm(); } catch (x) {} hmWeek(); return; }\n    var ev = calendarEvents[ix];\n    var allDay = !!(document.getElementById('allDayToggle') || { classList: { contains: function () { return false; } } }).classList.contains('on');\n    ev.title = title;\n    ev.color = $v('calendarEventColor') || null;\n    ev.location = $v('calendarEventLocation') || null;\n    ev.url = $v('calendarEventUrl') || null;\n    ev.note = $v('calendarEventNote') || null;\n    ev.allDay = allDay;\n    ev.time = allDay ? null : ($v('calendarEventTime') || null);\n    ev.endTime = allDay ? null : ($v('calendarEventEndTime') || null);\n    if (E.single && /^\\d{4}-\\d{2}-\\d{2}$/.test($v('calendarEventDate'))) ev.date = $v('calendarEventDate');\n    // Personal or Work (only where the switch shows): the same mark a new event gets\n    var w = document.getElementById('dbkSpaceAdd');\n    if (w && !w.hidden) {\n      if (w.getAttribute('data-v') === 'work') { ev.space = 'work'; if (!ev.spaceBy) ev.spaceBy = role === 'person2' ? 'person2' : 'person1'; }\n      else { delete ev.space; delete ev.spaceBy; }\n    }\n    var day = ev.date;\n    try { calendarSaveEvents(); } catch (x) {}\n    try { calendarHideAddForm(); } catch (x) {}\n    try { calendarRender(); } catch (x) {}\n    try { if (window.dbkHmShow) window.dbkHmShow(day); } catch (x) {}\n  }\n  window.dbkEditEvent = function (ev, at0) {\n    var ix = evFind(ev, at0); if (ix < 0) return false;\n    ev = calendarEvents[ix];\n    var ov = document.getElementById('addEventModalOverlay');\n    if (!ov || typeof window.calendarShowAddForm !== 'function') return false;\n    evFormSetup();\n    try { document.getElementById('dayModalOverlay').classList.remove('visible'); } catch (x) {}\n    try { calendarHideAddForm(); } catch (x) {}\n    var single = evSingle(ev);\n    try { window.calendarShowAddForm(); } catch (x) { return false; }\n    evEdit = { ev: ev, single: single };\n    ov.classList.add('dbk-ev-editing'); ov.classList.toggle('dbk-ev-group', !single);\n    var t = document.getElementById('addEventModalTitle'); if (t) t.textContent = 'Edit event';\n    var sb = ov.querySelector('.form-actions [type=submit]'); if (sb) sb.textContent = 'Save';\n    var put = function (id, v) { var el = document.getElementById(id); if (el) el.value = v || ''; };\n    put('calendarEventTitle', ev.title); put('calendarEventLocation', ev.location); put('calendarEventUrl', ev.url); put('calendarEventNote', ev.note);\n    try { selectEventColor(ev.color || null); } catch (x) {}\n    var rm = document.getElementById('calendarRepeatMode'); if (rm) rm.value = 'single';\n    try { toggleRepeatOptions(); } catch (x) {}\n    if (single) dbkSetEventDate(new Date(ev.date + 'T00:00:00'));\n    // one of several dates keeps its date: the form says which one it is (it showed no date at all, Oct 24 audit)\n    var od = document.getElementById('dbkEvOneDate'), sdm = document.getElementById('singleDateMode');\n    if (!od && sdm) { od = document.createElement('div'); od.id = 'dbkEvOneDate'; od.className = 'form-group dbk-ev-onedate'; od.innerHTML = '<label>Date</label><div class=\"dbk-ev-onedate-v\"></div>'; sdm.insertBefore(od, sdm.firstChild); }\n    if (od) od.querySelector('.dbk-ev-onedate-v').textContent = single ? '' : evDayText(ev.date) + (evGroupSize(ev) > 1 ? ' \\u00b7 one of ' + evGroupSize(ev) + '\\u00a0dates' : '');\n    var allDay = !!ev.allDay && !ev.time, at = document.getElementById('allDayToggle'), tf = document.getElementById('singleTimeFields');\n    if (at) at.classList.toggle('on', allDay); if (tf) tf.style.display = allDay ? 'none' : '';\n    put('calendarEventTime', allDay ? '' : ev.time); put('calendarEventEndTime', allDay ? '' : ev.endTime);\n    // the Personal / Work switch shows what it is now\n    var sw = document.getElementById('dbkSpaceAdd'), b = sw && sw.querySelector('[data-space=\"' + (ev.space === 'work' ? 'work' : 'personal') + '\"]');\n    if (b) b.click();\n    var body = ov.querySelector('.modal-body'); if (body) body.scrollTop = 0; ov.scrollTop = 0;\n    return true;\n  };\n  window.dbkHmWeek = function () { try { hmWeek(); } catch (e) {} };\n  window.addEventListener('storage', function (e) { if (e.key === 'weekStart' && hc.anchor) { try { hmWeek(); } catch (x) {} } });\n  // show one day on Today's calendar (its week or month, that day picked): a new event appears where it went\n  window.dbkHmShow = function (k) {\n    if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(k || '')) return;\n    var p = k.split('-'), d = new Date(+p[0], +p[1] - 1, +p[2]), ws = 0;\n    try { var wsv = localStorage.getItem('weekStart'); ws = (wsv === 'monday' || wsv === '1') ? 1 : 0; } catch (e) {}\n    var wk = new Date(d); wk.setDate(d.getDate() - ((d.getDay() - ws + 7) % 7));\n    hc.sel = k;\n    if (hc.view === 'week') { if (!hc.anchor || hc.anchor.getTime() !== wk.getTime()) hc.anchor = wk; }\n    else if (!hc.anchor || hc.anchor.getMonth() !== d.getMonth() || hc.anchor.getFullYear() !== d.getFullYear()) hc.anchor = new Date(d.getFullYear(), d.getMonth(), 1);\n    try { hmWeek(); } catch (e) {}\n  };\n  function hmPhoto() {\n    var w = document.getElementById('photoWrapper'), d = document.getElementById('photoDraggable');\n    if (w && d) w.classList.toggle('hm-has-photo', d.style.display !== 'none' && !!(document.getElementById('headerPhoto') || {}).src);\n  }\n  function homeBottom() {\n    if (pageKey !== 'index') return;\n    var fit = function () {\n      var bar = document.getElementById('captureBar'), hm = document.querySelector('main.hm');\n      if (!bar || !hm) return;\n      // measure first, then change only what differs, so the page never shrinks for a moment\n      // (a momentary shrink pulls the scroll position up and leaves a gap under the capture bar)\n      // sections are cards now and the page itself leaves room above the capture bar (daybook-theme.css),\n      // so the last card no longer gets extra padding inside it; clear any left from before\n      [].slice.call(hm.querySelectorAll('.hm-band')).forEach(function (b) { if (b.style.paddingBottom) b.style.removeProperty('padding-bottom'); });\n    };\n    fit(); setTimeout(fit, 400); setTimeout(fit, 1500); window.addEventListener('resize', fit);\n    document.addEventListener('click', function () { setTimeout(fit, 50); setTimeout(fit, 400); });\n  }\n  /* Workroom posts with a post date show on the Home calendar (only businesses this phone can see in the Workroom) */\n  function homePosts() {\n    var role = 'person1'; try { role = localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) {}\n    var build = function (W) {\n      // only for someone who has Work (it can be for one person only), and not while Work is put away\n      var M = window.dbkModule;\n      if (M && (!M.forPerson('work', role === 'person2' ? 'p2' : 'p1') || (M.archived && M.archived('page:work')))) {\n        if (window.dbkPosts && window.dbkPosts.length) { window.dbkPosts = []; try { hmWeek(); } catch (e) {} }\n        return;\n      }\n      if (!W || !Array.isArray(W.content)) return;\n      var biz = {}; (W.businesses || []).forEach(function (b) { biz[b.id] = b; });\n      var ok = function (id) { var b = biz[id]; var o = (b && b.owner) || 'both'; return o === 'both' || o === role; };\n      var many = (W.businesses || []).filter(function (b) { return ok(b.id); }).length > 1;\n      window.dbkPosts = W.content.filter(function (c) { return c && c.scheduledDate && c.stage !== 'posted' && ok(c.bizId); }).map(function (c) {\n        var name = String(c.text || c.hook || 'Post').trim(), b = biz[c.bizId];\n        return { id: 'post_' + c.id, contentId: c.id, isPost: true, date: c.scheduledDate, time: null, allDay: true, title: 'Post: ' + name + (many && b && b.name ? ' (' + b.name + ')' : '') };\n      });\n      try { hmWeek(); } catch (e) {}\n    };\n    try { var snapW = window.dbkSnapDoc && window.dbkSnapDoc('workroom/data'); build((snapW && snapW.items) || JSON.parse(localStorage.getItem('wr:data') || 'null')); } catch (e) {}\n    var live = function () {\n      try {\n        var fi = window.firestoreImports; if (!fi || !window.db) return;\n        var ref = fi.doc(window.db, 'workroom', 'data');\n        fi.getDoc(ref).then(function (s) { if (s.exists()) build(s.data().items); }, function () {});\n        fi.onSnapshot(ref, function (s) { if (s && s.exists && s.exists()) build(s.data().items); });\n      } catch (e) {}\n    };\n    if (window.firebaseReady) live(); else window.addEventListener('firebaseReady', function () { if (window.firebaseReady) live(); }, { once: true });\n  }\n  function homeInit() {\n    if (pageKey !== 'index') return;\n    homePosts();\n    try { var cdm = closeDayModal; window.closeDayModal = function (ev) { var r = cdm.apply(this, arguments); var mo = document.getElementById('dayModalOverlay'); if (mo && !mo.classList.contains('visible')) mo.classList.remove('hc-editing'); return r; }; } catch (e) {}\n    hmWeek(); hmPhoto();\n    setInterval(function () { hmWeek(); hmPhoto(); }, 4000);\n    try { var o = updateCalendarSummary; window.updateCalendarSummary = function () { var r = o.apply(this, arguments); hmWeek(); return r; }; } catch (e) {}\n    // the reminder line on the calendar follows the reminder list as soon as it changes\n    try { var ur = updateReminderDisplay; window.updateReminderDisplay = function () { var r = ur.apply(this, arguments); hmWeek(); return r; }; } catch (e) {}\n  }\n  /* Us: a one-line note under each list with the most useful thing to know */\n  function usNotes() {\n    if (pageKey !== 'our-dreams') return;\n    var D; try { D = dreams; } catch (e) { return; }\n    var n = names();\n    var rank = { high: 0, soon: 1 };\n    function open(list) { return (list || []).filter(function (d) { return d && !d.achieved; }); }\n    function top(list) {\n      var o = open(list).slice().sort(function (a, b) {\n        var pa = rank[a.priority] !== undefined ? rank[a.priority] : 2, pb = rank[b.priority] !== undefined ? rank[b.priority] : 2;\n        if (pa !== pb) return pa - pb;\n        return String(a.dateAdded || '').localeCompare(String(b.dateAdded || ''));\n      });\n      return o[0] ? (o[0].title || '') : '';\n    }\n    function nextOr(list, doneList, doneWord) {\n      var t = top(list);\n      if (t) return t + ' next';\n      var d = (doneList || []).length;\n      return d ? d + ' ' + doneWord : '';\n    }\n    var notes = {\n      restaurants: nextOr(D['restaurants'], D['our-restaurants'], 'favorites'),\n      places: nextOr(D['places'], D['our-places'], 'places been'),\n      travel: nextOr(D['travel'], D['our-travel'], 'trips taken'),\n      'shows-movies': nextOr(D['shows-movies'], D['our-shows-movies'], 'watched'),\n      wishlists: (function () {\n        var a = open(D['person1-wishlist']).length, b = open(D['person2-wishlist']).length;\n        return (a || b) ? n.a + ' ' + a + ' \\u00b7 ' + n.b + ' ' + b : '';\n      })(),\n      reading: (function () { var l = D['reading'] || [], now = l.filter(function (d) { return !d.achieved && d.priority === 'high'; }).length, todo = l.filter(function (d) { return !d.achieved; }).length; return now ? now + ' reading now' + (todo > now ? ' · ' + (todo - now) + ' to read' : '') : (todo ? todo + ' to read' : ''); })()\n    };\n    document.querySelectorAll('#sectionTiles .landing-tile').forEach(function (tile) {\n      var key = tile.getAttribute('data-section');\n      if (!(key in notes)) return;\n      if (tile.querySelector('.rl-tile-nm') || document.body.classList.contains('rl')) return; // the Lists page draws its own tile text\n      var el = tile.querySelector('.dbk-tile-note');\n      if (!el) { el = document.createElement('span'); el.className = 'dbk-tile-note'; tile.appendChild(el); }\n      if (el.textContent !== notes[key]) el.textContent = notes[key];\n    });\n  }\n  /* App behaviour: live data comes from the Firestore listeners; on top of that the page\n     reloads itself when it comes back after a long while in the background, and tapping the\n     page you're already on in the top menu refreshes it. */\n  var dirty = [];\n  document.addEventListener('input', function (e) {\n    var t = e.target;\n    if (t && (t.tagName === 'INPUT' || t.tagName === 'TEXTAREA' || t.isContentEditable) && dirty.indexOf(t) < 0) dirty.push(t);\n  }, true);\n  function busy() {\n    var a = document.activeElement;\n    if (a && ((a.tagName === 'INPUT' && !/^(checkbox|radio|button|submit|range|color)$/.test(a.type)) || a.tagName === 'TEXTAREA' || a.isContentEditable)) return true;\n    for (var i = 0; i < dirty.length; i++) {\n      var el = dirty[i]; if (!el.isConnected || el.offsetParent === null) continue;\n      var val = el.isContentEditable ? el.textContent : el.value;\n      if (val && String(val).trim()) return true;\n    }\n    // an open sheet or modal covering most of the screen\n    var vw = innerWidth, vh = innerHeight, all = document.body.querySelectorAll('div,section,aside,form');\n    for (var j = 0; j < all.length; j++) {\n      var n = all[j]; if (n.id === 'captureBar' || n.closest('nav')) continue;\n      var r = n.getBoundingClientRect(); if (r.width * r.height < vw * vh * 0.5) continue;\n      var cs = getComputedStyle(n);\n      if (cs.position === 'fixed' && cs.display !== 'none' && cs.visibility !== 'hidden' && parseFloat(cs.opacity) > 0.1) return true;\n    }\n    return false;\n  }\n  function freshReload() {\n    try { sessionStorage.setItem('dbkScroll:' + (window.__dbkPath||location.pathname) + location.hash, String(scrollY)); } catch (e) {}\n    location.reload();\n  }\n  var hiddenAt = 0;\n  document.addEventListener('visibilitychange', function () {\n    if (document.hidden) { hiddenAt = Date.now(); return; }\n    if (hiddenAt && Date.now() - hiddenAt > 15 * 60 * 1000 && !busy()) freshReload();\n  });\n  window.addEventListener('pageshow', function (e) { if (e.persisted && hiddenAt && Date.now() - hiddenAt > 15 * 60 * 1000) freshReload(); });\n  document.addEventListener('click', function (e) {\n    var a = e.target.closest && e.target.closest('nav.top-nav a[href]');\n    if (!a || a.classList.contains('dbk-ml')) return; // the mode menu handles its own same-page taps\n    var u; try { u = new URL(a.getAttribute('href'), location.href); } catch (x) { return; }\n    var norm = function (x) { return x.replace(/\\/$/, '/index.html').replace(/\\/([^\\/.]+)$/, '/$1.html'); }, samePage = norm(u.pathname) === norm((window.__dbkPath||location.pathname));\n    if (samePage && (!u.hash || u.hash === location.hash || (!location.hash && u.hash === '#bingo'))) { e.preventDefault(); location.reload(); }\n  }, true);\n  // the last time someone tapped or typed on this page (an update waits for a quiet moment before reloading)\n  ['pointerdown', 'keydown', 'input', 'touchstart'].forEach(function (ev) { addEventListener(ev, function () { window._dbkLastInput = Date.now(); }, true); });\n  function restoreScroll() {\n    try {\n      var k = 'dbkScroll:' + (window.__dbkPath||location.pathname) + location.hash, y = sessionStorage.getItem(k);\n      if (y !== null) { sessionStorage.removeItem(k); scrollTo(0, +y); setTimeout(function () { if (Math.abs(scrollY - y) > 4) scrollTo(0, +y); }, 0); }\n    } catch (e) {}\n  }\n  if ('serviceWorker' in navigator && location.protocol === 'https:') {\n    try {\n      // when a new upload takes over, reload once so you're on it right away (not on the very first install)\n      // Inside the app frame, the frame does this for every page at a calm moment (app.html), so a page never reloads\n      // itself under someone's finger. A page opened on its own waits the same way: no pop-up open, nothing tapped or\n      // typed for a few seconds, or the app put away.\n      var hadSW = !!navigator.serviceWorker.controller, reloaded = false;\n      var framed = false; try { framed = window.parent !== window && /(^|\\/)app(\\.html)?$/.test(window.parent.location.pathname); } catch (e) {}\n      navigator.serviceWorker.addEventListener('controllerchange', function () {\n        if (!hadSW || reloaded || framed) return;\n        // (as in app.html: once put away, or after half an hour on screen at a calm moment; a reload on screen blanks it)\n        var at = Date.now();\n        var calm = function () { return document.hidden || (Date.now() - at > 30 * 60000 && !root.classList.contains('dbk-pop-open') && !root.classList.contains('dbk-pop-on') && Date.now() - (window._dbkLastInput || 0) > 8000); };\n        var now = function () { if (!reloaded && document.hidden) { reloaded = true; location.reload(); } };\n        document.addEventListener('visibilitychange', now);\n        (function wait() { if (reloaded) return; if (calm()) { reloaded = true; location.reload(); } else setTimeout(wait, 2000); })();\n      });\n      navigator.serviceWorker.register('sw.js').catch(function () {});\n    } catch (e) {}\n  }\n\n  /* no page titles: the green band only carries tabs, and disappears on pages without tabs */\n  function trimHero() {\n    var hero = document.querySelector('.dbk-hero'); if (!hero) return;\n    hero.querySelectorAll('.dbk-title, .dbk-sub').forEach(function (el) { el.remove(); });\n    if (!hero.querySelector('.dbk-tabs, .dbk-subnav')) hero.classList.add('dbk-hero-empty');\n  }\n  /* Who's signed in: match this login to Person 1 (person1) or Person 2 (person2) using userRoles/mapping.\n     Runs on every page, so the right look and greeting follow the login. */\n  function resolveRole() {\n    var tries = 0, fails = 0, done = false;\n    var run = function () {\n      if (done) return;\n      var user = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n      if (!user || !window.db || !window.firestoreImports) { if (++tries < 24) setTimeout(run, 500); else if (window.__dbkRoleFree) window.__dbkRoleFree(); return; }\n      done = true;\n      var fi = window.firestoreImports;\n      fi.getDoc(fi.doc(window.db, 'userRoles', 'mapping')).then(function (snap) {\n        var d = snap.exists() ? (snap.data() || {}) : {};\n        var two = !(window.dbkModule && window.dbkModule.people < 2);\n        var r = user.uid === d.person1Uid ? 'person1' : (two && user.uid === d.person2Uid ? 'person2' : null);\n        if (!r) { roleHelp(user); return; }\n        // changes put aside when this login's sign-in ended on this phone (dbkLetGo, shared.js): back to unsent, and sent\n        if (window.dbkTakeBackAside && window.dbkTakeBackAside(user.uid)) {\n          try { localStorage.setItem('myPersonRole', r); localStorage.setItem('dbkRoleUid', user.uid); } catch (e) {}\n          if (window.dbkReload) window.dbkReload(); else location.reload(); return;\n        }\n        var prev = null; try { prev = localStorage.getItem('myPersonRole'); } catch (e) {}\n        // this phone had the wrong person (or none), or this page was drawn before that was put right (another page of\n        // the app, loaded alongside, got the answer first): throw away what it showed as the other person, start over\n        if (prev !== r || window.__dbkBootRole !== r) {\n          var saved = false;\n          try { localStorage.setItem('myPersonRole', r); localStorage.setItem('dbkRoleUid', user.uid); saved = localStorage.getItem('myPersonRole') === r; } catch (e) {}\n          if (saved) { if (window.dbkReload) window.dbkReload(); else location.reload(); return; }   // (a phone that can't keep it would reload forever; inside the app the frame swaps it in once built, app.html reloadMe)\n        }\n        if (window.__dbkRoleFree) window.__dbkRoleFree();\n        try { if (localStorage.getItem('dbkRoleUid') !== user.uid) { localStorage.setItem('dbkRoleUid', user.uid); window.dispatchEvent(new Event('dbkRoleOk')); } } catch (e) {}\n      }).catch(function (err) {\n        // only the household may read the mapping: a login that isn't in it yet (the partner before joining) is refused\n        if (err && err.code === 'permission-denied') {\n          // this phone was confirmed as part of the household with this same login, and now isn't: the owner removed\n          // this person (Settings > Household). The household's things leave this phone; the cloud keeps them all.\n          var was = null, wasUid = null; try { was = localStorage.getItem('myPersonRole'); wasUid = localStorage.getItem('dbkRoleUid'); } catch (e) {}\n          // ...but only once a FRESH sign-in token is refused too. A token being renewed, or a sign-in ended by a password\n          // change on another device, also reads as \"refused\" for a moment, and that must never cost unsent changes.\n          if (was && wasUid && wasUid === user.uid && window.dbkLetGo) { recheck(user, fi); return; }\n          roleHelp(user); return;\n        }\n        // couldn't read the mapping (weak signal, or Firebase hiccup): try again a few times, then say why\n        if (++fails < 4) { done = false; setTimeout(run, 2500); return; }\n        if (window.__dbkRoleFree) window.__dbkRoleFree();\n        var prev = null; try { prev = localStorage.getItem('myPersonRole'); } catch (e) {}\n        if (!prev) roleHelp(user, (err && (err.code || err.message)) || 'unknown error');\n      });\n    };\n    // refused once: get a fresh sign-in token, wait a moment, ask again, and only then decide\n    var recheck = function (user, fi) {\n      var tokenFailed = false;\n      Promise.resolve(user.getIdToken ? user.getIdToken(true) : null).catch(function (te) { tokenFailed = true; throw te; }).then(function () {\n        return new Promise(function (r) { setTimeout(r, 3000); }).then(function () { return fi.getDoc(fi.doc(window.db, 'userRoles', 'mapping')); });\n      }).then(function () { done = false; run(); }, function (e2) {\n        var c = (e2 && e2.code) || '';\n        // a fresh, working sign-in and still refused: the owner really removed this person\n        if (!tokenFailed && c === 'permission-denied') { window.dbkLetGo(user.uid, 'removed'); return; }\n        // the sign-in itself can't be renewed (password changed elsewhere, account turned off, or removed): this phone's\n        // sign-in has ended. Unsent changes are put aside for this login, the household's things leave this phone.\n        if (tokenFailed && /user-token-expired|user-disabled|user-not-found|invalid-user-token|token-revoked|invalid-refresh-token/.test(c)) { window.dbkLetGo(user.uid, 'ended'); return; }\n        // no signal or a hiccup: keep everything as it is and check again later\n        done = false; setTimeout(run, 15000);\n      });\n    };\n    window.addEventListener('firebaseReady', function () { setTimeout(run, 50); });\n    setTimeout(run, 900);\n    // another page of the app confirmed (or changed) who is signed in, and it isn't who this page was drawn as\n    window.addEventListener('storage', function (e) {\n      if (e.key !== 'myPersonRole' || (e.newValue !== 'person1' && e.newValue !== 'person2') || e.newValue === window.__dbkBootRole) return;\n      if (window.dbkReload) window.dbkReload(); else location.reload();\n    });\n  }\n  /* A login that isn't part of this household yet: usually the partner, right after making their account.\n     They enter the invite code the owner made in Settings, and the server adds them. */\n  function roleHelp(user, why) {\n    if (window.__dbkRoleFree) window.__dbkRoleFree();\n    if (document.getElementById('dbkRoleHelp')) return;\n    // this login is no one in the household yet, so Today greets no one (overnight audit, Oct 24: the partner, before\n    // entering the code, read \"Good morning, Maya\", the owner's name, on their own phone)\n    document.documentElement.classList.add('dbk-norole');\n    if (!document.getElementById('dbkNoRoleCss')) { var nc = document.createElement('style'); nc.id = 'dbkNoRoleCss'; nc.textContent = 'html.dbk-norole .hm-greet { display: none !important; }'; (document.head || document.documentElement).appendChild(nc); }\n    var C = window.DAYBOOK_CONFIG || {}, two = (C.people || []).length !== 1;\n    var d = document.createElement('div'); d.id = 'dbkRoleHelp';\n    d.style.cssText = 'position:fixed;left:12px;right:12px;bottom:calc(84px + var(--dbk-safe-bottom, env(safe-area-inset-bottom,0px)));z-index:10060;background:#2f3a2c;color:#f3eee4;padding:16px 16px 14px;font:15px/1.45 Georgia,serif;box-shadow:0 6px 24px rgba(0,0,0,.25);border-radius:14px;max-width:520px;margin:0 auto';\n    d.innerHTML = two\n      ? '<b>Join your household</b><br><span style=\"opacity:.85\">Enter the invite code from your partner. They can make one in Settings &rarr; Household.</span>' +\n        '<form style=\"display:flex;gap:8px;margin-top:10px\"><input name=\"code\" autocomplete=\"one-time-code\" autocapitalize=\"characters\" spellcheck=\"false\" placeholder=\"ABCD-2345\" maxlength=\"9\" aria-label=\"Invite code\" style=\"flex:1;min-width:0;font:600 18px/1.2 ui-monospace,Menlo,monospace;letter-spacing:.08em;padding:10px 12px;border-radius:10px;border:0;background:#f3eee4;color:#1f261d;text-align:left\">' +\n        '<button type=\"submit\" style=\"font:600 15px/1 system-ui,sans-serif;padding:0 16px;border-radius:10px;border:0;background:#d4919e;color:#1f1816\">Join</button></form>' +\n        '<div data-msg style=\"margin-top:8px;font-size:14px;min-height:1em\"></div>'\n      // a one-person copy: this login can't be added, so the way out is signing out\n      : '<b>This app is already set up with another account.</b><br><span style=\"opacity:.85\">This copy is for one person. Sign out, then sign in with the account that set it up.</span><div data-msg style=\"margin-top:6px;font-size:14px\"></div>';\n    d.insertAdjacentHTML('beforeend', '<div style=\"display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:8px 12px;margin-top:8px;font-size:13px\"><span data-who style=\"opacity:.8;flex:1 1 auto;min-width:0;overflow-wrap:anywhere\"></span><span style=\"display:flex;gap:8px\"><button type=\"button\" data-out style=\"all:unset;cursor:pointer;padding:5px 12px;border:1px solid currentColor;border-radius:8px\">Sign out</button><button type=\"button\" data-close style=\"all:unset;cursor:pointer;padding:5px 12px;border:1px solid currentColor;border-radius:8px\">Close</button></span></div>');\n    d.querySelector('[data-who]').textContent = 'Signed in as ' + (user.email || 'this account') + (why ? ' (couldn\\'t check the household: ' + why + ')' : '');\n    d.querySelector('[data-close]').addEventListener('click', function () { d.remove(); });\n    var form = d.querySelector('form'), msg = d.querySelector('[data-msg]');\n    // nothing of the household is on this phone for this login, so signing out here only forgets the login\n    d.querySelector('[data-out]').addEventListener('click', function () {\n      var a = window.dbkAuth;\n      try { sessionStorage.setItem('dbkSigningOut', '1'); } catch (e) {}\n      Promise.resolve(a && a.signOut ? a.signOut() : (window.firebaseAuthImports && window.firebaseAuth ? window.firebaseAuthImports.signOut(window.firebaseAuth) : null)).catch(function () {}).then(function () {\n        try { ['dbkSignedIn', 'dbkRoleUid', 'myPersonRole', 'authEmail'].forEach(function (k) { localStorage.removeItem(k); }); } catch (e) {}\n        try { var t = window.top; t.location.hash = '#meal-plan.html'; t.location.reload(); } catch (e) { location.href = 'meal-plan.html'; }\n      });\n    });\n    if (form) form.addEventListener('submit', function (e) {\n      e.preventDefault();\n      var btn = form.querySelector('button'), code = form.code.value;\n      msg.textContent = 'Checking…'; btn.disabled = true;\n      Promise.resolve(user.getIdToken ? user.getIdToken() : '').then(function (tok) {\n        return fetch('/api/join', { method: 'POST', headers: { 'content-type': 'application/json', authorization: 'Bearer ' + tok }, body: JSON.stringify({ code: code }) });\n      }).then(function (r) {\n        // without the app's server part deployed, Firebase Hosting answers with the app's own page instead\n        var json = /json/i.test(r.headers.get('content-type') || '');\n        return (json ? r.json().catch(function () { return {}; }) : Promise.resolve(null)).then(function (j) { return { ok: r.ok && json && j && j.ok, json: json, status: r.status, j: j || {} }; });\n      }).then(function (x) {\n          if (!x.json) { msg.textContent = 'This app’s server part isn’t installed yet, so codes can’t be checked. Whoever set up the app finishes the deploy step, then try again.'; btn.disabled = false; return; }\n          if (!x.ok) { msg.textContent = (x.j && x.j.error) || 'That didn\\'t work. Try again.'; btn.disabled = false; return; }\n          msg.textContent = 'You\\'re in. Opening your side of the app…';\n          try { localStorage.setItem('myPersonRole', 'person2'); localStorage.removeItem('dbkRoleUid'); } catch (err) {}\n          setTimeout(function () { (window.top || window).location.reload(); }, 700);\n        }).catch(function () { msg.textContent = 'No connection. Try again when you have signal.'; btn.disabled = false; });\n    });\n    document.body.appendChild(d);\n  }\n  /* pop-ups stay inside the part of the screen you can see, even with the keyboard up */\n  /* While any pop-up is open, the page behind it stays still: no scrolling it, no dragging it around. */\n  var POPS = '#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay, #resourceForm, #addEventModalOverlay, #section-modal, .wrc-overlay, #detailPopup, #triedModal, #skippedAnswerModal, .lightbox, .tp-overlay, .tp-pop-overlay, .dream-form, .modal-overlay, .day-modal-overlay, .reminder-modal-overlay, .seasonal-modal-overlay, #seasonal-modal, .dbk-confirm, .dbk-infopop, .mprj-scrim, #rlPop, .fin-sheet-overlay, #journal-day-popup';\n  window.DBK_POPS = POPS;\n  function popLock() {\n    var root = document.documentElement, t1 = null, t2 = null, poll = null;\n    function anyOpen() {\n      var els = document.querySelectorAll(POPS);\n      for (var i = 0; i < els.length; i++) {\n        var el = els[i]; if (!el.getClientRects().length) continue;\n        var cs = getComputedStyle(el);\n        if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < 0.05 || cs.pointerEvents === 'none') continue;\n        if (cs.position !== 'fixed' && cs.position !== 'absolute') continue;\n        return true;\n      }\n      return false;\n    }\n    // While a pop-up is open the page behind it doesn't move: swipes are only allowed inside something in the\n    // pop-up that actually scrolls. (Pinning the page itself made iPhones shift the fixed capture bar up.)\n    function pin() {}\n    function scrollsInside(el, dy) {\n      for (var n = el; n && n !== document.body && n !== document.documentElement; n = n.parentElement) {\n        var cs = getComputedStyle(n);\n        if (/(auto|scroll)/.test(cs.overflowY) && n.scrollHeight > n.clientHeight + 1) {\n          if (dy > 0 && n.scrollTop <= 0) return false;\n          if (dy < 0 && n.scrollTop + n.clientHeight >= n.scrollHeight - 1) return false;\n          return true;\n        }\n      }\n      return false;\n    }\n    // a sideways swipe inside a row that scrolls sideways (filter chips, a row of days) is that row's own: it was\n    // being stopped here whenever the pop-up itself had no up-and-down room (the designer: the trip's days were stuck)\n    function scrollsSideways(el) {\n      for (var n = el; n && n !== document.body && n !== document.documentElement; n = n.parentElement) {\n        if (/(auto|scroll)/.test(getComputedStyle(n).overflowX) && n.scrollWidth > n.clientWidth + 1) return true;\n      }\n      return false;\n    }\n    var y0 = 0, x0 = 0;\n    document.addEventListener('touchstart', function (e) { if (e.touches && e.touches[0]) { y0 = e.touches[0].clientY; x0 = e.touches[0].clientX; } }, { passive: true });\n    document.addEventListener('touchmove', function (e) {\n      if (!root.classList.contains('dbk-pop-open') || !e.touches || e.touches.length !== 1) return;\n      var t = e.target; if (t && t.closest && t.closest('input[type=\"range\"], .leaflet-container')) return;\n      var dy = e.touches[0].clientY - y0, dx = e.touches[0].clientX - x0;\n      if (Math.abs(dx) > Math.abs(dy) && scrollsSideways(t)) return;\n      if (!scrollsInside(t, dy)) e.preventDefault();\n    }, { passive: false });\n    // long pop-ups get a Close at the very end, so you don't have to scroll back up to the ×\n    function closeOf(pop) {\n      var c = pop.querySelector('[aria-label=\"Close\"], .modal-close, .wrc-x, .tp-x, [data-x], .section-modal-close, .inbox-close, .reminder-modal-close, .close-btn, .detail-popup-close');\n      if (c) return c;\n      var bs = pop.querySelectorAll('button, span[onclick], div[onclick]');\n      for (var i = 0; i < bs.length; i++) if (/^[\\u00d7x\\u2715]$/i.test((bs[i].textContent || '').trim())) return bs[i];\n      return null;\n    }\n    function endClose() {\n      document.querySelectorAll(POPS).forEach(function (pop) {\n        if (!pop.getClientRects().length) return;\n        // a list's own page (Lists) is a page with \"‹ Lists\" at the top, not a pop-up: no extra Close at its end\n        // (it came and went while searching, making the page jump)\n        if (pop.id === 'section-modal') { var old = pop.querySelector('.dbk-endclose-btn'); if (old) { var ow = old.parentNode; old.remove(); if (ow && ow.classList.contains('dbk-endclose') && !ow.children.length) ow.remove(); } return; }\n        var cs = getComputedStyle(pop); if (cs.display === 'none' || cs.visibility === 'hidden' || +cs.opacity < 0.05) return;\n        var all = [pop].concat([].slice.call(pop.querySelectorAll('*'))), sc = null;\n        for (var i = 0; i < all.length; i++) { var n = all[i], s2 = getComputedStyle(n); if (/(auto|scroll)/.test(s2.overflowY) && n.scrollHeight > n.clientHeight + 60 && n.clientHeight > 200) { sc = n; break; } }\n        // a Close at the bottom only when you'd have to scroll a long way to get back to the × (the designer: only if it needs to)\n        var made = pop.querySelector('.dbk-endclose-btn');\n        // Oct 23 (Kasey: \"any pop up that the user will scroll at some point should have a way to close it at the bottom\"):\n        // every pop-up that scrolls, not only very long ones\n        var far = !!sc;\n        // only when the × itself scrolls away; a × that always stays in view (like the Inbox's) is enough\n        var x0 = closeOf(pop); if (sc && x0 && !sc.contains(x0)) sc = null;\n        // a × pinned to the top of the pop-up (sticky) never scrolls out of view either\n        if (sc && x0) for (var xn = x0; xn && xn !== sc; xn = xn.parentElement) if (getComputedStyle(xn).position === 'sticky') { sc = null; break; }\n        if (made && !sc) { var w = made.parentNode; made.remove(); if (w && w.classList.contains('dbk-endclose') && !w.children.length) w.remove(); return; }\n        if (!sc || !far) return;\n        // a pop-up that already ends in Cancel / Save / Done doesn't need a third way to close\n        if ([].some.call(pop.querySelectorAll('button'), function (b) { return b.getClientRects().length && !b.closest('.dbk-rl-row, [class*=\"-row\"] .dbk-rl-done') && !b.classList.contains('dbk-rl-done') && /^(cancel|save|done)$/i.test((b.textContent || '').trim()); })) return;\n        var host = sc === pop && pop.firstElementChild ? pop.firstElementChild : sc;\n        if (host.querySelector(':scope > .dbk-endclose')) return;\n        var x = closeOf(pop); if (!x) return;\n        if (host.querySelector('.dbk-endclose-btn')) return;\n        // a pop-up that already ends in a short row of buttons gets Close in that same row\n        var last = host.lastElementChild;\n        while (last && (!last.getClientRects().length || /^(SCRIPT|STYLE)$/.test(last.tagName))) last = last.previousElementSibling;\n        // a form that ends in its own row of buttons (New Event: Save Event): Close goes beside them, not on a line of its\n        // own under Save (Kasey, Oct 31: \"Save event & close, put side by side. Keep clicking close on accident\")\n        for (var fl = 0; last && (last.tagName === 'FORM' || last.classList.contains('modal-body')) && fl < 3; fl++) {\n          var inner = last.lastElementChild;\n          while (inner && (!inner.getClientRects().length || /^(SCRIPT|STYLE|INPUT)$/.test(inner.tagName))) inner = inner.previousElementSibling;\n          if (!inner) break; last = inner;\n        }\n        var btnRow = function (el) {\n          if (!el || el.querySelector('input, textarea, select, ul, ol, table, img, svg')) return false;\n          var bs = el.querySelectorAll('button, a'); if (!bs.length || bs.length > 3) return false;\n          var all = (el.textContent || '').replace(/[\\s\\u00b7]+/g, ''), bt = [].map.call(bs, function (b) { return b.textContent || ''; }).join('').replace(/[\\s\\u00b7]+/g, '');\n          return all === bt;\n        };\n        var cb = document.createElement('button'); cb.type = 'button'; cb.className = 'dbk-link dbk-endclose-btn'; cb.textContent = 'Close';\n        cb.addEventListener('click', function (e) { e.preventDefault(); e.stopPropagation(); x.click(); });\n        if (btnRow(last)) { last.classList.add('dbk-actrow'); last.insertBefore(cb, last.firstChild); return; }\n        var d = document.createElement('div'); d.className = 'dbk-endclose dbk-links'; d.appendChild(cb);\n        host.appendChild(d);\n      });\n    }\n    function check() {\n      var on = anyOpen();\n      if (on) setTimeout(endClose, 120);\n      if (on !== root.classList.contains('dbk-pop-open')) { root.classList.toggle('dbk-pop-open', on); pin(on); }\n      if (on && !poll) poll = setInterval(check, 500);\n      if (!on && poll) { clearInterval(poll); poll = null; }\n    }\n    function soon() { clearTimeout(t1); clearTimeout(t2); requestAnimationFrame(function () { setTimeout(check, 0); }); t1 = setTimeout(check, 60); t2 = setTimeout(check, 360); }\n    ['click', 'submit', 'keyup', 'popstate', 'touchend'].forEach(function (ev) { addEventListener(ev, soon, true); });\n    soon();\n  }\n  /* Every pop-up gets the same calm backdrop: the page behind it blurred under a soft shade of the look's\n     darkest color (the designer: easier to focus). A pop-up's backdrop is whatever full-screen layer holds it;\n     a full-screen layer with a solid background is a page of its own (like a list's page) and is left alone.\n     It's tagged the moment it opens (before the screen draws), so nothing changes after it appears. */\n  function popScrims() {\n    var CAND = (window.DBK_POPS ? window.DBK_POPS + ', ' : '') + '[class*=\"modal\"], [class*=\"overlay\"], [class*=\"Overlay\"], [id*=\"Overlay\"], [id*=\"overlay\"], [id*=\"modal\"], [id*=\"Modal\"], [class*=\"scrim\"], [class*=\"popup\"], [class*=\"sheet\"], .dbk-pagepop';\n    function alpha(c) { var m = /rgba?\\(([^)]+)\\)/.exec(c || ''); if (!m) return c === 'transparent' ? 0 : 1; var p = m[1].split(/[ ,\\/]+/).filter(Boolean); return p.length > 3 ? parseFloat(p[3]) : 1; }\n    function test(el) {\n      if (!el || el.nodeType !== 1 || el.hasAttribute('data-dbk-scrim') || el.closest('nav, #captureBar')) return;\n      var ok = false; try { ok = el.matches(CAND); } catch (e) {} if (!ok) return;\n      var cs = getComputedStyle(el); if (cs.position !== 'fixed' || cs.display === 'none') return;\n      var r = el.getBoundingClientRect(), W = window.innerWidth, H = window.innerHeight;\n      if (r.width < W * 0.92 || r.height < H * 0.6) return;\n      if (alpha(cs.backgroundColor) > 0.96 && cs.backgroundImage === 'none') return;   // a page of its own\n      el.setAttribute('data-dbk-scrim', '');\n    }\n        function scan(root) { test(root); if (root.querySelectorAll) { var l = root.querySelectorAll(CAND); for (var i = 0; i < l.length; i++) test(l[i]); } }\n    new MutationObserver(function (list) {\n      for (var i = 0; i < list.length; i++) {\n        var m = list[i];\n        if (m.type === 'attributes') test(m.target);\n        else for (var j = 0; j < m.addedNodes.length; j++) if (m.addedNodes[j].nodeType === 1) scan(m.addedNodes[j]);\n      }\n    }).observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class', 'hidden', 'open'] });\n    scan(document.body);\n  }\n  /* Every pop-up opens at its top (the designer: \"when i open a pop up, scroll all the way down, close it and then open it\n     again, im still at the bottom... should take me to the top everytime i open something new\"). Most pop-ups are\n     hidden, not removed, when they close, so they kept where they had been scrolled to. The moment one shows again,\n     anything inside it still scrolled to where it was left goes back to the top, before the screen draws (the\n     observer runs ahead of the next paint), so nothing jumps. A spot the pop-up itself scrolls to as it opens\n     (a different spot) is left alone. */\n  function popTop() {\n    var CAND = POPS + ', [data-dbk-scrim], .dbk-pop, .dbk-pagepop, dialog';\n    function shown(el) {\n      if (!el.isConnected || !el.getClientRects().length) return false;\n      var cs = getComputedStyle(el);\n      if (cs.display === 'none' || cs.visibility === 'hidden' || cs.pointerEvents === 'none') return false;\n      // one that fades in counts from the moment it starts to (still see-through, so the move to the top can't be seen)\n      if (+cs.opacity <= 0) { var an = []; try { an = el.getAnimations ? el.getAnimations() : []; } catch (e) {} if (!an.some(function (x) { return x.playState === 'running' || x.playState === 'pending'; })) return false; }\n      var r = el.getBoundingClientRect();\n      return !(r.bottom <= 1 || r.top >= innerHeight - 1 || r.right <= 1 || r.left >= innerWidth - 1);   // parked off screen\n    }\n    function each(el, fn) { fn(el); var all = el.getElementsByTagName('*'); for (var i = 0; i < all.length; i++) fn(all[i]); }\n    // where each box was last scrolled to (by a finger or by the page), and where it was when its pop-up closed\n    document.addEventListener('scroll', function (e) { var t = e.target; if (t && t.nodeType === 1) t._dbkST = t.scrollTop; }, true);\n    var open = [];\n    function check() {\n      var els; try { els = document.querySelectorAll(CAND); } catch (e) { return; }\n      var now = [];\n      for (var i = 0; i < els.length; i++) {\n        var el = els[i]; if (el.closest('nav, #captureBar')) continue;\n        if (!shown(el)) continue;\n        now.push(el);\n        if (open.indexOf(el) >= 0) continue;\n        // a pop-up made new each time it opens, shown again after stepping aside for another (Meals' night pop-up):\n        // it comes back where it was\n        if (el.hasAttribute('data-dbk-keepscroll')) continue;\n        var a = document.activeElement;\n        each(el, function (n) {\n          var y = n.scrollTop; if (!(y > 0)) return;\n          // a box focused as it opened scrolls itself into view from the old spot: still the top when it fits there\n          var fits = false;\n          if (a && a !== n && n.contains(a)) { var ar = a.getBoundingClientRect(), nr = n.getBoundingClientRect(); fits = ar.bottom - nr.top + y <= n.clientHeight; }\n          if (y === n._dbkST || y === n._dbkSTc || fits) { n.scrollTop = 0; n._dbkST = 0; }\n        });\n      }\n      for (var j = 0; j < open.length; j++) if (now.indexOf(open[j]) < 0) each(open[j], function (n) { if (n.scrollTop > 0) n._dbkSTc = n.scrollTop; });\n      open = now;\n    }\n    var raf = 0;\n    function later() { if (raf) return; raf = requestAnimationFrame(function () { raf = 0; check(); requestAnimationFrame(check); }); }   // one that fades in shows a frame later\n    new MutationObserver(function (list) {\n      for (var i = 0; i < list.length; i++) {\n        var m = list[i];\n        if (m.type === 'attributes' || [].some.call(m.addedNodes, function (n) { return n.nodeType === 1; }) || m.removedNodes.length) { check(); later(); return; }\n      }\n    }).observe(document.documentElement, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class', 'hidden', 'open'] });\n    // one that fades out is only gone once the fade ends, which changes nothing the observer sees\n    ['transitionend', 'animationend'].forEach(function (ev) { document.addEventListener(ev, function (e) { if (e.target && e.target.matches && e.target.matches(CAND)) check(); }, true); });\n    check();\n  }\n  /* The \"are you sure?\" box's filled button is the box's own text color with the box's color as its words, so it\n     always stands out from the box and reads as clearly as the question does, in every look (in 2timelines it was pink\n     on a red box). Read from the box as it's drawn, after the look has recolored it. */\n  function confirmFill() {\n    function alpha(c) { var m = /rgba?\\(([^)]+)\\)/.exec(c || ''); if (!m) return 0; var p = m[1].split(/[ ,\\/]+/).filter(Boolean); return p.length > 3 ? parseFloat(p[3]) : 1; }\n    function paint(card) {\n      var b = card.querySelector('.dbk-confirm-yes, .lh-confirm-ok, .lh-confirm-btn:not(.lh-confirm-cancel)'); if (!b) return;\n      var cs = getComputedStyle(card); if (alpha(cs.backgroundColor) < 0.98) return;\n      b.setAttribute('data-dbk-live', '');   // already the look's own colors: dbk-look.js leaves them as they are\n      b.style.setProperty('background', cs.color, 'important'); b.style.setProperty('color', cs.backgroundColor, 'important');\n      b.style.setProperty('border-color', cs.color, 'important');\n    }\n    function look(n) {\n      if (n.nodeType !== 1) return;\n      var cards = n.matches('.dbk-confirm-card, .lh-confirm-box') ? [n] : n.querySelectorAll('.dbk-confirm-card, .lh-confirm-box');\n      [].forEach.call(cards, function (c) { paint(c); requestAnimationFrame(function () { paint(c); }); });\n    }\n    new MutationObserver(function (list) { list.forEach(function (m) { [].forEach.call(m.addedNodes, look); }); }).observe(document.body, { childList: true });\n  }\n  function popViewport() {\n    var vv = window.visualViewport, r = document.documentElement, last = '';\n    // Each page lives in a frame inside the app shell. On an iPhone the keyboard shrinks only the shell's visible area:\n    // the frame keeps its full height and never hears about the keyboard, so pop-ups sat half under it (the designer, Oct 20).\n    // So a page in the shell also reads the shell's visible area, in its own coordinates.\n    var pvv = null, fel = null, touch = false; try { touch = matchMedia('(pointer: coarse)').matches; } catch (e) {}\n    try { if (window.parent !== window && window.frameElement && window.parent.visualViewport) { pvv = window.parent.visualViewport; fel = window.frameElement; } } catch (e) {}\n    var set = function () {\n      var h = vv ? vv.height : window.innerHeight, t = vv ? vv.offsetTop : 0;\n      if (pvv && fel) {\n        try {\n          var fr = fel.getBoundingClientRect(), ptop = Math.max(0, pvv.offsetTop - fr.top), pbot = Math.min(fr.height, pvv.offsetTop + pvv.height - fr.top);\n          if (pbot > ptop && (ptop > t + 0.5 || pbot < t + h - 0.5)) {\n            var nt = Math.max(t, ptop), nh = Math.max(0, Math.min(t + h, pbot) - nt);\n            // an iPhone can report the shell as scrolled while it's settling the keyboard, leaving what looks like a thin strip\n            // of this frame in view; a pop-up squeezed into that strip can't be seen (the designer, Oct 20, Place to stay).\n            // A full-screen frame always shows at least half of the visible area, so a smaller strip is a stale reading.\n            if (nh >= Math.min(pvv.height, fr.height) * 0.5) { h = nh; t = nt; }\n            else { h = Math.min(h, pvv.height); }\n          }\n        } catch (e) {}\n      }\n      // kb: the room below what can be seen (what pop-ups keep clear at the bottom). up: whether the keyboard is up, from\n      // how much of the screen can't be seen. Not the same thing: with the keyboard up an iPhone often slides the whole\n      // screen up by the keyboard's height to show the box, and then nothing is left below what can be seen. Taking that\n      // for \"no keyboard\" put the pop-up under the keyboard (only its title showing) or above the top of the screen\n      // (the designer, Oct 21: Edit event and Add reminder, \"completely unusable\")\n      var full = r.clientHeight || window.innerHeight;\n      var kb = Math.max(0, full - h - t), up = full - h > 80;\n      // the keyboard can't be up for this page when nothing in it is being typed in. An iPhone can leave the app a\n      // shorter size after the keyboard was up in another app (Notes) and not say so on coming back, so pop-ups stayed\n      // cut short as if it were still up (the designer, Oct 20): then the whole frame is what can be seen\n      if (up && !isField(document.activeElement)) { h = full; t = 0; kb = 0; up = false; }\n      // A phone or tablet: pop-ups don't react to the keyboard at all. They stay where they are, the same size, and the\n      // phone itself slides the box being typed in up to just above the keyboard, the way an ordinary web page (the CRM)\n      // does. Measuring the keyboard and moving pop-ups for it fought the iPhone's own scrolling and kept going wrong\n      // (the designer, Oct 21: boxes under the keyboard, pop-ups cut off, moved and resized; the Inbox too).\n      if (touch) { h = full; t = 0; kb = 0; up = false; }\n      // pop-ups start below the top bar (unless the keyboard is up, when every bit of room counts)\n      var nav = document.querySelector('nav.top-nav'), nb = 0;\n      if (nav && !up) { var nr = nav.getBoundingClientRect(); if (nr.height && getComputedStyle(nav).display !== 'none') nb = Math.max(0, Math.round(nr.bottom)); }\n      // the lowest a pop-up that sits above the capture bar (the Inbox) may reach: the top of the capture bar where it can\n      // be seen, else the bottom of what can be seen (keyboard up: the bar is under it). Measured, not worked out from\n      // the keyboard's height: Safari's own bars looked like a small keyboard and the Inbox lost that room twice, and\n      // with the keyboard up it shrank to nothing, so nothing could be typed (the designer, Oct 20)\n      var ibot = Math.round(t + h), cb = document.getElementById('captureBar');\n      if (cb && cb.offsetHeight) { var cr = cb.getBoundingClientRect(); if (cr.top > t + 40 && cr.top < ibot) ibot = Math.round(cr.top); }\n      var key = Math.round(h) + '|' + Math.round(t) + '|' + Math.round(kb) + '|' + (up ? 1 : 0) + '|' + nb + '|' + ibot;\n      if (key === last) return; last = key;\n      r.style.setProperty('--dbk-vvh', Math.round(h) + 'px');\n      r.style.setProperty('--dbk-vvt', Math.round(t) + 'px');\n      // keyboard up: center in what's left above it; keyboard down: sit a little above the middle\n      r.style.setProperty('--dbk-kbh', Math.round(kb) + 'px');\n      r.style.setProperty('--dbk-popbias', up ? '0px' : '14vh');\n      r.style.setProperty('--dbk-navb', nb + 'px');\n      r.style.setProperty('--dbk-ibx-bot', ibot + 'px');\n      // the phone's whole screen height (portrait), the same in Safari (whose bars take part of it) and as a home-screen\n      // app, so things sized by it (the Inbox) are the same size in both (the designer, Oct 20)\n      try { var sh0 = (window.screen && Math.max(screen.height, screen.width)) || 0, land0 = window.innerWidth > window.innerHeight; r.style.setProperty('--dbk-scrh', Math.round(land0 ? window.innerHeight : Math.max(sh0, window.innerHeight)) + 'px'); } catch (e) {}\n      // keyboard up: every pop-up fits in what's left above it (end of daybook-theme.css, \"KEYBOARD UP\")\n      r.classList.toggle('dbk-kb', up);\n      vbot = Math.round(t + h);\n      // other scripts that place things against the bottom of the screen (dbk-look.js, workroom-plus.js, settings.html)\n      // hear about it here, since in the shell their own frame's visualViewport never changes with the keyboard\n      try { window.dispatchEvent(new CustomEvent('dbk-viewport')); } catch (e) {}\n      typing();\n      if (up) setTimeout(keepFocusSeen, 0);\n    };\n    var vbot = window.innerHeight;\n    // a box someone could be typing in (the keyboard, or an iPhone's date and list wheels, can only be up for one)\n    var isField = function (a) {\n      if (!a || a === document.body) return false;\n      if (a.isContentEditable || /^(TEXTAREA|SELECT)$/.test(a.tagName)) return true;\n      return a.tagName === 'INPUT' && !/^(checkbox|radio|button|submit|reset|range|color|file|hidden|image)$/i.test(a.type || '');\n    };\n    // the bottom edge of what can be seen right now, above the keyboard (for menus that open downward)\n    window.dbkViewBottom = function () { return vbot; };\n    // the box being typed in stays in view inside its pop-up as the pop-up gets shorter (only the pop-up's own list moves, never the page)\n    var keepFocusSeen = function () {\n      var a = document.activeElement; if (!a || !/^(INPUT|TEXTAREA)$/.test(a.tagName) || a.closest('#captureBar, .capture-sticky-bar')) return;\n      var b = a.getBoundingClientRect(), lo = vbot - 8, hi = parseFloat(r.style.getPropertyValue('--dbk-vvt')) + 8;\n      for (var n = a.parentElement; n && n !== document.body; n = n.parentElement) {\n        var cs = getComputedStyle(n);\n        if (/(auto|scroll)/.test(cs.overflowY) && n.scrollHeight > n.clientHeight + 1) {\n          // a little room around the box (clear of the soft edge a scrolling pop-up shows), so it never sits cut at an edge\n          var nr = n.getBoundingClientRect(), bot = Math.min(lo, nr.bottom - 30), top = Math.max(hi, nr.top + 30);\n          if (b.height > bot - top) { if (b.top < top || b.top > bot) n.scrollTop -= Math.ceil(top - b.top); }   // a tall box: its top in view\n          else if (b.bottom > bot) n.scrollTop += Math.ceil(b.bottom - bot); else if (b.top < top) n.scrollTop -= Math.ceil(top - b.top);\n          return;\n        }\n      }\n    };\n    // typing in any box but the capture bar's own: the bar steps aside so it can't sit over the form\n    var typing = function () {\n      var a = document.activeElement, kbUp = r.classList.contains('dbk-kb');\n      var field = a && /^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName) && !a.closest('#captureBar, .capture-sticky-bar');\n      r.classList.toggle('dbk-typing', !!(field && kbUp));\n    };\n    // leaving the app (to Notes, say) lets go of the box being typed in: coming back, the keyboard isn't up, so\n    // nothing should still be sized as if it were. Coming back, look again a few times while the phone settles.\n    document.addEventListener('visibilitychange', function () {\n      if (document.hidden) { var a = document.activeElement; if (isField(a)) try { a.blur(); } catch (e) {} return; }\n      set(); [150, 400, 900, 1600].forEach(function (ms) { setTimeout(set, ms); });\n    });\n    window.addEventListener('pageshow', function () { set(); setTimeout(set, 400); });\n    window.addEventListener('focus', function () { set(); setTimeout(set, 400); });\n    document.addEventListener('focusin', function () { setTimeout(typing, 0); });\n    document.addEventListener('focusout', function () { setTimeout(typing, 0); });\n    set();\n    if (pvv) {\n      pvv.addEventListener('resize', set); pvv.addEventListener('scroll', set);\n      try { window.parent.addEventListener('resize', set); } catch (e) {}\n    }\n    if (vv) {\n      vv.addEventListener('resize', set);\n      // the visual viewport only moves on its own while the keyboard is up\n      document.addEventListener('focusin', function () { vv.addEventListener('scroll', set); [120, 400, 900, 1600].forEach(function (ms) { setTimeout(set, ms); }); });\n      document.addEventListener('focusout', function () { vv.removeEventListener('scroll', set); [250, 700, 1500].forEach(function (ms) { setTimeout(set, ms); }); });   // iPhones report the full height late after the keyboard goes\n    }\n    window.addEventListener('resize', set);\n    try { if (pvv) window.parent.addEventListener('scroll', set, { passive: true }); } catch (e) {}\n    // while the keyboard is up (or someone is typing in a box), look again now and then: an iPhone doesn't always say when it has finished moving things\n    setInterval(function () { var a = document.activeElement; if (r.classList.contains('dbk-kb') || (a && /^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName))) set(); }, 500);\n    // the top bar is drawn after this first runs: check again once the page is up, and as a pop-up opens\n    window.addEventListener('load', set); setTimeout(set, 600); window.addEventListener('dbk-show', set);\n    document.addEventListener('click', function () { setTimeout(set, 0); }, true);\n  }\n  /* Adding an event: one form everywhere, every field showing (title, date, time, repeat, color, place, link, notes). */\n  function addEventSetup() {\n    if (pageKey !== 'index') return;\n    var form = document.querySelector('#addEventModalOverlay form'); if (!form || form.getAttribute('data-dbk')) return;\n    form.setAttribute('data-dbk', '1');\n    var grp = function (id) { var el = document.getElementById(id); return el ? el.closest('.form-group') : null; };\n    [grp('calendarEventColor'), grp('calendarRepeatMode'), grp('calendarEventLocation'), grp('calendarEventUrl'), grp('calendarEventNote')]\n      .forEach(function (g) { if (g) g.classList.add('dbk-more'); });\n    form.classList.add('dbk-more-open');   // every field shows (no \"More options\" toggle)\n    // repeat and color sit right under the times\n    var timeRow = [].slice.call(form.children).filter(function (c) { return c.querySelector && c.querySelector('#calendarEventTime, [id*=\"EventTime\"], input[type=\"time\"]'); })[0];\n    var after = timeRow || null;\n    [grp('calendarRepeatMode'), grp('calendarEventColor')].forEach(function (g) { if (g && after) { after.parentNode.insertBefore(g, after.nextSibling); after = g; } });\n    var ttl = document.getElementById('addEventModalTitle'); if (ttl) ttl.textContent = 'New Event';\n    var orig = window.calendarShowAddForm;\n    if (typeof orig === 'function' && !orig._dbk) {\n      window.calendarShowAddForm = function () {\n        orig.apply(this, arguments);\n        var inp = document.getElementById('calendarEventDate');\n        if (inp && !inp.value) dbkSetEventDate(new Date());\n      };\n      window.calendarShowAddForm._dbk = true;\n    }\n    // the day window's \"+ Add Event\" opens this same form, set to that day\n    var dayAdd = document.querySelector('#dayModalOverlay .day-modal-add');\n    if (dayAdd) { dayAdd.removeAttribute('onclick'); dayAdd.addEventListener('click', function () { var d = null; try { d = selectedModalDate; } catch (e) {} window.dbkAddEvent(d || new Date()); }); }\n  }\n  function dbkSetEventDate(d) {\n    var trig = document.querySelector('.hh-datepicker[data-dp-id=\"calendarEventDate\"] .hh-dp-trigger'); if (!trig) return;\n    var k = d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2);\n    try { window.hhDpOpen(trig); window.hhDpPick(k); } catch (e) { var i = document.getElementById('calendarEventDate'); if (i) i.value = k; }\n  }\n  window.dbkAddEvent = function (date) {\n    try { document.getElementById('dayModalOverlay').classList.remove('visible'); } catch (e) {}\n    try { window.calendarShowAddForm(); } catch (e) { return; }\n    if (date) dbkSetEventDate(new Date(date));\n    var t = document.getElementById('calendarEventTitle'); if (t) t.focus();\n  };\n  /* \"Add to Monday\" on Today's calendar (Kasey, Oct 26: \"it should ask if i want to add an event or reminder. too hard to\n     add a reminder rn\"): the small two-button pop-up (Back Burner's \"Put … on the calendar as\"), Reminder | Event, then\n     Today's own Add Reminder or New Event opens with that day as its date. Reminders put away (What shows): straight to\n     New Event, as before. Tapping outside or Escape closes it and nothing opens. */\n  window.dbkAddToDay = function (date) {\n    var d = date ? new Date(date) : new Date();\n    var remOk = typeof openAddReminderPopup === 'function' && !(typeof psdGetFeatures === 'function' && psdGetFeatures().reminders === false);\n    if (!remOk) { window.dbkAddEvent(d); return; }\n    var old = document.querySelector('.dbk-confirm.dbk-addday'); if (old) old.remove();\n    var k = d.getFullYear() + '-' + ('0' + (d.getMonth() + 1)).slice(-2) + '-' + ('0' + d.getDate()).slice(-2);\n    var t0 = new Date(); t0.setHours(0, 0, 0, 0);\n    var nm = k === (t0.getFullYear() + '-' + ('0' + (t0.getMonth() + 1)).slice(-2) + '-' + ('0' + t0.getDate()).slice(-2)) ? 'today' : d.toLocaleDateString('en-US', { weekday: 'long' });\n    var o = document.createElement('div'); o.className = 'dbk-confirm dbk-addday';\n    o.innerHTML = '<div class=\"dbk-confirm-card\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"dbkAddDayMsg\"><div class=\"dbk-confirm-msg\" id=\"dbkAddDayMsg\"></div>' +\n      '<div class=\"dbk-confirm-act\" role=\"group\"><button type=\"button\" class=\"dbk-confirm-no\" data-addk=\"reminder\">Reminder</button><button type=\"button\" class=\"dbk-confirm-yes\" data-addk=\"event\">Event</button></div></div>';\n    o.querySelector('.dbk-confirm-msg').textContent = 'Add to ' + nm;\n    var key = function (e) { if (e.key === 'Escape') { e.stopPropagation(); e.preventDefault(); done(); } };\n    var done = function () { if (o.parentNode) o.remove(); document.removeEventListener('keydown', key, true); };\n    o.addEventListener('click', function (e) {\n      if (e.target === o) return done();\n      var b = e.target.closest('[data-addk]'); if (!b) return;\n      done();\n      if (b.getAttribute('data-addk') === 'event') { window.dbkAddEvent(d); return; }\n      try {\n        openAddReminderPopup();\n        var i = document.getElementById('addReminderDate'); if (i) i.value = k;   // the date box shows it (its setter draws the trigger)\n        var w = document.getElementById('addReminderDayOfWeek'); if (w) w.value = String(d.getDay());   // Weekly picked after: that day, not Saturday\n      } catch (x) {}\n    });\n    document.addEventListener('keydown', key, true); document.body.appendChild(o);\n    try { if (window.dbkQuietFocus) window.dbkQuietFocus(o.querySelector('.dbk-confirm-yes')); } catch (x) {}\n  };\n  /* Reminders: the add and edit forms show every field (title, date, how often, description, phone, email, link) */\n  function remFormsSetup() {\n    if (pageKey !== 'index') return;\n    [['addReminderOverlay', 'add'], ['editReminderOverlay', 'edit']].forEach(function (pair) {\n      var ov = document.getElementById(pair[0]); if (!ov) return;\n      var box = ov.querySelector('.modal-body'); if (!box || box.getAttribute('data-dbk')) return;\n      box.setAttribute('data-dbk', '1');\n      var ids = ['Desc', 'Phone', 'Email', 'Link'].map(function (k) { return pair[1] + 'Reminder' + k; });\n      var groups = ids.map(function (id) { var el = document.getElementById(id); return el ? el.closest('.form-group') : null; }).filter(Boolean);\n      if (!groups.length) return;\n      groups.forEach(function (g) { g.classList.add('dbk-more'); });\n      box.classList.add('dbk-more-open');   // every field shows (no \"More options\" toggle)\n      ov._dbkRemMore = function () {};\n    });\n  }\n  /* Lists: each add form shows every field */\n  function usFormsSetup() {\n    if (pageKey !== 'our-dreams') return;\n    document.querySelectorAll('.dream-form > form').forEach(function (form) {\n      if (form.getAttribute('data-dbk')) return; form.setAttribute('data-dbk', '1');\n      var groups = [].slice.call(form.querySelectorAll(':scope > .form-group'));\n      if (groups.length < 3) return;\n      groups.slice(1).forEach(function (g) { g.classList.add('dbk-more'); });\n      form.classList.add('dbk-more-open');   // every field shows (no \"More options\" toggle)\n    });\n  }\n  /* Home inbox -> Workroom: each sent idea waits in its own little doc until that person's Workroom picks it up */\n  window.dbkSendToWorkroom = function (text, kind) {\n    var item = { id: 'wi_' + Date.now().toString(36) + Math.random().toString(36).slice(2, 6), text: text, kind: kind === 'spark' ? 'spark' : 'content', from: role === 'person2' ? 'person2' : 'person1', created: new Date().toISOString() };\n    var fi = window.firestoreImports;\n    if (!window.firebaseConfigEmpty && window.db && fi && fi.setDoc) return fi.setDoc(fi.doc(window.db, 'workroomInbox', item.id), item).then(function () { return item; });\n    try { var l = JSON.parse(localStorage.getItem('workroomInbox') || '[]'); l.push(item); localStorage.setItem('workroomInbox', JSON.stringify(l)); return Promise.resolve(item); }\n    catch (e) { return Promise.reject(e); }\n  };\n  window.dbkEarlyNav = function () { try { settingsGear(); todayMark(); } catch (e) {} };\n  // the mode button: top left, across from the settings gear. Opens a small window to switch modes.\n  // the Today mark: top left, across from the settings gear. One tap back to Today from any other page.\n  function todayMark() {\n    var nav = document.querySelector('nav.top-nav'); if (!nav || document.getElementById('dbkHomeBtn')) return;\n    if (page === 'index.html' || page === '') return;\n    var a = document.createElement('a'); a.id = 'dbkHomeBtn'; a.href = 'index.html#today'; a.setAttribute('aria-label', 'Today');\n    a.innerHTML = '<svg viewBox=\"0 0 24 24\" width=\"20\" height=\"20\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"4\" y=\"5\" width=\"16\" height=\"15\" rx=\"1.5\"/><path d=\"M4 10h16\"/><path d=\"M8 3v4M16 3v4\"/><circle cx=\"12\" cy=\"15\" r=\"1.4\" fill=\"currentColor\" stroke=\"none\"/></svg>';\n    nav.appendChild(a);\n  }\n  function settingsGear() {\n    var nav = document.querySelector('nav.top-nav'); if (!nav || document.getElementById('dbkGear')) return;\n    var a = document.createElement('a'); a.id = 'dbkGear'; a.href = 'settings.html'; a.setAttribute('aria-label', 'Settings');\n    // on Meals the gear opens Settings#sec-meals: the main Settings page at its top (Kasey, Oct 26; settings.html fromHash)\n    if (page === 'meal-plan.html') { a.href = 'settings.html#sec-meals'; a.setAttribute('aria-label', 'Meals settings'); }\n    // on Work the same (settings.html#sec-work)\n    if (page === 'workroom.html') { a.href = 'settings.html#sec-work'; a.setAttribute('aria-label', 'Work settings'); }\n    a.innerHTML = '<svg viewBox=\"0 0 24 24\" width=\"19\" height=\"19\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"3\"/><path d=\"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 1 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06A1.65 1.65 0 0 0 4.68 15a1.65 1.65 0 0 0-1.51-1H3a2 2 0 1 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06A1.65 1.65 0 0 0 9 4.68a1.65 1.65 0 0 0 1-1.51V3a2 2 0 1 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06A1.65 1.65 0 0 0 19.4 9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 1 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z\"/></svg>';\n    nav.appendChild(a);\n  }\n  // Us: the add and edit forms live inside the list pop-up's scrolling area. On iPhone a pop-up nested in a\n  // scrolling area gets clipped to it (the top gets cut off and can't be reached), so they move to the page itself.\n  function liftForms() {\n    if (pageKey !== 'our-dreams') return;\n    document.querySelectorAll('.dream-form').forEach(function (f) { if (f.parentElement !== document.body) document.body.appendChild(f); });\n  }\n  /* ---- \"Are you sure?\" before deleting anything worth keeping. One pop-up, the same everywhere. ---- */\n  window.dbkConfirm = function (message, okLabel, noLabel) {\n    return new Promise(function (resolve) {\n      var o = document.createElement('div'); o.className = 'dbk-confirm';\n      o.innerHTML = '<div class=\"dbk-confirm-card\" role=\"alertdialog\" aria-modal=\"true\"><div class=\"dbk-confirm-msg\"></div>' +\n        '<div class=\"dbk-confirm-act\"><button type=\"button\" class=\"dbk-confirm-no\">Keep it</button><button type=\"button\" class=\"dbk-confirm-yes\"></button></div></div>';\n      o.querySelector('.dbk-confirm-msg').textContent = message;\n      o.querySelector('.dbk-confirm-yes').textContent = okLabel || 'Delete';\n      if (noLabel) o.querySelector('.dbk-confirm-no').textContent = noLabel;\n      var done = function (v) { o.remove(); resolve(v); };\n      o.addEventListener('click', function (e) { if (e.target === o) done(false); });\n      o.querySelector('.dbk-confirm-no').onclick = function () { done(false); };\n      o.querySelector('.dbk-confirm-yes').onclick = function () { done(true); };\n      document.body.appendChild(o);\n    });\n  };\n  function guard(name, msg) {\n    var f = window[name]; if (typeof f !== 'function' || f.__dbkGuard) return;\n    var g = function () {\n      var a = arguments, self = this, m = '';\n      try { m = typeof msg === 'function' ? msg.apply(null, a) : msg; } catch (e) { m = 'Delete this?'; }\n      if (!m) return f.apply(self, a);\n      return window.dbkConfirm(m).then(function (ok) { if (ok) return f.apply(self, a); });\n    };\n    g.__dbkGuard = true; window[name] = g;\n  }\n  function guards() {\n    // (Edit reminder > Delete no longer asks \"Delete this reminder?\": it acts at once with Undo and Recently removed,\n    // like Edit event's Delete and All reminders; Kasey's \"no are you sure\", Oct 22/24)\n    if (pageKey === 'our-dreams') {\n      // these used a tap-twice \"Sure?\" that reads the tap itself, so they get the pop-up and then delete directly\n      var del = function (cat, id) {\n        var before = (dreams[cat] || []).slice();\n        dreams[cat] = (dreams[cat] || []).filter(function (d) { return d.firebaseId !== id; });\n        if (window.dbkRemoved) window.dbkRemoved.track(listKind(cat), window.dbkSharing ? window.dbkSharing.localKey(cat) : 'dreams_' + cat, before, dreams[cat], { id: 'firebaseId', title: 'title' });\n        try { saveToLocal(cat); } catch (e) {} try { renderDreams(cat); } catch (e) {} try { syncToFirestore(cat); } catch (e) {}\n        // Undo puts back only what was deleted, into the list as it is now (an old copy of the whole list took off what the\n        // other phone added meanwhile, Oct 23)\n        var gone = before.filter(function (d) { return d && d.firebaseId === id; });\n        if (window.dbkUndo && gone.length) window.dbkUndo(gone[0].title ? '“' + gone[0].title + '” deleted' : 'Deleted', function () {\n          var cur = dreams[cat] = dreams[cat] || [];\n          gone.forEach(function (d) { if (!cur.some(function (x) { return x && x.firebaseId === d.firebaseId; })) cur.splice(Math.min(before.indexOf(d), cur.length), 0, d); });\n          try { saveToLocal(cat); } catch (e) {} try { renderDreams(cat); } catch (e) {} try { syncToFirestore(cat); } catch (e) {}\n        });\n      };\n      var listKind = function (cat) {\n        // a list someone made (Lists > + New list) is named by its own name\n        if (/^cl-/.test(String(cat))) { try { var d = (window.dbkCustomLists ? window.dbkCustomLists() : []).filter(function (x) { return x.key === cat; })[0]; if (d) return d.title; } catch (e) {} return 'List item'; }\n        var c = String(cat).replace(/^our-/, '').replace(/-/g, ' '); return c === 'shows movies' ? 'TV & Movies' : c.charAt(0).toUpperCase() + c.slice(1); };\n      window.dbkListKind = listKind;   // (the Lists page's own Delete, rlDelete, names its Recently removed entry the same way)\n      // no \"are you sure?\" (Kasey, Oct 24): straight away, with Undo and Recently removed\n      window.deleteDream = function (cat, id) { del(cat, id); };\n      window.deleteDreamAndClose = function (cat, id) { del(cat, id); try { closeDetail(); } catch (e) {} };\n    }\n    if (/-hub$/.test(pageKey)) {\n      // an empty category goes without asking (nothing to lose); a full one, and a single resource, ask by name\n      var resOf = function (c) { try { return (typeof resources !== 'undefined' && resources[c]) || null; } catch (e) { return null; } };\n      guard('deleteResourceCategory', function (c) { var list = resOf(c); if (list && !list.length) return ''; var n = c && typeof window.resourceCategoryName === 'function' ? window.resourceCategoryName(c) : c; return 'Delete ' + (n ? '“' + n + '”' : 'this category') + ' and everything in it?'; });\n      guard('deleteResource', function (c, i) { var list = resOf(c), r = list && list[i]; return r && r.title ? 'Delete “' + r.title + '”?' : 'Delete this resource?'; });\n      guard('deleteHabit', 'Delete this habit?');\n    }\n    // (Work's image Remove has no question: Undo, like every other delete, Oct 24)\n  }\n  function boot() {\n    liftForms(); guards();\n    resolveRole(); popViewport(); popLock(); popScrims(); popTop(); confirmFill(); settingsGear(); todayMark(); addEventSetup(); remFormsSetup(); usFormsSetup();\n    ready(); trimHero(); try { paintNav(); } catch (e) {}\n    homeInit(); usNotes();\n    // (no timer: the notes follow renderDreams below, and a name changed in Settings arrives as a storage event)\n    if (pageKey === 'our-dreams') window.addEventListener('storage', function (e) { if (!e.key || e.key === 'userNames') { try { usNotes(); } catch (x) {} } });\n    // the little lines under the Us tiles follow the lists right away when they change\n    if (pageKey === 'our-dreams' && typeof window.renderDreams === 'function' && !window.renderDreams.__dbkNotes) {\n      var rdPrev = window.renderDreams;\n      window.renderDreams = function () { var r = rdPrev.apply(this, arguments); try { usNotes(); } catch (e) {} return r; };\n      window.renderDreams.__dbkNotes = true;\n    } restoreScroll(); homeBottom();\n    var fontsIn = (document.fonts && document.fonts.load) ? Promise.all([\n      document.fonts.load('italic 48px \"Playfair Display\"'), document.fonts.load('20px \"Playfair Display SC\"'), document.fonts.load('17px Lora')\n    ]).catch(function () {}) : Promise.resolve();\n    var have = false; try { have = document.fonts && document.fonts.check('20px \"Playfair Display SC\"') && document.fonts.check('17px Lora') && document.fonts.check('italic 48px \"Playfair Display\"'); } catch (e) {}\n    // show the page only when it's completely done: signed in, every saved list back from the cloud\n    // and drawn, and nothing on the page has changed for a moment. Until then the screen is plain\n    // background. If the connection is slow it gives up waiting after about 2.5 seconds.\n    var t0 = (window.performance && performance.timing && performance.timing.navigationStart) || Date.now();\n    // pages draw from the phone's copy, so the page no longer waits for the cloud connection itself;\n    // anything that has no copy yet holds the page on its own (dbkGateHold / uncached reads)\n    var cloudOn = false, cloudAt = Date.now(), freedAt = 0;\n    var fontsOk = have, quietT = null, lastChange = Date.now(), done = false, mo = null;\n    var finish = function () {\n      if (done) return; done = true; if (mo) mo.disconnect(); clearTimeout(quietT); gate.poke = function () {};\n      try { usNotes(); } catch (e) {}\n      reveal();\n    };\n    var check = function () {\n      if (done || !loading()) return finish();\n      clearTimeout(quietT);\n      var now = Date.now();\n      if (!fontsOk || !cloudAt) return;\n      // give the page's scripts a moment after sign-in to start their reads\n      if (now - cloudAt < 250) { quietT = setTimeout(check, 250 - (now - cloudAt)); return; }\n      if (gate.pending > 0) return;\n      // just signed in: the reads start once the sign-in check has said who this is; give them a moment to start\n      if (fresh && now - t0 < 11000) { if (window.__dbkRoleHeld) return; if (!freedAt) freedAt = now; if (now - freedAt < 400) { quietT = setTimeout(check, 400 - (now - freedAt)); return; } }\n      var still = now - lastChange;\n      if (still < 120) { quietT = setTimeout(check, 120 - still); return; }\n      finish();\n    };\n    gate.poke = function () { lastChange = Date.now(); check(); };\n    try { mo = new MutationObserver(function () { lastChange = Date.now(); check(); }); mo.observe(document.body, { childList: true, subtree: true, characterData: true, attributes: true, attributeFilter: ['class', 'style', 'src'] }); } catch (e) {}\n    if (cloudOn) window.addEventListener('firebaseReady', function () { cloudAt = Date.now(); lastChange = cloudAt; check(); }, { once: true });\n    if (!navigator.onLine) cloudAt = cloudAt || Date.now();\n    var giveUp = function () {\n      if (window.__dbkRoleHeld) { setTimeout(giveUp, 200); return; }   // (not while the sign-in check holds it)\n      // just signed in: also not while the cloud's first answers are still coming (the reads start once the sign-in\n      // check has said who this is), up to 11s from the page's start\n      if (fresh && Date.now() - t0 < 11000) { if (!freedAt) freedAt = Date.now(); if (gate.pending > 0 || !cloudAt || Date.now() - freedAt < 400) { setTimeout(giveUp, 150); return; } }\n      finish();\n    };\n    setTimeout(giveUp, Math.max(600, 2500 - (Date.now() - t0)));\n    if (!fontsOk) Promise.race([fontsIn, new Promise(function (r) { setTimeout(r, 400); })]).then(function () { fontsOk = true; check(); });\n    check();\n  }\n\n  /* ---------- add-ons: a private folder built into one household's copy (tools/build.mjs --addons).\n     The template ships nothing here. An add-on script may fill in, before this file runs or later:\n       dbkAddons.pages  [{ key, name, href, file, who: 'person1'|'person2' (optional), views: [[key, name, href]] }]\n       dbkAddons.events [{ date: 'YYYY-MM-DD', time, title, open: function (ev) {}, id, tick: true }]  shown on the Home calendar\n                        (tick: true with an id gives it the round Done tick, saved with the household's event ticks)\n       dbkAddons.workToday  function () { return { bits: ['a line for the summary'], html: 'a section' }; }  (work-today.js)\n     and call dbkHmWeek() after changing events. ---------- */\n  function addons() { var a = window.dbkAddons = window.dbkAddons || {}; a.pages = a.pages || []; a.events = a.events || []; return a; }\n  function addonPages() { var me = role === 'person2' ? 'person2' : 'person1'; return addons().pages.filter(function (x) { return x && x.key && (!x.who || x.who === me); }); }\n  addons();\n\n  /* ---------- the menu: the page's name sits in the middle of the bar; tap it for the list of pages.\n     Pages with several views (Meals, Work) list them under the page in this menu; there is no second switch on the page. ---------- */\n  function pageList() {\n    var M = window.dbkModule || null, me = role === 'person2' ? 'person2' : 'person1', hub = me + '-hub.html', meP = me === 'person2' ? 'p2' : 'p1';\n    var has = function (mod) { return !M || M.on(mod); };\n    var away = function (k) { return !!(M && M.archived && M.archived(k)); };\n    var items = [['home', 'Today', 'index.html#today']];\n    if (has('habits') && (!M || M.forPerson('habits', meP)) && !away('page:habits')) items.push(['habits', 'Habits', hub + '#bingo']);\n    if ((has('us') || has('travel')) && !away('page:us')) items.push(['us', has('us') ? 'Lists' : 'Travel', 'our-dreams.html']);\n    if (has('meals') && !away('page:meals')) items.push(['meals', 'Meals', 'meal-plan.html#plan']);\n    if (has('work') && (!M || M.forPerson('work', meP)) && !away('page:work')) items.push(['work', 'Work', 'workroom.html#today']);\n    if (has('finance') && !away('page:finance')) items.push(['finance', 'Money', 'finance.html']);\n    addonPages().forEach(function (x) { items.push([x.key, x.name, x.href]); });\n    return items;\n  }\n  // the views inside a page, listed under it in the dropdown\n  function viewsOf(k) {\n    var M = window.dbkModule || null;\n    var away = function (x) { return !!(M && M.archived && M.archived(x)); };\n    // tapping the page name opens Plan / Overview, so those don't repeat as sub-items\n    // Meals has one spot in the menu too (the designer, Oct 19): Plan, Recipes, Grocery and Journal are tabs on the Meals page\n    if (k === 'meals') return [];\n    var ad = addonPages().filter(function (x) { return x.key === k; })[0];\n    if (ad) return ad.views || [];\n    // Work has one spot in the menu: Content opens from the Work page itself, Home Base from the business name\n    if (k === 'work') return [];\n    return [];\n  }\n  function viewCurrent() {\n    if (typeof window.dbkModeView === 'function') { try { return window.dbkModeView(); } catch (e) {} }\n    return '';\n  }\n  function pageCurrent() {\n    if (page === 'index.html' || page === '') return 'home';\n    if (page === 'person1-hub.html' || page === 'person2-hub.html') return 'habits';\n    if (page === 'our-dreams.html') return 'us';\n    if (page === 'meal-plan.html') return 'meals';\n    if (page === 'workroom.html') return 'work';\n    if (page === 'finance.html') return 'finance';\n    if (page === 'settings.html') return 'settings';\n    var ad = addonPages().filter(function (x) { return (x.file || x.href.split('#')[0]) === page; })[0];\n    if (ad) return ad.key;\n    return '';\n  }\n  var paintNav = window.dbkPaintNav = function () {\n    var box = document.querySelector('nav.top-nav .dbk-ml-box'); if (!box) return;\n    fillNav(box);\n  };\n  function fillNav(box) {\n    var items = pageList(), cur = pageCurrent();\n    var here = items.filter(function (x) { return x[0] === cur; })[0];\n    // a page missing from the menu (put away, or opened from an old link) still shows its own name\n    var M = window.dbkModule, FIXED = { home: 'Today', habits: 'Habits', us: (M && !M.on('us') && M.on('travel')) ? 'Travel' : 'Lists', meals: 'Meals', work: 'Work', finance: 'Money', settings: 'Settings' };\n    var name = here ? here[1] : (FIXED[cur] || '');\n    var key = cur + '|' + name + '|' + items.map(function (x) { return x[0]; }).join(',');\n    if (box.getAttribute('data-key') !== key) {\n      box.innerHTML = '<button type=\"button\" class=\"dbk-title-btn\" id=\"dbkTitleBtn\" aria-haspopup=\"menu\" aria-expanded=\"false\"><span class=\"dbk-title-name\">' + name + '</span><span class=\"dbk-title-chev\" aria-hidden=\"true\"></span></button>';\n      box.setAttribute('data-key', key);\n    }\n  }\n  function navClick(e) {\n    var a = e.target.closest('a'); if (!a) return;\n    var href = a.getAttribute('href'), file = href.split('#')[0], hash = href.split('#')[1] || '';\n    if (file !== page && !(file === 'index.html' && page === '')) return; // another page: just go\n    e.preventDefault();\n    if ((page === 'index.html' || page === '') && !hash) { window.dbkGoHome(); return; }\n    if (('#' + hash) !== location.hash) location.hash = hash; else if (window.dbkModeShow) window.dbkModeShow(hash);\n    setTimeout(paintNav, 30);\n  }\n  function openPages() {\n    if (document.getElementById('dbkPagePop')) { closePages(); return; }\n    var items = pageList(), cur = pageCurrent();\n    var pop = document.createElement('div'); pop.id = 'dbkPagePop'; pop.className = 'dbk-pagepop'; pop.setAttribute('role', 'menu');\n    var curView = viewCurrent();\n    pop.innerHTML = '<div class=\"dbk-pagepop-card\">' + items.map(function (x) {\n      var views = viewsOf(x[0]);\n      return '<div class=\"dbk-pagepop-item' + (x[0] === cur ? ' is-here' : '') + '\">' +\n        '<a role=\"menuitem\" data-k=\"' + x[0] + '\" href=\"' + x[2] + '\"' + (x[0] === cur ? ' class=\"on\" aria-current=\"page\"' : '') + '>' + x[1] + '</a>' +\n        (views.length ? '<div class=\"dbk-pagepop-views\">' + views.map(function (v) {\n          return '<a role=\"menuitem\" data-k=\"' + v[0] + '\" href=\"' + v[2] + '\"' + (x[0] === cur && v[0] === curView ? ' class=\"on\"' : '') + '>' + v[1] + '</a>';\n        }).join('') + '</div>' : '') + '</div>';\n    }).join('') + '</div>';\n    document.body.appendChild(pop);\n    var btn = document.getElementById('dbkTitleBtn'); if (btn) btn.setAttribute('aria-expanded', 'true');\n    var esc = function (e) { if (e.key === 'Escape') closePages(); };\n    pop._esc = esc; document.addEventListener('keydown', esc);\n    pop.addEventListener('click', function (e) {\n      var a = e.target.closest('a');\n      if (!a) { if (e.target === pop) closePages(); return; }\n      closePages();\n      navClick(e);\n    });\n    var first = pop.querySelector('a.on') || pop.querySelector('a'); if (first) first.focus();\n  }\n  function closePages() {\n    var pop = document.getElementById('dbkPagePop'); if (!pop) return;\n    document.removeEventListener('keydown', pop._esc); pop.remove();\n    var btn = document.getElementById('dbkTitleBtn'); if (btn) btn.setAttribute('aria-expanded', 'false');\n  }\n  function modeNav() {\n    var links = document.querySelector('nav.top-nav .nav-links'); if (!links || links.querySelector('.dbk-ml-box')) return;\n    var box = document.createElement('span'); box.className = 'dbk-ml-box';\n    links.insertBefore(box, links.firstChild);\n    fillNav(box);\n    box.addEventListener('click', function (e) { if (e.target.closest('#dbkTitleBtn')) { e.preventDefault(); e.stopPropagation(); openPages(); } });\n    window.addEventListener('hashchange', function () { setTimeout(paintNav, 30); });\n    // a page left with its menu open (another page took over, or the app was put away) must not show it open on return\n    window.addEventListener('blur', closePages); window.addEventListener('pagehide', closePages);\n    document.addEventListener('visibilitychange', function () { if (document.visibilityState === 'hidden') closePages(); });\n    window.addEventListener('storage', function (e) { if (e.key === 'archived') setTimeout(paintNav, 30); });\n    paintNav(); setTimeout(paintNav, 400); setInterval(paintNav, 1500);\n  }\n  // Home means Today\n  window.dbkGoHome = function (replace) {\n    if (!(page === 'index.html' || page === '')) { __dbkLoc.href = 'index.html#today'; return; }\n    if (location.hash !== '#today') { try { if (replace) history.replaceState(null, '', 'index.html#today'); else location.hash = 'today'; } catch (e) {} }\n    try { window.scrollTo(0, 0); } catch (e) {}\n    paintNav();\n  };\n  /* ---------- capture a thought, fixed to the bottom of every page ---------- */\n  function inboxKey() { return 'capturedThoughts_' + (role === 'person2' ? 'person2' : 'person1'); }\n  function capToast(msg) {\n    if (window.dbkNotice) { window.dbkNotice(msg); return; }   // the app's one message spot\n    if (typeof window.showToast === 'function') { try { window.showToast(msg); return; } catch (e) {} }\n    var t = document.getElementById('dbkCapToast');\n    if (!t) { t = document.createElement('div'); t.id = 'dbkCapToast'; t.className = 'dbk-cap-toast'; document.body.appendChild(t); }\n    t.textContent = msg; t.classList.add('show'); clearTimeout(t._h); t._h = setTimeout(function () { t.classList.remove('show'); }, 1600);\n  }\n  function localThoughts() {\n    // the inbox's own saved list is what Today keeps up to date (deleting a note updates it straight away);\n    // the older cloud copy is only a fallback for a phone that has never opened the inbox\n    var K = inboxKey(), a; try { var raw = localStorage.getItem(K); if (raw !== null) a = JSON.parse(raw); } catch (e) {}\n    if (!Array.isArray(a)) a = window.dbkSnapItems ? window.dbkSnapItems(K) : undefined;\n    return Array.isArray(a) ? a : [];\n  }\n  function capQueue(q) { try { if (q) localStorage.setItem('dbkCapQueue', JSON.stringify(q)); else return JSON.parse(localStorage.getItem('dbkCapQueue') || '[]') || []; } catch (e) { return []; } }\n  var flushing = false;\n  async function flushCaptures() {\n    var q = capQueue(); if (!q.length || flushing) return;\n    var fi = window.firestoreImports, db = window.db; if (!window.firebaseReady || !fi || !db) return;\n    // through the shared lists' saving: each queued note added only if it's not there and wasn't removed meanwhile\n    if (typeof window.dbkPendSoftAdd === 'function') {\n      var K0 = inboxKey(), left = q.filter(function (t) { return !window.dbkPendSoftAdd(K0, t); });\n      capQueue(left.length ? left : []); paintBadge();\n      try { if (window.dbkFlushPending) window.dbkFlushPending(); } catch (e) {}\n      return;\n    }\n    flushing = true;\n    try {\n      var K = inboxKey(), ref = fi.doc(db, K, 'data');\n      var snap = await fi.getDoc(ref);\n      var items = snap.exists() && snap.data() && Array.isArray(snap.data().items) ? snap.data().items.slice() : localThoughts().slice();\n      var have = {}; items.forEach(function (t) { if (t) have[String(t.id)] = 1; });\n      q.forEach(function (t) { if (!have[String(t.id)]) items.push(t); });\n      await fi.setDoc(ref, { items: items });\n      try { localStorage.setItem(K, JSON.stringify(items)); } catch (e) {}\n      capQueue([]); paintBadge();\n    } catch (e) {}\n    flushing = false;\n  }\n  function paintBadge() {\n    var b = document.getElementById('inboxBadge'); if (!b || page === 'index.html' || page === '') return;\n    var n = localThoughts().length, v = n > 0 ? String(n) : ''; if (b.textContent !== v) b.textContent = v;   // only when it changes: rewriting the same number redrew it\n  }\n  function cloudSetUp() {\n    try { var c = JSON.parse(localStorage.getItem('firebaseConfig') || 'null'); if (c && c.apiKey) return true; } catch (e) {}\n    try { var ent = window.HEARTH_ENTITLEMENTS || {}; if (ent.firebaseConfig && ent.firebaseConfig.apiKey) return true; } catch (e) {}\n    return !!window.db;\n  }\n  function captureHere() {\n    var input = document.getElementById('captureInput'); if (!input) return;\n    var text = input.value.trim(); if (!text) return;\n    var item = { id: Date.now(), text: text, tag: null, createdAt: new Date().toISOString() };\n    input.value = '';\n    // the phone's copy first, so it's there even before the cloud answers\n    var K = inboxKey(), list = localThoughts().concat([item]);\n    try { localStorage.setItem(K, JSON.stringify(list)); localStorage.setItem('dbkSnap:' + K + '/data', JSON.stringify({ items: list })); } catch (e) {}\n    if (cloudSetUp()) { capQueue(capQueue().concat([item])); flushCaptures(); }\n    paintBadge(); capToast('Captured.');\n  }\n  function capBar() {\n    var onHome = page === 'index.html' || page === '';\n    var bar = document.getElementById('captureBar');\n    if (!bar) {\n      if (onHome) return;\n      bar = document.createElement('div'); bar.className = 'capture-sticky-bar dbk-capbar-global'; bar.id = 'captureBar';\n      bar.innerHTML = '<div class=\"capture-bar-row\"><input class=\"capture-bar-input\" id=\"captureInput\" placeholder=\"capture or search...\" enterkeyhint=\"send\" aria-label=\"Capture a thought\">' +\n        '<button type=\"button\" class=\"capture-bar-send\" title=\"Capture\" aria-label=\"Capture\">↵</button>' +\n        '<a class=\"capture-inbox-btn\" id=\"inboxBtn\" href=\"index.html#inbox\">inbox<span class=\"capture-inbox-badge\" id=\"inboxBadge\"></span></a></div>';\n      document.body.appendChild(bar);\n      bar.querySelector('.capture-bar-send').addEventListener('click', captureHere);\n      bar.querySelector('input').addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); captureHere(); } });\n      paintBadge();\n      // pages stay loaded in the background, so the count catches up whenever the page comes back or the inbox changes\n      window.addEventListener('dbk-show', paintBadge); window.addEventListener('focus', paintBadge); window.addEventListener('pageshow', paintBadge);\n      window.addEventListener('storage', function (e) { if (!e.key || /^capturedThoughts/.test(e.key)) paintBadge(); });\n      setInterval(paintBadge, 2000);\n      window.addEventListener('firebaseReady', function () { flushCaptures(); });\n      setTimeout(flushCaptures, 1500);\n    }\n    if (onHome) return; // Home already keeps its last section clear of the bar\n    var sp = document.getElementById('dbkCapSpace');\n    if (!sp) { sp = document.createElement('div'); sp.id = 'dbkCapSpace'; sp.setAttribute('aria-hidden', 'true'); document.body.appendChild(sp); }\n    var fit = function () { if (bar.offsetHeight) sp.style.height = bar.offsetHeight + 'px'; };\n    fit(); setTimeout(fit, 300); window.addEventListener('resize', fit);\n  }\n  // Home opened from another page's inbox link: straight to the inbox\n  function inboxFromHash() {\n    var onHome = page === 'index.html' || page === '';\n    if (!onHome) {\n      // the inbox button on any other page: remember where you were, open the inbox, come back when it closes\n      document.addEventListener('click', function (e) {\n        var a = e.target.closest('#inboxBtn'); if (!a) return;\n        e.preventDefault(); e.stopPropagation();\n        try { localStorage.setItem('dbkInboxBack', JSON.stringify({ to: page + (location.hash || ''), at: Date.now() })); } catch (x) {}\n        try { __dbkLoc.href = 'index.html#inbox'; } catch (x) { location.href = 'index.html#inbox'; }\n      }, true);\n      return;\n    }\n    // opened straight away (no fade), so the page behind never shows on its own first\n    var openNow = function () {\n      var o = document.getElementById('inboxOverlay');\n      if (typeof window.openInbox !== 'function' || !o) return false;\n      o.classList.add('dbk-now');\n      try { window.openInbox(); } catch (e) {}\n      // stays until the inbox closes: taking it off while open would restart the fade (a second flash)\n      return true;\n    };\n    var openIt = function () {\n      if (location.hash !== '#inbox') return;\n      try { history.replaceState(null, '', '#today'); } catch (e) {}\n      var tries = 0, t = null;\n      var step = function () {\n        tries++;\n        if (openNow()) {\n          if (t) clearInterval(t);\n          // closing it takes you back to the page you came from\n          if (typeof window.closeInbox === 'function' && !window.closeInbox.__dbkBack) {\n            var orig = window.closeInbox;\n            var wrapped = function () {\n              var r = orig.apply(this, arguments);\n              var back = null; try { back = JSON.parse(localStorage.getItem('dbkInboxBack') || 'null'); localStorage.removeItem('dbkInboxBack'); } catch (e) {}\n              // Send to Calendar or Reminder opens its form here on Today, so it stays on Today\n              if (!window._dbkInboxStay && back && back.to && Date.now() - back.at < 30 * 60 * 1000 && !/^index\\.html/.test(back.to)) { try { __dbkLoc.href = back.to; } catch (e) {} }\n              return r;\n            };\n            wrapped.__dbkBack = true; window.closeInbox = wrapped; try { closeInbox = wrapped; } catch (e) {}\n          }\n          return true;\n        } else if (tries > 100 && t) clearInterval(t);\n        return false;\n      };\n      if (!step()) t = setInterval(step, 30);\n    };\n    // app.html calls this the moment it switches to Today for the inbox, before Today is shown\n    window.dbkInboxFromHash = openIt;\n    openIt(); window.addEventListener('hashchange', openIt); window.addEventListener('dbk-show', function () { setTimeout(openIt, 0); });\n  }\n  /* ---------- Settings: names save as you type, connections, version ---------- */\n  function settingsExtras() {\n    if (page !== 'settings.html') return;\n    var t = null;\n    ['name1', 'name2'].forEach(function (id) {\n      var el = document.getElementById(id); if (!el) return;\n      el.addEventListener('input', function () { clearTimeout(t); t = setTimeout(function () { try { saveAppName(); } catch (e) {} try { saveNames(); } catch (e) {} }, 700); });\n    });\n    var v = document.getElementById('dbkVersion');\n    if (v && !window.__dbkPacked) fetch('sw.js', { cache: 'no-store' }).then(function (r) { return r.text(); }).then(function (txt) {\n      // the cache name ends in the version: \"-v2\" in the template, the build's code in a buyer's copy\n      // (Kasey, Oct 22: \"I just can't tell if our app is up to date\"): when this copy was last updated, and whether\n      // this phone is running it yet (its own cache has that version's name)\n      var m = /CACHE_NAME = '([^']*)'/.exec(txt), b = /BUILT = '([^']+)'/.exec(txt); if (!m) return;\n      var when = b ? new Date(b[1]) : null;\n      var said = when && !isNaN(when) ? 'Last updated ' + when.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }) + ', ' + when.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit' }).toLowerCase() : 'Version ' + m[1].replace(/^.*-/, '').slice(0, 7);\n      v.textContent = said;\n      if (window.caches && caches.keys) caches.keys().then(function (keys) {\n        if (keys.length && keys.indexOf(m[1]) === -1) { v.textContent = said + ' \\u00b7 loading it now'; try { navigator.serviceWorker.getRegistration().then(function (r) { if (r) r.update(); }); } catch (e) {} }\n        else if (keys.length) v.textContent = said + ' \\u00b7 up to date';\n      }).catch(function () {});\n    }).catch(function () {});\n  }\n  /* ---------- the space under the last section matches that section ---------- */\n  function matchBottom() {\n    var run = function () {\n      var best = null, bestBottom = -1, sy = window.scrollY || 0, vw = window.innerWidth;\n      var els = document.querySelectorAll('body section, body main, body .container > div, body .tab-view, body .hub-tab, body .dbk-sec, body .hm-band, #today-tab > *, #sbToday > *');\n      for (var i = 0; i < els.length; i++) {\n        var el = els[i];\n        if (el.closest('nav, #captureBar, [class*=\"overlay\"], [class*=\"modal\"], .dbk-confirm, [class*=\"popup\"]')) continue;\n        var r = el.getBoundingClientRect(); if (r.height < 20 || r.width < vw * 0.5) continue;\n        var cs = getComputedStyle(el); if (cs.position === 'fixed' || cs.visibility === 'hidden') continue;\n        var bg = cs.backgroundColor;\n        // colored bands may paint through border-image instead of background\n        if ((!bg || bg === 'transparent' || /rgba\\(.*,\\s*0\\)$/.test(bg)) && el.classList.contains('dbk-sec') && cs.borderImageSource && cs.borderImageSource !== 'none') bg = (cs.getPropertyValue('--bandc') || '').trim();\n        if (!bg || bg === 'transparent' || /rgba\\(.*,\\s*0\\)$/.test(bg)) continue;\n        var bottom = r.bottom + sy;\n        if (bottom >= bestBottom - 1) { best = bg; bestBottom = bottom; }\n      }\n      // kept in a style the look leaves alone, with a class on the page (Oct 25, Money's tabs slow in 2T): it was written\n      // on the page's own style, which a look that swaps colours (2T, own colours) swapped again, so this saw a colour it\n      // hadn't set, wrote it back, and so on (on every tap and every 2.5s), each time making the readable-text check go\n      // over the whole page; the colour is read from the screen, so it is already the look's\n      if (root.style.getPropertyValue('--dbk-tail')) root.style.removeProperty('--dbk-tail');\n      if (!tailCss) { tailCss = document.createElement('style'); tailCss.setAttribute('data-dbk-raw', ''); (document.head || root).appendChild(tailCss); }\n      var css = best ? 'html.dbk-tail { --dbk-tail: ' + best + '; }' : '';\n      if (tailCss.textContent !== css) tailCss.textContent = css;\n      if (root.classList.contains('dbk-tail') !== !!best) root.classList.toggle('dbk-tail', !!best);\n    };\n    var tailCss = null;\n    run(); setTimeout(run, 300); setTimeout(run, 1200);\n    window.addEventListener('resize', run); window.addEventListener('hashchange', function () { setTimeout(run, 60); });\n    document.addEventListener('click', function () { setTimeout(run, 80); setTimeout(run, 500); });\n    setInterval(run, 2500);\n  }\n  function modesReady() { try { modeNav(); } catch (e) {} try { capBar(); inboxFromHash(); } catch (e) {} try { settingsExtras(); } catch (e) {} try { matchBottom(); } catch (e) {} }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', modesReady); else modesReady();\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', boot);\n  else boot();\n})();\n\n/* ═══ Oct 12: Later on Today, Today's sections in Settings, and search from the capture bar ═══ */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html').toLowerCase(); if (page === '') page = 'index.html';\n  var role = 'person1'; try { if (localStorage.getItem('myPersonRole') === 'person2') role = 'person2'; } catch (e) {}\n  function jget(k, d) { try { var v = JSON.parse(localStorage.getItem(k) || 'null'); return v == null ? d : v; } catch (e) { return d; } }\n  function esc(t) { return String(t == null ? '' : t).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n  function go(u) { try { __dbkLoc.href = u; } catch (e) { location.href = u; } }\n  function ready(fn) { if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', fn); else fn(); }\n\n  /* ---------- Later: what used to be the Back Burner, folded under Today's Three ---------- */\n  function later() {\n    if (page !== 'index.html') return;\n    var tog = document.getElementById('dbkLaterToggle'), body = document.getElementById('dbkLaterBody'), list = document.getElementById('dbkLaterList');\n    var input = document.getElementById('dbkLaterInput'), add = document.getElementById('dbkLaterAdd');\n    if (!tog || !body || tog._dbk) return; tog._dbk = 1;\n    var KEY = 'futureTodos_' + role, items = jget(KEY, []);\n    if (!Array.isArray(items)) items = [];\n    var label = function () { var n = items.filter(function (t) { return !t.completed; }).length; tog.textContent = n ? 'Back Burner (' + n + ')' : 'Back Burner'; };\n    var render = function () {\n      label();\n      // while an item's words are being changed, the list waits (a redraw would close the box); it redraws when done\n      if (list.querySelector('.dbk-later-live')) { render._later = 1; return; }\n      list.innerHTML = items.length ? items.map(function (t) {\n        // only the box ticks (a 40px target of its own); the words beside it open the in-place edit (the designer, Oct 20:\n        // clicking to edit kept crossing items off)\n        return '<li class=\"dbk-later-item' + (t.completed ? ' done' : '') + '\" data-id=\"' + esc(t.id) + '\"><label class=\"dbk-later-tick\"><input type=\"checkbox\"' + (t.completed ? ' checked' : '') + ' aria-label=\"Done: ' + esc(t.text) + '\"></label>' +\n          '<div class=\"dbk-later-words\"' + (t.completed ? '' : ' role=\"button\" tabindex=\"0\" aria-label=\"Change “' + esc(t.text) + '”\"') + '><span class=\"dbk-later-text\">' + esc(t.text) + '</span></div>' +\n          (t.completed ? '' : '<button type=\"button\" class=\"dbk-later-cal\" aria-label=\"Put “' + esc(t.text) + '” on the calendar\" title=\"Put it on the calendar\"><svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><rect x=\"4\" y=\"5\" width=\"16\" height=\"15\" rx=\"2\"/><path d=\"M4 10h16M9 3v4M15 3v4\"/></svg></button>') +\n          (t.completed ? '' : '<button type=\"button\" class=\"dbk-later-up\" aria-label=\"Move “' + esc(t.text) + '” up to Today’s Three\" title=\"Move up to Today’s Three\"><svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M12 19V5\"/><path d=\"M6 11l6-6 6 6\"/></svg></button>') +\n          '<button type=\"button\" class=\"dbk-later-x\" aria-label=\"Remove\">&times;</button></li>';\n      }).join('') : '<li class=\"dbk-later-empty\">Nothing on the back burner.</li>';\n      list.classList.toggle('three-full', threeFull());\n    };\n    var lastSave = 0;\n    // What this phone took off the Back Burner (moved up to Today's Three, removed) stays off for 30 days, even if\n    // a cloud copy that still has it arrives later (Kasey, Oct 22: one moved up and ticked off came back down).\n    // Put back or Undo puts it on the list again, which clears its mark. Kept on this phone only.\n    var GONE = 'dbkLaterGone_' + role, SEEN = 'dbkLaterSeen_' + role;\n    var goneGet = function () { var g = jget(GONE, {}), cut = Date.now() - 30 * 864e5, o = {}; if (g && typeof g === 'object') for (var k in g) if (g[k] > cut) o[k] = g[k]; return o; };\n    var store = function () {\n      lastSave = Date.now();\n      try {\n        var was = jget(KEY, []), g = goneGet(), have = {};\n        items.forEach(function (t) { if (t && t.id != null) { have[String(t.id)] = 1; delete g[String(t.id)]; } });\n        if (Array.isArray(was)) was.forEach(function (t) { if (t && t.id != null && !have[String(t.id)]) g[String(t.id)] = Date.now(); });\n        localStorage.setItem(GONE, JSON.stringify(g));\n      } catch (e) {}\n      try { localStorage.setItem(KEY, JSON.stringify(items)); } catch (e) {}\n      try { if (typeof syncToFirebase === 'function') syncToFirebase(KEY, items); } catch (e) {}\n    };\n    var save = function () { store(); render(); };\n    // the cloud copy: what this person added on another phone (or before this address) shows here too.\n    // Items only on this phone are kept and saved back. An item the cloud had last time and no longer has\n    // was removed on the other phone, so it goes here too (instead of coming back).\n    // what the cloud had the last time this phone looked (kept on the phone, so a computer opened days later still\n    // knows that an item it holds and the cloud no longer has was taken off on the other phone, and doesn't put it back)\n    var cloudSeen = (function () { var s0 = jget(SEEN, null); return s0 && typeof s0 === 'object' ? s0 : null; })();\n    var fromCloud = function (cloud) {\n      if (!Array.isArray(cloud)) return;\n      // a read that started before this phone's own save finished would put the old copy back (a tick undoing\n      // itself a moment later): skip it, the next check brings anything newer\n      if (Date.now() - lastSave < 3000) return;\n      var have = {}, g = goneGet(), dropped = false, extra = false;\n      cloud.forEach(function (t) { if (t && t.id != null) have[String(t.id)] = 1; });\n      // taken off here: an older cloud copy that still has it doesn't bring it back (and the cloud is put right)\n      var out = cloud.filter(function (t) { var off = !!(t && t.id != null && g[String(t.id)]); if (off) dropped = true; return !off; });\n      // Oct 23 (Kasey: items deleted several times kept coming back on the computer): the Back Burner is saved item by\n      // item now (SHARED above), so the cloud's copy already holds this phone's unsent changes and is the list as it\n      // is. A device's own copy is never added back on top of it: a computer that hadn't opened the app since an item\n      // was removed on the phone used to put it back. Without the merge (an old page), the earlier rule stays.\n      if (!window.dbkMerge) items.forEach(function (t) {\n        if (t && t.id != null && have[String(t.id)]) return;\n        if (t && t.id != null && cloudSeen && cloudSeen[String(t.id)]) return;   // removed on the other phone\n        out.push(t); extra = true;\n      });\n      cloudSeen = have; try { localStorage.setItem(SEEN, JSON.stringify(have)); } catch (e) {}\n      if (dropped && window.dbkRoleOk && window.dbkRoleOk()) extra = true;\n      if (JSON.stringify(out) === JSON.stringify(items)) { if (dropped && extra) { try { syncToFirebase(KEY, items); } catch (e) {} } return; }\n      items = out; try { localStorage.setItem(KEY, JSON.stringify(items)); } catch (e) {}\n      render();\n      if (extra && window.dbkRoleOk && window.dbkRoleOk()) { try { syncToFirebase(KEY, items); } catch (e) {} }\n    };\n    var pull = function () {\n      if (window.firebaseConfigEmpty || !window.dbkRoleOk || !window.dbkRoleOk()) return;\n      try { if (typeof window.loadFromFirebaseLive === 'function') window.loadFromFirebaseLive(KEY).then(fromCloud, function () {}); } catch (e) {}\n      try { if (!pull._l && typeof window.setupFirebaseListener === 'function') { pull._l = 1; window.setupFirebaseListener(KEY, fromCloud); } } catch (e) {}\n    };\n    if (window.firebaseReady) pull();\n    window.addEventListener('firebaseReady', function () { setTimeout(pull, 50); });\n    window.addEventListener('dbkRoleOk', pull);\n    // up arrow: a Back Burner item moves into the first empty line of Today's Three (with Undo)\n    var threeList = function () { try { return Array.isArray(window._threeThings) ? window._threeThings : null; } catch (e) { return null; } };\n    var threeFull = function () { var l = threeList(); return !!l && l.length >= 3 && l.slice(0, 3).every(function (x) { return x && x.text; }); };\n    var tellMsg = function (m, opts) { try { if (typeof window.showToast === 'function') return window.showToast(m, opts || {}); } catch (e) {} };\n    var moveUp = function (id) {\n      var l = threeList(); if (!l) return;\n      try { if (typeof window.threeStale === 'function' && window.threeStale()) l = threeList(); } catch (e) {}\n      var slot = -1; for (var i = 0; i < 3; i++) { if (!l[i] || !l[i].text) { slot = i; break; } }\n      if (slot < 0) { tellMsg('Today’s Three is full. Finish or remove one first.'); return; }\n      var at = -1; items.forEach(function (t, i) { if (String(t.id) === String(id)) at = i; });\n      if (at < 0) return;\n      var it = items[at], before = items.slice();\n      l[slot] = { text: it.text, done: false };\n      try { window.threeThingsSave(); window.threeThingsRender(); } catch (e) {}\n      items.splice(at, 1);\n      // off the Back Burner for good (ticked off or not up there); Settings > Recently removed can still put it back\n      if (window.dbkRemoved) window.dbkRemoved.track('Back Burner', KEY, before, items, { title: 'text' });\n      save();\n      tellMsg('Moved to Today’s Three', { duration: 5000, undoCallback: function () {\n        var cur = threeList(); if (cur && cur[slot] && cur[slot].text === it.text) { cur[slot] = { text: '', done: false }; try { window.threeThingsSave(); window.threeThingsRender(); } catch (e) {} }\n        items.splice(Math.min(at, items.length), 0, it); save();\n      } });\n    };\n    // the arrows dim while Today's Three is full (tapping one still says why)\n    if (typeof window.threeThingsRender === 'function' && !window.threeThingsRender._later) {\n      var tr = window.threeThingsRender;\n      window.threeThingsRender = function () { var r = tr.apply(this, arguments); try { list.classList.toggle('three-full', threeFull()); } catch (e) {} return r; };\n      window.threeThingsRender._later = true;\n    }\n    var open = function (on) { body.hidden = !on; tog.setAttribute('aria-expanded', on ? 'true' : 'false'); tog.classList.toggle('on', on); };\n    // opening it never scrolls the page (it opens right under its button)\n    tog.addEventListener('click', function () { open(body.hidden); });\n    var addIt = function () { if (!input) return; var v = (input.value || '').trim(); if (!v) return; items.unshift({ id: Date.now(), text: v, completed: false, createdAt: new Date().toISOString() }); input.value = ''; save(); };\n    // the small + under the list opens a one-line box; Enter adds and keeps it open for the next one.\n    // (The capture bar always goes to the Inbox, even while this is open.)\n    var plus = document.getElementById('dbkLaterPlus'), form = document.getElementById('dbkLaterForm'), shut = document.getElementById('dbkLaterClose');\n    var showForm = function (on) { if (!form || !plus) return; form.hidden = !on; plus.hidden = on; if (on) setTimeout(function () { try { input.focus({ preventScroll: true }); } catch (e) {} }, 30); else if (input) input.value = ''; };\n    if (plus) plus.addEventListener('click', function () { showForm(true); });\n    if (shut) shut.addEventListener('click', function () { showForm(false); try { plus.focus(); } catch (e) {} });\n    if (form) form.addEventListener('submit', function (e) { e.preventDefault(); addIt(); try { input.focus(); } catch (x) {} });\n    if (input) input.addEventListener('keydown', function (e) { if (e.key === 'Escape') { e.preventDefault(); showForm(false); } });\n    list.addEventListener('change', function (e) {\n      var li = e.target.closest('li[data-id]'); if (!li) return;\n      var id = li.getAttribute('data-id'), on = e.target.checked;\n      items.forEach(function (t) { if (String(t.id) === id) t.completed = on; }); save();\n      // done gets the standard Undo (5 seconds)\n      if (on && window.dbkUndo) window.dbkUndo('Back Burner item done', function () { items.forEach(function (t) { if (String(t.id) === id) t.completed = false; }); save(); });\n    });\n    // tap the words of an item to change them (only the box ticks it): Enter or tapping away saves, Escape keeps it as it was\n    var editIt = function (li) {\n      var id = li.getAttribute('data-id'), t = items.filter(function (i) { return String(i.id) === id; })[0];\n      var sp = li.querySelector('.dbk-later-text'); if (!t || !sp || sp.isContentEditable) return;\n      // the words themselves become editable, right where they are: nothing is swapped or moves (a box that took\n      // their place was one line where the words wrapped onto two, so the rows jumped and a tap could miss)\n      var was = sp.textContent;\n      try { sp.contentEditable = 'plaintext-only'; } catch (x) {}\n      if (sp.contentEditable !== 'plaintext-only') sp.contentEditable = 'true';\n      sp.classList.add('dbk-later-live'); sp.setAttribute('role', 'textbox'); sp.setAttribute('aria-label', 'Change “' + t.text + '”'); sp.setAttribute('enterkeyhint', 'done'); sp.spellcheck = true;\n      li.classList.add('editing');\n      window.dbkTapFocus = Date.now();   // a tap to change it: the keyboard comes up (phones skip a script's focus otherwise)\n      try { sp.focus({ preventScroll: true }); var r = document.createRange(); r.selectNodeContents(sp); r.collapse(false); var sel = window.getSelection(); sel.removeAllRanges(); sel.addRange(r); } catch (x) {}\n      var done = false, finish = function (keep) {\n        if (done) return; done = true;\n        var v = (sp.textContent || '').replace(/\\s+/g, ' ').trim();\n        // the list may have been refreshed from the cloud meanwhile: change the item as it is now\n        var cur = items.filter(function (i) { return String(i.id) === id; })[0];\n        var changed = keep && cur && v && v !== cur.text, pending = render._later; render._later = 0;\n        if (changed) cur.text = v;\n        sp.removeAttribute('contenteditable'); sp.removeAttribute('role'); sp.removeAttribute('aria-label'); sp.removeAttribute('enterkeyhint'); sp.classList.remove('dbk-later-live'); li.classList.remove('editing');\n        sp.textContent = cur ? cur.text : was;\n        if (cur) { var w = li.querySelector('.dbk-later-words'), cb = li.querySelector('.dbk-later-tick input'); if (w) w.setAttribute('aria-label', 'Change “' + cur.text + '”'); if (cb) cb.setAttribute('aria-label', 'Done: ' + cur.text); }\n        // saved without redrawing the list, so a tap that closed the editing (say on another item's box) still lands\n        if (changed) { store(); if (window.dbkSavedHere) window.dbkSavedHere(li); }\n        if (pending || !cur || !document.contains(li)) setTimeout(render, 400);\n      };\n      sp.addEventListener('keydown', function (ev) { if (ev.key === 'Enter') { ev.preventDefault(); finish(true); try { sp.blur(); } catch (x) {} } else if (ev.key === 'Escape') { ev.preventDefault(); finish(false); try { sp.blur(); } catch (x) {} } });\n      sp.addEventListener('blur', function () { finish(true); }, { once: true });\n    };\n    /* An item onto the calendar (Kasey, Oct 25: \"add them to the calendar as an event/reminder easily\"): Event or Reminder,\n       then Today's own form opens with its words (and any day or time in them, the Inbox's guess) filled in. Saved, it\n       leaves the Back Burner; Undo takes the event or reminder off again and puts the item back. Closed without saving,\n       nothing changes. */\n    var toCal = function (id) {\n      var t = items.filter(function (i) { return String(i.id) === id; })[0]; if (!t) return;\n      var o = document.createElement('div'); o.className = 'dbk-confirm dbk-later-pick';\n      o.innerHTML = '<div class=\"dbk-confirm-card\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Put it on the calendar\"><div class=\"dbk-confirm-msg\"></div>' +\n        '<div class=\"dbk-confirm-act\" role=\"group\"><button type=\"button\" class=\"dbk-confirm-no\" data-k=\"reminder\">Reminder</button><button type=\"button\" class=\"dbk-confirm-yes\" data-k=\"event\">Event</button></div></div>';\n      o.querySelector('.dbk-confirm-msg').textContent = 'Put “' + t.text + '” on the calendar as';\n      var key = function (e) { if (e.key === 'Escape') done(); };\n      var done = function () { o.remove(); document.removeEventListener('keydown', key); };\n      o.addEventListener('click', function (e) {\n        if (e.target === o) return done();\n        var b = e.target.closest('[data-k]'); if (!b) return;\n        done(); openForm(b.getAttribute('data-k'), t);\n      });\n      document.addEventListener('keydown', key); document.body.appendChild(o);\n    };\n    var openForm = function (kind, t) {\n      var g = {}; try { if (typeof inboxGuess === 'function') g = inboxGuess({ text: t.text }) || {}; } catch (e) {}\n      var title = g.titleFor ? g.titleFor(kind === 'event' ? 'event' : 'reminder') : t.text;\n      var val = function (i, x) { var el = document.getElementById(i); if (el && x != null) el.value = x; };\n      var then = function (k, undoMade) {\n        var idx = -1; items.forEach(function (i, n) { if (String(i.id) === String(t.id)) idx = n; });\n        items = items.filter(function (i) { return String(i.id) !== String(t.id); }); save();\n        if (window.dbkUndo) window.dbkUndo(k === 'event' ? 'On the calendar, off the Back Burner' : 'Reminder added, off the Back Burner', function () {\n          try { undoMade(); } catch (e) {}\n          if (!items.some(function (i) { return String(i.id) === String(t.id); })) { items.splice(Math.min(Math.max(idx, 0), items.length), 0, t); save(); }\n        });\n      };\n      try {\n        if (kind === 'event') {\n          var rm = document.getElementById('calendarRepeatMode'); if (rm) rm.value = 'single';\n          if (typeof calendarShowAddForm === 'function') calendarShowAddForm();\n          val('calendarEventTitle', title); if (g.date) val('calendarEventDate', g.date); if (g.time) val('calendarEventTime', g.time);\n        } else {\n          if (typeof openAddReminderPopup === 'function') openAddReminderPopup();\n          val('addReminderTitle', title); if (g.date) val('addReminderDate', g.date);\n          if (g.freq) { val('addReminderFrequency', g.freq); if (g.dow != null) val('addReminderDayOfWeek', String(g.dow)); var wr = document.getElementById('addWeeklyDayRow'), dg = document.getElementById('addReminderDateGroup'); if (wr) wr.style.display = g.freq === 'weekly' ? '' : 'none'; if (dg) dg.style.display = g.freq === 'weekly' ? 'none' : ''; }\n        }\n        window.dbkFormThen = then;   // set after opening: opening a form clears it\n      } catch (e) {}\n    };\n    list.addEventListener('keydown', function (e) { if ((e.key === 'Enter' || e.key === ' ') && e.target.classList && e.target.classList.contains('dbk-later-words') && !e.target.querySelector('.dbk-later-live')) { e.preventDefault(); editIt(e.target.closest('li')); } });\n    list.addEventListener('click', function (e) {\n      var word = e.target.closest('.dbk-later-item:not(.done) .dbk-later-words');\n      if (word) { if (word.querySelector('.dbk-later-live')) return; e.preventDefault(); editIt(word.closest('li')); return; }\n      var cal = e.target.closest('.dbk-later-cal');\n      if (cal) { toCal(cal.closest('li').getAttribute('data-id')); return; }\n      var up = e.target.closest('.dbk-later-up');\n      if (up) { moveUp(up.closest('li').getAttribute('data-id')); return; }\n      var x = e.target.closest('.dbk-later-x'); if (!x) return;\n      var id = x.closest('li').getAttribute('data-id'), t = items.filter(function (i) { return String(i.id) === id; })[0];\n      // no \"are you sure?\" (Kasey, Oct 22): it goes at once, with Undo and Settings > Recently removed\n      if (!t) return;\n      Promise.resolve(true).then(function (ok) { if (!ok) return; var before = items.slice(); items = items.filter(function (i) { return String(i.id) !== id; }); if (window.dbkRemoved) window.dbkRemoved.track('Back Burner', KEY, before, items, { title: 'text' }); save(); if (window.dbkUndo) window.dbkUndo('Off the Back Burner', function () { if (!items.some(function (i) { return String(i.id) === id; })) { items.splice(Math.min(before.indexOf(t), items.length), 0, t); save(); } }); });   // Undo puts back only that one (a whole old copy undid the other device's change, Oct 23)\n    });\n    // the cloud copy and anything the inbox sent here\n    // (this replaces the first pull for later calls: same merge, never a straight swap that would drop\n    // what's only on this phone)\n    // ...and it starts the live listener too (overnight audit, Oct 23: the first pull is replaced before Firebase is\n    // ready, so the listener was never set up and the other device's changes only showed on coming back to the app)\n    var listen0 = pull;\n    pull = function () {\n      var fresh = jget(KEY, items); if (Array.isArray(fresh) && JSON.stringify(fresh) !== JSON.stringify(items)) { items = fresh; render(); }\n      try { if (window.db && !window.firebaseConfigEmpty && window.dbkRoleOk && window.dbkRoleOk() && typeof window.loadFromFirebaseLive === 'function') window.loadFromFirebaseLive(KEY).then(fromCloud, function () {}); } catch (e) {}\n      try { if (!listen0._l && window.db && window.firebaseReady && !window.firebaseConfigEmpty && window.dbkRoleOk && window.dbkRoleOk() && typeof window.setupFirebaseListener === 'function') { listen0._l = 1; window.setupFirebaseListener(KEY, fromCloud); } } catch (e) {}\n    };\n    if (window.dbkRemoved) window.dbkRemoved.on(function (k) { return k === KEY; }, function (k, back, idf) { if (window.dbkRemovedAddMissing(items, back, idf)) save(); return true; });\n    window.dbkLaterPull = function () { var fresh = jget(KEY, items); if (Array.isArray(fresh)) { items = fresh; render(); } };\n    window.addEventListener('firebaseReady', pull); window.addEventListener('dbk-show', pull); window.addEventListener('focus', pull);\n    window.addEventListener('storage', function (e) { if (e.key === KEY) window.dbkLaterPull(); });\n    setTimeout(pull, 2500);\n    var fromHash = function () {\n      if (location.hash !== '#later') return;\n      try { history.replaceState(null, '', '#today'); } catch (e) {}\n      try { window.dispatchEvent(new HashChangeEvent('hashchange')); } catch (e) {}\n      open(true); setTimeout(function () { document.getElementById('panelToday').scrollIntoView({ block: 'start', behavior: 'smooth' }); }, 120);\n    };\n    window.addEventListener('hashchange', fromHash); window.addEventListener('dbk-show', fromHash); setTimeout(fromHash, 300);\n    window.dbkOpenLater = function () { open(true); setTimeout(function () { body.scrollIntoView({ block: 'center', behavior: 'smooth' }); }, 80); };\n    render();\n  }\n\n  /* ---------- Today's sections: chosen and ordered in Settings; Today picks the change up when shown ---------- */\n  var SECTIONS = [['three', 'Today’s Three and Back Burner'], ['routine', 'Routine'], ['reminders', 'Reminder'], ['calendar', 'Calendar'], ['grocery', 'Grocery list']];\n  // the grocery list lives on Meals › Grocery; Today shows it only in copies without Meals\n  var groceryOnMeals = function () { var M = window.dbkModule; return !!(M && M.on && M.on('meals')); };\n  if (groceryOnMeals()) { SECTIONS = SECTIONS.filter(function (s) { return s[0] !== 'grocery'; }); try { document.documentElement.classList.add('dbk-groc-on-meals'); } catch (e) {} }\n  var EXTRAS = [['intention', 'Daily question'], ['weather', 'Weather'], ['moon', 'Moon']].filter(function (x) { return x[0] !== 'weather' || !document.documentElement.classList.contains('dbk-no-wx'); });\n  function todayOrder() {\n    var keys = SECTIONS.map(function (s) { return s[0]; }), o = jget('dashboardOrder', []);\n    if (!Array.isArray(o)) o = [];\n    o = o.filter(function (k) { return keys.indexOf(k) !== -1; }); keys.forEach(function (k) { if (o.indexOf(k) === -1) o.push(k); });\n    return o;\n  }\n  // what shows on Today is one of the shared settings: a change is sent to the cloud like the others,\n  // so the next cloud pull doesn't put the old choice back\n  function todaySync(keys) {\n    try { localStorage.setItem('_settingsLastSaved', String(Date.now())); } catch (e) {}\n    // named, so switching one back isn't taken for an old cloud copy and undone (dbkSettings in shared.js)\n    if (window.dbkSettings && window.dbkSettings.save) { try { window.dbkSettings.save(keys); } catch (e) {} }\n    else if (typeof window.syncSettingsToFirebase === 'function') { try { window.syncSettingsToFirebase(); } catch (e) {} }\n  }\n  function todaySettings() {\n    var box = document.getElementById('dbkTodaySet'); if (!box || box._dbk) return; box._dbk = 1;\n    var paint = function () {\n      var f = jget('dashboardFeatures', {}), order = todayOrder();\n      var row = function (k, label, i, n) {\n        var on = f[k] !== false;\n        return '<div class=\"dbk-set-row' + (on ? '' : ' off') + '\" data-k=\"' + k + '\"><label class=\"dbk-set-check\"><input type=\"checkbox\"' + (on ? ' checked' : '') + '><span>' + label + '</span></label>' +\n          (n ? '<span class=\"dbk-set-move\"><button type=\"button\" data-mv=\"-1\" aria-label=\"Move ' + label + ' up\"' + (i === 0 ? ' disabled' : '') + '>↑</button><button type=\"button\" data-mv=\"1\" aria-label=\"Move ' + label + ' down\"' + (i === n - 1 ? ' disabled' : '') + '>↓</button></span>' : '') + '</div>';\n      };\n      var names = {}; SECTIONS.forEach(function (s) { names[s[0]] = s[1]; });\n      box.innerHTML = '<p class=\"dbk-set-note\">Today, top to bottom</p>' +\n        order.map(function (k, i) { return row(k, names[k], i, order.length); }).join('') +\n        '<p class=\"dbk-set-note dbk-set-gap\">At the top, under the date</p>' +\n        EXTRAS.map(function (x) { return row(x[0], x[1]); }).join('');\n    };\n    paint();\n    box.addEventListener('change', function (e) {\n      var r = e.target.closest('.dbk-set-row'); if (!r) return;\n      var f = jget('dashboardFeatures', {}); f[r.getAttribute('data-k')] = e.target.checked;\n      try { localStorage.setItem('dashboardFeatures', JSON.stringify(f)); } catch (x) {}\n      r.classList.toggle('off', !e.target.checked);\n      todaySync(['dashboardFeatures']);\n    });\n    box.addEventListener('click', function (e) {\n      var b = e.target.closest('[data-mv]'); if (!b) return;\n      var k = b.closest('.dbk-set-row').getAttribute('data-k'), o = todayOrder(), i = o.indexOf(k), j = i + parseInt(b.getAttribute('data-mv'), 10);\n      if (j < 0 || j >= o.length) return;\n      o.splice(i, 1); o.splice(j, 0, k);\n      try { localStorage.setItem('dashboardOrder', JSON.stringify(o)); } catch (x) {}\n      todaySync(['dashboardOrder']);\n      paint();\n      var nb = box.querySelector('.dbk-set-row[data-k=\"' + k + '\"] [data-mv=\"' + b.getAttribute('data-mv') + '\"]'); if (nb && !nb.disabled) nb.focus();\n    });\n  }\n  function todayApply() {\n    if (page !== 'index.html') return;\n    // the reminder band always sits right before the calendar (with the calendar on, the due reminder is the calendar's\n    // first line and the band is hidden): Settings moves them as one piece, and an order saved before that (Reminder\n    // somewhere else) is read that way too. Nothing saved is changed.\n    if (typeof window.psdGetOrder === 'function' && !window.psdGetOrder._dbkPair) {\n      var og = window.psdGetOrder;\n      window.psdGetOrder = function () { var o = og.apply(this, arguments); if (!Array.isArray(o) || o.indexOf('calendar') === -1) return o; var out = []; o.forEach(function (k) { if (k === 'reminders') return; if (k === 'calendar') out.push('reminders'); out.push(k); }); return out; };\n      window.psdGetOrder._dbkPair = 1;\n      try { psdApplyOrder(); } catch (e) {}\n    }\n    var run = function () { try { psdApplyOrder(); psdApplyAll(); } catch (e) {} };\n    window.addEventListener('dbk-show', run); window.addEventListener('focus', run);\n    window.addEventListener('storage', function (e) { if (e.key === 'dashboardOrder' || e.key === 'dashboardFeatures') run(); });\n  }\n\n  /* ---------- Search: type in the capture bar and matches from across the app show above it ---------- */\n  var DREAMS = { 'restaurants': ['Restaurant', 'restaurants'], 'our-restaurants': ['Loved restaurant', 'restaurants'], 'places': ['Place to go', 'places'], 'our-places': ['Been there', 'places'],\n    'travel': ['Trip', 'travel'], 'our-travel': ['Been there', 'travel'], 'shows-movies': ['To watch', 'shows-movies'], 'our-shows-movies': ['Watched', 'shows-movies'], 'reading': ['Book', 'reading'] };\n  function names() { var n = jget('userNames', {}); return { person1: n.name1 || 'Person 1', person2: n.name2 || 'Person 2' }; }\n  function gather() {\n    var out = [], nm = names();\n    // nothing that is off, put away (Settings > What shows) or switched off on Today comes up\n    var M = window.dbkModule, feat = jget('dashboardFeatures', {}) || {}, meP = role === 'person2' ? 'p2' : 'p1';\n    var isAway = function (k) { return !!(M && M.archived && M.archived(k)); }, isOn = function (m) { return !M || M.on(m); };\n    var todayOn = function (k) { return feat[k] !== false; };\n    // (never what the other person keeps just for themselves: Settings > Sharing, dbk-sharing.js)\n    var SHR = window.dbkSharing, hid = function (a, x) { return !!(SHR && SHR.itemHidden && SHR.itemHidden(a, x)); };\n    // reminders and events as this phone last had them from the cloud (with its own unsent changes on top): the plain\n    // 'lifeReminders' / 'calendarEvents' copies are only written when THIS phone saves, so they missed the other\n    // phone's additions and still held what it deleted (overnight audit, Oct 24)\n    var cloudList = function (col) { var v; try { v = window.dbkSnapItems && window.dbkSnapItems(col); } catch (e) { v = undefined; } return Array.isArray(v) ? v : jget(col, []); };\n    if (todayOn('reminders')) cloudList('lifeReminders').forEach(function (r) { if (r && r.title && !hid('reminders', r)) out.push({ t: r.title, k: 'Reminder', a: { p: 'index.html', type: 'reminder', q: r.title } }); });\n    var today = new Date(); today.setHours(0, 0, 0, 0); var seen = {};\n    if (todayOn('calendar')) cloudList('calendarEvents').filter(function (e) { return e && e.title && e.date && !hid('calendar', e); })\n      .sort(function (a, b) { var da = Math.abs(new Date(a.date + 'T12:00') - today), db = Math.abs(new Date(b.date + 'T12:00') - today); return da - db; })\n      .forEach(function (e) { var key = e.title.toLowerCase(); if (seen[key]) return; seen[key] = 1; var d = new Date(e.date + 'T12:00'); out.push({ t: e.title, k: 'Calendar', s: d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }), a: { p: 'index.html', type: 'day', date: e.date } }); });\n    var away = function (sec) { return !isOn(sec === 'travel' ? 'travel' : 'us') || isAway('page:us') || isAway('us:' + sec); };\n    Object.keys(DREAMS).forEach(function (cat) { if (away(DREAMS[cat][1])) return; jget(window.dbkSharing ? window.dbkSharing.localKey(cat) : 'dreams_' + cat, []).forEach(function (d) { if (d && d.title && !(window.dbkSharing && window.dbkSharing.listHidden && window.dbkSharing.listHidden(cat, d))) out.push({ t: d.title, k: DREAMS[cat][0], a: { p: 'our-dreams.html', type: 'dream', sec: DREAMS[cat][1], cat: cat, id: d.firebaseId } }); }); });\n    // lists people made themselves (Lists > + New list): their things are found too, under the list's name\n    if (!isAway('page:us') && isOn('us')) jget('dreams_custom-lists', []).forEach(function (L) { if (!L || !L.title || !/^cl-[a-z0-9-]+$/.test(L.key || '')) return; jget('dreams_' + L.key, []).forEach(function (d) { if (d && d.title) out.push({ t: d.title, k: L.title, a: { p: 'our-dreams.html', type: 'dream', sec: L.key, cat: L.key, id: d.firebaseId } }); }); });\n    if (!away('wishlists')) ['person1', 'person2'].filter(function (p) { return !(window.dbkSharing && window.dbkSharing.hidden(p + '-wishlist')); }).forEach(function (p) { jget('dreams_' + p + '-wishlist', []).forEach(function (d) { if (d && d.title) out.push({ t: d.title, k: nm[p] + '’s wishlist', a: { p: 'our-dreams.html', type: 'dream', sec: 'wishlists', cat: p + '-wishlist', id: d.firebaseId } }); }); });\n    if (todayOn('three')) jget('futureTodos_' + role, []).forEach(function (t) { if (t && t.text) out.push({ t: t.text, k: 'Back Burner', a: { p: 'index.html', type: 'later' } }); });\n    jget('capturedThoughts_' + role, []).forEach(function (t) { if (t && t.text) out.push({ t: t.text, k: 'Inbox', a: { p: 'index.html', type: 'inbox', q: t.text } }); });\n    var res = (!M || M.forPerson('habits', meP)) && !isAway('page:habits') && !isAway('hub:resources') ? jget('resources_' + role, {}) : {}; Object.keys(res || {}).forEach(function (c) { (res[c] || []).forEach(function (r) { if (r && r.title) out.push({ t: r.title, k: 'Habit resource', a: { p: role + '-hub.html', type: 'hash', h: '#resources' } }); }); });\n    // (a recipe the other person now keeps just for themselves isn't found, though this phone's list of names is older)\n    var recs = jget('mealplan_recipes', null), recOk = null;\n    if (Array.isArray(recs) && recs.length) { recOk = {}; recs.forEach(function (r) { if (r && r.name && !hid('recipes', r)) recOk[String(r.name).trim()] = 1; }); }\n    if (isOn('meals') && !isAway('page:meals') && !isAway('meals:recipes')) jget('dbkIdx_recipes', []).forEach(function (n) { if (recOk && !recOk[String(n).trim()]) return; out.push({ t: n, k: 'Recipe', a: { p: 'meal-plan.html', type: 'recipe', name: n } }); });\n    return out;\n  }\n  function norm(s) { return String(s || '').toLowerCase().normalize('NFD').replace(/[̀-ͯ]/g, ''); }\n  /* How the search matches (Kasey, Oct 23: typing \"need to\" brought up things that only had \"need\" and a \"to\" somewhere,\n     even inside another word): each word typed has to begin a word of the name (\"bo\" finds \"Book club\", not \"Jumbo\"),\n     small words (to, the, a, of…) only count as part of the whole phrase, and names that start with what was typed come\n     first, then ones with the whole phrase, then the rest. Returns a score (lower is better) or -1. Add-ons use it too. */\n  var SMALL = { a: 1, an: 1, the: 1, to: 1, of: 1, for: 1, and: 1, or: 1, in: 1, on: 1, at: 1, my: 1, i: 1, is: 1, it: 1, with: 1, from: 1, by: 1 };\n  function starts(t, w) { var i = t.indexOf(w); while (i !== -1) { if (i === 0 || !/[a-z0-9]/.test(t.charAt(i - 1))) return true; i = t.indexOf(w, i + 1); } return false; }\n  function matchScore(text, q) {\n    var t = norm(text); q = norm(q).trim().replace(/\\s+/g, ' '); if (q.length < 2 || !t) return -1;\n    var all = q.split(' '), words = all.filter(function (w) { return !SMALL[w]; }); if (!words.length) words = all;\n    var phrase = starts(t, q);\n    if (!phrase && !words.every(function (w) { return starts(t, w); })) return -1;\n    return (t.indexOf(q) === 0 ? 0 : phrase ? 1 : 2) + t.length / 400;\n  }\n  window.dbkSearchMatch = matchScore;\n  function find(q) {\n    q = norm(q).trim(); if (q.length < 2) return [];\n    var seen = {};\n    return gather().map(function (it) {\n      var sc = matchScore(it.t, q); if (sc < 0) return null;\n      it.score = sc; return it;\n    }).filter(Boolean).sort(function (a, b) { return a.score - b.score; }).filter(function (it) { var k = it.k + '|' + norm(it.t); if (seen[k]) return false; seen[k] = 1; return true; }).slice(0, 8);\n  }\n  // pages remember their own long lists, so search can find them from anywhere\n  function indexPage() {\n    var grab = function (key, sel) {\n      var names = [], seen = {};\n      document.querySelectorAll(sel).forEach(function (el) { var n = (el.textContent || '').trim(); if (n && !seen[n]) { seen[n] = 1; names.push(n); } });\n      if (names.length) try { if (localStorage.getItem(key) !== JSON.stringify(names)) localStorage.setItem(key, JSON.stringify(names)); } catch (e) {}\n    };\n    var keep = function (key, list) {\n      var names = [], seen = {};\n      (list || []).forEach(function (x) { var n = x && (x.name || x.title); n = n && String(n).trim(); if (n && !seen[n]) { seen[n] = 1; names.push(n); } });\n      if (names.length) try { if (localStorage.getItem(key) !== JSON.stringify(names)) localStorage.setItem(key, JSON.stringify(names)); } catch (e) {}\n      return names.length;\n    };\n    if (page === 'meal-plan.html') { var r = function () { var n = 0; try { n = keep('dbkIdx_recipes', typeof recipeBank !== 'undefined' ? recipeBank : null); } catch (e) {} if (!n) grab('dbkIdx_recipes', '.rb-card-name'); }; setTimeout(r, 1500); setTimeout(r, 4000); setInterval(r, 15000); }\n  }\n  function setSearch(id, q) {\n    var el = document.getElementById(id); if (!el) return false;\n    el.value = q; el.dispatchEvent(new Event('input', { bubbles: true })); return true;\n  }\n  function run(a) {\n    var tries = 0, t = setInterval(function () {\n      tries++; var done = false;\n      try {\n        if (a.type === 'reminder') { if (typeof openReminderModal === 'function') { openReminderModal(); setTimeout(function () { setSearch('reminderSearch', a.q); }, 120); done = true; } }\n        // an event: Today's calendar shows its day (the old day pop-up, with its own older edit form, is no longer used)\n        else if (a.type === 'day') {\n          var hmE = document.getElementById('hmEvents');\n          if (window.dbkHmShow && hmE) { window.dbkHmShow(a.date); var cs = document.getElementById('calendarSection') || hmE; try { cs.scrollIntoView({ block: 'start', behavior: 'smooth' }); } catch (e) {} done = true; }\n          else if (typeof openDayModal === 'function' && tries > 10) { openDayModal(new Date(a.date + 'T12:00')); done = true; }\n        }\n        else if (a.type === 'later') { if (window.dbkOpenLater) { window.dbkOpenLater(); done = true; } }\n        else if (a.type === 'inbox') { if (typeof openInbox === 'function') { openInbox(); setTimeout(function () { setSearch('inboxSearchInput', a.q); }, 120); done = true; } }\n        else if (a.type === 'dream') {\n          if (typeof switchToSection === 'function') {\n            switchToSection(a.sec); done = true;\n            if (a.id && a.cat && typeof openDetail === 'function') setTimeout(function () { try { openDetail(a.cat, a.id); } catch (e) {} }, 300);\n          }\n        }\n        else if (a.type === 'recipe') {\n          var card = [].filter.call(document.querySelectorAll('.rb-card-name'), function (el) { return el.textContent.trim() === a.name; })[0];\n          if (card && card.offsetParent) { card.click(); done = true; }\n          else if (tries > 6 && setSearch('rb-search', a.name)) done = true;\n        }\n        else done = true;\n      } catch (e) { done = true; }\n      if (done || tries > 30) clearInterval(t);\n    }, 120);\n  }\n  function hashFor(a) { return a.type === 'recipe' ? '#recipes' : a.type === 'hash' ? a.h : a.p === 'index.html' ? '#today' : ''; }\n  function open(a) {\n    if (a.p === page) { var h = hashFor(a); if (h && location.hash !== h) location.hash = h; run(a); return; }\n    try { localStorage.setItem('dbkFind', JSON.stringify({ a: a, at: Date.now() })); } catch (e) {}\n    go(a.p + hashFor(a));\n  }\n  function pickUp() {\n    var f = jget('dbkFind', null); if (!f || !f.a || f.a.p !== page) return;\n    try { localStorage.removeItem('dbkFind'); } catch (e) {}\n    if (Date.now() - f.at > 15000) return;\n    run(f.a);\n  }\n  function searchBar() {\n    var input = document.getElementById('captureInput'); if (!input || input._dbkFind) return; input._dbkFind = 1;\n    var bar = document.getElementById('captureBar') || input.closest('.capture-sticky-bar') || input.parentNode;\n    var box = document.createElement('div'); box.id = 'dbkFind'; box.className = 'dbk-find'; box.setAttribute('role', 'listbox'); box.hidden = true;\n    // the results ride on top of the capture bar itself, so they stay right above it even with the keyboard up\n    bar.appendChild(box);\n    var results = [], place = function () {};\n    var paint = function () {\n      results = find(input.value);\n      if (!results.length || document.activeElement !== input) { box.hidden = true; return; }\n      box.innerHTML = '<div class=\"dbk-find-card\">' + results.map(function (it, i) {\n        return '<button type=\"button\" role=\"option\" data-i=\"' + i + '\"><span class=\"dbk-find-t\">' + esc(it.t) + '</span><span class=\"dbk-find-k\">' + esc(it.k) + (it.s ? ' · ' + esc(it.s) : '') + '</span></button>';\n      }).join('') + '<div class=\"dbk-find-hint\">Press return to save it as a thought instead</div></div>';\n      place(); box.hidden = false;\n    };\n    var t = null;\n    input.addEventListener('input', function () { clearTimeout(t); t = setTimeout(paint, 90); });\n    input.addEventListener('focus', function () { if (input.value) paint(); });\n    input.addEventListener('blur', function () { setTimeout(function () { if (!box.contains(document.activeElement)) box.hidden = true; }, 350); });\n    input.addEventListener('keydown', function (e) { if (e.key === 'Enter' || e.key === 'Escape') box.hidden = true; });\n    // pick a result on the first touch, before the keyboard closing can hide the list\n    var pick = function (e) {\n      var b = e.target.closest('button[data-i]'); if (!b) return;\n      e.preventDefault();\n      var it = results[+b.getAttribute('data-i')]; box.hidden = true; input.value = ''; input.blur();\n      if (it) open(it.a);\n    };\n    box.addEventListener('pointerdown', function (e) { if (e.pointerType === 'mouse' && e.button !== 0) return; pick(e); });\n    box.addEventListener('mousedown', function (e) { e.preventDefault(); });\n    box.addEventListener('click', function (e) { e.preventDefault(); });\n    window.addEventListener('resize', function () { if (!box.hidden) place(); });\n    if (window.visualViewport) window.visualViewport.addEventListener('resize', function () { if (!box.hidden) place(); });\n    input.setAttribute('placeholder', 'capture or search...');\n  }\n\n  /* ---------- a pop-up that has more to scroll shows a soft edge on that side, so nothing looks cut off (the designer,\n     Oct 20: with the keyboard up the trip pop-ups looked sliced at the top and bottom). daybook-theme.css \"SOFT EDGES\" ---------- */\n  function softEdges() {\n    var SEL = '.tp-sheet, .tp-pop';\n    var run = function () {\n      [].forEach.call(document.querySelectorAll(SEL), function (el) {\n        if (!el.getClientRects().length) return;\n        var more = (el.scrollTop > 2 ? 'up ' : '') + (el.scrollHeight - el.clientHeight - el.scrollTop > 2 ? 'down' : '');\n        more = more.trim();\n        if (el.getAttribute('data-dbk-more') !== more) { if (more) el.setAttribute('data-dbk-more', more); else el.removeAttribute('data-dbk-more'); }\n      });\n    };\n    var queued = false, kick = function () { if (queued) return; queued = true; requestAnimationFrame(function () { queued = false; try { run(); } catch (e) {} }); };\n    document.addEventListener('scroll', kick, true);\n    window.addEventListener('resize', kick); window.addEventListener('dbk-viewport', kick);\n    new MutationObserver(kick).observe(document.body, { childList: true, subtree: true, characterData: true });\n    document.addEventListener('input', kick, true);\n    kick();\n  }\n\n  /* ---------- What's in Season: say what's been added, and a Done to finish ---------- */\n  function seasonFoot() {\n    if (page !== 'meal-plan.html') return;\n    var body = document.getElementById('seasonal-modal-body'), note = document.getElementById('dbkSeasonNote'), done = document.getElementById('dbkSeasonDone');\n    if (!body || !note) return;\n    var paint = function () {\n      var n = body.querySelectorAll('.seasonal-pill-add.seasonal-added').length;\n      note.textContent = n ? n + (n === 1 ? ' thing' : ' things') + ' from this month on your grocery list' : '';\n      done.hidden = !n;\n    };\n    body.addEventListener('click', function () { setTimeout(paint, 60); setTimeout(paint, 400); });\n    new MutationObserver(function () { setTimeout(paint, 30); }).observe(body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class'] });\n    paint();\n  }\n\n  /* ---------- Weather and moon pop-ups (option B): the day ahead, and the cycle ---------- */\n  function infoPop(cls, html) {\n    var old = document.querySelector('.dbk-infopop'); if (old) old.remove();\n    var o = document.createElement('div'); o.className = 'dbk-infopop';\n    o.style.cssText = 'position:fixed;inset:0;z-index:99999;display:flex;justify-content:center;';\n    o.innerHTML = '<div class=\"dbk-infocard ' + cls + '\" role=\"dialog\" aria-modal=\"true\"><button type=\"button\" class=\"dbk-info-x\" aria-label=\"Close\">&times;</button>' + html + '</div>';\n    var close = function () { o.remove(); document.removeEventListener('keydown', esc); };\n    var esc = function (e) { if (e.key === 'Escape') close(); };\n    o.addEventListener('click', function (e) { if (e.target === o || e.target.closest('.dbk-info-x')) close(); });\n    document.addEventListener('keydown', esc);\n    document.body.appendChild(o);\n    return o;\n  }\n  function moonSvg(frac, size) {\n    var s = size, r = s / 2 - 1, c = s / 2, il = (1 - Math.cos(2 * Math.PI * frac)) / 2;\n    var o = '<svg width=\"' + s + '\" height=\"' + s + '\" viewBox=\"0 0 ' + s + ' ' + s + '\" aria-hidden=\"true\"><circle cx=\"' + c + '\" cy=\"' + c + '\" r=\"' + r + '\" fill=\"rgba(var(--info-ink),0.12)\" stroke=\"rgba(var(--info-ink),0.28)\" stroke-width=\"0.6\"/>';\n    if (il >= 0.98) return o + '<circle cx=\"' + c + '\" cy=\"' + c + '\" r=\"' + r + '\" fill=\"var(--info-moon)\"/></svg>';\n    if (il > 0.02) {\n      var wax = frac < 0.5, tx = Math.max(0.1, r * Math.abs(2 * il - 1)), sw = wax ? (il <= 0.5 ? 0 : 1) : (il <= 0.5 ? 1 : 0);\n      o += '<path d=\"M ' + c + ' ' + (c - r) + ' A ' + r + ' ' + r + ' 0 0 ' + (wax ? 1 : 0) + ' ' + c + ' ' + (c + r) + ' A ' + tx + ' ' + r + ' 0 0 ' + sw + ' ' + c + ' ' + (c - r) + ' Z\" fill=\"var(--info-moon)\"/>';\n    }\n    return o + '</svg>';\n  }\n  // a different note every day: several for each phase (they rotate day by day), plus a line for the sign the moon is in\n  var MOON_NOTES = {\n    \"New Moon\": [\"Write down one thing you want this month to hold. One line is plenty.\", \"Pick the habit you most want to grow this month and put it on today’s list.\", \"Start something small today: ten minutes, one page, one call.\", \"Clear one surface, a counter or a desk, so the month starts with room.\", \"Look at next week’s calendar and protect one quiet evening.\", \"Choose a word for this month. Let it decide the small things.\", \"Plan one thing you’d be glad to have done by the full moon.\"],\n    \"Waxing Crescent\": [\"Give the new thing ten minutes today, even if it’s rough.\", \"Gather what you need for this month’s plan: a list, a tool, a person to ask.\", \"Say yes to the next small step, not the whole project.\", \"Tell one person what you’re starting. It’s easier to keep going.\", \"Do the easy part first today and let it carry you into the rest.\", \"Show up again today. Doing it twice in a row is how it sticks.\", \"Put tomorrow’s first task where you’ll see it in the morning.\"],\n    \"First Quarter\": [\"Make the decision you’ve been putting off. A good choice now beats a perfect one later.\", \"Do the hardest thing on today’s list before lunch.\", \"Something will push back today. Give it one more honest try, then ask for help.\", \"Pick one task and finish it all the way before starting another.\", \"If a plan isn’t working, change one piece of it today instead of starting over.\", \"Send the message or make the call you’ve been avoiding.\", \"Halfway point: look at what you started at the new moon and choose what to keep.\"],\n    \"Waxing Gibbous\": [\"Check in with your plans and trim what isn’t needed.\", \"Look at what’s working and do a little more of it today.\", \"Polish one thing instead of starting something new.\", \"Fix the small annoyance you keep stepping around.\", \"Ask someone for feedback on what you’ve been working on.\", \"The last stretch takes the longest. Keep the pace, not the pressure.\", \"Tidy the details today so the finish feels easy.\"],\n    \"Full Moon\": [\"Notice how far you’ve come since the new moon. Write one sentence about it.\", \"Celebrate one win out loud today, however small.\", \"Feelings can run high around now. Give yourself and others extra patience.\", \"Let one worry go tonight. Write it down, then close the notebook.\", \"Gather the people you love, even for a few minutes.\", \"Take a slow walk after dark and look up.\", \"Say thank you to someone who helped this month.\"],\n    \"Waning Gibbous\": [\"Pass something on today: a recipe, a tip, a kind word.\", \"Write down one thing this month taught you.\", \"Share the load. Ask for help with one thing, offer help with another.\", \"Enjoy something you built this month instead of adding to it.\", \"Give away one thing you no longer use.\", \"Tell someone what you appreciate about how they handled this month.\", \"Slow down one routine today and actually enjoy it.\"],\n    \"Last Quarter\": [\"Clear out one drawer, one inbox or one backlog.\", \"Finish it or drop it: pick one half-done thing and decide today.\", \"Forgive a slip from this month and start fresh tomorrow.\", \"Cancel or skip one thing that drains you this week.\", \"Make room for what’s next: clear the counter, the calendar or the list.\", \"Say no to one thing so you can say yes to something better.\", \"Look at what didn’t get done and move it to a real day, or let it go.\"],\n    \"Waning Crescent\": [\"Go to bed a little early tonight.\", \"Keep today simple. Do the basics and call it enough.\", \"Rest is part of the plan, not a break from it.\", \"Think about what you want the next new moon to bring. No list yet.\", \"A quiet evening at home is a fine plan.\", \"Let the week wind down without catching up on everything.\", \"Do one kind thing for yourself today, on purpose.\"]\n  };\n  function moonNote(name, d) { var l = MOON_NOTES[name]; if (!l) return ''; var day = Math.floor((d.getTime() - d.getTimezoneOffset() * 60000) / 864e5); return l[day % l.length]; }\n  var MOON_MEAN = {};   // (kept for anything that still reads it)\n  window.dbkMoonPop = function () {\n    var w = window._moonDetail; if (!w || !window.dbkMoonAge) return;\n    var SYN = 29.530588861, now = new Date(), noon = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 12), ageNow = window.dbkMoonAge(noon);\n    var names = ['New moon', 'Waxing crescent', 'First quarter', 'Waxing gibbous', 'Full moon', 'Waning gibbous', 'Last quarter', 'Waning crescent'];\n    // the marked phase is the one the title names (counting from the age gave the neighbouring phase near a change)\n    var cur = names.map(function (n) { return n.toLowerCase(); }).indexOf(String(w.name || '').toLowerCase());\n    if (cur < 0) cur = Math.floor((ageNow / SYN) * 8 + 0.5) % 8;\n    var nextFull = null, nextNew = null;\n    // the next full and new moon: the first on or after today, in the household's time zone (dbk-moon.js)\n    if (window.dbkMoon) { var mn = window.dbkMoon(now); nextFull = mn.nextFull; nextNew = mn.nextNew; }\n    for (var i = 1; i < 40 && (!nextFull || !nextNew); i++) {\n      var a0 = window.dbkMoonAge(new Date(noon.getTime() + (i - 1) * 864e5)), d1 = new Date(noon.getTime() + i * 864e5), a1 = window.dbkMoonAge(d1);\n      if (!nextFull && a0 < SYN / 2 && a1 >= SYN / 2) nextFull = d1;\n      if (!nextNew && a1 < a0) nextNew = d1;\n    }\n    var tzo = {}; try { var tz0 = localStorage.getItem('timezone'); if (tz0) tzo.timeZone = tz0; } catch (e) {}\n    var fmt = function (d) { if (!d) return ''; try { return d.toLocaleDateString('en-US', Object.assign({ month: 'short', day: 'numeric' }, tzo)); } catch (e) { return d.toLocaleDateString('en-US', { month: 'short', day: 'numeric' }); } };\n    var row = ''; for (var p = 0; p < 8; p++) row += '<div' + (p === cur ? ' class=\"now\" aria-current=\"true\"' : '') + ' title=\"' + names[p] + '\">' + moonSvg(p / 8, 28) + '<i></i></div>';\n    infoPop('dbk-moonB',\n      '<h3 class=\"dbk-info-title\">' + w.name + '</h3><p class=\"dbk-info-sub\">' + w.illum + '% lit</p>' +\n      '<div class=\"dbk-phases\" aria-label=\"This month’s moon phases, today marked\">' + row + '</div>' +\n      '<p class=\"dbk-info-quote\">' + esc(moonNote(w.name, new Date())) + '</p>' +\n      // three facts side by side, each with its label right under it (they sat at opposite edges before)\n      '<div class=\"dbk-moon-trio\"><div><b>' + w.sign.sign + '</b><small>Moon in</small></div><div><b>' + fmt(nextFull) + '</b><small>Full moon</small></div><div><b>' + fmt(nextNew) + '</b><small>New moon</small></div></div>');\n  };\n  function wxIcon(code, day) {\n    var g = 'fill=\"currentColor\"';\n    var cloud = '<path d=\"M7 17C5.3 17 4 15.8 4 14.3c0-1.4 1.1-2.6 2.6-2.7C7 9.5 8.9 8 11 8c1.9 0 3.6 1.2 4.2 3 .2 0 .5-.1.8-.1 1.9 0 3.5 1.4 3.5 3.1S17.9 17 16 17H7Z\" ' + g + ' opacity=\"0.72\"/>';\n    if (code === 0 || code === 1) return day ? '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"4.5\" ' + g + ' opacity=\"0.8\"/><g stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" opacity=\"0.8\"><path d=\"M12 2.5V5M12 19v2.5M2.5 12H5M19 12h2.5M5.3 5.3 7 7M17 17l1.7 1.7M5.3 18.7 7 17M17 7l1.7-1.7\"/></g></svg>'\n      : '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M15.5 4.5a8 8 0 1 0 4 12 6.5 6.5 0 0 1-4-12Z\" ' + g + ' opacity=\"0.75\"/></svg>';\n    if (code <= 3) return '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">' + (day ? '<circle cx=\"8.5\" cy=\"8\" r=\"3.3\" ' + g + ' opacity=\"0.5\"/>' : '<path d=\"M9.5 3.5a4.5 4.5 0 1 0 3.2 7.7 3.6 3.6 0 0 1-3.2-7.7Z\" ' + g + ' opacity=\"0.5\"/>') + cloud + '</svg>';\n    if (code <= 48) return '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><g stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" opacity=\"0.75\"><path d=\"M4 8h16M6 12h12M4 16h16\"/></g></svg>';\n    if (code <= 67 || (code >= 80 && code <= 82)) return '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M7 14C5.3 14 4 12.8 4 11.3c0-1.4 1.1-2.6 2.6-2.7C7 6.5 8.9 5 11 5c1.9 0 3.6 1.2 4.2 3 .2 0 .5-.1.8-.1 1.9 0 3.5 1.4 3.5 3.1S17.9 14 16 14H7Z\" ' + g + ' opacity=\"0.72\"/><g stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" opacity=\"0.75\"><path d=\"M9 17l-1 3M13 17l-1 3M17 17l-1 3\"/></g></svg>';\n    if (code <= 77 || code === 85 || code === 86) return '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">' + cloud + '<g ' + g + ' opacity=\"0.75\"><circle cx=\"9\" cy=\"20\" r=\"1\"/><circle cx=\"13\" cy=\"21\" r=\"1\"/><circle cx=\"17\" cy=\"20\" r=\"1\"/></g></svg>';\n    return '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\">' + cloud + '<path d=\"M13 15l-2 3.5h3L12 22\" stroke=\"currentColor\" stroke-width=\"1.4\" fill=\"none\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>';\n  }\n  /* ---------- Weather: everything comes from the US National Weather Service (api.weather.gov) ----------\n     Public domain, free, no key, asked straight from this browser with the household's own saved location.\n     Nothing goes through our servers. Outside the US the NWS has no forecast, so the weather simply isn't shown.\n     window.dbkNWS.load(loc) → { hourly:[…], now:{…}, hi, lo, pop, tz, city } or { outside: true } (or throws). */\n  var NWS = 'https://api.weather.gov', NWS_H = { headers: { Accept: 'application/geo+json' } };\n  function nwsGet(url, point) {\n    return fetch(url, NWS_H).then(function (r) {\n      if (point && r.status === 404) { var e = new Error('404'); e.outside = true; throw e; }\n      if (!r.ok) throw new Error(r.status); return r.json();\n    });\n  }\n  // NWS picture names (\"…/icons/land/day/tsra_hi,40?size=small\") and short forecasts → the app's weather codes\n  var NWS_CODE = { skc: 0, few: 1, sct: 2, bkn: 3, ovc: 3, fog: 45, haze: 45, smoke: 45, dust: 45, rain: 61, rain_showers: 80, rain_showers_hi: 80,\n    fzra: 67, rain_fzra: 67, snow_fzra: 67, sleet: 67, rain_sleet: 67, snow_sleet: 73, rain_snow: 73, snow: 73, blizzard: 75,\n    tsra: 95, tsra_sct: 95, tsra_hi: 95, tornado: 95, hurricane: 95, tropical_storm: 95, hot: 0, cold: 0 };\n  function nwsCode(icon, text) {\n    var m = /\\/(?:day|night)\\/([a-z_]+)/.exec(String(icon || ''));\n    if (m) { var k = m[1].replace(/^wind_/, ''); if (k in NWS_CODE) return NWS_CODE[k]; }\n    var t = String(text || '').toLowerCase();\n    if (/thunder|t-storm|tstorm/.test(t)) return 95;\n    if (/snow|flurr|blizzard/.test(t)) return 73;\n    if (/sleet|freezing|ice/.test(t)) return 67;\n    if (/shower/.test(t)) return 80;\n    if (/rain|drizzle/.test(t)) return 61;\n    if (/fog|haze|smoke|dust|mist/.test(t)) return 45;\n    if (/overcast|mostly cloudy|cloudy/.test(t)) return 3;\n    if (/partly|mostly sunny|mostly clear/.test(t)) return 2;\n    return 0;\n  }\n  function nwsNum(q) { return q && typeof q.value === 'number' ? q.value : null; }\n  function nwsMph(s) { var m = /(\\d+)(?:\\s*to\\s*(\\d+))?/.exec(String(s || '')); return m ? +(m[2] || m[1]) : null; }\n  // sunrise and sunset from the NOAA solar calculator's formula, worked out on the phone\n  function nwsSun(lat, lon, day) {\n    var rad = Math.PI / 180, jd = Date.UTC(day.getFullYear(), day.getMonth(), day.getDate(), 12) / 864e5 + 2440587.5 - lon / 360;\n    var t = (jd - 2451545) / 36525;\n    var L0 = (280.46646 + t * (36000.76983 + t * 0.0003032)) % 360, M = 357.52911 + t * (35999.05029 - 0.0001537 * t);\n    var e = 0.016708634 - t * (0.000042037 + 0.0000001267 * t);\n    var C = Math.sin(M * rad) * (1.914602 - t * (0.004817 + 0.000014 * t)) + Math.sin(2 * M * rad) * (0.019993 - 0.000101 * t) + Math.sin(3 * M * rad) * 0.000289;\n    var om = 125.04 - 1934.136 * t, lam = L0 + C - 0.00569 - 0.00478 * Math.sin(om * rad);\n    var eps = 23 + (26 + (21.448 - t * (46.815 + t * (0.00059 - t * 0.001813))) / 60) / 60 + 0.00256 * Math.cos(om * rad);\n    var dec = Math.asin(Math.sin(eps * rad) * Math.sin(lam * rad)) / rad;\n    var y = Math.pow(Math.tan(eps / 2 * rad), 2);\n    var eq = 4 / rad * (y * Math.sin(2 * L0 * rad) - 2 * e * Math.sin(M * rad) + 4 * e * y * Math.sin(M * rad) * Math.cos(2 * L0 * rad) - 0.5 * y * y * Math.sin(4 * L0 * rad) - 1.25 * e * e * Math.sin(2 * M * rad));\n    var cosH = (Math.cos(90.833 * rad) - Math.sin(lat * rad) * Math.sin(dec * rad)) / (Math.cos(lat * rad) * Math.cos(dec * rad));\n    if (cosH > 1 || cosH < -1) return null;   // the sun doesn't rise or doesn't set today (far north)\n    var H = Math.acos(cosH) / rad, noon = 720 - 4 * lon - eq, base = Date.UTC(day.getFullYear(), day.getMonth(), day.getDate());\n    return { rise: new Date(base + (noon - 4 * H) * 60e3), set: new Date(base + (noon + 4 * H) * 60e3) };\n  }\n  // \"7:12am\" in the forecast place's own time zone\n  function nwsClock(d, tz) {\n    try { var s = d.toLocaleTimeString('en-US', { hour: 'numeric', minute: '2-digit', timeZone: tz || undefined }); return s.replace(/\\s*([AP])M$/i, function (_, a) { return a.toLowerCase() + 'm'; }); }\n    catch (e) { var h = d.getHours(), m = d.getMinutes(); return (h % 12 || 12) + ':' + ('0' + m).slice(-2) + (h < 12 ? 'am' : 'pm'); }\n  }\n  var NWS_MEM = { key: '', at: 0, p: null };\n  // the forecast office and grid for a place never change, so that first answer is kept for the location\n  // (and \"not covered\" too); resolves { outside: 1 } outside the US\n  function nwsPoint(loc, slot) {\n    var key = (+loc.lat).toFixed(4) + ',' + (+loc.lon).toFixed(4), SK = slot === 2 ? 'dbkNwsPoint2' : 'dbkNwsPoint';\n    var pt = null; try { var c = JSON.parse(localStorage.getItem(SK) || 'null'); if (c && c.key === key) pt = c; } catch (e) {}\n    var getPoint = pt ? Promise.resolve(pt) : nwsGet(NWS + '/points/' + key, true).then(function (j) {\n      var p = (j && j.properties) || {}, rl = (p.relativeLocation && p.relativeLocation.properties) || {};\n      if (!p.forecastHourly) { var e = new Error('no forecast'); e.outside = true; throw e; }\n      var o = { key: key, hourly: p.forecastHourly, daily: p.forecast, stations: p.observationStations, tz: p.timeZone || '', city: rl.city || '', state: rl.state || '' };\n      try { localStorage.setItem(SK, JSON.stringify(o)); } catch (e) {}\n      return o;\n    }, function (e) {\n      if (e && e.outside) { var o = { key: key, outside: 1 }; try { localStorage.setItem(SK, JSON.stringify(o)); } catch (x) {} return o; }\n      throw e;\n    });\n    return getPoint.then(function (pt) { if (slot !== 2) { try { window.dbkWxMark(); } catch (e) {} } return pt; });\n  }\n  function nwsLoad(loc, slot) {\n    var key = (+loc.lat).toFixed(4) + ',' + (+loc.lon).toFixed(4);\n    if (NWS_MEM.key === key && NWS_MEM.p && Date.now() - NWS_MEM.at < 10 * 60e3) return NWS_MEM.p;\n    var p = nwsPoint(loc, slot).then(function (pt) {\n      if (pt.outside) return { outside: true };\n      var obs = pt.stations ? fetch(pt.stations + '?limit=1', NWS_H).then(function (r) { return r.ok ? r.json() : null; }).then(function (s) {\n        var f = s && s.features && s.features[0], id = f && f.properties && f.properties.stationIdentifier;\n        return id ? fetch(NWS + '/stations/' + id + '/observations/latest', NWS_H).then(function (r) { return r.ok ? r.json() : null; }) : null;\n      }).catch(function () { return null; }) : Promise.resolve(null);\n      return Promise.all([nwsGet(pt.hourly), nwsGet(pt.daily).catch(function () { return null; }), obs]).then(function (r) {\n        var now = Date.now(), per = (r[0] && r[0].properties && r[0].properties.periods) || [];\n        var hourly = per.map(function (x) {\n          var ms = Date.parse(x.startTime), tF = x.temperatureUnit === 'C' ? x.temperature * 9 / 5 + 32 : x.temperature;\n          return { t: String(x.startTime).slice(0, 16), ms: ms, temp: Math.round(tF), code: nwsCode(x.icon, x.shortForecast), day: x.isDaytime ? 1 : 0,\n            pop: nwsNum(x.probabilityOfPrecipitation) || 0, hum: nwsNum(x.relativeHumidity), wind: nwsMph(x.windSpeed), desc: x.shortForecast || '' };\n        }).filter(function (h) { return h.ms + 3600e3 > now; });\n        if (!hourly.length) throw new Error('no hours');\n        var h0 = hourly[0], cur = { temp: h0.temp, code: h0.code, isDay: h0.day, feels: h0.temp, humidity: h0.hum, wind: h0.wind, desc: h0.desc };\n        // the nearest station's latest reading, when it's recent and complete, is \"now\"\n        var o = r[2] && r[2].properties;\n        if (o && nwsNum(o.temperature) !== null && now - Date.parse(o.timestamp) < 2 * 3600e3) {\n          var c2f = function (c) { return Math.round(c * 9 / 5 + 32); }, fl = nwsNum(o.heatIndex) !== null ? o.heatIndex.value : nwsNum(o.windChill);\n          var ws = nwsNum(o.windSpeed);\n          cur.temp = c2f(o.temperature.value); cur.feels = fl !== null ? c2f(fl) : cur.temp;\n          if (nwsNum(o.relativeHumidity) !== null) cur.humidity = o.relativeHumidity.value;\n          if (ws !== null) cur.wind = /m_s/.test(o.windSpeed.unitCode || '') ? ws * 2.237 : ws / 1.609;\n          if (o.textDescription) { cur.desc = o.textDescription; cur.code = nwsCode(o.icon, o.textDescription); }\n          if (o.icon) cur.isDay = /\\/night\\//.test(o.icon) ? 0 : 1;\n        }\n        cur.humidity = cur.humidity === null || cur.humidity === undefined ? null : Math.round(cur.humidity);\n        cur.wind = cur.wind === null || cur.wind === undefined ? null : Math.round(cur.wind);\n        // today's high and low: the daytime period and the night after it; after dark, the high already happened\n        var dp = (r[1] && r[1].properties && r[1].properties.periods) || [], d0 = dp[0], d1 = dp[1];\n        var today = h0.t.slice(0, 10), rest = hourly.filter(function (h) { return h.t.slice(0, 10) === today; }).map(function (h) { return h.temp; }).concat([cur.temp]);\n        var hi, lo, pop;\n        if (d0 && d0.isDaytime) { hi = d0.temperature; lo = d1 ? d1.temperature : Math.min.apply(null, rest); pop = nwsNum(d0.probabilityOfPrecipitation); }\n        else { hi = Math.max.apply(null, rest); lo = d0 ? d0.temperature : Math.min.apply(null, rest); pop = d0 ? nwsNum(d0.probabilityOfPrecipitation) : null; }\n        if (pop === null) pop = Math.max.apply(null, hourly.slice(0, 12).map(function (h) { return h.pop; }));\n        var sun = nwsSun(+loc.lat, +loc.lon, new Date());\n        return { hourly: hourly, now: cur, hi: Math.round(Math.max(hi, cur.temp)), lo: Math.round(Math.min(lo, cur.temp)), pop: Math.round(pop || 0), tz: pt.tz, city: pt.city, state: pt.state,\n          sunrise: sun ? nwsClock(sun.rise, pt.tz) : null, sunset: sun ? nwsClock(sun.set, pt.tz) : null };\n      });\n    });\n    NWS_MEM = { key: key, at: Date.now(), p: p };\n    p.catch(function () { if (NWS_MEM.p === p) NWS_MEM.p = null; });\n    return p;\n  }\n  window.dbkNWS = { load: nwsLoad, point: nwsPoint, code: nwsCode, sun: nwsSun };\n  /* ---------- Weather pop-up details: the next 24 hours, when rain is likely, official alerts ---------- */\n  // the hours and official statements for each place (the main place, and an optional second one), kept for this visit\n  var WX = { at: 0, key: '', data: null, busy: false }, WX2 = { at: 0, key: '', data: null, busy: false, d: null, outside: null };\n  try { var _wx0 = JSON.parse(sessionStorage.getItem('dbkWxMore') || 'null'); if (_wx0 && _wx0.data && _wx0.data.f) { WX.at = _wx0.at; WX.key = _wx0.key; WX.data = _wx0.data; } } catch (e) {}\n  try { var _wx2 = JSON.parse(sessionStorage.getItem('dbkWxMore2') || 'null'); if (_wx2 && _wx2.data && _wx2.data.f) { WX2.at = _wx2.at; WX2.key = _wx2.key; WX2.data = _wx2.data; WX2.d = _wx2.d || null; } } catch (e) {}\n  function wxGetLoc(k) { try { var l = JSON.parse(localStorage.getItem(k) || 'null'); return l && l.lat && l.lon ? l : null; } catch (e) { return null; } }\n  function wxLoc() { return wxGetLoc('userLocation'); }\n  function wxLoc2() { return wxGetLoc('userLocation2'); }\n  function wxGet(url, opts) { return fetch(url, opts).then(function (r) { if (!r.ok) throw new Error(r.status); return r.json(); }).catch(function () { return null; }); }\n  function wxMore(done, slot) {\n    var C = slot === 2 ? WX2 : WX, l = slot === 2 ? wxLoc2() : wxLoc(); if (!l) return;\n    var key = (+l.lat).toFixed(3) + ',' + (+l.lon).toFixed(3);\n    if (C.data && C.key === key && Date.now() - C.at < 15 * 60e3 && (slot !== 2 || C.d)) { if (done) done(); return; }\n    if (C.busy) return; C.busy = true;\n    var lat = (+l.lat).toFixed(4), lon = (+l.lon).toFixed(4);\n    nwsLoad(l, slot).then(function (f) {\n      if (f.outside) return [f, null];\n      return wxGet(NWS + '/alerts/active?point=' + lat + ',' + lon, NWS_H).then(function (al) { return [f, al]; });\n    }).catch(function () { return [null, null]; }).then(function (r) {\n      C.busy = false;\n      if (!r[0]) return;\n      if (r[0].outside) { if (slot === 2) { C.outside = key; if (done) done(); } return; }\n      C.data = { f: { hourly: r[0].hourly }, al: r[1] }; C.at = Date.now(); C.key = key; C.outside = null;\n      if (slot === 2) { var n = r[0].now; C.d = { temp: n.temp, desc: n.desc, feelsLike: n.feels, code: n.code, isDay: n.isDay, precipChance: r[0].pop, wind: n.wind, humidity: n.humidity, sunrise: r[0].sunrise, sunset: r[0].sunset }; }\n      try { sessionStorage.setItem(slot === 2 ? 'dbkWxMore2' : 'dbkWxMore', JSON.stringify(C)); } catch (e) {}\n      if (slot !== 2) wxAlertChip();\n      if (done) done();\n    });\n  }\n  function wxTime(d) { var h = d.getHours(), m = d.getMinutes(); return (h % 12 || 12) + (m ? ':' + ('0' + m).slice(-2) : '') + (h < 12 ? ' AM' : ' PM'); }\n  function wxIsSnow(c) { return (c >= 71 && c <= 77) || c === 85 || c === 86; }\n  // the forecast's own local times (\"2026-10-19T15:00\") read as this phone's clock\n  function wxDate(t) { var p = String(t).split(/[-T:]/); return new Date(+p[0], +p[1] - 1, +p[2], +p[3] || 0, +p[4] || 0); }\n  function wxHours(C) {\n    C = C || WX; var f = C.data && C.data.f; if (!f || !f.hourly) return null;\n    var now = Date.now(), out = [];\n    for (var i = 0; i < f.hourly.length && out.length < 25; i++) {\n      var h = f.hourly[i]; if (h.ms + 3600e3 <= now) continue;\n      out.push({ d: wxDate(h.t), temp: h.temp, code: h.code, day: h.day, pop: h.pop });\n    }\n    return out.length ? out : null;\n  }\n  // one plain line about rain from the hourly chances (the NWS gives hours, not minutes):\n  // easing off later, likely around a time, a small chance, or none coming\n  function wxRainLine(hours) {\n    if (!hours || !hours.length) return '';\n    var wet = function (c) { return wxIsSnow(c) ? 'Snow' : 'Rain'; };\n    var isWet = function (c) { return (c >= 51 && c <= 82) || c >= 95; };\n    if ((hours[0].pop || 0) >= 50 && isWet(hours[0].code)) {\n      for (var i = 1; i < hours.length; i++) if ((hours[i].pop || 0) < 30) return wet(hours[0].code) + ' easing off around ' + wxTime(hours[i].d);\n      return wet(hours[0].code) + ' for the next several hours';\n    }\n    var top = 0, at = null;\n    for (var j = 1; j < hours.length; j++) { var p = hours[j].pop || 0; if (p >= 50 && !at) at = hours[j]; if (p > top) top = p; }\n    // the first hour from 15% (the NWS's \"slight chance\") on, so the line never names a late hour as if\n    // nothing came before it (Kasey, Nov 1: \"small chance of rain at 4am\", the row showed 15-21% from 6 PM)\n    var first = null;\n    for (var k = 0; k < hours.length; k++) if ((hours[k].pop || 0) >= 15) { first = hours[k]; break; }\n    var early = function (h) { return first && h.d - first.d >= 2 * 3600e3; };\n    if (at) return wet(at.code) + (early(at) ? ' possible from ' + wxTime(first.d) + ', likely around ' : ' likely around ') + wxTime(at.d);\n    if (top >= 15) {\n      var m = hours.filter(function (x) { return (x.pop || 0) === top; })[0], w = wet(m.code).toLowerCase();\n      var what = top >= 30 ? 'Small chance of ' : 'Slight chance of ';\n      if (early(m)) return what + w + ' from ' + wxTime(first.d) + ', highest around ' + wxTime(m.d) + ' (' + top + '%)';\n      return what + w + ' around ' + wxTime(m.d) + ' (' + top + '%)';\n    }\n    return 'No rain in the next 24 hours';\n  }\n  var SEV = { Extreme: 0, Severe: 1, Moderate: 2 };\n  function wxAlerts(C) {\n    C = C || WX; var al = C.data && C.data.al; if (!al || !al.features) return [];\n    var seen = {}, now = Date.now();\n    return al.features.map(function (x) { return x.properties || {}; }).filter(function (p) {\n      if (!(p.severity in SEV) || seen[p.event]) return false;\n      var end = Date.parse(p.ends || p.expires || ''); if (end && end < now) return false;\n      seen[p.event] = 1; return true;\n    }).sort(function (a, b) { return SEV[a.severity] - SEV[b.severity]; });\n  }\n  function wxUntil(p) { var e = Date.parse(p.ends || p.expires || ''); if (!e) return ''; var d = new Date(e), t = new Date(), tm = new Date(t.getFullYear(), t.getMonth(), t.getDate() + 1); return 'until ' + (d < tm ? '' : d.toLocaleDateString('en-US', { weekday: 'short' }) + ' ') + wxTime(d); }\n  var WARN = '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.8\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3.5 2.8 19.5h18.4L12 3.5Z\"/><path d=\"M12 10v4.2M12 17.2v.1\"/></svg>';\n  // Today: an official alert shows under the weather, tap for the details\n  function wxAlertChip() {\n    if (page !== 'index.html') return;\n    var row = document.querySelector('.hm-conds'); if (!row) return;\n    var a = wxAlerts(), old = document.querySelector('.dbk-wx-chip');\n    if (!a.length) { if (old) old.remove(); return; }\n    var b = old || document.createElement('button');\n    b.type = 'button'; b.className = 'dbk-wx-chip';\n    b.innerHTML = '<span>' + esc(a[0].event) + '</span>' + (a.length > 1 ? '<em>+' + (a.length - 1) + '</em>' : '');\n    b.setAttribute('aria-label', a.map(function (x) { return x.event; }).join(', ') + '. Tap for details');\n    if (!old) { b.addEventListener('click', function () { if (window.dbkWeatherPop) window.dbkWeatherPop(); }); row.parentNode.insertBefore(b, row.nextSibling); }\n  }\n  if (page === 'index.html') {\n    ready(function () {\n      var go = function () { wxAlertChip(); wxMore(); };\n      setTimeout(go, 1200);\n      window.addEventListener('dbk-show', go); window.addEventListener('online', go);\n      window.addEventListener('storage', function (e) { if (e.key === 'userLocation' || e.key === 'dbkNwsPoint') { try { window.dbkWxMark(); } catch (x) {} } if (e.key === 'userLocation') { WX.at = 0; go(); } });\n    });\n  }\n  /* ---------- Weather: a live rain map ----------\n     Nothing loads until it's opened: the map library (Leaflet 1.9.4, kept in this copy: vendor/leaflet/, the files\n     exactly as Leaflet publishes them, BSD-2 licence beside them; security, Oct 31: it came from cdnjs with nothing\n     checking it, so a changed file there would have run inside the app), the base map (USGS National Map)\n     and the radar pictures (NOAA/NWS MRMS radar, about the last hour). US government sources: public domain, free,\n     no key, asked straight from this browser. Closing it removes the map completely, so it holds no memory afterwards. */\n  var LEAF = 'vendor/leaflet/';\n  // the published Subresource Integrity values for Leaflet 1.9.4 (leafletjs.com/download.html): a file that isn't exactly it never runs\n  var LEAF_SRI = { js: 'sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo=', css: 'sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY=' };\n  var leafWait = null;\n  function leaflet() {\n    if (window.L && window.L.map) return Promise.resolve(window.L);\n    if (leafWait) return leafWait;\n    leafWait = new Promise(function (ok, no) {\n      var l = document.createElement('link'); l.rel = 'stylesheet'; l.integrity = LEAF_SRI.css; l.href = LEAF + 'leaflet.css'; document.head.appendChild(l);\n      var s = document.createElement('script'); s.integrity = LEAF_SRI.js; s.src = LEAF + 'leaflet.js';\n      s.onload = function () { window.L && window.L.map ? ok(window.L) : no(); };\n      s.onerror = function () { leafWait = null; s.remove(); no(); };\n      document.head.appendChild(s);\n    });\n    return leafWait;\n  }\n  var PLAY = '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"currentColor\"><path d=\"M8 5.5v13l10.5-6.5L8 5.5Z\"/></svg>';\n  var PAUSE = '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"currentColor\"><rect x=\"6.5\" y=\"5.5\" width=\"4\" height=\"13\" rx=\"1\"/><rect x=\"13.5\" y=\"5.5\" width=\"4\" height=\"13\" rx=\"1\"/></svg>';\n  // NOAA/NWS MRMS base reflectivity (the radar behind radar.weather.gov), one picture for each US region\n  function wxRadarSrc(lat, lon) {\n    var r = lon > 130 ? 'guam' : lat > 50 && lon < -129 ? 'alaska' : lat < 24 && lon < -150 ? 'hawaii' : lat < 21 && lon > -69 ? 'carib' : 'conus';\n    return { url: 'https://opengeo.ncep.noaa.gov/geoserver/' + r + '/' + r + '_bref_qcd/ows', layer: r + '_bref_qcd' };\n  }\n  // the times listed in the radar's capabilities: a comma list, or start/end/step ranges\n  function wxRadarTimes(xml) {\n    var m = /<Dimension[^>]*name=\"time\"[^>]*>([^<]+)</i.exec(String(xml || '')); if (!m) return [];\n    var out = [];\n    m[1].trim().split(',').forEach(function (part) {\n      var r = part.trim().split('/');\n      if (r.length === 3) {\n        var a = Date.parse(r[0]), b = Date.parse(r[1]), st = /PT(?:(\\d+)H)?(?:(\\d+)M)?(?:(\\d+)S)?/.exec(r[2]);\n        var step = st ? ((+st[1] || 0) * 3600 + (+st[2] || 0) * 60 + (+st[3] || 0)) * 1000 : 0;\n        if (a && b && step > 0) for (var t = Math.max(a, b - 2 * 3600e3 - (b - a) % step); t <= b; t += step) out.push(t);\n      } else { var t1 = Date.parse(r[0]); if (t1) out.push(t1); }\n    });\n    var cut = Date.now() - 3 * 3600e3;\n    return out.filter(function (t) { return t > cut; }).sort(function (x, y) { return x - y; });\n  }\n  function wxRadar() {\n    var l = (WP.slot === 2 && wxLoc2()) || wxLoc(); if (!l || document.querySelector('.dbk-radar-pop')) return;\n    var dark = document.documentElement.getAttribute('data-dbk') === 'p2';\n    var o = document.createElement('div'); o.className = 'dbk-infopop dbk-radar-pop';\n    o.style.cssText = 'position:fixed;inset:0;z-index:100000;display:flex;justify-content:center;';\n    o.innerHTML = '<div class=\"dbk-infocard dbk-radar\" role=\"dialog\" aria-modal=\"true\" aria-label=\"Rain map\"><button type=\"button\" class=\"dbk-info-x\" aria-label=\"Close\">&times;</button>' +\n      '<h3 class=\"dbk-info-title\">Rain map</h3>' +\n      '<div class=\"dbk-radar-map\" data-dbk-keep><p class=\"dbk-radar-msg\">Loading the map…</p></div>' +\n      '<div class=\"dbk-radar-bar\"><button type=\"button\" class=\"dbk-radar-play\" aria-label=\"Pause\" hidden>' + PAUSE + '</button><span class=\"dbk-radar-time\" aria-live=\"off\"></span></div></div>';\n    var box = o.querySelector('.dbk-radar-map'), msg = o.querySelector('.dbk-radar-msg'), play = o.querySelector('.dbk-radar-play'), time = o.querySelector('.dbk-radar-time');\n    var map = null, timer = null, closed = false;\n    var close = function () {\n      if (closed) return; closed = true;\n      clearTimeout(timer); document.removeEventListener('keydown', key, true);\n      try { if (map) map.remove(); } catch (e) {}\n      map = null; o.remove();\n    };\n    // Escape closes just the map, not the weather pop-up under it\n    var key = function (e) { if (e.key === 'Escape') { e.preventDefault(); e.stopPropagation(); close(); } };\n    // tapping outside closes it, but only a tap that starts outside: dragging the map and letting go outside never does\n    var downOut = false;\n    o.addEventListener('pointerdown', function (e) { downOut = e.target === o; }, true);\n    o.addEventListener('click', function (e) { if (e.target.closest('.dbk-info-x')) { close(); return; } if (e.target === o && downOut) close(); downOut = false; });\n    document.addEventListener('keydown', key, true);\n    document.body.appendChild(o);\n    var say = function (t) { msg.textContent = t; msg.hidden = !t; };\n    leaflet().then(function (L) {\n      if (closed) return;\n      say('');\n      map = L.map(box, { center: [+l.lat, +l.lon], zoom: 7, minZoom: 3, maxZoom: 10, zoomControl: false, attributionControl: true });\n      map.attributionControl.setPrefix(false);\n      // the USGS National Map (public domain, no key); softened, and turned dark for dark looks\n      L.tileLayer('https://basemap.nationalmap.gov/arcgis/rest/services/USGSTopo/MapServer/tile/{z}/{y}/{x}', { maxZoom: 10, className: 'dbk-rm-base' + (dark ? ' is-dark' : ''), attribution: 'USGS' }).addTo(map);\n      L.circleMarker([+l.lat, +l.lon], { radius: 6, weight: 2, color: dark ? '#e6eaef' : '#2f3a2c', fillColor: dark ? '#8fc98a' : '#9b5a62', fillOpacity: 1, interactive: false }).addTo(map);\n      var rd = wxRadarSrc(+l.lat, +l.lon);\n      var layer = function (t) {\n        var o = { layers: rd.layer, format: 'image/png', transparent: true, version: '1.3.0', opacity: 0, maxZoom: 10, attribution: 'NOAA/NWS' };\n        if (t) o.time = new Date(t).toISOString();\n        return L.tileLayer.wms(rd.url, o).addTo(map);\n      };\n      // which radar times exist: the service's own list; if it can't be read, just the latest picture\n      return fetch(rd.url + '?service=WMS&version=1.3.0&request=GetCapabilities').then(function (r) { if (!r.ok) throw 0; return r.text(); })\n        .then(wxRadarTimes, function () { return []; }).then(function (times) {\n        if (closed || !map) return;\n        var frames = [];\n        if (times.length) {\n          var last = times[times.length - 1];\n          // about the last hour, one picture every 10 minutes\n          for (var k = 6; k >= 0; k--) {\n            var want = last - k * 600e3, best = null;\n            times.forEach(function (t) { if (Math.abs(t - want) <= 300e3 && (best === null || Math.abs(t - want) < Math.abs(best - want))) best = t; });\n            if (best !== null && frames.indexOf(best) < 0) frames.push(best);\n          }\n        }\n        var nowAt = Math.max(0, frames.length - 1);\n        var layers = frames.length ? frames.map(layer) : [layer(null)];\n        var errs = 0, shown = false, failed = false;\n        layers.forEach(function (x) {\n          x.on('tileerror', function () {\n            if (++errs <= 12 || shown || closed || failed) return;\n            failed = true; playing = false; clearTimeout(timer); play.hidden = true;\n            time.textContent = 'Radar couldn’t load. Try again in a bit.';\n          });\n          x.on('tileload', function () { shown = true; });\n        });\n        var at = 0, playing = true;   // starts an hour back and plays up to now\n        var show = function (i) {\n          layers.forEach(function (x, k) { x.setOpacity(k === i ? 0.75 : 0); });\n          time.textContent = !frames.length ? 'Latest radar' : i === nowAt ? 'Radar at ' + wxTime(new Date(frames[i])) : wxTime(new Date(frames[i]));\n        };\n        var step = function () {\n          if (closed || !playing || failed) return;\n          at = (at + 1) % layers.length; show(at);\n          timer = setTimeout(step, at === nowAt ? 1800 : 650);   // a rest on the latest picture\n        };\n        show(at);\n        if (layers.length > 1 && !failed) {\n          play.hidden = false;\n          play.addEventListener('click', function () {\n            playing = !playing; clearTimeout(timer);\n            play.innerHTML = playing ? PAUSE : PLAY; play.setAttribute('aria-label', playing ? 'Pause' : 'Play');\n            if (playing) step();\n          });\n          timer = setTimeout(step, 1200);\n        }\n      }).catch(function () { if (!closed) time.textContent = 'Radar couldn’t load. Try again in a bit.'; });\n    }).catch(function () { if (!closed) say('The map couldn’t load. Try again when you have signal.'); });\n  }\n  /* The weather pop-up, in cards you can skim: official statements, right now, the next 24 hours, and today.\n     It's drawn once and then updated in place when newer details arrive. (It used to be thrown away and built\n     again a second or two after opening, which sent the scroll back to the top: the \"stuck\" scroll.)\n     Up to two places: the household's location and one more (userLocation2, shared by both phones). */\n  var WP = { pop: null, slot: 1 };\n  function wxCell(label, code, day, temp, pop) { return '<div><small>' + label + '</small>' + wxIcon(code, day) + '<span>' + temp + '°</span><i>' + (pop >= 10 ? pop + '%' : '') + '</i></div>'; }\n  function wxPlaceName(l, slot) { return window.dbkLocName(l && l.name) || (slot === 2 ? 'Second place' : 'Your location'); }\n  function wxBody() {\n    var main = wxLoc(), two = wxLoc2(), slot = two ? WP.slot : 1, C = slot === 2 ? WX2 : WX;\n    var place = slot === 2 ? two : main, w = slot === 2 ? WX2.d : window._weatherDetail;\n    var h = '<h3 class=\"dbk-info-title\">' + esc(two ? 'Weather' : wxPlaceName(main, 1)) + '</h3>';\n    // two places: switch between them here (the title then says Weather, so no name shows twice)\n    if (two) h += '<div class=\"dbk-wx-locs\" role=\"tablist\" aria-label=\"Places\">' + [[1, main], [2, two]].map(function (p) {\n      return '<button type=\"button\" role=\"tab\" class=\"dbk-wx-loc\" data-slot=\"' + p[0] + '\" aria-selected=\"' + (slot === p[0]) + '\">' + esc(wxPlaceName(p[1], p[0])) + '</button>';\n    }).join('') + '</div>';\n    var outside = slot === 2 && C.outside && two && C.outside === (+two.lat).toFixed(3) + ',' + (+two.lon).toFixed(3);\n    if (outside) {\n      h += '<div class=\"dbk-wx-card\"><p class=\"dbk-wx-wait\">The weather comes from the US National Weather Service, so it only covers places in the US.</p></div>';\n    } else if (!w) {\n      h += '<div class=\"dbk-wx-card\"><p class=\"dbk-wx-wait\">Getting the forecast…</p></div>';\n    } else {\n      var hrs = wxHours(C);\n      var hours = hrs\n        ? hrs.map(function (x, i) { return wxCell(i === 0 ? 'Now' : wxTime(x.d), i === 0 ? w.code : x.code, i === 0 ? w.isDay !== 0 : x.day !== 0, i === 0 ? w.temp : x.temp, x.pop); }).join('')\n        : wxCell('Now', w.code, w.isDay !== 0, w.temp, null) + (w.hours || []).map(function (x) { return wxCell(wxTime(wxDate(x.t)), x.code, x.day !== 0, x.temp, null); }).join('');\n      var has = function (v) { return v !== null && v !== undefined && v === v; };\n      var trio = (has(w.precipChance) ? '<div><b>' + w.precipChance + '%</b><small>Rain</small></div>' : '') +\n        (has(w.wind) ? '<div><b>' + w.wind + ' mph</b><small>Wind</small></div>' : '') + (has(w.humidity) ? '<div><b>' + w.humidity + '%</b><small>Humidity</small></div>' : '');\n      var alerts = wxAlerts(C).map(function (p) {\n        var more = [p.description, p.instruction].filter(Boolean).map(function (t) { return '<p>' + esc(String(t).replace(/\\s*\\n\\s*\\n\\s*/g, '\\u0000').replace(/\\s*\\n\\s*/g, ' ')).replace(/\\u0000/g, '</p><p>') + '</p>'; }).join('');\n        // the arrow sits right after \"until ...\", so a statement takes two lines, not three (the designer, Oct 20)\n        return '<details class=\"dbk-wx-al\" data-k=\"' + esc(p.event) + '\"><summary><span><b>' + WARN + esc(p.event) + '</b><small>' + esc(wxUntil(p)) + '<svg class=\"dbk-wx-chev\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><path d=\"m6 9 6 6 6-6\"/></svg></small></span></summary><div class=\"dbk-wx-alt\">' + more + '</div></details>';\n      }).join('');\n      var rain = wxRainLine(hrs);\n      if (alerts) h += '<div class=\"dbk-wx-card dbk-wx-als\">' + alerts + '</div>';\n      h += '<div class=\"dbk-wx-card dbk-wx-now\"><h4 class=\"dbk-wx-h\">Right now</h4>' +\n        '<div class=\"dbk-wx-big\"><span class=\"dbk-wx-num\">' + w.temp + '<span class=\"dbk-wx-deg\">°</span></span></div>' +\n        '<p class=\"dbk-info-sub\">' + esc(w.desc || '') + (has(w.feelsLike) && w.feelsLike !== w.temp ? ' · feels like ' + w.feelsLike + '°' : '') + '</p>' +\n        (rain ? '<p class=\"dbk-wx-rain\">' + esc(rain) + '</p>' : '') +\n        (place ? '<button type=\"button\" class=\"dbk-wx-mapbtn\"><svg viewBox=\"0 0 24 24\" aria-hidden=\"true\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 4 3.5 6v14L9 18l6 2 5.5-2V4L15 6 9 4Z\"/><path d=\"M9 4v14M15 6v14\"/></svg>Rain map</button>' : '') + '</div>';\n      h += '<div class=\"dbk-wx-card\"><h4 class=\"dbk-wx-h\">Next 24 hours</h4><div class=\"dbk-wx-hours\" tabindex=\"0\" aria-label=\"Next 24 hours\">' + hours + '</div></div>';\n      if (trio || (w.sunrise && w.sunset)) h += '<div class=\"dbk-wx-card\"><h4 class=\"dbk-wx-h\">Today</h4>' + (trio ? '<div class=\"dbk-wx-trio\">' + trio + '</div>' : '') +\n        (w.sunrise && w.sunset ? '<div class=\"dbk-wx-sun\"><span>Sunrise ' + w.sunrise.replace(/(am|pm)$/, ' $1').toUpperCase() + '</span><span>Sunset ' + w.sunset.replace(/(am|pm)$/, ' $1').toUpperCase() + '</span></div>' : '') + '</div>';\n    }\n    h += '<div class=\"dbk-wx-acts\">' +\n      '<button type=\"button\" class=\"dbk-wx-btn\" data-wx=\"change\">' + 'Change place' + '</button>' +\n      (two ? (slot === 2 ? '<button type=\"button\" class=\"dbk-wx-btn\" data-wx=\"remove\">Remove place</button>' : '') : '<button type=\"button\" class=\"dbk-wx-btn\" data-wx=\"add\">+ Second place</button>') +\n      '</div>';\n    return h;\n  }\n  // draw the contents again in place: same scroll, same statements open, nothing flashes\n  function wxPaint() {\n    var pop = WP.pop; if (!pop || !document.body.contains(pop)) return;\n    var card = pop.querySelector('.dbk-infocard'); if (!card) return;\n    var st = card.scrollTop, open = [].map.call(card.querySelectorAll('.dbk-wx-al[open]'), function (d) { return d.getAttribute('data-k'); });\n    var hx = card.querySelector('.dbk-wx-hours'), hsl = hx ? hx.scrollLeft : 0, x = card.querySelector('.dbk-info-x');\n    card.innerHTML = wxBody(); if (x) card.insertBefore(x, card.firstChild);\n    open.forEach(function (k) { [].forEach.call(card.querySelectorAll('.dbk-wx-al'), function (d) { if (d.getAttribute('data-k') === k) d.open = true; }); });\n    var hx2 = card.querySelector('.dbk-wx-hours'); if (hx2) hx2.scrollLeft = hsl;\n    card.scrollTop = st;\n  }\n  // newer details for the place on screen; when they arrive the pop-up is updated in place\n  function wxFresh() {\n    var slot = wxLoc2() ? WP.slot : 1, C = slot === 2 ? WX2 : WX;\n    if (!wxHours(C) || Date.now() - C.at > 15 * 60e3 || (slot === 2 && !WX2.d)) wxMore(function () { if (!document.querySelector('.dbk-radar-pop')) wxPaint(); }, slot);\n  }\n  window.dbkWeatherPop = function () {\n    if (!window._weatherDetail) return;\n    if (WP.pop && document.body.contains(WP.pop)) { wxPaint(); return; }\n    if (!wxLoc2()) WP.slot = 1;\n    var pop = infoPop('dbk-wxB', wxBody()); WP.pop = pop;\n    pop.addEventListener('click', function (e) {\n      var t = e.target.closest('.dbk-wx-loc, .dbk-wx-btn, .dbk-wx-mapbtn'); if (!t) return;\n      if (t.classList.contains('dbk-wx-mapbtn')) { wxRadar(); return; }\n      if (t.classList.contains('dbk-wx-loc')) {\n        var sl = +t.getAttribute('data-slot'); if (sl === WP.slot) return;\n        WP.slot = sl; wxPaint(); var c = pop.querySelector('.dbk-infocard'); if (c) c.scrollTop = 0; wxFresh(); return;\n      }\n      var a = t.getAttribute('data-wx');\n      if (a === 'change' || a === 'add') {\n        var second = a === 'add' || (!!wxLoc2() && WP.slot === 2);\n        pop.remove(); WP.pop = null;\n        try {\n          if (window.dbkPlaces && window.dbkPlaces.open) window.dbkPlaces.open(second\n            ? { key: 'userLocation2', after: function () { WP.slot = 2; WX2.at = 0; WX2.d = null; WX2.data = null; setTimeout(window.dbkWeatherPop, 60); } }\n            : { after: function () { WX.at = 0; } });\n          else openLocationSetup();\n        } catch (x) {}\n        return;\n      }\n      if (a === 'remove') {\n        var was = localStorage.getItem('userLocation2');\n        try { localStorage.removeItem('userLocation2'); if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['userLocation2']); } catch (x) {}\n        WP.slot = 1; wxPaint(); wxFresh();\n        if (window.dbkUndo) window.dbkUndo('Second place removed', function () {\n          try { localStorage.setItem('userLocation2', was); if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['userLocation2']); } catch (x) {}\n          WP.slot = 2; wxPaint(); wxFresh();\n        });\n      }\n    });\n    wxFresh();\n  };\n\n  /* ---------- Meals: a skipped meal keeps its row like the others, one line, with undo on the right ---------- */\n  function skippedRows() {\n    if (page !== 'meal-plan.html') return;\n    var fix = function () {\n      [].forEach.call(document.querySelectorAll('.mc-card.mc-skipped'), function (c) {\n        if (c.getAttribute('data-dbk-skip')) return;\n        var t = (c.textContent || '').trim(), m = /^(.*?)\\s+skipped$/i.exec(t); if (!m) return;\n        c.setAttribute('data-dbk-skip', '1');\n        c.removeAttribute('style');\n        c.innerHTML = '<div class=\"mc-body\"><div class=\"mc-type\">' + m[1].replace(/</g, '&lt;') + '</div><div class=\"mc-name mc-name-empty dbk-skipped-note\">Skipped</div></div><span class=\"mc-skip-link\">undo</span>';\n      });\n    };\n    new MutationObserver(function () { fix(); }).observe(document.body, { childList: true, subtree: true });\n    fix();\n  }\n\n  /* ---------- Food journal calendar: tap any day to see what was logged (or that nothing was) ---------- */\n  function journalTaps() {\n    if (page !== 'meal-plan.html') return;\n    var MONTHS = ['january','february','march','april','may','june','july','august','september','october','november','december'];\n    var esc = function (t) { return String(t == null ? '' : t).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); };\n    var keyOf = function (cell) {\n      var m = /_openJournalDay\\('([0-9-]+)'\\)/.exec(cell.getAttribute('onclick') || ''); if (m) return m[1];\n      var day = parseInt((cell.firstElementChild && cell.firstElementChild.textContent) || cell.textContent, 10); if (!day) return null;\n      var lab = document.querySelector('#journal-timeline > div:first-child span'); var t = lab ? lab.textContent.trim().toLowerCase().split(/\\s+/) : [];\n      var mo = MONTHS.indexOf(t[0]), yr = parseInt(t[1], 10); if (mo < 0 || !yr) return null;\n      return yr + '-' + ('0' + (mo + 1)).slice(-2) + '-' + ('0' + day).slice(-2);\n    };\n    var details = function (dk) {\n      var person = 'person1'; try { if (localStorage.getItem('showPartner2') === 'true' && window._journalActivePerson) person = window._journalActivePerson; } catch (e) {}\n      try { if (typeof _journalActivePerson !== 'undefined' && localStorage.getItem('showPartner2') === 'true') person = _journalActivePerson; } catch (e) {}\n      var p = dk.split('-'), dt = new Date(+p[0], +p[1] - 1, +p[2]), today = new Date(); today.setHours(0, 0, 0, 0);\n      var future = dt > today, label = dt.toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric' });\n      var ate = '', nut = {}, note = '';\n      try { ate = localStorage.getItem('journal_meals_' + dk + '_' + person) || ''; } catch (e) {}\n      try { nut = JSON.parse(localStorage.getItem('journal_nutrition_' + dk + '_' + person) || '{}') || {}; } catch (e) {}\n      try { note = localStorage.getItem('journal_' + dk + '_' + person) || ''; } catch (e) {}\n      var planned = [];\n      try {\n        var dd = (typeof mealSchedule !== 'undefined' && mealSchedule[dk]) ? mealSchedule[dk][person] : null;\n        if (dd) ['breakfast', 'lunch', 'dinner', 'dessert', 'snack'].forEach(function (sl) {\n          var v = dd[sl]; if (!v) return;\n          (Array.isArray(v) ? v : [v]).forEach(function (x) { if (x && x.name) planned.push(x.name); });\n        });\n      } catch (e) {}\n      var nutLine = [nut.protein ? nut.protein + 'g protein' : '', nut.calories ? nut.calories + ' cal' : '', nut.fiber ? nut.fiber + 'g fiber' : ''].filter(Boolean).join(' · ');\n      var h = '<h3 class=\"dbk-info-title\">' + esc(label) + '</h3>';\n      var any = ate || nutLine || note || planned.length;\n      if (!any) {\n        h += '<p class=\"dbk-jd-empty\">' + (future ? 'Nothing planned for this day yet.' : 'Nothing was logged for this day.') + '</p>';\n      } else {\n        if (ate || (!future && planned.length)) h += '<div class=\"dbk-jd-block\"><div class=\"dbk-jd-label\">What I ate</div><p>' + esc(ate || planned.join(', ')) + '</p></div>';\n        else if (planned.length) h += '<div class=\"dbk-jd-block\"><div class=\"dbk-jd-label\">Planned</div><p>' + esc(planned.join(', ')) + '</p></div>';\n        if (nutLine) h += '<p class=\"dbk-jd-nut\">' + esc(nutLine) + '</p>';\n        if (note) h += '<div class=\"dbk-jd-block\"><div class=\"dbk-jd-label\">How I felt</div><p class=\"dbk-jd-note\">' + esc(note) + '</p></div>';\n      }\n      if (!future && window._openJournalDay) h += '<button type=\"button\" class=\"dbk-info-link\" data-edit>' + (any ? 'Edit this day' : 'Add to this day') + '</button>';\n      var pop = infoPop('dbk-jd', h); pop.classList.add('dbk-centerpop');\n      var ed = pop.querySelector('[data-edit]'); if (ed) ed.addEventListener('click', function () { pop.remove(); window._openJournalDay(dk); });\n    };\n    document.addEventListener('click', function (e) {\n      var tl = document.getElementById('journal-timeline'); if (!tl || !tl.contains(e.target)) return;\n      var grid = tl.children[2]; if (!grid || !grid.contains(e.target)) return;\n      var cell = e.target; while (cell && cell.parentElement !== grid) cell = cell.parentElement;\n      // days ahead can't take taps themselves, so find the one under the finger\n      if (!cell) cell = [].filter.call(grid.children, function (c) { var r = c.getBoundingClientRect(); return e.clientX >= r.left && e.clientX <= r.right && e.clientY >= r.top && e.clientY <= r.bottom; })[0];\n      if (!cell) return;\n      var dk = keyOf(cell); if (!dk) return;\n      e.preventDefault(); e.stopPropagation();\n      details(dk);\n    }, true);\n  }\n\n  /* ---------- Inbox: one list. The phone's saved copy is the truth on this phone, notes captured on\n     other pages (still waiting for the cloud) are always included, and Today re-reads it before showing or\n     changing anything, since Today stays loaded in the background while you capture elsewhere ---------- */\n  function inboxOneList() {\n    var K = 'capturedThoughts_' + role;\n    var pending = function () { try { return JSON.parse(localStorage.getItem('dbkCapQueue') || '[]') || []; } catch (e) { return []; } };\n    var withPending = function (list) {\n      var out = Array.isArray(list) ? list.slice() : [], have = {};\n      out.forEach(function (t) { if (t) have[String(t.id)] = 1; });\n      pending().forEach(function (t) { if (t && !have[String(t.id)]) { out.push(t); have[String(t.id)] = 1; } });\n      return out;\n    };\n    // what the cloud says, plus anything captured here that hasn't reached it yet; kept as this phone's copy\n    window.dbkInboxAdopt = function (cloud) {\n      var list = withPending(cloud);\n      try { localStorage.setItem(K, JSON.stringify(list)); } catch (e) {}\n      return list;\n    };\n    if (page !== 'index.html') return;\n    var fresh = function () {\n      var local = null; try { local = JSON.parse(localStorage.getItem(K) || 'null'); } catch (e) {}\n      if (!Array.isArray(local)) return;\n      var list = withPending(local);\n      try { if (JSON.stringify(list) !== JSON.stringify(window._capturedThoughts)) { window._capturedThoughts = list; return true; } } catch (e) {}\n      return false;\n    };\n    window.dbkInboxFresh = fresh;\n    var wrap = function (name, after) {\n      var f = window[name]; if (typeof f !== 'function' || f.__dbkFresh) return;\n      var w = function () { fresh(); var r = f.apply(this, arguments); if (after) try { after(); } catch (e) {} return r; };\n      w.__dbkFresh = true; window[name] = w;\n    };\n    var install = function () {\n      ['openInbox', 'renderInbox', 'captureThought', 'deleteThought', 'removeThoughtById', 'clearAllThoughts', 'routeThought', 'startEditThought', 'saveEditThought', 'toggleThought', 'setInboxTagFilter', 'onInboxSearch', 'updateInboxBadge', 'dbkInboxMenu', 'setThoughtTag'].forEach(function (n) { wrap(n); });\n    };\n    // a note deleted here before it reached the cloud must not come back\n    var dropQueued = function (ids) { try { var q = pending().filter(function (t) { return t && (ids === 'all' ? false : ids.indexOf(String(t.id)) === -1); }); localStorage.setItem('dbkCapQueue', JSON.stringify(q)); } catch (e) {} };\n    var guardDeletes = function () {\n      var r = window.removeThoughtById; if (typeof r === 'function' && !r.__dbkQ) { var w1 = function (id) { dropQueued([String(id)]); return r.apply(this, arguments); }; w1.__dbkQ = true; w1.__dbkFresh = true; window.removeThoughtById = w1; }\n      var c = window.clearAllThoughts; if (typeof c === 'function' && !c.__dbkQ) { var w2 = function () { var ids = (window._capturedThoughts || []).map(function (t) { return String(t.id); }); var res = c.apply(this, arguments); Promise.resolve(res).then(function () { if (!(window._capturedThoughts || []).length) dropQueued(ids); }); return res; }; w2.__dbkQ = true; w2.__dbkFresh = true; window.clearAllThoughts = w2; }\n    };\n    // Send to Back Burner: onto this phone's list right away (Today shows it at once), then the cloud copy,\n    // merged so nothing already there is lost; the note leaves the inbox either way\n    var wrapRoute = function () {\n      var r = window.routeThought; if (typeof r !== 'function' || r.__dbkHub) return;\n      var w = function (id, dest) {\n        if (dest !== 'hub') return r.apply(this, arguments);\n        fresh();\n        var t = (window._capturedThoughts || []).filter(function (x) { return x.id === id; })[0]; if (!t) return;\n        var HK = 'futureTodos_' + role, list = jget(HK, []); if (!Array.isArray(list)) list = [];\n        var entry = { id: Date.now(), text: t.text, completed: false, createdAt: t.createdAt || new Date().toISOString() };\n        list.unshift(entry);\n        try { localStorage.setItem(HK, JSON.stringify(list)); } catch (e) {}\n        try { if (window.dbkLaterPull) window.dbkLaterPull(); } catch (e) {}\n        try { removeThoughtById(id); } catch (e) {}\n        try { showToast('Added to the Back Burner.'); } catch (e) {}\n        // the cloud: just this one item added, through the shared lists' own saving (noted on the phone and added onto the\n        // cloud's newest copy once connected). Oct 25 audit: right after opening the app, before it had connected, it\n        // was never sent, and the Back Burner's next read of the cloud took it off: the note was in neither place.\n        try {\n          if (typeof syncToFirebase === 'function') {\n            var P = HK + '/data', B = window.__dbkSync && window.__dbkSync.base && window.__dbkSync.base[P];\n            var cur = Array.isArray(B) ? B : (window.dbkSnapItems ? window.dbkSnapItems(HK) : undefined);\n            // what the phone last knew of the cloud, plus the new one (so nothing else counts as changed); nothing known:\n            // the whole list goes as \"add if missing\", which never removes anything\n            var next = Array.isArray(cur) ? cur.filter(function (x) { return x && String(x.id) !== String(entry.id); }) : list.slice();\n            if (Array.isArray(cur)) next.unshift(entry);\n            // connected: saved now. Not yet: noted on the phone now (it outlasts the app being closed) and sent once\n            // connected, onto whatever the cloud has by then\n            if (window.firebaseReady && window.db) Promise.resolve(syncToFirebase(HK, next)).catch(function () {});\n            else if (!(typeof window.dbkPendAdd === 'function' && window.dbkPendAdd(HK, entry))) Promise.resolve(syncToFirebase(HK, next)).catch(function () {});\n          }\n        } catch (e) {}\n      };\n      w.__dbkHub = true; w.__dbkFresh = true; window.routeThought = w;\n    };\n    // Send to Reminder / Calendar opens a form; once it's saved, the note leaves the inbox (cancelling keeps it)\n    var isOpen = function (el) { if (!el) return false; var c = getComputedStyle(el); return c.display !== 'none' && c.visibility !== 'hidden' && (el.classList.contains('visible') || el.classList.contains('active') || el.classList.contains('open')); };\n    var wrapForms = function () {\n      [['saveAddReminderPopup', 'addReminderOverlay'], ['calendarAddEvent', 'addEventModalOverlay']].forEach(function (x) {\n        var f = window[x[0]]; if (typeof f !== 'function' || f.__dbkRoute) return;\n        var w2 = function () {\n          var pid = window._pendingRouteThoughtId;\n          var res = f.apply(this, arguments);\n          if (pid) Promise.resolve(res).then(function () { setTimeout(function () {\n            if (!isOpen(document.getElementById(x[1]))) { try { removeThoughtById(pid); } catch (e) {} if (window._pendingRouteThoughtId === pid) window._pendingRouteThoughtId = null; }\n          }, 400); });\n          return res;\n        };\n        w2.__dbkRoute = true; window[x[0]] = w2;\n      });\n      [['closeAddReminderPopup'], ['calendarHideAddForm']].forEach(function (x) {\n        var f = window[x[0]]; if (typeof f !== 'function' || f.__dbkRoute) return;\n        var w3 = function () { var r = f.apply(this, arguments); setTimeout(function () { window._pendingRouteThoughtId = null; }, 600); return r; };\n        w3.__dbkRoute = true; window[x[0]] = w3;\n      });\n    };\n    install(); guardDeletes(); wrapRoute(); wrapForms(); setTimeout(function () { install(); guardDeletes(); wrapRoute(); wrapForms(); }, 500); setTimeout(function () { install(); guardDeletes(); wrapRoute(); wrapForms(); }, 2000);\n    var refresh = function () {\n      var changed = fresh();\n      try { if (typeof updateInboxBadge === 'function') updateInboxBadge(); } catch (e) {}\n      // only redraw when something actually changed, and never while a note is being edited\n      try { var o = document.getElementById('inboxOverlay'); if (changed && o && o.classList.contains('visible') && !document.querySelector('.inbox-edit-area') && typeof renderInbox === 'function') renderInbox(); } catch (e) {}\n    };\n    window.addEventListener('storage', function (e) { if (!e.key || e.key === K || e.key === 'dbkCapQueue') refresh(); });\n    window.addEventListener('dbk-show', refresh); window.addEventListener('focus', refresh);\n    setInterval(refresh, 3000);\n  }\n\n  /* ---------- pages with little on them start a bit lower; an empty grocery list says so ---------- */\n  function sparsePages() {\n    // Work keeps its content right under its own switch, so it isn't spaced down\n    var views = { 'meal-plan.html': '.tab-view.active' };\n    var sel = views[page]; if (!sel) return;\n    var run = function () {\n      var v = document.querySelector(sel); if (!v) return;\n      [].forEach.call(document.querySelectorAll('.dbk-sparse'), function (x) { if (x !== v) x.classList.remove('dbk-sparse'); });\n      var had = v.classList.contains('dbk-sparse');\n      var h = v.scrollHeight - (had ? v.offsetHeight - v.clientHeight + (parseFloat(getComputedStyle(v).paddingTop) || 0) : 0);\n      var sparse = (had ? v.scrollHeight - window.innerHeight * 0.09 : v.scrollHeight) < window.innerHeight * 0.45;\n      // pages keep the same spacing whether or not they have much on them (nothing jumps as you add things)\n      if (had) v.classList.remove('dbk-sparse');\n      if (page === 'meal-plan.html') {\n        var gv = document.getElementById('grocery-view'); if (!gv) return;\n        var items = gv.querySelectorAll('.grocery-item').length, e = document.getElementById('dbkGrocEmpty');\n        if (!items && gv.classList.contains('active')) {\n          if (!e) { e = document.createElement('p'); e.id = 'dbkGrocEmpty'; e.className = 'dbk-groc-empty'; e.textContent = 'Nothing on the list yet. Add things above, or fill it from your meal plan.'; var anchorEl = gv.querySelector('.grocery-toolbar') || gv.querySelector('.grocery-add-row'); if (anchorEl) anchorEl.parentNode.insertBefore(e, anchorEl.nextSibling); else gv.appendChild(e); }\n        } else if (e) e.remove();\n      }\n    };\n    run(); setInterval(run, 800); window.addEventListener('hashchange', function () { setTimeout(run, 60); }); window.addEventListener('dbk-show', function () { setTimeout(run, 60); });\n  }\n\n  /* Reminders open at the top every time (Kasey, Oct 22: \"Every time i open reminders it should take me to the top of\n     the page\"). The general rule (popTop) puts a pop-up back at its top only when it is still where it was left; a list\n     drawn again as it opens, or a scroll still gliding when it was closed, slipped past that. These say it outright. */\n  function remTop() {\n    if (page !== 'index.html') return;\n    var top = function (id) { var o = document.getElementById(id); if (!o) return; o.scrollTop = 0; var all = o.getElementsByTagName('*'); for (var i = 0; i < all.length; i++) if (all[i].scrollTop) all[i].scrollTop = 0; };\n    var wrapTop = function (name, id) {\n      var f = window[name]; if (typeof f !== 'function' || f._dbkTop) return;\n      var w = function () { var r = f.apply(this, arguments); top(id); return r; }; w._dbkTop = 1; window[name] = w;\n    };\n    // (the list, when it was not already open: closing an edit goes back to the list where it was)\n    var lf = window.openReminderModal;\n    if (typeof lf === 'function' && !lf._dbkTop) {\n      window.openReminderModal = function () { var o = document.getElementById('reminderModalOverlay'), was = !!(o && o.classList.contains('visible')); var r = lf.apply(this, arguments); if (!was) top('reminderModalOverlay'); return r; };\n      window.openReminderModal._dbkTop = 1;\n    }\n    wrapTop('openAddReminderPopup', 'addReminderOverlay');\n    wrapTop('editReminder', 'editReminderOverlay');\n  }\n\n  ready(function () {\n    try { remTop(); } catch (e) {}\n    try { later(); } catch (e) {}\n    try { sparsePages(); } catch (e) {}\n    try { inboxOneList(); } catch (e) {}\n    try { journalTaps(); } catch (e) {}\n    try { skippedRows(); } catch (e) {}\n    try { seasonFoot(); } catch (e) {}\n    // (alignCloses lined each × up with its title; since Oct 21 every × sits in its pop-up's top right corner instead,\n    // \"THE × ON EVERY POP-UP\" at the end of daybook-theme.css)\n    try { softEdges(); } catch (e) {}\n    try { todaySettings(); todayApply(); } catch (e) {}\n    try { indexPage(); } catch (e) {}\n    // the bar says what it will do from the start (Today's own bar is written into index.html as \"capture a thought...\",\n    // and swapping the words 0.4s later showed on every page that had already appeared)\n    try { var ci0 = document.getElementById('captureInput'); if (ci0 && !ci0._dbkFind) ci0.setAttribute('placeholder', 'capture or search...'); } catch (e) {}\n    setTimeout(function () { try { searchBar(); } catch (e) {} }, 400);\n    setTimeout(pickUp, 700); window.addEventListener('dbk-show', function () { setTimeout(pickUp, 150); }); window.addEventListener('hashchange', function () { setTimeout(pickUp, 150); });\n    window.addEventListener('storage', function (e) { if (e.key === 'dbkFind' && e.newValue) setTimeout(pickUp, 200); });\n  });\n})();\n\n/* ═══ Notifications stay on (Kasey, Oct 23: \"they turned off on their own\"). An iPhone can drop a phone's push sign-up\n   (the app re-added to the Home Screen, website data cleared, Apple renewing it), and the server forgets a sign-up the\n   push service says is gone. Nothing then told the phone, so Settings just showed \"off\". Now, while this phone's person\n   wants them (dbkPushWant, set by Turn on, cleared only by Turn off) and the phone still allows them, every app open\n   (at most every 6 hours; Settings always) checks the sign-up and quietly makes a new one when it's gone, marked dead by\n   the server, or no longer the one the server has. It never asks the person anything: if the phone stopped allowing\n   notifications, Settings says so. Only the household's own Firebase is used. ═══ */\n(function () {\n  if (window.dbkPushKeep) return;\n  var ls = function (k, v) { try { if (v === undefined) return localStorage.getItem(k); if (v === null) localStorage.removeItem(k); else localStorage.setItem(k, v); } catch (e) { return null; } };\n  var supported = function () { return 'serviceWorker' in navigator && 'PushManager' in window && 'Notification' in window; };\n  var perm = function () { try { return Notification.permission; } catch (e) { return 'default'; } };\n  var cloud = function () { var fi = window.firestoreImports; return (!window.firebaseConfigEmpty && window.db && fi && fi.setDoc && fi.getDoc) ? fi : null; };\n  var who = function () { return window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser) || null; };\n  var reg = function () { return navigator.serviceWorker.getRegistration().then(function (r) { return r || navigator.serviceWorker.ready; }); };\n  var b64 = function (t) { var p = '='.repeat((4 - t.length % 4) % 4), raw = atob((t + p).replace(/-/g, '+').replace(/_/g, '/')), a = new Uint8Array(raw.length); for (var i = 0; i < raw.length; i++) a[i] = raw.charCodeAt(i); return a; };\n  // older phones that turned them on before dbkPushWant existed\n  if (ls('dbkPushOn') === '1' && !ls('dbkPushWant')) ls('dbkPushWant', '1');\n  var running = null;\n  // resolves 'on' (signed up and the server has it), 'renewed' (a new sign-up was made and saved), 'blocked', 'off'\n  // (not wanted), or 'later' (not signed in yet, offline or not supported)\n  window.dbkPushKeep = function (force) {\n    if (running) return running;\n    // a phone signed up before 'dbkPushWant' existed still wants them while it holds its sign-up\n    if (ls('dbkPushWant') !== '1') { if (ls('dbkPushOn') === '1' && ls('dbkPushId')) ls('dbkPushWant', '1'); else return Promise.resolve('off'); }\n    if (!supported()) return Promise.resolve('later');\n    if (perm() === 'denied') return Promise.resolve('blocked');\n    if (perm() !== 'granted') return Promise.resolve('blocked');\n    var at = +(ls('dbkPushCheckAt') || 0);\n    // (dbkPushV: this phone has checked its sign-up carries its login since Oct 31; until then it checks at once)\n    if (!force && Date.now() - at < 6 * 3600e3 && ls('dbkPushV') === '2') return Promise.resolve('on');\n    var fi = cloud(), u = who(), id = ls('dbkPushId');\n    if (!fi || !u || !u.uid || !id) return Promise.resolve('later');\n    // kept through a sign-in that ended by itself, for that login only: someone else signing in here starts fresh\n    var owner = ls('dbkPushUid');\n    if (owner && owner !== u.uid) { ['dbkPushWant', 'dbkPushOn', 'dbkPushId', 'dbkPushUid', 'dbkPushCheckAt', 'dbkPushV'].forEach(function (k) { ls(k, null); }); return Promise.resolve('off'); }\n    var ref = fi.doc(window.db, 'pushSubs', id);\n    running = Promise.all([reg().then(function (r) { return r.pushManager.getSubscription().then(function (s) { return { r: r, s: s }; }); }), fi.getDoc(ref).then(function (d) { return d.exists() ? d.data() : null; }, function (e) { return e && e.code === 'permission-denied' ? null : undefined; })])\n      .then(function (x) {\n        var r = x[0].r, s = x[0].s, d = x[1];\n        // couldn't read the server's copy (offline): try again next time. (A sign-up the server removed reads as\n        // refused under the rules, which is the same as gone: it's saved again below.)\n        if (d === undefined) return 'later';\n        var have = d && d.subscription && d.subscription.endpoint, dead = !!(d && d.dead);\n        // a sign-up saved before sign-ups carried a login (security audit, Oct 31): the server no longer sends to it and the\n        // rules let nobody change it, so it is removed and made again with this login, keeping its choices\n        var old = !!(d && !d.uid);\n        var keep = function (o) {\n          if (!old) return fi.setDoc(ref, o, { merge: true });\n          var whole = {}; for (var k in d) if (k !== 'dead' && k !== 'deadAt') whole[k] = d[k];\n          for (var k2 in o) whole[k2] = o[k2];\n          return Promise.resolve(fi.deleteDoc(ref)).then(function () { return fi.setDoc(ref, whole); });\n        };\n        var ok = function () { ls('dbkPushCheckAt', String(Date.now())); ls('dbkPushOn', '1'); ls('dbkPushUid', u.uid); ls('dbkPushV', '2'); return 'renewed'; };\n        var data = function (sub) {\n          var o = {}; try { o = JSON.parse(ls('dbkNotify') || '{}') || {}; } catch (e) {}\n          var out = { subscription: JSON.parse(JSON.stringify(sub)), dead: false, role: ls('myPersonRole') === 'person2' ? 'person2' : 'person1', uid: u.uid, updatedAt: new Date().toISOString(), renewedAt: new Date().toISOString() };\n          try { out.tz = Intl.DateTimeFormat().resolvedOptions().timeZone || 'America/New_York'; } catch (e) {}\n          if (!d || !d.prefs) out.prefs = { rem: o.rem || 'off', remTime: o.remTime || '08:00', ev: o.ev || 'off', evTime: o.evTime || '19:00', quietFrom: o.quietFrom || '', quietTo: o.quietTo || '' };\n          return out;\n        };\n        // all is well: the phone's sign-up is the one the server has\n        if (s && !dead && !old && have === s.endpoint) { ls('dbkPushCheckAt', String(Date.now())); ls('dbkPushOn', '1'); ls('dbkPushV', '2'); return 'on'; }\n        // the server lost it (or has an older one, or one without this login) but the phone's is fine: save it again\n        if (s && !dead) return keep(data(s)).then(ok);\n        // gone, or the push service said it's dead: make a new one\n        return Promise.resolve(s && s.unsubscribe().catch(function () {}))\n          .then(function () { return window.dbkPushUnmute ? window.dbkPushUnmute() : null; })   // (a phone marked signed out never drops this new sign-up: sw.js)\n          .then(function () { return fetch('/api/push-key', { cache: 'no-store' }).then(function (k) { return k.ok ? k.json() : {}; }); })\n          .then(function (k) {\n            if (!k || !k.key) return 'later';\n            return r.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: b64(k.key) }).then(function (n) {\n              return keep(data(n)).then(ok);\n            });\n          });\n      })\n      .catch(function () { return 'later'; })\n      .then(function (v) { running = null; return v; });\n    return running;\n  };\n  // on every page load (throttled above), once someone is signed in\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').toLowerCase();\n  if (page === 'settings.html' || window.top !== window && page !== 'index.html') return;   // Settings runs it itself; one page is enough\n  var tries = 0;\n  (function go() { if (++tries > 20) return; if (!cloud() || !who()) { setTimeout(go, 3000); return; } window.dbkPushKeep(false); })();\n})();\n\n/* ═══ Notifications: each phone chooses in Settings; a timed job on the site sends them ═══ */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html').toLowerCase();\n  if (page !== 'settings.html') return;\n  var role = 'person1'; try { if (localStorage.getItem('myPersonRole') === 'person2') role = 'person2'; } catch (e) {}\n  var DEF = { rem: 'off', remTime: '08:00', ev: 'off', evTime: '19:00', quietFrom: '21:00', quietTo: '07:00' };\n  var load = function () { var o = {}; try { o = JSON.parse(localStorage.getItem('dbkNotify') || '{}') || {}; } catch (e) {} var r = {}; for (var k in DEF) r[k] = o[k] != null ? o[k] : DEF[k]; return r; };\n  var devId = function () { var id = ''; try { id = localStorage.getItem('dbkPushId') || ''; if (!id) { id = 'p' + Date.now().toString(36) + Math.random().toString(36).slice(2, 10); localStorage.setItem('dbkPushId', id); } } catch (e) { id = 'p' + Date.now().toString(36); } return id; };\n  var tz = function () { try { return Intl.DateTimeFormat().resolvedOptions().timeZone || 'America/New_York'; } catch (e) { return 'America/New_York'; } };\n  var ios = /iphone|ipad|ipod/i.test(navigator.userAgent) || (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);\n  var standalone = function () { try { return (window.top || window).matchMedia('(display-mode: standalone)').matches || window.navigator.standalone === true || (window.top && window.top.navigator.standalone === true); } catch (e) { return false; } };\n  var supported = function () { return 'serviceWorker' in navigator && 'PushManager' in window && 'Notification' in window; };\n  var b64 = function (s) { var p = '='.repeat((4 - s.length % 4) % 4), raw = atob((s + p).replace(/-/g, '+').replace(/_/g, '/')), a = new Uint8Array(raw.length); for (var i = 0; i < raw.length; i++) a[i] = raw.charCodeAt(i); return a; };\n  var reg = function () { return navigator.serviceWorker.getRegistration().then(function (r) { return r || navigator.serviceWorker.ready; }); };\n  var cloud = function () { var fi = window.firestoreImports; return (!window.firebaseConfigEmpty && window.db && fi && fi.setDoc) ? fi : null; };\n  var dev = function () { return window.dbkDevice || 'device'; };\n  var appName = function () { return ((window.HH && window.HH.appName) || '2daysbook').trim(); };\n  var perm = function () { try { return typeof Notification !== 'undefined' ? Notification.permission : 'default'; } catch (e) { return 'default'; } };\n  var signedUp = function () { try { return localStorage.getItem('dbkPushOn') === '1'; } catch (e) { return false; } };\n  // this phone's state, for the pop-up and the Settings row: on / off / blocked / homescreen (iPhone in Safari) / unsupported\n  var stateNow = function (on) {\n    if (ios && !standalone()) return 'homescreen';\n    if (!supported()) return 'unsupported';\n    if (perm() === 'denied') return 'blocked';\n    return (on == null ? signedUp() : on) && perm() === 'granted' ? 'on' : 'off';\n  };\n  window.dbkNotifyState = function () { return stateNow(); };\n  var esc = function (t) { return String(t == null ? '' : t).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); };\n  var clock = function (t) { var m = /^(\\d{1,2}):(\\d{2})/.exec(t || ''); if (!m) return ''; var h = +m[1]; return (h % 12 || 12) + ':' + m[2] + (h < 12 ? ' AM' : ' PM'); };\n  var ICON = {\n    on: '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><path d=\"M7.5 12.5l3 3 6-6.5\"/></svg>',\n    bell: '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z\"/><path d=\"M10 20.5a2 2 0 0 0 4 0\"/></svg>',\n    off: '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M6 16V11a6 6 0 0 1 12 0v5l1.5 2h-15z\"/><path d=\"M10 20.5a2 2 0 0 0 4 0\"/><path d=\"M4 4l16 16\"/></svg>'\n  };\n\n  function run() {\n    var el = function (id) { return document.getElementById(id); };\n    var rem = el('ntRem'); if (!rem || rem._dbk) return; rem._dbk = 1;\n    var remT = el('ntRemTime'), ev = el('ntEv'), evT = el('ntEvTime'), qf = el('ntQuietFrom'), qt = el('ntQuietTo'), state = el('ntState'), acts = el('ntActs'), head = el('ntHead'), box = el('ntStatus');\n    var p = load();\n    rem.value = p.rem; remT.value = p.remTime; ev.value = p.ev; evT.value = p.evTime; qf.value = p.quietFrom; qt.value = p.quietTo;\n    var on = signedUp(), busy = '';\n    var rows = function () {\n      el('ntRemTimeRow').hidden = rem.value === 'off';\n      el('ntEvTimeRow').hidden = !(ev.value === 'daybefore' || ev.value === 'morning');\n    };\n    // what this phone will be sent, one line each\n    var picked = function () {\n      var out = [];\n      if (rem.value === 'morning') out.push('Reminders the morning they’re due, at ' + clock(remT.value || DEF.remTime));\n      else if (rem.value === 'daybefore') out.push('Reminders the day before, at ' + clock(remT.value || DEF.remTime));\n      if (ev.value === 'morning') out.push('Calendar events the morning of, at ' + clock(evT.value || DEF.evTime));\n      else if (ev.value === 'daybefore') out.push('Calendar events the day before, at ' + clock(evT.value || DEF.evTime));\n      else if (ev.value === 'hour') out.push('Calendar events an hour before');\n      return out;\n    };\n    var btn = function (what, label, filled) { return '<button type=\"button\" class=\"' + (filled ? 'btn btn-small' : 'btn-secondary btn btn-small') + '\" data-nt=\"' + what + '\">' + label + '</button>'; };\n    var lines = function (a) { return a.map(function (t) { return '<span class=\"dbk-nt-line\">' + esc(t) + '</span>'; }).join(''); };\n    // busy: 'asking' | 'nokey' | 'failed' | 'sending' | 'sent' | 'testfail' (a moment's note on top of the state)\n    var paint = function () {\n      rows();\n      var st = stateNow(on), d = dev(), name = appName(), icon = 'bell', h = '', det = [], b = '';\n      if (st === 'on') {\n        icon = 'on'; h = 'Notifications are on for this ' + d;\n        var what = picked();\n        det = what.length ? what : ['Nothing is picked below yet, so nothing will be sent.'];\n        if (busy === 'sending') det = ['Sending a test…'];\n        else if (busy === 'sent') det = ['Test sent. It should show up in a few seconds.'];\n        else if (busy === 'testfail') det = ['The test didn’t send. Turn them off and on again, then try once more.'];\n        b = btn('test', 'Send me a test') + btn('off', 'Turn off');\n      } else if (st === 'homescreen') {\n        icon = 'off'; h = 'On iPhone, notifications work from the Home Screen';\n        det = ['In Safari, tap Share, then Add to Home Screen.', 'Open ' + name + ' from that icon and come back here.'];\n      } else if (st === 'unsupported') {\n        icon = 'off'; h = 'This browser can’t show notifications';\n        det = ios ? ['Notifications need iOS 16.4 or newer.', 'Update in Settings › General › Software Update.'] : ['Try another browser, or turn them on from your phone.'];\n      } else if (st === 'blocked') {\n        icon = 'off'; h = 'Notifications are blocked for ' + name;\n        det = ios ? ['To allow them, open your iPhone’s Settings › Notifications › ' + name + ' and turn on Allow Notifications.', 'Then come back here.']\n          : ['To allow them, open this ' + d + '’s settings for ' + name + ' (or for this site in the browser) and allow notifications.', 'Then come back here.'];\n      } else {\n        h = 'Notifications are off for this ' + d;\n        det = [picked().length ? 'Turn them on, and when your ' + d + ' asks, tap Allow.' : 'Pick what you’d like below, then turn them on. When your ' + d + ' asks, tap Allow.'];\n        // they were on and the phone itself let go of them (it asks again before allowing them)\n        var wanted = false; try { wanted = localStorage.getItem('dbkPushWant') === '1'; } catch (x) {}\n        if (wanted && perm() === 'default') det = ['Your ' + d + ' turned notifications off for ' + name + ', not you. Turn them on again and tap Allow.'];\n        if (busy === 'asking') det = ['Waiting for your ' + d + '’s answer…'];\n        else if (busy === 'nokey') det = ['Notifications aren’t set up on this copy of ' + name + ' yet.', 'The person who set up this copy can finish that step.'];\n        else if (busy === 'failed') det = ['That didn’t work. Check this ' + d + ' is online, then try again.'];\n        b = busy === 'nokey' ? '' : btn('on', busy === 'failed' ? 'Try again' : 'Turn on for this ' + d, true);\n      }\n      box.setAttribute('data-state', st);\n      var hh = '<span class=\"dbk-nt-ic\">' + ICON[icon] + '</span><span>' + esc(h) + '</span>';\n      if (head._h !== hh) { head.innerHTML = hh; head._h = hh; }\n      var dd = lines(det); if (state._h !== dd) { state.innerHTML = dd; state._h = dd; }\n      if (acts._h !== b) { acts.innerHTML = b; acts._h = b; }\n      acts.hidden = !b;\n    };\n    var prefs = function () { return { rem: rem.value, remTime: remT.value || DEF.remTime, ev: ev.value, evTime: evT.value || DEF.evTime, quietFrom: qf.value || '', quietTo: qt.value || '' }; };\n    var saveCloud = function (extra) {\n      var fi = cloud(); if (!fi) return Promise.resolve();\n      // the login that signed this phone up: only it can change or remove the sign-up (firestore.rules)\n      var u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n      var data = { prefs: prefs(), role: role, tz: tz(), updatedAt: new Date().toISOString(), uid: (u && u.uid) || null };\n      // whether this person has the Work page: Work events and reminders are only sent to phones that do\n      try { if (window.dbkModule && window.dbkModule.workOn) data.work = !!window.dbkModule.workOn(); } catch (e) {}\n      if (extra) for (var k in extra) data[k] = extra[k];\n      return fi.setDoc(fi.doc(window.db, 'pushSubs', devId()), data, { merge: true });\n    };\n    var save = function () {\n      try { localStorage.setItem('dbkNotify', JSON.stringify(prefs())); } catch (e) {}\n      if (on) saveCloud().catch(function () {});\n      if (busy === 'sent' || busy === 'testfail') busy = '';\n      paint();\n    };\n    var tell = function (m) { try { if (window.dbkNotice) window.dbkNotice(m); } catch (e) {} };\n    // the times shown follow the choice: an evening heads-up for \"the day before\", early for \"the morning of\"\n    ev.addEventListener('change', function () { if (ev.value === 'morning' && evT.value === '19:00') evT.value = '07:00'; if (ev.value === 'daybefore' && evT.value === '07:00') evT.value = '19:00'; save(); });\n    rem.addEventListener('change', function () { if (rem.value === 'daybefore' && remT.value === '08:00') remT.value = '18:00'; if (rem.value === 'morning' && remT.value === '18:00') remT.value = '08:00'; save(); });\n    [remT, evT, qf, qt].forEach(function (i) { i.addEventListener('change', save); });\n\n    acts.addEventListener('click', function (e) {\n      var b = e.target.closest('[data-nt]'); if (!b || b.disabled) return;\n      var what = b.getAttribute('data-nt');\n      if (what === 'on') {\n        b.disabled = true; busy = 'asking'; paint();\n        Notification.requestPermission().then(function (pm) {\n          if (pm !== 'granted') { busy = ''; paint(); return; }   // blocked: the pop-up says how to allow it\n          return fetch('/api/push-key', { cache: 'no-store' }).then(function (r) { return r.ok ? r.json() : {}; }).catch(function () { return {}; }).then(function (k) {\n            if (!k || !k.key) { busy = 'nokey'; paint(); return; }\n            return Promise.resolve(window.dbkPushUnmute ? window.dbkPushUnmute() : null).then(reg).then(function (r) {\n              return r.pushManager.getSubscription().then(function (s) { return s || r.pushManager.subscribe({ userVisibleOnly: true, applicationServerKey: b64(k.key) }); });\n            }).then(function (s) {\n              return saveCloud({ subscription: JSON.parse(JSON.stringify(s)) }).then(function () {\n                on = true; busy = ''; try { localStorage.setItem('dbkPushOn', '1'); localStorage.setItem('dbkPushWant', '1'); localStorage.setItem('dbkPushCheckAt', String(Date.now())); var su = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser); if (su && su.uid) localStorage.setItem('dbkPushUid', su.uid); } catch (x) {}\n                paint(); tell('Notifications are on for this ' + dev());\n              });\n            });\n          });\n        }).catch(function () { busy = 'failed'; paint(); }).then(function () { b.disabled = false; });\n      } else if (what === 'test') {\n        b.disabled = true; busy = 'sending'; paint();\n        // the server only sends for someone signed in to this household\n        var u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n        Promise.resolve(u && u.getIdToken ? u.getIdToken() : '').catch(function () { return ''; }).then(function (tok) {\n          var h = { 'content-type': 'application/json' }; if (tok) h.authorization = 'Bearer ' + tok;\n          return fetch('/api/push-test', { method: 'POST', headers: h, body: JSON.stringify({ id: devId() }) });\n        })\n          .then(function (r) { busy = r.ok ? 'sent' : 'testfail'; paint(); tell(r.ok ? 'Test sent. It should show up in a few seconds.' : 'The test didn’t send.'); })\n          .catch(function () { busy = 'testfail'; paint(); tell('Couldn’t reach the server. Try again in a moment.'); })\n          .then(function () { b.disabled = false; });\n      } else if (what === 'off') {\n        b.disabled = true;\n        reg().then(function (r) { return r.pushManager.getSubscription(); }).then(function (s) { return s && s.unsubscribe(); }).catch(function () {})\n          .then(function () { var fi = cloud(); if (fi && fi.deleteDoc) return fi.deleteDoc(fi.doc(window.db, 'pushSubs', devId())).catch(function () {}); })\n          .then(function () { on = false; busy = ''; try { localStorage.removeItem('dbkPushOn'); localStorage.removeItem('dbkPushWant'); localStorage.removeItem('dbkPushUid'); } catch (x) {} paint(); tell('Notifications are off for this ' + dev()); });\n      }\n    });\n\n    // is this phone already signed up? (checked again whenever the app comes back, e.g. from the phone's Settings)\n    var check = function () {\n      if (!supported()) { paint(); return; }\n      // first make sure a wanted sign-up is really there (a new one is made quietly when the phone dropped it)\n      Promise.resolve(window.dbkPushKeep ? window.dbkPushKeep(true) : null).catch(function () {}).then(function () { return reg(); }).then(function (r) { return r && r.pushManager.getSubscription(); }).then(function (s) {\n        var was = on; on = !!s && perm() === 'granted';\n        if (!!s !== signedUp()) { try { if (s && on) localStorage.setItem('dbkPushOn', '1'); else localStorage.removeItem('dbkPushOn'); } catch (x) {} }\n        if (s && on) { try { localStorage.setItem('dbkPushWant', '1'); } catch (x) {} }\n        if (on !== was || busy === 'failed') paint();\n        if (on) saveCloud({ subscription: JSON.parse(JSON.stringify(s)) }).catch(function () {});\n      }).catch(function () {});\n    };\n    document.addEventListener('visibilitychange', function () { if (!document.hidden) { paint(); check(); } });\n    // opening Settings > Notifications always shows where things stand now (a note from last time is gone)\n    document.addEventListener('click', function (e) { if (e.target.closest && e.target.closest('[data-setx=\"notify\"]')) { busy = ''; paint(); check(); } }, true);\n    check();\n    paint();\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();\n  setTimeout(run, 800);\n})();\n\n/* ═══ Fewer buttons on the page: the less-used actions live inside the pop-up they belong to ═══ */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html').toLowerCase();\n  var ready = function (fn) { if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', fn); else fn(); };\n  // Habits: the board shows just \"Edit habits\"; Reset and Shuffle are in that pop-up\n  if (/-hub\\.html$/.test(page)) ready(function () {\n    var modal = document.querySelector('#habitsModalOverlay .habits-modal'), acts = modal && modal.querySelector('.habits-modal-actions');\n    if (!modal || !acts || document.getElementById('dbkHabitMore')) return;\n    var row = document.createElement('div'); row.id = 'dbkHabitMore'; row.className = 'dbk-habit-more';\n    row.innerHTML = '<button type=\"button\" class=\"dbk-link\" data-hm=\"reset\">Reset today</button><button type=\"button\" class=\"dbk-link\" data-hm=\"shuffle\">Shuffle the board</button>';\n    modal.insertBefore(row, acts);\n    row.addEventListener('click', function (e) {\n      var b = e.target.closest('[data-hm]'); if (!b) return;\n      // the hub keeps unsaved edits (it asks to save them first) and asks before clearing today's checks\n      if (typeof window.habitsEditorAction === 'function') { window.habitsEditorAction(b.getAttribute('data-hm')); return; }\n      try { if (typeof closeHabitsEditor === 'function') closeHabitsEditor(); } catch (x) {}\n      try { if (b.getAttribute('data-hm') === 'reset') resetBoard(); else shuffleBoard(); } catch (x) {}\n    });\n  });\n  // Meals: \"skip\" moves off every row and into the pop-up you get when you tap a meal\n  if (page === 'meal-plan.html') {\n    var last = null;\n    var hook = function () {\n      var f = window.openMealPicker; if (typeof f !== 'function' || f.__dbkSkip) return;\n      var w = function (dk, st, p) { last = { dk: dk, st: st, p: p }; var r = f.apply(this, arguments); setTimeout(paint, 30); return r; };\n      for (var k in f) w[k] = f[k]; w.__dbkSkip = true; window.openMealPicker = w;\n    };\n    var paint = function () {\n      var m = document.getElementById('meal-picker-modal'); if (!m) return;\n      var body = m.querySelector('.modal-body'); if (!body) return;\n      var row = document.getElementById('dbkPickSkip');\n      if (!row) { row = document.createElement('div'); row.id = 'dbkPickSkip'; row.className = 'dbk-pick-skip'; row.innerHTML = '<button type=\"button\" class=\"dbk-link\"></button>'; body.appendChild(row);\n        row.firstChild.addEventListener('click', function () { if (!last || typeof window.toggleSlotSkip !== 'function') return; window.toggleSlotSkip(last.dk, last.st || 'snack', last.p); try { closeMealPicker(); } catch (x) {} }); }\n      var name = { breakfast: 'breakfast', lunch: 'lunch', dinner: 'dinner', dessert: 'dessert', snack: 'snacks' }[last && last.st] || 'this meal';\n      row.firstChild.textContent = 'Skip ' + name;\n      row.hidden = !last || !last.dk;\n    };\n    ready(function () { hook(); setTimeout(hook, 800); setTimeout(hook, 2500); });\n  }\n})();\n\n/* ═══ Today's greeting: one line if it fits (it may shrink a touch). A longer name goes on its own second line at the\n   full size, rather than everything crammed small onto one (the designer, Oct 20) ═══ */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html').toLowerCase();\n  if (page !== 'index.html' && page !== '') return;\n  var fit = function () {\n    var h = document.querySelector('.hm-greet'); if (!h || !h.offsetWidth) return;\n    h.style.removeProperty('font-size'); h.querySelectorAll('span').forEach(function (s) { s.style.removeProperty('font-size'); });\n    h.classList.remove('dbk-greet-2');\n    var max = parseFloat(getComputedStyle(h).fontSize) || 38, min = Math.max(24, Math.round(max * 0.9)), size = max;\n    var room = h.clientWidth;\n    h.style.whiteSpace = 'nowrap';\n    var set = function (px) { h.style.setProperty('font-size', px + 'px', 'important'); h.querySelectorAll('span').forEach(function (s) { s.style.setProperty('font-size', px + 'px', 'important'); }); };\n    while (h.scrollWidth > room && size > min) { size -= 1; set(size); }\n    if (h.scrollWidth <= room) return;\n    // two lines: the greeting, then the name, back at full size; only a name too long for its own line shrinks (not below 24px)\n    h.classList.add('dbk-greet-2'); size = max; set(size);\n    var nm = document.getElementById('homeNames');\n    while (nm && nm.scrollWidth > room && size > 24) { size -= 1; set(size); }\n    h.style.whiteSpace = nm && nm.scrollWidth > room ? '' : 'nowrap';\n  };\n  var run = function () { requestAnimationFrame(fit); };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', run); else run();\n  window.addEventListener('resize', run); window.addEventListener('dbk-show', run);\n  if (document.fonts && document.fonts.ready) document.fonts.ready.then(run);\n  var tries = 0, t = setInterval(function () { run(); if (++tries > 8) clearInterval(t); }, 500);\n  var obs = new MutationObserver(run); var watch = function () { var g = document.getElementById('homeNames'), gg = document.getElementById('homeGreeting'); if (g) obs.observe(g, { childList: true, characterData: true, subtree: true }); if (gg) obs.observe(gg, { childList: true, characterData: true, subtree: true }); };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', watch); else watch();\n})();\n\n\n/* ── Small icons in place of row-level words: a round tick for \"Done\", a + beside a single field for \"Add\",\n   and a × for removing one row. Same buttons and handlers as before, so nothing works differently; the words\n   become an aria-label for screen readers. Form actions (Save, Cancel…) and section links keep their words. ── */\n(function () {\n  var RULES = [\n    ['tick', 'Done', '#hmEvents .hc-rem [data-remdone], #hmEvents .hc-cook [data-cookdone], #currentReminder button[onclick^=\"markCurrentReminderDone\"]'],\n    ['plus', 'Add', '#wbNew button[type=\"submit\"], #wbIdeaForm button[type=\"submit\"], #wbSparkForm button[type=\"submit\"], #wrcNewIdea button[type=\"submit\"], ' +\n      '#mprGroc .mprg-add button[type=\"submit\"], .tp-packadd button[type=\"submit\"], .habits-modal .add-habit-btn, button[onclick^=\"addDietTagFromSettings\"], ' +\n      'button[onclick=\"addSpark()\"], button[onclick=\"addManualGroceryItem()\"], .mprj-addday'],\n    ['x', 'Remove', '#brandColorsList button[onclick^=\"removeBrandColor\"], button[onclick^=\"removeCustomLink\"], button[onclick^=\"deleteBusiness\"], ' +\n      '.brand-asset-act[onclick^=\"removeAssetAt\"], .dbk-skip-rm, button[onclick^=\"removeOffer\"], button[onclick^=\"removeBizDate\"], ' +\n      '.hm-thing .thing-x, #reminderModalList [data-remdel-id], #hmEvents .hc-cook [data-cookx], #habitsList .habit-delete, #mprGroc .mprg-x, .resource-item-actions [data-act=\"delete\"]']\n  ];\n  function mark(root) {\n    if (!root || !root.querySelectorAll) return;\n    RULES.forEach(function (r) {\n      var list = root.querySelectorAll(r[2]);\n      for (var i = 0; i < list.length; i++) {\n        var b = list[i]; if (b.getAttribute('data-dbk-icon') === r[0]) continue;\n        var words = (b.textContent || '').trim();\n        if (!b.getAttribute('aria-label')) b.setAttribute('aria-label', words && !/^[+×x✕]$/i.test(words) ? words.charAt(0).toUpperCase() + words.slice(1).toLowerCase() : r[1]);\n        b.setAttribute('data-dbk-icon', r[0]);\n        if (b.tagName === 'SPAN') b.setAttribute('aria-hidden', 'true');\n        // a centered field keeps its words centered on the whole line: room on the left to match the + on the right\n        if (r[0] === 'plus') { var f = b.parentNode && b.parentNode.querySelector('input[type=\"text\"], input:not([type])'); if (f && getComputedStyle(f).textAlign === 'center') f.style.setProperty('padding-left', '44px', 'important'); }\n      }\n    });\n  }\n  // new rows get their icon before the screen updates (waiting a frame showed the word first, then swapped it)\n  // (each place looked through once per batch: a list drawn with 300 rows added 300 nodes under one parent and that parent\n  // was searched 300 times, about 1.7s of Money opening on a phone 4x slower; Oct 31)\n  function added(ms) {\n    var seen = [];\n    for (var i = 0; i < ms.length; i++) for (var j = 0; j < ms[i].addedNodes.length; j++) { var n = ms[i].addedNodes[j]; if (n.nodeType === 1) { var r = n.parentNode || n; if (seen.indexOf(r) < 0) seen.push(r); } }\n    seen.forEach(function (r) { if (!seen.some(function (o) { return o !== r && o.contains && o.contains(r); })) mark(r); });\n  }\n  function start() {\n    mark(document);\n    try { new MutationObserver(added).observe(document.body, { childList: true, subtree: true }); } catch (e) {}\n    // (A tick used to fill with a ✓ the moment a finger went down on it. A finger that went down on one to scroll the\n    // page left it ticked but not crossed off, since no click came (Kasey, Oct 31: \"When my scroll touches a 'o' … it\n    // checks it but doesn't cross it … Make it to where i have to click to cross\"). It only changes on a real tap now.)\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();\n})();\n\n/* ---------- No font swaps mid-use: every weight and style of the fonts this page uses loads up front ----------\n   Fonts load one weight at a time, the first time something needs it, so a bold name or an italic note used to\n   show in a fallback font for a moment and then jump to the real one. Loading them all right after the page\n   loads (only the families actually in use) means text never changes size after it appears. */\n(function () {\n  if (!document.fonts || !document.fonts.forEach) return;\n  var busy = false;\n  function inUse() {\n    var fams = {}, els = [document.body].concat([].slice.call(document.querySelectorAll('h1, h2, h3, b, strong, em, i, button, .dbk-hero, [class*=\"title\"]')).slice(0, 80));\n    els.forEach(function (e) { try { String(getComputedStyle(e).fontFamily).split(',').forEach(function (f) { fams[f.trim().replace(/^[\"']|[\"']$/g, '').toLowerCase()] = 1; }); } catch (x) {} });\n    return fams;\n  }\n  function warm() {\n    if (busy) return; busy = true;\n    setTimeout(function () {\n      busy = false;\n      var fams = inUse();\n      document.fonts.forEach(function (ff) { var fam = String(ff.family).replace(/^[\"']|[\"']$/g, '').toLowerCase(); if (ff.status === 'unloaded' && fams[fam]) { try { ff.load().catch(function () {}); } catch (x) {} } });\n    }, 50);\n  }\n  if (document.readyState === 'complete') warm(); else window.addEventListener('load', warm);\n  // a new look (other fonts) or a font file arriving: catch up on the rest of that family\n  try { document.fonts.addEventListener('loadingdone', warm); } catch (x) {}\n  window.addEventListener('dbk-show', warm);\n})();\n/* ---------- Recently removed (the designer, Oct 19: a reminder deleted by accident was gone for good) ----------\n   Whatever is removed (reminders, calendar events, Back Burner items, list items, Inbox notes, grocery items,\n   recipes, ...) is kept for 5 days in\n   'dbkRemoved', on this phone and in the household's cloud copy, so it shows on both phones. Settings > Recently\n   removed lists it; \"put back\" leaves a request in 'dbkRestoreQ', and the page the item belongs to puts it back\n   with its own saving (so it lands exactly as an item added there would). A page only does that once it has been\n   open a few seconds with its data loaded, so a half-loaded list is never saved over the real one. */\n(function () {\n  var KEY = 'dbkRemoved', QKEY = 'dbkRestoreQ', DAYS = 5, born = Date.now();   // (Kasey, Oct 25: \"maybe only actually keep stuff for 3 or 5 days\"; it was 7, before that 30)\n  window.dbkRemovedDays = DAYS;\n  // bigger deletions: their Undo message says where they went (dbkNotice.kept in shared.js)\n  var BIG = { 'Business': 1, 'List': 1, 'Recipe': 1, 'Post': 1, 'Trip stop': 1, 'Place to stay': 1, 'Subscription': 1 };\n  function big(kind, gone) { if (/^Done/.test(kind)) return false; return !!BIG[kind] || gone.length >= 3 || (kind === 'Event' && gone.length >= 2); }\n  var read = function (k, d) { try { var v = JSON.parse(localStorage.getItem(k) || 'null'); return v == null ? d : v; } catch (e) { return d; } };\n  var write = function (k, v) { try { localStorage.setItem(k, JSON.stringify(v)); } catch (e) {} };\n  var me = function () { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) { return 'person1'; } };\n  // two copies (this phone's and the cloud's) become one: every entry once, \"put back\" wins, nothing older than DAYS\n  // (security review 2, Nov 1: this person's own entries, those in their own place, are kept apart from the shared ones:\n  // 300 of each, so 300 entries the partner's login dated far ahead can't push anyone's own out)\n  function merge(a, b) {\n    var by = {}, out = [], now = Date.now(), cut = now - DAYS * 864e5;\n    // (third review: an entry is never dropped for a time ahead, so a device whose clock runs fast loses nothing; such a\n    // time only counts as now, for ordering and the 300s)\n    // (fourth review: and one dated ahead counts from when this phone first saw it, so it still goes after DAYS)\n    var seenAt = {}; try { seenAt = JSON.parse(localStorage.getItem('dbkRemovedSeen') || '{}') || {}; } catch (e0) {}\n    var seenNew = false;\n    var when = function (e) {\n      var t = +e.at || 0; if (t <= now) return t;\n      if (!seenAt[e.id]) { seenAt[e.id] = now; seenNew = true; }\n      return Math.min(now, seenAt[e.id]);\n    };\n    (a || []).concat(b || []).forEach(function (e) {\n      if (!e || !e.id || !(when(e) > cut)) return;\n      if (by[e.id]) { if (e.done) by[e.id].done = true; return; }\n      by[e.id] = JSON.parse(JSON.stringify(e)); out.push(by[e.id]);\n    });\n    out.sort(function (x, y) { return when(y) - when(x); });\n    var mine = {}; try { mine = (window.dbkOwnKeysOf && window.dbkOwnKeysOf('dbkRemoved/data')) || {}; } catch (e) {}\n    var own = out.filter(function (e) { return mine['k' + e.id]; }), rest = out.filter(function (e) { return !mine['k' + e.id]; });\n    var res = own.slice(0, 300).concat(rest.slice(0, 300)).sort(function (x, y) { return when(y) - when(x); });\n    if (seenNew) { try { var ids = {}; res.forEach(function (e) { ids[e.id] = 1; }); var keep = {}; Object.keys(seenAt).forEach(function (k) { if (ids[k]) keep[k] = seenAt[k]; }); localStorage.setItem('dbkRemovedSeen', JSON.stringify(keep)); } catch (e1) {} }\n    return res;\n  }\n  function cloudOk() { return typeof syncToFirebase === 'function' && window.firebaseReady && !window.firebaseConfigEmpty; }\n  function save(list) { write(KEY, list); try { if (cloudOk()) syncToFirebase(KEY, list); } catch (e) {} }\n  function pull() {\n    try {\n      if (!cloudOk() || typeof window.loadFromFirebaseLive !== 'function') return;\n      window.loadFromFirebaseLive(KEY).then(function (cloud) {\n        if (!Array.isArray(cloud)) return;\n        var local = read(KEY, []), both = merge(local, cloud);\n        if (JSON.stringify(both) !== JSON.stringify(local)) write(KEY, both);\n        if (JSON.stringify(both) !== JSON.stringify(merge(cloud, []))) { try { syncToFirebase(KEY, both); } catch (e) {} }\n      }, function () {});\n    } catch (e) {}\n  }\n  // what a list looks like right now on this phone (to tell whether an entry is already back)\n  // The cloud copy this phone last saw comes first: a list's own key ('lifeReminders', 'calendarEvents') is only\n  // written when THIS phone saves, so on the other phone it still holds things removed here since.\n  function current(key) {\n    // the Work page's parts ('wr|businesses', 'wr|content', 'wr|offers|<business>'): one document on the phone (wr:data)\n    // the new Work page's Waiting to be paid ('wrwait|<business>'): the items still waiting (paid or deleted ones stay in\n    // the list marked gone, work-new.js)\n    if (/^wrwait\\|/.test(key)) { var ww = (read('wr:data', {}) || {}).waiting; return Array.isArray(ww) ? ww.filter(function (x) { return x && !x.gone; }) : []; }\n    if (/^wr\\|/.test(key)) { var w = read('wr:data', {}) || {}; String(key).split('|').slice(1).forEach(function (k) { w = w && typeof w === 'object' ? w[k] : undefined; }); return Array.isArray(w) ? w : []; }\n    try { if (window.dbkSnapItems) { var s = window.dbkSnapItems(key); if (Array.isArray(s)) return s; } } catch (e) {}\n    var v = read(key, null); return Array.isArray(v) ? v : (v && Array.isArray(v.items) ? v.items : []);\n  }\n  // things taken off a shared list (Lists page) that the partner now keeps just for themselves: not listed here either\n  function listAway(S, e) {\n    var k = String(e.key || ''); if (!S || !S.listHidden || !/^dreams_/.test(k) || /_person[12]$/.test(k)) return false;\n    var cat = k.slice(7), it = Array.isArray(e.items) ? e.items : [];\n    return it.length > 0 && it.every(function (x) { return S.listHidden(cat, x); });\n  }\n  function isBack(e) { var idf = e.idf || 'id', have = {}; current(e.key).forEach(function (x) { if (x && x[idf] != null) have[String(x[idf])] = 1; }); return (e.items || []).every(function (x) { return x && have[String(x[idf])]; }); }\n  var appliers = [];\n  var api = window.dbkRemoved = {\n    // before/after: the list as it was and as it is; what's missing from after was removed\n    track: function (kind, key, before, after, opts) {\n      try {\n        opts = opts || {}; var idf = opts.id || 'id', tf = opts.title || 'title';\n        var have = {}; (after || []).forEach(function (x) { if (x && x[idf] != null) have[String(x[idf])] = 1; });\n        var gone = (before || []).filter(function (x) { return x && x[idf] != null && !have[String(x[idf])]; });\n        if (!gone.length) return;\n        // an item kept \"just mine\" (Settings > Sharing) keeps its owner mark here too, so the other phone doesn't list it;\n        // a page may hold it without the mark (the mark is added on the way to the cloud), so it comes from the cloud copy\n        var snapL = []; try { snapL = (window.dbkSnapItems && window.dbkSnapItems(key)) || []; } catch (x0) {}\n        if (Array.isArray(snapL) && snapL.length) gone = gone.map(function (x) {\n          if (x.mine || x.by) return x;\n          var m = snapL.filter(function (y) { return y && y[idf] != null && String(y[idf]) === String(x[idf]) && (y.mine || y.by); })[0];\n          if (!m) return x; var c = {}; for (var f in x) c[f] = x[f];\n          if (m.mine) { c.mine = m.mine; c.mineAt = m.mineAt; } if (m.mineIn) c.mineIn = m.mineIn; if (m.by) c.by = m.by; return c;\n        });\n        var t = String(opts.label || gone[0][tf] || gone[0].text || gone[0].name || '').trim() || kind;   // (opts.label: \"Soccer (Sat, Oct 25)\" for one date of an event)\n        var e = { id: 'rr' + Date.now().toString(36) + Math.random().toString(36).slice(2, 6), kind: kind, title: t, n: gone.length, key: key, idf: idf, items: JSON.parse(JSON.stringify(gone)), at: Date.now(), by: me() };\n        save(merge([e], read(KEY, [])));\n        try { if (big(kind, gone) && window.dbkNotice && window.dbkNotice.kept) window.dbkNotice.kept(); } catch (x1) {}\n        return e.id;\n      } catch (x) {}\n    },\n    // put back some other way (Undo): off the list on both phones\n    drop: function (id) {\n      if (!id) return; var all = read(KEY, []), e = all.filter(function (x) { return x.id === id; })[0]; if (!e || e.done) return;\n      e.done = true; save(merge(all, []));\n    },\n    // what Settings shows: not put back yet, not already back some other way (Undo), and not the other person's own lists\n    list: function () {\n      var other = me() === 'person2' ? 'person1' : 'person2';\n      var S = window.dbkSharing;\n      // (a business kept just for the other person isn't theirs to see here either)\n      var theirs = function (e) { return /^wr\\|businesses/.test(String(e.key)) && (e.items || []).length && (e.items || []).every(function (x) { return x && x.owner === other; }); };\n      // (a business's Waiting to be paid: only on a Work page it's on; never for a person without Work, nor for a business\n      // kept just for the other person; work-new.js)\n      var waitAway = function (e) {\n        var m = /^wrwait\\|(.*)$/.exec(String(e.key || '')); if (!m) return false;\n        var M = window.dbkModule; if (M && M.forPerson && !M.forPerson('work', me() === 'person2' ? 'p2' : 'p1')) return true;   // (modules.js names people p1 / p2)\n        var b = ((read('wr:data', {}) || {}).businesses || []).filter(function (x) { return x && x.id === m[1]; })[0];\n        var own = b ? b.owner : ((e.items || [])[0] || {})._owner;   // (the owner when it was filed, for a phone without the Work page's copy)\n        return own === other;\n      };\n      return merge(read(KEY, []), []).filter(function (e) { return !e.done && !theirs(e) && !waitAway(e) && !new RegExp('_' + other + '$').test(e.key) && !(S && S.hidden(String(e.key || '').slice(7))) && !(S && S.visibleAt && !S.visibleAt('dbkRemoved/data', [e]).length) && !listAway(S, e) && !isBack(e); });\n    },\n    restore: function (id) {\n      var all = read(KEY, []), e = all.filter(function (x) { return x.id === id; })[0]; if (!e) return false;\n      var q = read(QKEY, []); q.push({ id: e.id, key: e.key, idf: e.idf, items: e.items, at: Date.now() }); write(QKEY, q);\n      e.done = true; save(merge(all, []));\n      apply();\n      return true;\n    },\n    // a page says which lists it can put things back into: test(key) -> bool, put(key, items, idf) -> true when done\n    on: function (test, put) { appliers.push({ test: test, put: put }); setTimeout(apply, 50); },\n    pull: pull\n  };\n  function apply() {\n    var q = read(QKEY, []); if (!q.length) return;\n    if (!(window.firebaseConfigEmpty || window.firebaseReady) || Date.now() - born < 4000) { clearTimeout(apply._t); apply._t = setTimeout(apply, 1500); return; }\n    var left = q.filter(function (r) {\n      var a = appliers.filter(function (x) { try { return x.test(r.key); } catch (e) { return false; } })[0];\n      if (!a) return true;\n      try { return !a.put(r.key, r.items || [], r.idf || 'id'); } catch (e) { return true; }\n    });\n    if (left.length !== q.length) { write(QKEY, left); try { if (window.dbkNotice) window.dbkNotice('Put back'); } catch (e) {} }\n  }\n  window.addEventListener('storage', function (e) { if (e.key === QKEY) apply(); });\n  window.addEventListener('firebaseReady', function () { setTimeout(pull, 1200); setTimeout(apply, 4200); });\n  if (window.firebaseReady) setTimeout(pull, 1200);\n  setTimeout(apply, 4200);\n  // adding back the ones that aren't there (by id), leaving everything else as it is\n  var addMissing = function (list, items, idf) { var have = {}; list.forEach(function (x) { if (x && x[idf] != null) have[String(x[idf])] = 1; }); var n = 0; items.forEach(function (x) { if (x && !have[String(x[idf])]) { list.push(x); n++; } }); return n; };\n  window.dbkRemovedAddMissing = addMissing;\n  // Today: reminders and calendar events (the Back Burner registers itself where it's drawn)\n  var pg = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').toLowerCase();\n  if (pg === 'index.html' || pg === '') {\n    api.on(function (k) { return k === 'lifeReminders'; }, function (k, items, idf) {\n      if (typeof lifeReminders === 'undefined' || typeof saveLifeReminders !== 'function') return false;\n      addMissing(lifeReminders, items, idf); saveLifeReminders();\n      // a reminder Money made turns its bill's or subscription's reminder setting back on (dashboard.js dbkMoneyRem)\n      try { if (window.dbkMoneyRem) window.dbkMoneyRem.on(items); } catch (e) {}\n      try { renderReminderList(); } catch (e) {} try { updateReminderDisplay(); } catch (e) {} try { window.dbkHmWeek && window.dbkHmWeek(); } catch (e) {}\n      return true;\n    });\n    api.on(function (k) { return k === 'calendarEvents'; }, function (k, items, idf) {\n      if (typeof calendarEvents === 'undefined' || typeof calendarSaveEvents !== 'function') return false;\n      addMissing(calendarEvents, items, idf); calendarSaveEvents();\n      try { calendarRender(); } catch (e) {} try { window.dbkHmWeek && window.dbkHmWeek(); } catch (e) {}\n      return true;\n    });\n    // this person's Inbox notes (the other person's Inbox is theirs: never listed here, never put back from here)\n    api.on(function (k) { return k === 'capturedThoughts_' + me(); }, function (k, items, idf) {\n      if (!Array.isArray(window._capturedThoughts) || typeof saveCapturedThoughts !== 'function') return false;\n      try { if (window.dbkInboxFresh) window.dbkInboxFresh(); } catch (e) {}   // the newest copy first (notes captured on another page)\n      addMissing(window._capturedThoughts, items, idf); saveCapturedThoughts();\n      try { updateInboxBadge(); } catch (e) {} try { renderInbox(); } catch (e) {}\n      return true;\n    });\n    // the grocery list (the same list as Meals > Grocery; whichever page is open puts it back)\n    api.on(function (k) { return k === 'groceries'; }, function (k, items, idf) {\n      if (typeof groceries === 'undefined' || typeof saveGroceries !== 'function') return false;\n      try { if (typeof freshGroceries === 'function') freshGroceries(); } catch (e) {}\n      addMissing(groceries, items, idf); saveGroceries();\n      try { renderGroceries(); } catch (e) {}\n      return true;\n    });\n  }\n  // Meals: recipes (the grocery list registers itself in meal-plan.html, where it's drawn)\n  if (pg === 'meal-plan.html') {\n    api.on(function (k) { return k === 'mealplan_recipes'; }, function (k, items, idf) {\n      if (typeof recipeBank === 'undefined' || typeof saveRecipeBankToFirebase !== 'function' || window._recipeBankLoadFailed) return false;\n      addMissing(recipeBank, items, idf); saveRecipeBankToFirebase();\n      try { renderRecipeBank(); } catch (e) {}\n      return true;\n    });\n  }\n  // Lists: list items\n  if (pg === 'our-dreams.html') {\n    api.on(function (k) { return /^dreams_/.test(k); }, function (k, items, idf) {\n      if (typeof dreams === 'undefined' || typeof saveToLocal !== 'function') return false;\n      // (a list kept just for one person is saved as dreams_<list>_person1: it goes back into that list)\n      var cat = k.slice(7).replace(/_person[12]$/, ''); dreams[cat] = dreams[cat] || [];\n      addMissing(dreams[cat], items, idf); saveToLocal(cat);\n      try { syncToFirestore(cat); } catch (e) {} try { renderDreams(cat); } catch (e) {}\n      return true;\n    });\n  }\n})();\n/* ---------- Calendar events ticked off for the day (the designer, Oct 20: \"check off calendar events throughout the day\") ----------\n   One tick per day an event is on: 'eventCompletions' holds { '<event id>:<YYYY-MM-DD>': true } (the same shape the\n   old full calendar's hearts used, so ticks saved before still show). Ticking today's soccer practice leaves next\n   week's alone. It's the household's, one copy for both of you, like the events themselves, so an event ticked on\n   one phone shows ticked on the other. Only the one changed tick is written to the cloud (a merge), so two phones\n   ticking at the same moment never undo each other, and nothing old is ever pruned. */\n(function () {\n  var KEY = 'eventCompletions';\n  function all() { try { var v = JSON.parse(localStorage.getItem(KEY) || '{}'); return v && typeof v === 'object' && !Array.isArray(v) ? v : {}; } catch (e) { return {}; } }\n  function k(id, ds) { return String(id) + ':' + ds; }\n  function is(id, ds) { return id != null && id !== '' && !!all()[k(id, ds)]; }\n  function cloud(key, on) {\n    if (window.firebaseConfigEmpty) return;\n    if (!window.firebaseReady || !window.db || !window.firestoreImports) { window.addEventListener('firebaseReady', function () { cloud(key, on); }, { once: true }); return; }\n    try {\n      var fi = window.firestoreImports, items = {};\n      items[key] = !!on;   // taking a tick off saves false (reads as not done), never a delete\n      fi.setDoc(fi.doc(window.db, KEY, 'data'), { items: items }, { merge: true }).catch(function () {});\n    } catch (e) {}\n  }\n  function redraw() {\n    try { if (typeof calendarRender === 'function') calendarRender(); } catch (e) {}\n    try { window.dbkHmWeek && window.dbkHmWeek(); } catch (e) {}\n    try { var mo = document.getElementById('dayModalOverlay'); if (mo && mo.classList.contains('visible') && typeof renderDayModalEvents === 'function') renderDayModalEvents(); } catch (e) {}\n    try { window.dispatchEvent(new CustomEvent('dbk-evdone')); } catch (e) {}\n  }\n  function set(id, ds, on) {\n    if (id == null || id === '' || !ds) return;\n    var c = all(), key = k(id, ds);\n    if (on) c[key] = true; else delete c[key];\n    try { localStorage.setItem(KEY, JSON.stringify(c)); } catch (e) {}\n    cloud(key, !!on); redraw();\n  }\n  // a tick gets the standard Undo (5 seconds); taking a tick off needs none\n  function toggle(id, ds, what) {\n    var on = !is(id, ds); set(id, ds, on);\n    if (!what && /^visit_/.test(String(id))) what = 'Visit';   // an add-on's client visit (Our2daybook)\n    if (on) { var u = window.dbkUndo || (window.dbkNotice && function (m, f) { return window.dbkNotice(m, { undo: f }); }); if (u) u((what || 'Event') + ' done', function () { set(id, ds, false); }); }\n    return on;\n  }\n  window.dbkEvDone = { is: is, set: set, toggle: toggle, all: all };\n})();\n\n/* ═══ SWEEP-LOOK (Oct 20): the greeting and the Three's numbers follow the font ═══\n   A font picked in Settings > Look loads a moment later (from Google Fonts). The greeting's fit ran before it arrived,\n   kept the old size with no wrapping, and a wide font (Cinzel, Typewriter) ran off the screen. The fit runs again\n   whenever fonts finish loading or the look changes. The Three's number column is measured here as well. */\n(function () {\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').toLowerCase();\n  if (page !== 'index.html' && page !== '' && page !== 'workroom.html') return;\n  var widest = function (sel) { var w = 0; document.querySelectorAll(sel).forEach(function (n) { if (!n.getClientRects().length) return; var r = document.createRange(); r.selectNodeContents(n); w = Math.max(w, r.getBoundingClientRect().width); }); return w; };\n  var measure = function () {\n    var root = document.documentElement;\n    var a = widest('.hm-thing > :first-child'), b = widest('.wk3-n');\n    if (a) { var va = Math.ceil(a + 10) + 'px'; if (root.style.getPropertyValue('--dbk-3n') !== va) root.style.setProperty('--dbk-3n', va); }\n    if (b) { var vb = Math.ceil(b + 6) + 'px'; if (root.style.getPropertyValue('--dbk-w3n') !== vb) root.style.setProperty('--dbk-w3n', vb); }\n  };\n  var refit = function () {\n    measure();\n    // the greeting: let it wrap again, then the fit (above) shrinks it to one line or leaves it wrapping\n    var h = document.querySelector('.hm-greet'); if (h) { h.style.whiteSpace = ''; }\n    try { window.dispatchEvent(new Event('resize')); } catch (e) {}\n  };\n  var t = null, soon = function () { clearTimeout(t); t = setTimeout(refit, 60); };\n  if (document.fonts) { try { document.fonts.addEventListener('loadingdone', soon); } catch (e) {} if (document.fonts.ready) document.fonts.ready.then(soon); }\n  // a new look (colors or fonts) marks the page's root element\n  try { new MutationObserver(soon).observe(document.documentElement, { attributes: true, attributeFilter: ['data-dbk'] }); } catch (e) {}\n  window.addEventListener('dbk-show', soon); window.addEventListener('storage', function (e) { if (/^dbkLook_/.test(e.key || '')) setTimeout(soon, 300); });\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', soon); else soon();\n  var n = 0, iv = setInterval(function () { measure(); if (++n > 10) clearInterval(iv); }, 600);\n  // the Three re-draws when something is added or ticked\n  var queued = false, watch = function () { try { new MutationObserver(function () { if (queued) return; queued = true; requestAnimationFrame(function () { queued = false; measure(); }); }).observe(document.body, { childList: true, subtree: true }); } catch (e) {} };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', watch); else watch();\n})();\n\n/* ═══ SWEEP-LOOK (Oct 20): a pop-up title on two lines keeps its line as wide as its words ═══\n   The short line under a pop-up title (POP-UP TITLES in daybook-theme.css) hugs the words when the title is on one\n   line. A long name on two lines (\"Greek Chicken & Hummus Bowl\") made the title box as wide as the pop-up, so the line\n   ran almost across it. Here a two-line title gets the width of its longest line, before the pop-up is drawn. */\n(function () {\n  var SEL = '.modal-header .modal-title, .modal-header h2, .modal-header h3, .reminder-modal-title, .habits-modal-title, .inbox-modal-title, #dayModalTitle, .day-modal-header h2, .day-modal-header h3, .section-modal-title, .seasonal-modal-title, .tried-modal-title, .dbk-setx-h, .dbk-info-title, .detail-popup-title, .fin-sheet > h3:first-of-type, .wb-pop-title, #mprjPopT, .rl-pop-h, .tp-pop-h > span, .dream-form form > h3, .ai-panel-title, #mcpT, #mpkT, #detailActions .icon-btn.tp-open';\n  var busy = false;\n  function hug(t) {\n    if (t.style.getPropertyValue('width')) t.style.removeProperty('width');\n    if (!t.getClientRects().length) return;\n    var r = document.createRange(); r.selectNodeContents(t);\n    var lines = []; [].forEach.call(r.getClientRects(), function (q) { if (q.width < 1) return; var l = lines.filter(function (x) { return Math.abs(x.top - q.top) < q.height / 2; })[0]; if (l) { l.left = Math.min(l.left, q.left); l.right = Math.max(l.right, q.right); } else lines.push({ top: q.top, left: q.left, right: q.right }); });\n    if (lines.length < 2) return;\n    var cs = getComputedStyle(t), most = Math.max.apply(null, lines.map(function (l) { return l.right - l.left; }));\n    var w = Math.ceil(most + parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight) + parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth)) + 2;\n    if (w < t.getBoundingClientRect().width - 4) t.style.setProperty('width', w + 'px', 'important');\n  }\n  function run() {\n    if (busy) return; busy = true;\n    try { [].forEach.call(document.querySelectorAll(SEL), function (t) { if (t.offsetParent !== null || t.getClientRects().length) hug(t); }); } catch (e) {}\n    // nothing shown twice: a Settings pop-up whose first label only repeats its title (\"Names\" / \"Names\") drops the label\n    try {\n      var st = document.getElementById('setxTitle');\n      if (st && st.getClientRects().length) {\n        var box = st.parentElement, norm = function (x) { return (x || '').toLowerCase().replace(/[^a-z0-9]+/g, ' ').trim(); }, tt = norm(st.textContent);\n        var lab = box && box.querySelector('.setting-label-inline');\n        if (lab && !lab.classList.contains('dbk-dup-label') && norm(lab.textContent) === tt) lab.classList.add('dbk-dup-label');\n      }\n    } catch (e) {}\n    busy = false;\n  }\n  var obs = new MutationObserver(function (ms) {\n    for (var i = 0; i < ms.length; i++) { var t = ms[i].target; if (t.nodeType === 1 && t.matches && ms[i].type === 'attributes' && ms[i].attributeName === 'style' && t.matches(SEL)) continue; run(); return; }\n  });\n  var start = function () { try { obs.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['class', 'style', 'hidden', 'open'], characterData: true }); } catch (e) {} run(); };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();\n  window.addEventListener('resize', function () { requestAnimationFrame(run); });\n  if (document.fonts) { try { document.fonts.addEventListener('loadingdone', run); } catch (e) {} }\n})();\n\n/* ═══ No zooming in on a text box (the designer, Oct 20: \"it zooms in, then it's frozen\") ═══\n   An iPhone zooms the whole app in when a text box with letters under 16px is tapped, and the app then looks stuck.\n   On a touch screen every text box under 16px is set to 16px (bigger ones stay as they are), before it's tapped. */\n(function () {\n  var touch = false; try { touch = matchMedia('(pointer: coarse)').matches || 'ontouchstart' in window; } catch (e) {}\n  if (!touch) return;\n  var SEL = 'input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]):not([type=file]):not([type=hidden]):not([type=button]):not([type=submit]), textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [contenteditable=\"plaintext-only\"]';\n  var fix = function (el) {\n    if (el.hasAttribute('data-dbk-fs16')) return;\n    var fs = parseFloat(getComputedStyle(el).fontSize);\n    if (fs && fs < 16) el.setAttribute('data-dbk-fs16', '');\n  };\n  var all = function (root) { try { if (root.matches && root.matches(SEL)) fix(root); [].forEach.call((root.querySelectorAll ? root : document).querySelectorAll(SEL), fix); } catch (e) {} };\n  var st = document.createElement('style');\n  st.textContent = 'html [data-dbk-fs16]:not(#z):not(#y):not(#x):not(#w):not(#v) { font-size: 16px !important; }';\n  var go = function () {\n    (document.head || document.documentElement).appendChild(st);\n    all(document);\n    new MutationObserver(function (list) { list.forEach(function (m) { [].forEach.call(m.addedNodes, function (n) { if (n.nodeType === 1) all(n); }); }); }).observe(document.documentElement, { childList: true, subtree: true });\n    // a box whose size changed after it was drawn (a look or font applied late): caught on the first touch, before the focus\n    document.addEventListener('touchstart', function (e) { var t = e.target && e.target.closest ? e.target.closest(SEL) : null; if (t) fix(t); }, { capture: true, passive: true });\n    setTimeout(function () { all(document); }, 1500);\n  };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', go); else go();\n})();\n\n/* ── A tap that stops a scroll is not a tap (Kasey, Oct 22: \"I keep accidentally marking off reminders while I'm just\n   scrolling\"). On a phone, putting a finger down on a list that is still gliding stops it, and the phone can still\n   send that touch on as a click, ticking whatever was under the finger. So a click is dropped when the finger went\n   down on a page that was still gliding from a finger's scroll (moving faster than about 2px a frame in the 200ms\n   before), or when the finger itself scrolled the page. Text boxes always get their tap. Touch screens only; a mouse or\n   keyboard is never affected.\n   Oct 25 (Kasey: \"sometimes i have to click things twice throughout the site for shit to work\"), tools/snap/taps.mjs:\n   - an iPhone's glide creeps on for a second or more after it looks stopped (a pixel now and then, slowing by 0.998 a\n     millisecond); any scroll event in the 200ms before counted, so the first tap on a list that had come to rest was\n     dropped. Only a glide still moving counts now (`FAST`, measured per scroller between its own scroll events).\n   - after ANY tap, the app's own scrolling for 3s counted as a glide (a pop-up going back to its top, a part sliding\n     into view, the page's smooth scroll-behavior). Now only after a finger that scrolled or slid (`glide`).\n   - a finger that rolls a little (more than 10px) on something that doesn't scroll dropped the click the phone sent\n     anyway. The slide counts only when the page scrolled under it, or past 24px.\n   - a touch whose end never reached this page (its target was taken out under the finger) left it \"touching\" for good,\n     so every later scroll of the app's own counted; now a touch counts for 10 seconds at most. ── */\n(function () {\n  if (window.__dbkTapGuard) return; window.__dbkTapGuard = 1;\n  var lastFast = 0, start = null, bad = false, endAt = 0, touchAt = 0, slid = 0, scrolledIn = false, glide = false;\n  var FIELD = 'input, textarea, select, [contenteditable=\"\"], [contenteditable=\"true\"], [contenteditable=\"plaintext-only\"]';\n  var FAST = 0.12;   // px a millisecond (about 2px a frame): slower than that, a glide has come to rest to the eye\n  var touching = function () { return !!touchAt && Date.now() - touchAt < 10000; };\n  document.addEventListener('scroll', function (e) {\n    var now = Date.now(), t = e.target, el = (t && t.nodeType === 1) ? t : (document.scrollingElement || document.documentElement);\n    if (!el) return;\n    // how fast it moves, over at least 32ms (one scroll event to the next jitters: two a few ms apart looked fast)\n    var x = el.scrollLeft, y = el.scrollTop, a = el._dbkTapA;\n    if (!a || now - a.t > 250) a = el._dbkTapA = { x: x, y: y, t: now, v: 0 };\n    else if (now - a.t >= 32) a = el._dbkTapA = { x: x, y: y, t: now, v: Math.max(Math.abs(y - a.y), Math.abs(x - a.x)) / (now - a.t) };\n    if (touching()) { scrolledIn = true; return; }               // the finger is scrolling it\n    if (!glide || now - endAt > 3000) return;                    // the app's own scrolling, never a finger's glide\n    if (a.v >= FAST) lastFast = now;\n  }, { capture: true, passive: true });\n  document.addEventListener('touchstart', function (e) {\n    var t = e.touches && e.touches[0]; if (!t) return;\n    start = { x: t.clientX, y: t.clientY }; touchAt = Date.now(); slid = 0; scrolledIn = false;\n    bad = e.touches.length > 1 || Date.now() - lastFast < 200;\n  }, { capture: true, passive: true });\n  var move = function (x, y) { if (!start) return; slid = Math.max(slid, Math.abs(x - start.x), Math.abs(y - start.y)); };\n  document.addEventListener('touchmove', function (e) { var t = e.touches && e.touches[0]; if (t) move(t.clientX, t.clientY); }, { capture: true, passive: true });\n  // (some browsers hold back touchmove for the first few pixels; the pointer events still say where the finger went)\n  document.addEventListener('pointermove', function (e) { if (e.pointerType === 'touch') move(e.clientX, e.clientY); }, { capture: true, passive: true });\n  var end = function (e) {\n    if (e.touches && e.touches.length) return;\n    endAt = Date.now(); touchAt = 0;\n    if (slid > 24 || (slid > 10 && scrolledIn)) bad = true;\n    glide = slid > 10;                                           // only a finger that moved leaves a glide behind it\n  };\n  document.addEventListener('touchend', end, { capture: true, passive: true });\n  document.addEventListener('touchcancel', end, { capture: true, passive: true });\n  document.addEventListener('click', function (e) {\n    if (!bad) return;\n    bad = false;\n    if (Date.now() - endAt > 700) return;                       // not the click that touch made (keyboard, later)\n    var el = e.target && e.target.closest ? e.target : null;\n    if (el && el.closest(FIELD)) return;                       // a text box always gets its tap (and its cursor)\n    e.preventDefault(); e.stopPropagation(); e.stopImmediatePropagation();\n  }, true);\n})();\n\n/* A pop-up that puts focus on its × when it opens (so the keyboard starts there) shows no focus box for it until the\n   keyboard is used: opened by itself (Getting started on a first visit) or from a link, the browser drew a square box\n   around the × on a computer. Tab still shows it. */\nwindow.dbkQuietFocus = function (el) {\n  if (!el) return;\n  try { el.setAttribute('data-dbk-qf', ''); el.focus({ preventScroll: true }); } catch (e) { return; }\n  var off = function () { el.removeAttribute('data-dbk-qf'); el.removeEventListener('blur', off); document.removeEventListener('keydown', key, true); };\n  var key = function (e) { if (e.key === 'Tab' || /^Arrow/.test(e.key)) off(); };\n  el.addEventListener('blur', off); document.addEventListener('keydown', key, true);\n};\n/* the pop-up backdrop on its own (blur and veil, as behind any pop-up), for the page under Today's event and reminder\n   forms when Work opens them over itself (app.html overlay). Nothing else on the page changes. */\nwindow.dbkUnderVeil = function (on) {\n  var v = document.getElementById('dbkUnderVeil');\n  if (on && !v) { v = document.createElement('div'); v.id = 'dbkUnderVeil'; v.setAttribute('aria-hidden', 'true'); document.body.appendChild(v); }\n  else if (!on && v) v.remove();\n};\n\n/* A word wider than its box (a choice button with \"Not a subscription\" on a phone, a long name in a narrow row) is made\n   a little smaller until it fits inside its padding, down to 60% of its size; words never break in the middle (the rule\n   at the end of daybook-theme.css). Only text that may wrap is looked at: a line kept to one line with \"…\" on purpose\n   stays as it is. Checked when the page draws something new, when the screen changes size and once fonts load. */\n(function () {\n  if (window.dbkFitWords) return;\n  var SKIP = /^(SCRIPT|STYLE|INPUT|TEXTAREA|SELECT|OPTION|SVG|svg|path|IMG|CANVAS|IFRAME|BR|HR|NOSCRIPT|TEMPLATE)$/;\n  var rng = document.createRange();\n  function ownText(el) { for (var n = el.firstChild; n; n = n.nextSibling) if (n.nodeType === 3 && /\\S{2}/.test(n.nodeValue)) return true; return false; }\n  // the widest single word in the element's own text\n  function widest(el) {\n    var max = 0;\n    for (var n = el.firstChild; n; n = n.nextSibling) {\n      if (n.nodeType !== 3) continue;\n      var re = /\\S+/g, m, v = n.nodeValue;\n      while ((m = re.exec(v))) { rng.setStart(n, m.index); rng.setEnd(n, m.index + m[0].length); var rs = rng.getClientRects(), wd = 0; for (var i = 0; i < rs.length; i++) wd += rs[i].width; if (wd > max) max = wd; }\n    }\n    return max;\n  }\n  function undo(el) { el.style.removeProperty('font-size'); el.style.removeProperty('letter-spacing'); el.removeAttribute('data-dbk-fit'); }\n  function roomIn(el, cs) { return el.clientWidth - (parseFloat(cs.paddingLeft) || 0) - (parseFloat(cs.paddingRight) || 0); }\n  function fit(el) {\n    if (!el.isConnected) return;\n    if (el.hasAttribute('data-dbk-fit')) undo(el);\n    if (el.hasAttribute('data-dbk-bal')) { el.style.removeProperty('text-wrap'); el.removeAttribute('data-dbk-bal'); }\n    if (!el.clientWidth) return;\n    var cs = getComputedStyle(el);\n    // Chrome's balanced lines give up on some names beside a float (Lists cards keep a corner free with one) and draw the\n    // whole name on one line, cut off by the card (\"Lessons in Ch\", Oct 26 audit): that name wraps the plain way instead\n    if (/balance/.test(cs.textWrapStyle || cs.textWrap || '') && el.scrollWidth > el.clientWidth + 1 && /\\S\\s+\\S/.test(el.textContent || '')) {\n      el.style.setProperty('text-wrap', 'pretty', 'important'); el.setAttribute('data-dbk-bal', '1'); cs = getComputedStyle(el);\n    }\n    if (cs.display === 'inline' || cs.display === 'contents' || /nowrap|pre$/.test(cs.whiteSpace) || cs.textOverflow === 'ellipsis') return;\n    var room = roomIn(el, cs);\n    if (room <= 0 || widest(el) <= room + 0.5) return;\n    var size = parseFloat(cs.fontSize); if (!(size > 0)) return;\n    el.setAttribute('data-dbk-fit', '1');\n    if (parseFloat(cs.letterSpacing) > 0) el.style.setProperty('letter-spacing', '0', 'important');\n    for (var k = 0.95; k >= 0.6 && widest(el) > roomIn(el, cs) + 0.5; k -= 0.05) el.style.setProperty('font-size', (size * k).toFixed(2) + 'px', 'important');\n    if (widest(el) > roomIn(el, cs) + 0.5) undo(el);   // shrinking didn't make it fit: not a word that's too long\n  }\n  // buttons side by side in one choice group (Keep | Plan to cancel | Not a subscription) shrink together, so they match\n  function evenGroup(g) {\n    var kids = [].slice.call(g.children).filter(function (k) { return ownText(k); }), min = 0;\n    kids.forEach(function (k) { if (k.hasAttribute('data-dbk-fit')) { var v = parseFloat(k.style.fontSize); if (v && (!min || v < min)) min = v; } });\n    if (!min) return;\n    kids.forEach(function (k) { if (!k.hasAttribute('data-dbk-fit') || parseFloat(k.style.fontSize) !== min) { k.setAttribute('data-dbk-fit', '1'); k.style.setProperty('font-size', min + 'px', 'important'); k.style.setProperty('letter-spacing', '0', 'important'); } });\n  }\n  function scan(root) {\n    if (!root || root.nodeType !== 1 || SKIP.test(root.tagName)) return;\n    var groups = [];\n    var one = function (el) { if (SKIP.test(el.tagName) || !ownText(el)) return; fit(el); var g = el.parentElement; if (g && g.getAttribute('role') === 'group' && groups.indexOf(g) < 0) groups.push(g); };\n    one(root);\n    var all = root.getElementsByTagName('*');\n    for (var i = 0; i < all.length; i++) one(all[i]);\n    groups.forEach(evenGroup);\n  }\n  var queue = [], big = [], whole = false, busy = false;\n  // a part put away whole with `hidden` (a Money tab) keeps its fitted words: shown again at the same width with nothing\n  // changed inside it, there is nothing to measure (Oct 25: each Money tab tap measured every word of the tab)\n  var kept = [];\n  function keptDrop(r) { for (var i = kept.length - 1; i >= 0; i--) if (kept[i].el === r || kept[i].el.contains(r) || r.contains(kept[i].el)) kept.splice(i, 1); }\n  function run(fromLater) {\n    if (fromLater) busy = false;\n    if (whole) { whole = false; queue = []; kept = []; scan(document.body); return; }\n    var q = queue; queue = [];\n    if (kept.length) q.forEach(keptDrop);\n    q = q.filter(function (r, i) { return q.indexOf(r) === i; });\n    if (q.length > 300) { scan(document.body); return; }\n    q.forEach(function (r) { if (r.isConnected && !q.some(function (o) { return o !== r && o.contains(r); })) scan(r); });\n  }\n  function later() { if (!busy) { busy = true; requestAnimationFrame(function () { setTimeout(function () { run(true); }, 0); }); } }\n  window.dbkFitWords = function (root) { if (root) queue.push(root); else whole = true; later(); };\n  function start() {\n    if (!document.body) return;\n    window.dbkFitWords();\n    new MutationObserver(function (list) {\n      for (var i = 0; i < list.length; i++) {\n        var m = list[i], t = m.type === 'characterData' ? m.target.parentElement : m.target;\n        if (!t || t.nodeType !== 1 || (m.type === 'attributes' && (t === document.body || t === document.documentElement))) continue;\n        if (m.type === 'attributes' && m.attributeName === 'hidden') {\n          if (t.hasAttribute('hidden') && !t.getClientRects().length) { if (m.oldValue === null && !kept.some(function (k) { return k.el === t; })) kept.push({ el: t, w: window.innerWidth }); continue; }\n          var ki = -1; kept.forEach(function (k, j) { if (k.el === t) ki = j; });\n          if (ki >= 0 && m.oldValue !== null) { var kw = kept[ki].w; kept.splice(ki, 1); if (kw === window.innerWidth) continue; }\n        }\n        if (m.type === 'attributes' && t.getElementsByTagName('*').length > 1500) { big.push(t); continue; }   // a whole page switched: after it shows\n        queue.push(t);\n      }\n      // fitted before the screen is drawn, so a word never shows too big first and then jumps smaller\n      if (queue.length && !whole) run();\n      if (big.length) { big.forEach(function (b) { queue.push(b); }); big = []; later(); }\n    }).observe(document.body, { childList: true, subtree: true, characterData: true, attributes: true, attributeOldValue: true, attributeFilter: ['hidden', 'class', 'open', 'aria-hidden'] });\n    var rt = 0; window.addEventListener('resize', function () { clearTimeout(rt); rt = setTimeout(function () { window.dbkFitWords(); }, 150); });\n    if (document.fonts && document.fonts.ready) document.fonts.ready.then(function () { window.dbkFitWords(); });\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start); else start();\n})();\n\n/* ---------- drop-down lists match the look (Kasey, Oct 22: \"drop down menus on desktop should match the app. theyre like\n   really light despite my colors being dark\") ----------\n   The open list of a <select> is drawn by the browser, which only follows light or dark (color-scheme) and, on some\n   computers, each option's own colours. Just before one opens (pointer down, or it gets the focus), it takes the colours\n   really behind it: dark ones make its list dark, and its options get that background and the box's own text colour. */\n(function () {\n  function rgba(s) { var m = /rgba?\\(([^)]+)\\)/.exec(s || ''); if (!m) return null; var p = m[1].split(/[ ,\\/]+/).filter(Boolean).map(parseFloat); return [p[0], p[1], p[2], p.length > 3 ? p[3] : 1]; }\n  function lum(c) { var f = function (v) { v /= 255; return v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }; return 0.2126 * f(c[0]) + 0.7152 * f(c[1]) + 0.0722 * f(c[2]); }\n  // the colour actually seen behind the box: its own background, mixed over whatever is behind it until something is solid\n  function behind(el) {\n    var layers = [];\n    for (var n = el; n && n.nodeType === 1; n = n.parentElement) { var c = rgba(getComputedStyle(n).backgroundColor); if (c && c[3] > 0) { layers.push(c); if (c[3] >= 0.99) break; } }\n    var out = [255, 255, 255];\n    for (var i = layers.length - 1; i >= 0; i--) { var a = layers[i][3]; out = [0, 1, 2].map(function (k) { return layers[i][k] * a + out[k] * (1 - a); }); }\n    return out;\n  }\n  function match(sel) {\n    if (!sel || sel.tagName !== 'SELECT') return;\n    try {\n      var bg = behind(sel), dark = lum(bg) < 0.22, fg = getComputedStyle(sel).color;\n      var bgS = 'rgb(' + bg.map(Math.round).join(',') + ')';\n      if (sel.style.colorScheme !== (dark ? 'dark' : 'light')) sel.style.colorScheme = dark ? 'dark' : 'light';\n      sel.style.setProperty('--dbk-opt-bg', bgS); sel.style.setProperty('--dbk-opt-fg', fg);\n    } catch (e) {}\n  }\n  document.addEventListener('pointerdown', function (e) { match(e.target && e.target.closest && e.target.closest('select')); }, true);\n  document.addEventListener('focusin', function (e) { match(e.target); }, true);\n  var st = document.createElement('style');\n  st.textContent = 'html[data-dbk] select option, html[data-dbk] select optgroup { background-color: var(--dbk-opt-bg, inherit); color: var(--dbk-opt-fg, inherit); }';\n  (document.head || document.documentElement).appendChild(st);\n})();\n\n/* \"Saved\" beside a line changed in place (Kasey, Oct 23: \"a lot of the time i'm unsure if something saved until i see\n   it\"). Today's Three, Work's Three and the Back Burner save as you leave the line, with no Save button: a small \"Saved\"\n   shows at the end of that line for a moment. It sits over the page (nothing moves) and fades. */\nwindow.dbkSavedHere = function (row) {\n  try {\n    if (!row || !row.getBoundingClientRect) return;\n    var r = row.getBoundingClientRect(); if (!r.width) return;\n    var old = document.getElementById('dbkSavedHere'); if (old) old.remove();\n    var n = document.createElement('span'); n.id = 'dbkSavedHere'; n.className = 'dbk-saved-here'; n.textContent = 'Saved'; n.setAttribute('role', 'status');\n    var cs = getComputedStyle(row); n.style.color = cs.color;\n    document.body.appendChild(n);\n    var w = n.offsetWidth, h = n.offsetHeight, right = r.right;\n    // the end of the words, before the line's own buttons (×, the up arrow): never on top of them\n    [].forEach.call(row.querySelectorAll('button'), function (b) { var br = b.getBoundingClientRect(); if (br.width && br.left > r.left + r.width / 2 && br.left < right) right = br.left; });\n    // placed against the box it's measured from: the page's body is position: relative under the menu bar (Oct 23 audit:\n    // it showed one line lower, over the next line's buttons)\n    var bs = getComputedStyle(document.body), br0 = document.body.getBoundingClientRect();\n    var ox = bs.position === 'static' ? -window.scrollX : br0.left + (parseFloat(bs.borderLeftWidth) || 0);\n    var oy = bs.position === 'static' ? -window.scrollY : br0.top + (parseFloat(bs.borderTopWidth) || 0);\n    n.style.left = Math.round(right - w - 6 - ox) + 'px';\n    n.style.top = Math.round(r.top + Math.max(0, (Math.min(r.height, 44) - h) / 2) - oy) + 'px';\n    requestAnimationFrame(function () { n.classList.add('on'); });\n    setTimeout(function () { n.classList.remove('on'); setTimeout(function () { n.remove(); }, 400); }, 1600);\n  } catch (e) {}\n};\n(function () {\n  var st = document.createElement('style');\n  st.textContent = '.dbk-saved-here { position: absolute; z-index: 50; pointer-events: none; font-style: italic; font-size: 13px; line-height: 1; padding: 4px 8px; border-radius: 999px; background: color-mix(in srgb, currentColor 10%, transparent); opacity: 0; transition: opacity .25s ease; } .dbk-saved-here.on { opacity: .85; } @media (prefers-reduced-motion: reduce) { .dbk-saved-here { transition: none; } }';\n  (document.head || document.documentElement).appendChild(st);\n  // Today's Three: after a line's words change\n  var wrapThree = function () {\n    var f = window.thingFinishEdit; if (typeof f !== 'function' || f._saved) return;\n    var w = function (i) {\n      var inp = document.getElementById('thing-edit-' + i), before = null;\n      try { before = window._threeThings && window._threeThings[i] ? window._threeThings[i].text : null; } catch (e) {}\n      var r = f.apply(this, arguments);\n      try { var now = window._threeThings && window._threeThings[i] ? window._threeThings[i].text : null; if (inp && now !== before) window.dbkSavedHere(document.getElementById('thing-' + i)); } catch (e) {}\n      return r;\n    };\n    w._saved = true; window.thingFinishEdit = w;\n  };\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', wrapThree); else wrapThree();\n  setTimeout(wrapThree, 1500);\n})();\n\n/* 2T on Money and Meals (Kasey, Oct 23: \"the menu strip … I don't want that to be light when what's above it and below it\n   is darker\"): when the full-width card right under the tabs is darker than the page, the strip behind the tabs takes\n   that card's colour (and its words' colour), reaching up to the menu bar and down to the card. Worked out again when a\n   tab is picked or the page changes size; only on 2T, the other looks are as they were. */\n(function () {\n  var lum = function (c) { var m = /rgba?\\(([^)]+)\\)/.exec(c || ''); if (!m) return -1; var p = m[1].split(/[ ,\\/]+/).filter(Boolean).map(Number); if (p.length > 3 && p[3] < 0.9) return -1; return (0.2126 * p[0] + 0.7152 * p[1] + 0.0722 * p[2]) / 255; };\n  var bgOf = function (el) { for (var n = el; n && n.nodeType === 1; n = n.parentElement) { var c = getComputedStyle(n).backgroundColor; if (lum(c) >= 0) return { el: n, c: c }; } return null; };\n  var sheet = null;\n  function run() {\n    var t = document.querySelector('.dbk-mealtabs'); if (!t) return;\n    var on = document.documentElement.getAttribute('data-dbk-look') === '2timelines';\n    var off = function () { if (t.classList.contains('dbk-strip-on')) t.classList.remove('dbk-strip-on'); };\n    if (!on || !t.getClientRects().length) return off();\n    var r = t.getBoundingClientRect(), W = window.innerWidth;\n    // the first thing under the tabs, a little below them\n    // (the first coloured thing: wrappers with no background of their own are looked through)\n    var b = null, page = bgOf(document.body);\n    for (var y = r.bottom + 2; y < r.bottom + 60 && !b; y += 4) {\n      var el = document.elementFromPoint(W / 2, y); if (!el || t.contains(el)) continue;\n      var bb = bgOf(el); if (bb && bb.el !== document.body && bb.el !== document.documentElement) b = bb;\n    }\n    if (!b || !page || b.el === document.body || b.el === document.documentElement) return off();\n    var br = b.el.getBoundingClientRect();\n    if (br.width < W - 2 || !(lum(b.c) < lum(page.c) - 0.15)) return off();\n    var nav = document.querySelector('nav.top-nav'), nb = nav ? nav.getBoundingClientRect().bottom : 0;\n    // in a style the look leaves alone (its colours are already the look's; set on the element they'd be recoloured again)\n    var css = '.dbk-mealtabs.dbk-strip-on{--dbk-strip:' + b.c + ';--dbk-strip-ink:' + getComputedStyle(b.el).color + ';--dbk-strip-up:' + Math.max(0, Math.round(r.top - nb)) + 'px;--dbk-strip-down:' + Math.max(0, Math.round(br.top - r.bottom)) + 'px}';\n    if (!sheet) { sheet = document.createElement('style'); sheet.setAttribute('data-dbk-raw', ''); (document.head || document.documentElement).appendChild(sheet); }\n    if (sheet.textContent !== css) sheet.textContent = css;\n    if (!t.classList.contains('dbk-strip-on')) t.classList.add('dbk-strip-on');\n  }\n  var q = null; function soon() { clearTimeout(q); q = setTimeout(run, 30); }\n  function go() { run(); setTimeout(run, 400); setTimeout(run, 1500); document.addEventListener('click', function (e) { if (e.target.closest && e.target.closest('.dbk-mealtabs')) { soon(); setTimeout(run, 300); } }, true); window.addEventListener('resize', soon); window.addEventListener('hashchange', soon); window.addEventListener('dbk-show', soon); }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', go); else go();\n  window.dbkTabStrip = run;\n})();\n","dbk-look.js":"/* 2daysbook \"Look\": each person's colors and fonts.\n   - Five ready-made looks (Stone and Midnight are today's two looks) or \"your own color\": pick one color and\n     the app builds the rest from it (lighter versions for the cards, a darker one for text and the top bar).\n   - A heading font and a body font, picked separately. Today's (Playfair Display + Lora) is the default.\n   Saved per person as dbkLook_person1 / dbkLook_person2: { t: template id, c: '#hex' for your own color,\n   h: heading font id, b: body font id, fam: 'p1' | 'p2' (light or dark) }. daybook-theme.js reads fam before the page paints.\n   How the colors change: today's two looks are left exactly as they are. Any other choice rewrites the\n   app's own colors in the page's style sheets: each color is matched to the closest color of today's look\n   (its \"role\": text, page, a card, the accent...) and swapped for that role's color in the new look, keeping\n   the same small lighter/darker difference. Nothing is fetched except the chosen fonts from Google Fonts. */\n(function () {\n  if (window.dbkLook) return;\n\n  /* ---------- color math (sRGB <-> OKLab / OKLCH) ---------- */\n  function hex2rgb(h) {\n    h = String(h || '').trim().replace('#', '');\n    if (h.length === 3 || h.length === 4) h = h.split('').map(function (c) { return c + c; }).join('');\n    if (!/^[0-9a-f]{6}([0-9a-f]{2})?$/i.test(h)) return null;\n    return [parseInt(h.slice(0, 2), 16), parseInt(h.slice(2, 4), 16), parseInt(h.slice(4, 6), 16)];\n  }\n  function rgb2hex(c) { return '#' + c.map(function (v) { v = Math.max(0, Math.min(255, Math.round(v))); return (v < 16 ? '0' : '') + v.toString(16); }).join(''); }\n  function lin(v) { v /= 255; return v <= 0.04045 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }\n  function delin(v) { v = v <= 0.0031308 ? 12.92 * v : 1.055 * Math.pow(v, 1 / 2.4) - 0.055; return v * 255; }\n  function rgb2lab(c) {\n    var r = lin(c[0]), g = lin(c[1]), b = lin(c[2]);\n    var l = Math.cbrt(0.4122214708 * r + 0.5363325363 * g + 0.0514459929 * b);\n    var m = Math.cbrt(0.2119034982 * r + 0.6806995451 * g + 0.1073969566 * b);\n    var s = Math.cbrt(0.0883024619 * r + 0.2817188376 * g + 0.6299787005 * b);\n    return [0.2104542553 * l + 0.7936177850 * m - 0.0040720468 * s, 1.9779984951 * l - 2.4285922050 * m + 0.4505937099 * s, 0.0259040371 * l + 0.7827717662 * m - 0.8086757660 * s];\n  }\n  function lab2rgbRaw(L, a, b) {\n    var l = Math.pow(L + 0.3963377774 * a + 0.2158037573 * b, 3), m = Math.pow(L - 0.1055613458 * a - 0.0638541728 * b, 3), s = Math.pow(L - 0.0894841775 * a - 1.2914855480 * b, 3);\n    return [delin(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s), delin(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s), delin(-0.0041960863 * l - 0.7034186147 * m + 1.7076147010 * s)];\n  }\n  function lch(c) { var o = rgb2lab(c); return [o[0], Math.sqrt(o[1] * o[1] + o[2] * o[2]), Math.atan2(o[2], o[1])]; }\n  // back to sRGB, lowering chroma until it fits\n  function fromLch(L, C, H) {\n    L = Math.max(0, Math.min(1, L)); C = Math.max(0, C);\n    for (var i = 0; i < 24; i++) {\n      var c = lab2rgbRaw(L, C * Math.cos(H), C * Math.sin(H));\n      if (c.every(function (v) { return v >= -0.5 && v <= 255.5; })) return c.map(function (v) { return Math.max(0, Math.min(255, v)); });\n      C *= 0.85;\n    }\n    return lab2rgbRaw(L, 0, 0).map(function (v) { return Math.max(0, Math.min(255, v)); });\n  }\n  function tone(hex, L, Cmax, dh) { var o = lch(hex2rgb(hex)); return rgb2hex(fromLch(L, Cmax == null ? o[1] : Math.min(o[1], Cmax), o[2] + (dh || 0))); }\n  function lum(c) { return 0.2126 * lin(c[0]) + 0.7152 * lin(c[1]) + 0.0722 * lin(c[2]); }\n  function contrast(a, b) { var x = lum(hex2rgb(a)), y = lum(hex2rgb(b)); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); }\n\n  /* ---------- today's two looks: the colors each role uses ---------- */\n  // light family (Person 1 today: \"Stone\")\n  var BASE_P1 = {\n    ink: '#2f3a2c', cream: '#f3eee4', card: '#fbf8f1', paper: '#ebe5d7', page: '#e4ded0', linen: '#e8e1d1',\n    pink: '#ead3cf', sand: '#e7d5b6', celadon: '#dcdfc2', sageband: '#c7c494', sage: '#b9bfa0',\n    accent: '#9b5a62', accent2: '#b0596b', clay: '#a5502f'\n  };\n  // dark family (Person 2 today: \"Midnight\")\n  var BASE_P2 = {\n    deep: '#06080b', bg: '#0c1118', bg2: '#0b1018', card: '#121c2b', card2: '#17263d', card3: '#10151c',\n    text: '#e6eaef', accent: '#8fc98a', accent2: '#e79aa9'\n  };\n  // never recolored: Money's good / over colors on the light look\n  var KEEP = ['#5f7044', '#c3d39a', '#f0b7a8', '#ffffff', '#000000'];\n\n  /* ---------- the five ready-made looks ---------- */\n  // like Stone, each has dark text plus 3-4 clearly different card colors side by side\n  var TEMPLATES = [\n    { id: 'stone', name: 'Stone', fam: 'p1', base: true, sw: ['#2f3a2c', '#ead3cf', '#c7c494', '#e7d5b6'] },\n    { id: 'midnight', name: 'Midnight', fam: 'p2', base: true, sw: ['#06080b', '#121c2b', '#17263d', '#8fc98a'] },\n    // the studio's own colors (the designer, Oct 20: 2T is light again): a beige page, lilac and a pale lilac for the\n    // cards, the bright red as the accent, and a deep plum-brown for text and the top bar. Red is only for small things\n    // (labels, a Delete, a dot), never a big section. Matches the sample on the 2daysbook page of the studio's site\n    // (the designer, Oct 20): there Today's calendar and the other \"deep\" cards are the pale lilac, not red or latte\n    { id: '2timelines', name: '2T', fam: 'p1', sw: ['#33242b', '#ddb9e3', '#a3263b', '#ece3d3'],\n      roles: { ink: '#33242b', accent: '#a3263b', accent2: '#b8485a', clay: '#a3263b', page: '#ece3d3', paper: '#f2eadb', cream: '#f8f1e4', card: '#fcf8f0', linen: '#efe6d5',\n               pink: '#ddb9e3', sand: '#c6a0d0', celadon: '#ecdcef', sageband: '#ecdcef', sage: '#ecdcef' } },\n    { id: 'coastal', name: 'Coastal', fam: 'p1', sw: ['#1f2f4a', '#cfe3df', '#f1cfc4', '#ead9bf'],\n      roles: { ink: '#1f2f4a', accent: '#b8513f', accent2: '#c86a57', clay: '#b8513f', page: '#e2e6e4', paper: '#ebeeec', cream: '#f7f5f0', card: '#fbfaf6', linen: '#f2efe8',\n               pink: '#cfe3df', sand: '#ead9bf', celadon: '#f1cfc4', sageband: '#a9cbc6', sage: '#b4ccc8' } },\n    { id: 'orchard', name: 'Orchard', fam: 'p1', sw: ['#3b4226', '#f2d48f', '#e9c2a6', '#c2c990'],\n      roles: { ink: '#3b4226', accent: '#a8532a', accent2: '#b96a40', clay: '#a8532a', page: '#e7e1cf', paper: '#eee8d8', cream: '#f6f1e4', card: '#fbf8ef', linen: '#f1e9d6',\n               pink: '#f2d48f', sand: '#e9c2a6', celadon: '#d5dcbb', sageband: '#c2c990', sage: '#b6bd8a' } },\n    { id: 'berry', name: 'Berry', fam: 'p1', sw: ['#3d2340', '#f1cfd6', '#cfe6d8', '#ddd0ea'],\n      roles: { ink: '#3d2340', accent: '#a03f66', accent2: '#b2577b', clay: '#a03f66', page: '#e7e1e4', paper: '#efe8ea', cream: '#f7f2f1', card: '#fcf9f8', linen: '#f3ece6',\n               pink: '#f1cfd6', sand: '#ddd0ea', celadon: '#cfe6d8', sageband: '#b4d7c3', sage: '#bccfc3' } }\n  ];\n  function tpl(id) { return TEMPLATES.filter(function (t) { return t.id === id; })[0]; }\n\n  // your own color: that color for labels, a lighter version for some cards and a darker one for text and the\n  // top bar, with a soft cream and two gentle partner tones so the cards aren't all one color\n  // which colors the picker offers: today's two looks plus \"Your own\". Coastal, Orchard and Berry are built\n  // but hidden (the designer removed them; add an id here to show one again)\n  var SHOWN = ['stone', 'midnight', '2timelines'], OWN_ON = true;\n  // the extra colors made from your pick, which you can remove: a close neighbor, a lighter one, a deeper one\n  var GROUPS = { p1: { near: ['sand'], light: ['celadon'], deep: ['sageband', 'sage'] }, p2: { near: ['card2'], light: ['accent', 'accent2'], deep: ['card3'] } };\n  var GROUP_ORDER = ['near', 'light', 'deep'];\n  // LIGHT-PALETTE: how far to turn the hue (OKLCH degrees) for the deep shades of a light color, so they stay\n  // clean when darkened, as [hue, turn, deeper] points (in between is blended). \"deeper\" starts the top bar's\n  // shade a little darker: blues go toward navy, where a bright mid blue read loud.\n  var TURN = [[0, -6, 0], [25, -12, 0], [50, -14, 0], [72, -20, 0], [90, -24, 0], [108, -36, 0], [125, 12, 0], [150, 12, 0], [185, 10, 0], [220, 14, 0.03], [250, 12, 0.07], [280, 6, 0.03], [302, 7, 0], [330, 6, 0], [360, -6, 0]];\n  function turnAt(h, k) {\n    var d = ((h * 180 / Math.PI) % 360 + 360) % 360;\n    for (var i = 1; i < TURN.length; i++) if (d <= TURN[i][0]) { var a = TURN[i - 1], b = TURN[i], t = (d - a[0]) / (b[0] - a[0]); return a[k] + (b[k] - a[k]) * t; }\n    return 0;\n  }\n  function deepTurn(h) { return turnAt(h, 1) * Math.PI / 180; }\n  function customRoles(c, off) {\n    off = (off || []).filter(function (g) { return GROUP_ORDER.indexOf(g) >= 0; });\n    // Your color is always used exactly for the main card. Whichever reads better on it, dark text or\n    // light text, decides the rest: dark text gives a light app, light text gives a dark app.\n    var o = lch(hex2rgb(c)), L = o[0], C = o[1], H = o[2];\n    var cap = function (x, lo, hi) { return Math.max(lo, Math.min(hi, x)); };\n    var hx = function (l, ch, dh) { return rgb2hex(fromLch(l, ch, H + (dh || 0))); };\n    // step a color lighter (+) or darker (-) until it reads against `on`\n    var fit = function (x, on, min, step) { var n = 0; while (contrast(x, on) < min && n++ < 50) { var q = lch(hex2rgb(x)); x = rgb2hex(fromLch(cap(q[0] + step, 0, 1), q[1], q[2])); } return x; };\n    if (contrast(c, '#ffffff') >= 4.55) {\n      // dark app: your color is the main card, the page is a deep shade of it, text is near white\n      var d = Math.min(C, 0.09), text = fit(hx(0.96, Math.min(C, 0.015)), c, 4.5, 0.02);\n      var dk = L < 0.24;   // a near-black pick: the other cards go a little lighter instead of darker\n      // a deep shade that still reads as your color; a near-black pick gets a charcoal page so its cards stand out\n      var page = L < 0.14 ? hx(0.27, Math.min(C, 0.03)) : hx(Math.min(0.24, L * 0.55), d * 0.85);\n      var r = {\n        deep: hx(Math.min(0.16, L * 0.4), d * 0.7), bg: page, bg2: page,\n        card: c,                                                             // your color, exactly\n        card2: hx(dk ? L + 0.08 + (0.24 - L) * 0.5 : L - 0.04, Math.min(C, 0.12), 0.08),        // a close neighbor\n        card3: hx(dk ? L + 0.05 + (0.24 - L) * 0.35 : cap(L - 0.1, 0.14, 1), Math.min(C, 0.1)),  // a deeper version\n        text: text,\n        accent: fit(hx(cap(L + 0.3, 0.78, 0.9), Math.min(C, 0.13)), c, 4.5, 0.02),\n        accent2: fit(hx(cap(L + 0.3, 0.78, 0.9), Math.min(C, 0.1), 1.2), c, 4.5, 0.02)\n      };\n      ['card2', 'card3', 'bg', 'bg2', 'deep'].forEach(function (k) { r[k] = fit(r[k], text, 4.5, -0.02); });\n      // removed colors: those cards use a card color you kept (or your color), and buttons use the text color\n      if (off.indexOf('light') >= 0) { r.accent = text; r.accent2 = text; }\n      var keptD = ['near', 'deep'].filter(function (g) { return off.indexOf(g) < 0; }), fillD = keptD.length ? r[GROUPS.p2[keptD[0]][0]] : c;\n      ['near', 'deep'].forEach(function (g) { if (off.indexOf(g) >= 0) GROUPS.p2[g].forEach(function (k) { r[k] = fillD; }); });\n      return { fam: 'p2', roles: r };\n    }\n    // light app: your color is the main card, text is a deep shade of it.\n    // LIGHT-PALETTE (Oct 20, \"all of the light options are fugly\"): the darker colors used to be your color made\n    // darker with its color kept as weak as it was, which turned grey-brown (pink gave a mauve-brown bar, yellow an\n    // olive one, sage a swampy green). Now they're made the way a designer would: darker AND richer, with a small turn\n    // of the hue where a plain darker version goes muddy (yellow toward amber, green toward forest/teal, pink toward\n    // raspberry, blue toward navy, lavender toward plum), and the cards are a soft white with a hint of your color\n    // instead of the same beige for every pick.\n    // (a mid-tone, already strong pick, like terracotta, gets less of the turn and a calmer deep shade: the full\n    // amount turned it fire-engine red)\n    var w = cap((L - 0.6) / 0.2, 0, 1);\n    var Hd = H + deepTurn(H) * (0.4 + 0.6 * w), hd = function (l, ch) { return rgb2hex(fromLch(l, ch, Hd)); };\n    // the cards and boxes: near-white, just a breath of your color\n    var cream = hx(0.962, Math.min(C * 0.24, 0.012)), card = hx(0.984, Math.min(C * 0.14, 0.007)), linen = hx(0.94, Math.min(C * 0.3, 0.016));\n    // as dark as it needs to be to read well, but still a shade of your color (not plain black) on bright picks\n    var inkMin = Math.max(4.6, Math.min(6, contrast(c, '#000000') * 0.88));\n    var ink = fit(hd(0.28, Math.min(0.085, 0.035 + C * 0.5)), c, inkMin, -0.015);\n    var accent = fit(hd(0.5, Math.min(0.15, 0.08 + C)), card, 4.5, -0.02);\n    accent = fit(accent, c, 4.5, -0.02);   // it also sits on your color (dates, labels)\n    // the top bar, filled buttons and ticked boxes: a rich deep shade of your color with light text (not near-black),\n    // always clearly deeper than your color (a mid-tone pick like terracotta got a bar as bright as itself)\n    var inkFill = fit(hd(Math.min(0.52, L - 0.18) - turnAt(H, 2), Math.min(0.07 + 0.09 * w, 0.065 + C * 0.9)), cream, 5.6, -0.015);\n    // MID-LIGHT (Kasey, Nov 1: \"a spot in the middle for the kind of mid light colors that just looks really bad … the\n    // color you chose and a white background\"): a pick in the middle (sage, dusty blue, terracotta, mauve) is already\n    // as deep as the cards' \"deeper versions\" were meant to be, so the calendar came out the same as your color and every\n    // other card near-white: two tones, block after block. For those picks the other cards are soft tints of your color\n    // instead (like 2T's lilac and pale lilac), lighter than it and clearly colored, so the page has 3-4 related tones.\n    // mw: 1 for a mid pick (L up to 0.72), fading to 0 by L 0.84, where the light-pick rules above stay exactly as they were.\n    var mw = cap((0.84 - L) / 0.12, 0, 1);\n    var mid = function (old, l, ch, dh) { if (!mw) return old; var q = lch(hex2rgb(old)); var n = [l, ch, H + (dh || 0)]; return rgb2hex(fromLch(q[0] + (n[0] - q[0]) * mw, q[1] + (n[1] - q[1]) * mw, n[2])); };\n    var roles = {\n      ink: ink, inkFill: inkFill, accent: accent, accent2: tone(accent, Math.min(0.6, lch(hex2rgb(accent))[0] + 0.07)), clay: accent,\n      page: mid(hx(0.905, Math.min(C * 0.45, 0.028), deepTurn(H) / 2), 0.9, Math.min(C * 0.4, 0.03), deepTurn(H) / 2),\n      paper: mid(hx(0.93, Math.min(C * 0.35, 0.02), deepTurn(H) / 2), 0.925, Math.min(C * 0.35, 0.026), deepTurn(H) / 2),\n      cream: mid(cream, 0.935, Math.min(C * 0.4, 0.03)), card: mid(card, 0.965, Math.min(C * 0.22, 0.016)), linen: mid(linen, 0.91, Math.min(C * 0.45, 0.036)),\n      pink: c,                                                                // your color, exactly\n      sand: mid(hx(cap(L + 0.05, 0.62, 0.95), C * 0.8, 0.08), 0.87, Math.min(C * 0.7, 0.07), 0.08),     // a close neighbor\n      celadon: mid(hx(cap(L + 0.08, 0.86, 0.95), Math.min(C * 0.6, 0.09)), 0.9, Math.min(C * 0.55, 0.055)),       // a lighter version\n      sageband: mid(hx(cap(L - 0.06, 0.6, 0.9), C * 1.1, deepTurn(H) / 4), 0.84, Math.min(C * 0.65, 0.065), deepTurn(H) / 4),\n      sage: mid(hx(cap(L - 0.09, 0.58, 0.88), C, deepTurn(H) / 4), 0.8, Math.min(C * 0.65, 0.065), deepTurn(H) / 4)   // deeper versions (richer, so not dusty); soft tints for a mid pick\n    };\n    // safety: text stays easy to read on every other card\n    ['sand', 'celadon', 'sageband', 'sage', 'page', 'paper'].forEach(function (k) { roles[k] = fit(roles[k], ink, 4.6, 0.02); });\n    // removed colors: their spots use the first color you kept, or your own color if you removed them all\n    var kept = GROUP_ORDER.filter(function (g) { return off.indexOf(g) < 0; }), fill = kept.length ? roles[GROUPS.p1[kept[0]][0]] : c;\n    off.forEach(function (g) { GROUPS.p1[g].forEach(function (k) { roles[k] = fill; }); });\n    return { fam: 'p1', roles: roles };\n  }\n  function rolesFor(look) {\n    if (!look || !look.t) return null;\n    if (look.t === 'custom' && hex2rgb(look.c)) return customRoles(look.c, look.off);\n    var t = tpl(look.t); if (!t || t.base) return null;\n    return { fam: t.fam, roles: t.roles };\n  }\n  function famFor(look) { if (!look) return null; if (look.t === 'custom') { var r = rolesFor(look); return r ? r.fam : null; } var t = tpl(look.t); return t ? t.fam : null; }\n\n  /* ---------- the color map ---------- */\n  function makeMap(fam, roles) {\n    var base = fam === 'p2' ? BASE_P2 : BASE_P1, list = [];\n    Object.keys(base).forEach(function (k) { if (roles[k]) list.push({ k: k, from: lch(hex2rgb(base[k])), lab: rgb2lab(hex2rgb(base[k])), to: lch(hex2rgb(roles[k])) }); });\n    var keep = {}; KEEP.forEach(function (h) { keep[hex2rgb(h).join(',')] = 1; });\n    var cache = {};\n    // filled things (bars, buttons, ticks) that use the text color can get their own shade\n    var fillTo = roles.inkFill ? lch(hex2rgb(roles.inkFill)) : null;\n    return function (rgb, prop) {\n      var isFill = !!(fillTo && prop && /^(background|border|outline|fill|stroke|box-shadow|--dbk-fill|--dbk-deep|--bandc)/.test(prop));\n      var key = rgb.join(',') + (isFill ? 'f' : ''); if (keep[rgb.join(',')]) return null;\n      if (cache[key] !== undefined) return cache[key];\n      var lab = rgb2lab(rgb), best = null, bd = 9;\n      list.forEach(function (r) { var d = Math.sqrt(Math.pow(lab[0] - r.lab[0], 2) + Math.pow(lab[1] - r.lab[1], 2) + Math.pow(lab[2] - r.lab[2], 2)); if (d < bd) { bd = d; best = r; } });\n      var out = null;\n      if (best && bd < 0.09) {\n        if (isFill && best.k === 'ink') best = { from: best.from, to: fillTo };\n        var me = lch(rgb), L = best.to[0] + (me[0] - best.from[0]);\n        var C = best.from[1] > 0.015 ? best.to[1] * Math.min(1, me[1] / best.from[1]) : best.to[1] + Math.max(0, me[1] - best.from[1]);\n        C = Math.min(C, Math.max(best.to[1], 0.03));   // never richer than the color it's standing in for (a deep red used to come out firetruck red)\n        out = fromLch(L, Math.min(C, 0.25), best.to[2] + (best.from[1] > 0.015 && me[1] > 0.015 ? me[2] - best.from[2] : 0)).map(Math.round);\n      }\n      cache[key] = out; return out;\n    };\n  }\n  var RE_HEX = /#([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{3,4})\\b/gi;\n  var RE_RGB = /rgba?\\(\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*(,\\s*[\\d.]+\\s*)?\\)/gi;\n  var RE_TRIP = /^\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*,\\s*(\\d{1,3})\\s*$/;\n  function swapValue(v, map, prop) {\n    if (!v || v.indexOf('url(') !== -1 && v.indexOf('data:') !== -1) return v;\n    var out = v.replace(RE_HEX, function (m, h) {\n      var c = hex2rgb(h.length === 8 ? h.slice(0, 6) : h.length === 4 ? h.slice(0, 3) : h); if (!c) return m;\n      var n = map(c, prop); if (!n) return m;\n      return rgb2hex(n) + (h.length === 8 ? h.slice(6) : h.length === 4 ? h[3] + h[3] : '');\n    }).replace(RE_RGB, function (m, r, g, b, a) {\n      var n = map([+r, +g, +b], prop); if (!n) return m;\n      return (a ? 'rgba(' : 'rgb(') + n.join(', ') + (a || '') + ')';\n    });\n    if (prop && /^--.*rgb$/i.test(prop)) { var t = RE_TRIP.exec(out); if (t) { var n = map([+t[1], +t[2], +t[3]], prop); if (n) out = n.join(','); } }\n    return out;\n  }\n\n  /* ---------- fonts: a heading font and a body font ---------- */\n  // heading: title (big titles) + caps (labels, small capitals); body: everything you read\n  var HEADS = [\n    { id: 'playfair', name: 'Playfair', title: \"'Playfair Display'\", caps: \"'Playfair Display SC'\", gf: null },\n    { id: 'fell', name: 'Storybook', title: \"'IM Fell English'\", caps: \"'IM Fell English SC'\", gf: 'IM+Fell+English:ital@0;1&family=IM+Fell+English+SC' },\n    { id: 'cormorant', name: 'Cormorant', title: \"'Cormorant Garamond'\", caps: \"'Cormorant SC'\", gf: 'Cormorant+Garamond:ital,wght@0,500;1,500&family=Cormorant+SC:wght@500' },\n    { id: 'fraunces', name: 'Fraunces', title: \"'Fraunces'\", caps: \"'Fraunces'\", gf: 'Fraunces:ital,opsz,wght@0,9..144,400;1,9..144,400' },\n    { id: 'dmserif', name: 'DM Serif', title: \"'DM Serif Display'\", caps: \"'DM Serif Display'\", gf: 'DM+Serif+Display:ital@0;1' },\n    { id: 'abril', name: 'Abril', title: \"'Abril Fatface'\", caps: \"'Abril Fatface'\", gf: 'Abril+Fatface' },\n    { id: 'cinzel', name: 'Cinzel', title: \"'Cinzel'\", caps: \"'Cinzel'\", gf: 'Cinzel:wght@400;600' },\n    { id: 'alice', name: 'Alice', title: \"'Alice'\", caps: \"'Alice'\", gf: 'Alice' },\n    { id: 'elite', name: 'Typewriter', title: \"'Special Elite'\", caps: \"'Special Elite'\", gf: 'Special+Elite' },\n    { id: 'josefin', name: 'Josefin', title: \"'Josefin Sans'\", caps: \"'Josefin Sans'\", gf: 'Josefin+Sans:ital,wght@0,400;0,600;1,400' },\n    { id: 'quicksand', name: 'Quicksand', title: \"'Quicksand'\", caps: \"'Quicksand'\", gf: 'Quicksand:wght@500;600' },\n    { id: 'caveat', name: 'Caveat', title: \"'Caveat'\", caps: \"'Quicksand'\", gf: 'Caveat:wght@500;600&family=Quicksand:wght@500;600' }\n  ];\n  var BODIES = [\n    { id: 'lora', name: 'Lora', body: \"'Lora'\", gf: null },\n    { id: 'crimson', name: 'Crimson', body: \"'Crimson Pro'\", gf: 'Crimson+Pro:ital,wght@0,400;0,500;1,400' },\n    { id: 'literata', name: 'Literata', body: \"'Literata'\", gf: 'Literata:ital,opsz,wght@0,7..72,400;1,7..72,400' },\n    { id: 'sourceserif', name: 'Source Serif', body: \"'Source Serif 4'\", gf: 'Source+Serif+4:ital,opsz,wght@0,8..60,400;1,8..60,400' },\n    { id: 'merriweather', name: 'Merriweather', body: \"'Merriweather'\", gf: 'Merriweather:ital,wght@0,300;0,400;1,300' },\n    { id: 'alegreya', name: 'Alegreya', body: \"'Alegreya'\", gf: 'Alegreya:ital,wght@0,400;1,400' },\n    { id: 'inter', name: 'Inter', body: \"'Inter'\", gf: 'Inter:wght@400;500' },\n    { id: 'nunito', name: 'Nunito', body: \"'Nunito'\", gf: 'Nunito:ital,wght@0,400;1,400' },\n    { id: 'worksans', name: 'Work Sans', body: \"'Work Sans'\", gf: 'Work+Sans:ital,wght@0,400;1,400' },\n    { id: 'courier', name: 'Courier Prime', body: \"'Courier Prime'\", gf: 'Courier+Prime:ital,wght@0,400;1,400' }\n  ];\n  function head(id) { return HEADS.filter(function (f) { return f.id === id; })[0] || HEADS[0]; }\n  function bodyF(id) { return BODIES.filter(function (f) { return f.id === id; })[0] || BODIES[0]; }\n  function fontsOf(look) { var h = head(look.h), b = bodyF(look.b); return { id: h.id + '/' + b.id, plain: h.id === 'playfair' && b.id === 'lora', title: h.title, caps: h.caps, body: b.body, h: h, b: b }; }\n  var FB = \", 'Iowan Old Style', Georgia, serif\";\n  function swapFont(v, f) {\n    if (!v || !f || f.plain || !/Playfair|Lora/.test(v)) return v;\n    return v.replace(/(['\"])Playfair Display SC\\1/g, f.caps).replace(/(['\"])Playfair Display\\1/g, f.title).replace(/(['\"])Lora\\1/g, f.body)\n      .replace(/(^|,\\s*)Playfair Display SC(?=\\s*,|$)/g, '$1' + f.caps).replace(/(^|,\\s*)Playfair Display(?=\\s*,|$)/g, '$1' + f.title).replace(/(^|,\\s*)Lora(?=\\s*,|$)/g, '$1' + f.body);\n  }\n  function loadGf(id, gf) {\n    if (!gf) return; id = 'dbkLookFont-' + id; if (document.getElementById(id)) return;\n    var l = document.createElement('link'); l.id = id; l.rel = 'stylesheet'; l.href = 'https://fonts.googleapis.com/css2?family=' + gf + '&display=swap';\n    (document.head || document.documentElement).appendChild(l);\n  }\n  function loadFont(f) { if (f && f.h) { loadGf('h-' + f.h.id, f.h.gf); loadGf('b-' + f.b.id, f.b.gf); } }\n\n  /* ---------- whose look this page shows ---------- */\n  function owner() {\n    var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').toLowerCase();\n    if (/person1-hub/.test(page)) return 'person1';\n    if (/person2-hub/.test(page)) return 'person2';\n    try { var r = localStorage.getItem('myPersonRole'); if (r === 'person1' || r === 'person2') return r; } catch (e) {}\n    // nobody known yet on this phone: the person whose look it last showed (dbk-frame.js, dbkLookCarry)\n    try { return (window.dbkLookCarry && window.dbkLookCarry.who()) || 'person1'; } catch (e) { return 'person1'; }\n  }\n  function known() { try { var r = localStorage.getItem('myPersonRole'); return r === 'person1' || r === 'person2'; } catch (e) { return false; } }\n  function read(p) { try { var o = JSON.parse(localStorage.getItem('dbkLook_' + (p || owner())) || 'null'); return o && typeof o === 'object' ? o : null; } catch (e) { return null; } }\n  function defaultLook(p) { return { t: p === 'person2' ? 'midnight' : 'stone', h: 'playfair', b: 'lora' }; }\n  // (no look saved for them on this phone yet: the look this phone last showed, before Stone or Midnight)\n  function carried(p) { try { var l = window.dbkLookCarry && window.dbkLookCarry.lookFor(p); return l ? JSON.parse(JSON.stringify(l)) : null; } catch (e) { return null; } }\n  function current(p) { p = p || owner(); var o = read(p) || carried(p) || defaultLook(p); if (!o.h) o.h = 'playfair'; if (!o.b) o.b = 'lora'; if (!o.t) o.t = defaultLook(p).t; return o; }\n\n  /* ---------- applying it to this page ---------- */\n  var orig = typeof WeakMap === 'function' ? new WeakMap() : null, applied = null;\n  function eachRule(list, fn) {\n    for (var i = 0; i < list.length; i++) {\n      var r = list[i];\n      if (r.style) fn(r);\n      if (r.cssRules) { try { eachRule(r.cssRules, fn); } catch (e) {} }\n    }\n  }\n  function remapSheet(sheet, map, f) {\n    if (sheet.ownerNode && sheet.ownerNode.hasAttribute && sheet.ownerNode.hasAttribute('data-dbk-raw')) return;   // colors already worked out for this look\n    var rules; try { rules = sheet.cssRules; } catch (e) { return; }   // other sites' style sheets (fonts) can't be read\n    if (!rules) return;\n    eachRule(rules, function (r) {\n      var st = r.style, saved = orig && orig.get(r);\n      if (!saved) {\n        saved = [];\n        for (var i = 0; i < st.length; i++) { var p = st[i], v = st.getPropertyValue(p); if (/#|rgb|Playfair|Lora|^\\s*\\d{1,3}\\s*,/.test(v)) saved.push([p, v, st.getPropertyPriority(p)]); }\n        if (orig) orig.set(r, saved);\n      }\n      saved.forEach(function (s) {\n        var v = s[1];\n        if (map) v = swapValue(v, map, s[0]);\n        if (/font/.test(s[0]) || /^--font|^--dbk-(caps|serif|script|sans)/.test(s[0])) v = swapFont(v, f);\n        if (st.getPropertyValue(s[0]) !== v) { try { st.setProperty(s[0], v, s[2]); } catch (e) {} }\n      });\n    });\n  }\n  function remapOne(el, map) {\n    if (el.closest('[data-dbk-keep]')) return;   // the picker shows each look's real colors\n    // colors a page set from what's already drawn (the \"are you sure?\" box's filled button, daybook-theme.js\n    // confirmFill) are this look's colors already: swapping them again turned a pink look's button dark navy\n    if (el.hasAttribute('data-dbk-live')) { var o0 = el.getAttribute('data-dbk-ost'); if (o0 !== null) el.removeAttribute('data-dbk-ost'); return; }\n    var o = el.getAttribute('data-dbk-ost');\n    var cur = el.getAttribute('style') || '';\n    if (o === null || (el._dbkSet !== cur)) { if (!/#|rgb/.test(cur)) return; o = cur; el.setAttribute('data-dbk-ost', o); }\n    var v = map ? swapValue(o, map) : o;\n    if (cur !== v) { el.setAttribute('style', v); }\n    el._dbkSet = v;\n  }\n  function remapInline(map) { document.querySelectorAll('[style]').forEach(function (el) { remapOne(el, map); }); }\n  // a part of the page that just appeared: its own colors, right away\n  function remapIn(n, map) { if (n.hasAttribute('style')) remapOne(n, map); var a = n.querySelectorAll('[style]'); for (var i = 0; i < a.length; i++) remapOne(a[i], map); }\n  /* ---------- readable everywhere: text never ends up light on light (or dark on dark) ----------\n     Colors are swapped one at a time, so a badge's white number can land on a light version of your color.\n     After every recolor this looks at what's on screen and switches any hard-to-read text to near-black or white. */\n  function rgbaOf(s) { var m = /rgba?\\(([^)]+)\\)/.exec(s || ''); if (!m) return null; var p = m[1].split(/[ ,\\/]+/).filter(Boolean).map(parseFloat); return [p[0], p[1], p[2], p.length > 3 ? p[3] : 1]; }\n  function lumRgb(c) { return 0.2126 * lin(c[0]) + 0.7152 * lin(c[1]) + 0.0722 * lin(c[2]); }\n  function ratio(a, b) { var x = lumRgb(a), y = lumRgb(b); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); }\n  // one small rule per box color, in a style sheet the recolor leaves alone\n  var inCss = null, inKeys = {}, inN = 0;\n  function inRule(bg, tx) {\n    var k = bg + tx; if (inKeys[k]) return inKeys[k];\n    var n = String(++inN); inKeys[k] = n;\n    if (!inCss) { inCss = document.createElement('style'); inCss.setAttribute('data-dbk-raw', ''); document.head.appendChild(inCss); }\n    var a = hex2rgb(tx).join(','), sel = 'html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-in=\"' + n + '\"]';\n    inCss.appendChild(document.createTextNode(sel + '{background:' + bg + '!important;background-image:none!important;color:' + tx + '!important;-webkit-text-fill-color:' + tx + '!important;caret-color:' + tx + '!important;border-color:rgba(' + a + ',.25)!important}' + sel + '::placeholder{color:rgba(' + a + ',.62)!important;-webkit-text-fill-color:rgba(' + a + ',.62)!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-in-ic=\"' + n + '\"]{color:' + tx + '!important}'));\n    return n;\n  }\n  var cgCss = null, cgTimer = null, cgLast = 0, cgAll = false, cgRoots = [];\n  // SWEEP-LOOK (Oct 20): a color that reads, close to the one it replaces. The text's own color (as seen, fades\n  // included) moves toward white or black only until it reaches the standard (a little over, so rounding never\n  // dips under), so a faded gray-green stays gray-green and a red date stays red, just deeper. 'up' is the fade\n  // left on it from above (a faded row), which the new color makes up for. Returns 'l' / 'd' (the old pure white or\n  // black) when nothing gentler reads, otherwise the number of a small rule made for that color.\n  var rdCss = null, rdKeys = {}, rdN = 0;\n  function readable(f, bg, need, up, kind) {\n    var white = ratio([255, 255, 255], bg) >= ratio([0, 0, 0], bg), end = white ? [255, 255, 255] : [0, 0, 0];\n    if (ratio(end, bg) < need) return kind === 'ph' ? rule(end) : white ? 'l' : 'd';\n    var lo = 0, hi = 1, mix = function (t) { return [0, 1, 2].map(function (k) { return f[k] + (end[k] - f[k]) * t; }); };\n    for (var i = 0; i < 14; i++) { var mid = (lo + hi) / 2; if (ratio(mix(mid), bg) >= need + 0.15) hi = mid; else lo = mid; }\n    var seen = mix(hi), a = Math.max(0.05, Math.min(1, up || 1));\n    var c = [0, 1, 2].map(function (k) { return (seen[k] - bg[k] * (1 - a)) / a; });\n    if (c.some(function (v) { return v < -0.5 || v > 255.5; })) return kind === 'ph' ? rule(end) : white ? 'l' : 'd';\n    return rule(c);\n    function rule(c) {\n      var hex = rgb2hex(c), key = (kind || '') + hex;\n      if (rdKeys[key]) return rdKeys[key];\n      var n = (kind === 'ph' ? 'p' : 'c') + (++rdN); rdKeys[key] = n;\n      if (!rdCss) { rdCss = document.createElement('style'); rdCss.setAttribute('data-dbk-raw', ''); (document.head || document.documentElement).appendChild(rdCss); }\n      var sel = 'html:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o)';   // above every page rule\n      rdCss.appendChild(document.createTextNode(kind === 'ph'\n        ? sel + ' [data-dbk-ph=\"' + n + '\"]::placeholder{color:' + hex + '!important;-webkit-text-fill-color:' + hex + '!important;opacity:1!important}'\n        : sel + ' [data-dbk-cg=\"' + n + '\"]{color:' + hex + '!important;-webkit-text-fill-color:' + hex + '!important;opacity:1!important}'));\n      return n;\n    }\n  }\n  /* ---------- 2T: the two closest purples never back to back (the designer, Oct 21) ----------\n     2T turns two of the base look's card colors (pink and sand) into lilac (#ddb9e3) and a deeper lilac (#c6a0d0).\n     Where two sections that touch would both be one of those (Habits: October challenge, then Resources), the second\n     takes a color that differs from both its neighbors: the pale lilac, else the cream. Nothing changes in other looks. */\n  var t2Css = null, T2_NEAR = ['rgb(221, 185, 227)', 'rgb(198, 160, 208)'], T2_ALT = [['c', 'rgb(236, 220, 239)'], ['m', 'rgb(248, 241, 228)']];\n  function spread2T() {\n    var on = (current().t === '2timelines');\n    var marked = document.querySelectorAll('[data-dbk-2t]');\n    if (!on) { [].forEach.call(marked, function (e) { e.removeAttribute('data-dbk-2t'); e.removeAttribute('data-dbk-2tbg'); }); return; }\n    if (!t2Css) { t2Css = document.createElement('style'); t2Css.setAttribute('data-dbk-raw', ''); (document.head || document.documentElement).appendChild(t2Css);\n      t2Css.textContent = 'html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) [data-dbk-2t=\"c\"] { background-color: #ecdcef !important; background-image: none !important; }' +\n        'html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) [data-dbk-2t=\"m\"] { background-color: #f8f1e4 !important; background-image: none !important; }' +\n        // a little more of the studio red: a ticked bingo square is red instead of the plum-brown (the designer, Oct 21)\n        'html[data-dbk-look=\"2timelines\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) :is(.bingo-cell.completed, .bingo-cell.in-bingo) { background: #a3263b !important; color: #fff !important; border-color: #a3263b !important; }'; }\n    var secs = [].filter.call(document.querySelectorAll('.dbk-sec, section'), function (e) {\n      if (!e.getClientRects().length || e.getBoundingClientRect().height < 40) return false;\n      var up = e.parentElement && e.parentElement.closest('.dbk-sec, section'); return !up;\n    });\n    // each one's own color (what it was before this check changed it)\n    var bg = secs.map(function (e) { return e.getAttribute('data-dbk-2tbg') || getComputedStyle(e).backgroundColor; });\n    var want = secs.map(function () { return ''; }), shown = bg.slice();\n    // cards side by side in one row (Work's slim rows on a computer, `.wt-slimrow`) count as one: each takes what the\n    // row's first card took, and the first looks past its row-mates for the card after the row\n    var rowOf = function (e) { return e.parentElement && e.parentElement.classList.contains('wt-slimrow') ? e.parentElement : null; };\n    var sameRow = function (x, y) { var r = rowOf(x); return !!r && r === rowOf(y) && getComputedStyle(r).display !== 'contents'; };\n    for (var i = 1; i < secs.length; i++) {\n      if (sameRow(secs[i - 1], secs[i])) { want[i] = want[i - 1]; shown[i] = shown[i - 1]; continue; }\n      var a = secs[i - 1].getBoundingClientRect(), b = secs[i].getBoundingClientRect();\n      if (b.top - a.bottom > 40) continue;   // not touching (something else between them)\n      if (T2_NEAR.indexOf(shown[i - 1]) === -1 || T2_NEAR.indexOf(bg[i]) === -1) continue;\n      var nx = i + 1; while (nx < secs.length && sameRow(secs[i], secs[nx])) nx++;\n      var next = nx < secs.length ? bg[nx] : '';\n      for (var k = 0; k < T2_ALT.length; k++) if (T2_ALT[k][1] !== shown[i - 1] && T2_ALT[k][1] !== next) { want[i] = T2_ALT[k][0]; shown[i] = T2_ALT[k][1]; break; }\n    }\n    secs.forEach(function (e, j) {\n      var cur = e.getAttribute('data-dbk-2t') || '';\n      if (cur === want[j]) return;\n      if (want[j]) { if (!e.hasAttribute('data-dbk-2tbg')) e.setAttribute('data-dbk-2tbg', bg[j]); e.setAttribute('data-dbk-2t', want[j]); }\n      else { e.removeAttribute('data-dbk-2t'); e.removeAttribute('data-dbk-2tbg'); }\n    });\n    [].forEach.call(marked, function (e) { if (secs.indexOf(e) === -1) { e.removeAttribute('data-dbk-2t'); e.removeAttribute('data-dbk-2tbg'); } });\n  }\n  // Parts put away whole with `hidden` (a Money tab, a pop-up closed and opened again) keep the marks they were given\n  // while they showed: nothing has to be worked out again when they come back, so the tap that shows one paints at once\n  // (Oct 25, Kasey: Money's tabs \"insanely slow\"; each tap checked every tab's text, about 0.2-0.4s on a phone). Anything\n  // that changes inside one, or around it, or a check of the whole page, and it is checked again as it shows.\n  var kept = [];\n  function keptDrop(r) { for (var i = kept.length - 1; i >= 0; i--) if (kept[i] === r || kept[i].contains(r) || r.contains(kept[i])) kept.splice(i, 1); }\n  function guard(roots) {\n    if (!roots) kept = []; else roots.forEach(keptDrop);\n    try { spread2T(); } catch (e) {}\n    if (!document.body) return;\n    // read final colors, never a color halfway through a fade (that made text flash back and forth). Only the parts being\n    // checked and what's above them stop their fades for the moment (Oct 25): a mark on the whole page made the browser\n    // work out every style on the page twice for each check, about 0.1-0.2s per Money tab tap on a phone\n    if (!cgCss) guardCss();\n    var on = roots ? roots.filter(function (r) { return r.isConnected; }) : [document.documentElement], up = [];\n    if (roots) on.forEach(function (r) { for (var a = r.parentElement; a; a = a.parentElement) { if (a.hasAttribute('data-dbk-cgu')) break; a.setAttribute('data-dbk-cgu', ''); up.push(a); } });\n    on.forEach(function (r) { r.setAttribute('data-dbk-cgm', ''); });\n    try { guardPass(roots); } finally { on.forEach(function (r) { r.removeAttribute('data-dbk-cgm'); }); up.forEach(function (a) { a.removeAttribute('data-dbk-cgu'); }); }\n  }\n  function guardCss() { cgCss = document.createElement('style'); cgCss.setAttribute('data-dbk-cg', ''); cgCss.textContent = '[data-dbk-cgm],[data-dbk-cgm] *,[data-dbk-cgu]{transition:none!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cg=\"l\"]{color:#ffffff!important;-webkit-text-fill-color:#ffffff!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cg=\"d\"]{color:#000000!important;-webkit-text-fill-color:#000000!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgb=\"l\"]{border-color:rgba(255,255,255,.75)!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgb=\"d\"]{border-color:rgba(0,0,0,.6)!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgf=\"l\"]{background-color:#ffffff!important;border-color:#ffffff!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgf=\"d\"]{background-color:#000000!important;border-color:#000000!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgf=\"lf\"]{background-color:rgba(255,255,255,.42)!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgf=\"df\"]{background-color:rgba(0,0,0,.28)!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgs=\"l\"]{box-shadow:inset 0 0 0 1.5px #ffffff!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgs=\"d\"]{box-shadow:inset 0 0 0 1.5px #000000!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgr=\"l\"]{border-color:#ffffff!important;opacity:1!important}html:not(#z):not(#y):not(#x):not(#w):not(#v) [data-dbk-cgr=\"d\"]{border-color:#000000!important;opacity:1!important}'; (document.head || document.documentElement).appendChild(cgCss); }\n  function guardPass(roots) {\n    if (!cgCss) guardCss();\n    var scope = roots ? roots.filter(function (r) { return r.isConnected; }) : [document.body];\n    var list = [];\n    scope.forEach(function (r) { if (r !== document.body) list.push(r); var a = r.getElementsByTagName('*'); for (var q = 0; q < a.length; q++) list.push(a[q]); });\n    list.forEach(function (el) { if (el.hasAttribute('data-dbk-cg')) el.removeAttribute('data-dbk-cg'); ['data-dbk-cgb', 'data-dbk-cgf', 'data-dbk-cgr', 'data-dbk-cgs', 'data-dbk-ph'].forEach(function (a) { if (el.hasAttribute(a)) el.removeAttribute(a); }); if (el.hasAttribute('data-dbk-in')) el.removeAttribute('data-dbk-in'); if (el.hasAttribute('data-dbk-in-ic')) el.removeAttribute('data-dbk-in-ic'); });\n    var bgCache = new Map(), page = rgbaOf(getComputedStyle(document.documentElement).backgroundColor);\n    if (!page || page[3] < 0.5) page = rgbaOf(getComputedStyle(document.body).backgroundColor);\n    if (!page || page[3] < 0.5) page = [255, 255, 255, 1];\n    // the solid color behind an element: its own background or the nearest one behind it (see-through ones blended in)\n    function bgOf(el) {\n      if (!el || el === document.documentElement || el.nodeType !== 1) return page.slice(0, 3);\n      if (bgCache.has(el)) return bgCache.get(el);\n      var cs = getComputedStyle(el), c = rgbaOf(cs.backgroundColor), out;\n      if (cs.backgroundImage && cs.backgroundImage !== 'none' && !/gradient/.test(cs.backgroundImage)) out = null;   // a photo: can't tell\n      else if (c && c[3] >= 0.98) out = c.slice(0, 3);\n      else { var under = bgOf(el.parentElement); out = !under ? null : (c && c[3] > 0) ? [0, 1, 2].map(function (k) { return c[k] * c[3] + under[k] * (1 - c[3]); }) : under; }\n      bgCache.set(el, out); return out;\n    }\n    var opCache = new Map();\n    function opOf(el) {\n      if (!el || el.nodeType !== 1) return 1;\n      if (opCache.has(el)) return opCache.get(el);\n      var v = parseFloat(getComputedStyle(el).opacity); v = (isNaN(v) ? 1 : v) * opOf(el.parentElement);\n      opCache.set(el, v); return v;\n    }\n    // text boxes: a dark box is fine, but never darker than what it sits on, and never black.\n    // One that is gets a shade just lighter than its background, with text that reads on it.\n    var TYPES = /^(text|search|email|url|tel|number|password|date|time|datetime-local|month|week|)$/;\n    list.forEach(function (el) {\n      var tg = el.tagName; if (tg !== 'INPUT' && tg !== 'TEXTAREA' && tg !== 'SELECT') return;\n      if (tg === 'INPUT' && !TYPES.test((el.getAttribute('type') || '').toLowerCase())) return;\n      if (!el.getClientRects().length || el.closest('[data-dbk-keep]')) return;\n      var cs = getComputedStyle(el), own = rgbaOf(cs.backgroundColor), boxy = (own && own[3] > 0.25) || parseFloat(cs.borderBottomWidth) > 0 || parseFloat(cs.borderTopWidth) > 0;\n      var bx = el;\n      if (!boxy) {   // the box may be drawn by a small wrapper around the field (with its icon)\n        var w = el.parentElement, wo = w && rgbaOf(getComputedStyle(w).backgroundColor);\n        if (!w || w.childElementCount > 3 || !(wo && wo[3] > 0.25)) return;\n        bx = w;\n      }\n      var box = bgOf(bx), under = bgOf(bx.parentElement); if (!box || !under) return;\n      var lb = lumRgb(box), lu = lumRgb(under);\n      if (!(lb < 0.012 || (lb < 0.2 && lb < lu * 0.92))) return;\n      var q = lch(under), nb = rgb2hex(fromLch(q[0] < 0.12 ? 0.22 : Math.min(0.97, q[0] + (lu < 0.2 ? 0.07 : 0.04)), q[1], q[2]));\n      var light = rgb2hex(fromLch(0.97, Math.min(q[1], 0.015), q[2])), dark = rgb2hex(fromLch(0.22, Math.min(q[1], 0.04), q[2]));\n      var tx = contrast(light, nb) >= contrast(dark, nb) ? light : dark;\n      var rn = inRule(nb, tx); el.setAttribute('data-dbk-in', rn); if (bx !== el) bx.setAttribute('data-dbk-in', rn);\n      // an icon in or over the box (like a search magnifier) matches the text\n      var par = el.parentElement; if (par) [].forEach.call(par.children, function (sib) { if (sib !== el && (sib.tagName === 'svg' || sib.querySelector && sib.querySelector('svg') && !sib.querySelector('input,textarea')) && (bx !== el || getComputedStyle(sib).position === 'absolute')) sib.setAttribute('data-dbk-in-ic', rn); });\n    });\n    // (SWEEP-LOOK, Oct 20: this used to stop here for Stone and Midnight, so their faded text, outline buttons and\n    // placeholders were never checked; the sweep measured hundreds of places under 4.5 to 1. It runs for every look now,\n    // and a fix-up keeps the text's own color, only as much darker or lighter as it takes: see readable() below.)\n    // every color is read first and the marks are put on together at the end: putting each one on as it was found\n    // made the browser work out the whole page's styles again for the next read, so a long list took up to a second\n    // and the fix-up had to wait, showing faded text first and then switching (a flash)\n    var marks = [];\n    for (var j = 0; j < list.length; j++) {\n      var el = list[j], tag = el.tagName;\n      if ((tag === 'INPUT' || tag === 'TEXTAREA') && el.placeholder && !el.value && !el.closest(':disabled, [data-dbk-keep]') && el.getClientRects().length) {\n        // placeholders read too (SWEEP-LOOK): the hint in an empty box was often under 2 to 1\n        var pcs = getComputedStyle(el, '::placeholder'), pc = rgbaOf(pcs.color), pbg = bgOf(el);\n        if (pc && pbg) { var pop = opOf(el), pal = pc[3] * pop, pf = [0, 1, 2].map(function (k) { return pc[k] * pal + pbg[k] * (1 - pal); }); if (ratio(pf, pbg) < 4.5) marks.push([el, 'data-dbk-ph', readable(pf, pbg, 4.5, pop, 'ph')]); }\n      }\n      if (tag === 'SCRIPT' || tag === 'STYLE' || tag === 'svg' || tag === 'SVG' || tag === 'INPUT' || tag === 'TEXTAREA' || tag === 'SELECT' || tag === 'IMG' || el.closest('svg,[data-dbk-keep]')) continue;\n      // a button that can't be pressed yet (Connect before a token is pasted) keeps its fade: making it solid\n      // made it look ready to tap. Its own look keeps the words readable enough to see what it will do.\n      if (el.closest(':disabled, [aria-disabled=\"true\"]')) continue;\n      var txt = false;\n      for (var n = el.firstChild; n; n = n.nextSibling) if (n.nodeType === 3 && /\\S/.test(n.nodeValue)) { txt = true; break; }\n      try { markGuard(el, txt); } catch (e) {}\n      if (!txt && !el.childElementCount && /badge|count|num/i.test(typeof el.className === 'string' ? el.className : '')) { var own = rgbaOf(getComputedStyle(el).backgroundColor); txt = !!(own && own[3] >= 0.9); }   // an empty badge that will get a number later\n      if (!txt) continue;\n      // (text in an element laid out as 'contents' has no box of its own but is still on screen: Today's event times)\n      if (!el.getClientRects().length && getComputedStyle(el).display !== 'contents') continue;\n      var cs2 = getComputedStyle(el), fg = rgbaOf(cs2.color), bg = bgOf(el);\n      if (!fg || !bg || parseFloat(cs2.opacity) === 0) continue;\n      // how see-through the text really is: its own color's alpha times every fade on it and above it\n      var op = opOf(el);\n      if (op < 0.05) continue;\n      var al = fg[3] * op, f = [0, 1, 2].map(function (k) { return fg[k] * al + bg[k] * (1 - al); });\n      // the usual reading standard: 4.5 to 1, or 3 to 1 for big text\n      var fs = parseFloat(cs2.fontSize) || 16, big = fs >= 24 || (fs >= 18.5 && parseInt(cs2.fontWeight, 10) >= 600);\n      if (ratio(f, bg) >= (big ? 3 : 4.5)) continue;\n      var opUp = op / Math.max(0.05, parseFloat(cs2.opacity) || 1);   // the fades above it stay; its own goes\n      // a person's own color: clean dark or light text, as before Oct 20 (the gentle tint made own-color looks muddy,\n      // the designer, Oct 20). The built-in looks keep the gentle fix-up, close to the text's own color.\n      marks.push([el, 'data-dbk-cg', applied ? ownTx(bg, big ? 3 : 4.5) : readable(f, bg, big ? 3 : 4.5, opUp, '')]);\n    }\n    for (var mk = 0; mk < marks.length; mk++) marks[mk][0].setAttribute(marks[mk][1], marks[mk][2]);\n    // LIGHT-PALETTE: a light own color's fix-up uses its own deep ink (or its soft white) when that reads, not plain\n    // black or white (pure black looked harsh next to the tinted text around it). Dark own colors keep black / white.\n    function ownTx(bg, need) {\n      var w = ratio([255, 255, 255], bg) >= ratio([0, 0, 0], bg), t = w ? state.lt : state.dk;\n      return t && ratio(t, bg) >= need + 0.15 ? (w ? 'ol' : 'od') : w ? 'l' : 'd';\n    }\n    // marks with no words that still need to be seen: little dots and rings drawn in the text color (habit\n    // history, step dots), and the outline of an outline button. Drawn in a person's own colors (a calendar\n    // dot, a color swatch) they are left alone.\n    function markGuard(el, hasText) {\n      if (!el.parentElement || !el.getClientRects().length) return;\n      var cs = getComputedStyle(el), r = el.getBoundingClientRect(), under = bgOf(el.parentElement); if (!under) return;\n      var side = ratio([255, 255, 255], under) >= ratio([0, 0, 0], under) ? 'l' : 'd', op = opOf(el);\n      var ink = rgbaOf(getComputedStyle(el.parentElement).color);\n      var nearInk = function (c) { return ink && ratio(c, ink) < 1.4; };\n      if (!hasText && !el.childElementCount && r.width <= 24 && r.height <= 24 && r.width >= 3) {\n        var fb = rgbaOf(cs.backgroundColor), bw = parseFloat(cs.borderTopWidth) || 0, bc = rgbaOf(cs.borderTopColor);\n        var fbm0 = fb && [0, 1, 2].map(function (k) { return fb[k] * fb[3] * op + under[k] * (1 - fb[3] * op); });\n        // a color swatch to pick from (an event's color label) keeps its color: one that blends into the box gets a\n        // thin ring instead of being filled in black (LIGHT-PALETTE: pastel looks showed rows of black dots)\n        if (fb && fb[3] * op >= 0.75 && !nearInk(fb) && ratio(fbm0, under) < 1.5 && (el.hasAttribute('data-color') || /swatch|color-dot/i.test(typeof el.className === 'string' ? el.className : ''))) { marks.push([el, 'data-dbk-cgs', state.dk && side === 'd' ? 'od' : side]); return; }\n        // in the text color, or so close to what's behind it that it can't be seen at all\n        if (fb && fb[3] > 0.2 && (nearInk(fb) || (fb[3] * op >= 0.75 && ratio(fbm0, under) < 1.5))) {\n          var fbm = [0, 1, 2].map(function (k) { return fb[k] * fb[3] * op + under[k] * (1 - fb[3] * op); });\n          // a faint dot (a missed day) stays faint, just in the color that shows; a solid one turns solid\n          if (fb[3] * op < 0.75) { if (ratio(fbm, under) < 1.35) marks.push([el, 'data-dbk-cgf', side + 'f']); return; }\n          if (ratio(fbm, under) < 3) { marks.push([el, 'data-dbk-cgf', side]); return; }\n        }\n        var shm = /inset[^,]*?(rgba?\\([^)]+\\))|(rgba?\\([^)]+\\))[^,]*inset/.exec(cs.boxShadow || '');\n        if ((!fb || fb[3] < 0.2) && shm) {\n          var sc = rgbaOf(shm[1] || shm[2]);\n          if (sc && nearInk(sc)) {\n            var scm = [0, 1, 2].map(function (k) { return sc[k] * sc[3] * op + under[k] * (1 - sc[3] * op); });\n            if (ratio(scm, under) < 3) { marks.push([el, 'data-dbk-cgs', side]); return; }\n          }\n        }\n        if (bw > 0 && cs.borderTopStyle !== 'none' && bc && bc[3] > 0.1 && nearInk(bc)) {\n          var bcm = [0, 1, 2].map(function (k) { return bc[k] * bc[3] * op + under[k] * (1 - bc[3] * op); });\n          if (ratio(bcm, under) < 3) marks.push([el, 'data-dbk-cgr', side]);\n        }\n        return;\n      }\n      if (hasText && (el.tagName === 'BUTTON' || el.getAttribute('role') === 'button') && cs.borderTopStyle !== 'none' && (parseFloat(cs.borderTopWidth) || 0) > 0 && (parseFloat(cs.borderLeftWidth) || 0) > 0) {\n        var b2 = rgbaOf(cs.borderTopColor), own = rgbaOf(cs.backgroundColor); if (!b2 || b2[3] < 0.05 || (own && own[3] > 0.5)) return;\n        var b2m = [0, 1, 2].map(function (k) { return b2[k] * b2[3] * op + under[k] * (1 - b2[3] * op); });\n        if (ratio(b2m, under) < 1.8) marks.push([el, 'data-dbk-cgb', side]);\n      }\n    }\n  }\n  // after a recolor, and again when the page changes; never more than about once a second\n  // right now, for small changes (a menu, a pop-up, a long list); only very big ones wait a moment so typing never lags\n  function guardNow(roots) {\n    var uniq = roots.filter(function (r, i) { return r.isConnected && roots.indexOf(r) === i && !roots.some(function (o) { return o !== r && o.contains(r); }); });\n    var n = 0; uniq.forEach(function (r) { n += 1 + r.getElementsByTagName('*').length; });\n    if (n > 3000) { uniq.forEach(function (r) { guardSoon(r); }); return; }   // (a check already waiting for the whole page doesn't hold this one back)\n    try { guard(uniq); } catch (e) {}\n  }\n  // (with an element: only that part of the page changed, so only it is checked)\n  function guardSoon(el) {\n    if (el) { if (el.nodeType !== 1) el = el.parentElement; if (el && cgRoots.length < 40 && cgRoots.indexOf(el) < 0) cgRoots.push(el); else if (el) cgAll = true; }\n    else cgAll = true;\n    if (cgTimer) return;\n    var wait = Math.max(120, 900 - (Date.now() - cgLast));\n    cgTimer = setTimeout(function () {\n      cgTimer = null; cgLast = Date.now();\n      var go = function () { var all = cgAll, roots = cgRoots; cgAll = false; cgRoots = []; if (building()) { heldAll = true; holdIdle(); return; } try { guard(all ? null : roots); } catch (e) {} };\n      if (window.requestIdleCallback) requestIdleCallback(go, { timeout: 600 }); else go();\n    }, wait);\n  }\n  var state = { map: null, font: null, key: '', dk: null, lt: null };\n  // LIGHT-PALETTE: the two fix-up colors of a light own color (see ownTx in guardPass)\n  var otCss = null;\n  function ownTxCss(roles) {\n    state.dk = roles ? hex2rgb(roles.ink) : null; state.lt = roles ? hex2rgb(roles.cream) : null;\n    if (!otCss) { if (!roles) return; otCss = document.createElement('style'); otCss.setAttribute('data-dbk-raw', ''); (document.head || document.documentElement).appendChild(otCss); }\n    var sel = 'html:not(#z):not(#y):not(#x):not(#w):not(#v)', one = function (k, hx) { return sel + ' [data-dbk-cg=\"' + k + '\"]{color:' + hx + '!important;-webkit-text-fill-color:' + hx + '!important;opacity:1!important}'; };\n    otCss.textContent = roles ? one('od', roles.ink) + one('ol', roles.cream) + sel + ' [data-dbk-cgs=\"od\"]{box-shadow:inset 0 0 0 1.5px ' + roles.ink + '!important;opacity:1!important}' : '';\n  }\n  // text size: the whole page a little smaller or larger (everything scales together, so layouts stay intact)\n  var TEXT_SIZES = [0.9, 1, 1.1, 1.2], tsCss = null;\n  function applyTextSize(look) {\n    if (/(^|\\/)app(\\.html)?$/.test((window.__dbkPath||location.pathname))) return;   // the frame around the pages: each page sizes itself\n    var z = look && TEXT_SIZES.indexOf(+look.ts) >= 0 ? +look.ts : 1;\n    if (!tsCss) { if (z === 1) return; tsCss = document.createElement('style'); tsCss.setAttribute('data-dbk-raw', ''); tsCss.id = 'dbkTextSize'; (document.head || document.documentElement).appendChild(tsCss); }\n    // smaller text (Kasey, Oct 22: the top of the menu blurry in the home-screen app): zoom shrank the room kept for the\n    // clock too, so the menu sat about 7px under the clock instead of 14px, inside the iPhone's blur. Below 1 the\n    // phone's notch and home-bar room is divided back out, so it stays the real size on screen (--dbk-zoom lets the\n    // menu's 14px gap stay 14px too, end of daybook-theme.css). Larger sizes are left as they were.\n    var safe = z < 1 ? ['top', 'right', 'bottom', 'left'].map(function (k) { return '--dbk-safe-' + k + ':calc(var(--dbk-safe-' + k + '-screen, env(safe-area-inset-' + k + ', 0px)) / ' + z + ') !important;'; }).join('') + '--dbk-zoom:' + z + ';' : '';\n    tsCss.textContent = z === 1 ? '' : 'html{zoom:' + z + ';--dbk-vw:calc(1vw / ' + z + ');--dbk-vh:calc(1vh / ' + z + ');' + safe + '}';   // full-width things stay the width of the screen\n  }\n  // now: a person just picked this look, so the readable-text fix-ups go on in the same step as the new colors\n  // (waiting for the usual quiet moment made the capture box and faded text change color a beat later)\n  function guardAllNow() { clearTimeout(cgTimer); cgTimer = null; cgAll = false; cgRoots = []; cgLast = Date.now(); if (building()) { heldAll = true; holdIdle(); return; } heldAll = false; try { guard(null); } catch (e) {} }\n  // (Oct 31, speed: Kasey, \"settings, money & work pages are all really slow to load\") while a page is still being built\n  // out of sight (html.dbk-loading, daybook-theme.js) its parts aren't checked one change at a time: each draw of Money\n  // and Work while their lists came in was checked again (3.5s and 10s of a phone 4x slower). The whole page is checked\n  // once instead, the moment it's revealed (in the observer below, so before the page paints: nothing shows unchecked)\n  // Out of sight too (a page loaded ahead, left behind or reloading behind the one on screen, in the app's frame): its\n  // changes are checked once, when the phone is idle, or at the latest the moment it's shown (app.html sends\n  // 'dbk-onscreen' as it puts the page on screen, before it paints). The pages behind used to check every draw while\n  // the one being opened waited for the phone (Money's lists came in 5-50s late on a phone 4x slower).\n  var heldAll = false, idleT = null;\n  function offScreen() { try { var fe = window.frameElement; return !!(fe && fe.classList.contains('dbk-layer') && !fe.classList.contains('on') && !fe.classList.contains('dbk-over') && !fe.classList.contains('dbk-peek')); } catch (e) { return false; } }\n  // (a page the app's frame put on screen while still loading, on a weak signal after 4s, is checked as it changes, as\n  // before: it's being looked at)\n  function inFrame() { try { var fe = window.frameElement; return !!(fe && fe.classList.contains('dbk-layer')); } catch (e) { return false; } }\n  function building() { return inFrame() ? offScreen() : document.documentElement.classList.contains('dbk-loading'); }\n  function holdIdle() {\n    if (idleT || document.documentElement.classList.contains('dbk-loading') || inFrame()) return;\n    idleT = setTimeout(function () { var go = function () { idleT = null; if (heldAll && !document.documentElement.classList.contains('dbk-loading')) { heldAll = false; try { guard(null); } catch (e) {} } };\n      if (window.requestIdleCallback) requestIdleCallback(go, { timeout: 5000 }); else go(); }, 2500);\n  }\n  window.addEventListener('dbk-onscreen', function () { if (heldAll) guardAllNow(); });\n  function apply(look, now) {\n    look = look || current();\n    // the look shown to a known person is the one a signed-out screen shows next (dbkLookShown, this phone only), and\n    // Safari's address carries it to a home-screen app added from here (dbk-frame.js)\n    try { var C = window.dbkLookCarry, me = owner(); if (C && known() && read(me)) C.remember(me, read(me)); if (C && window.top === window) C.mark(); } catch (e) {}\n    applyTextSize(look);\n    var r = rolesFor(look), f = fontsOf(look);\n    var fam = r ? r.fam : famFor(look) || (owner() === 'person2' ? 'p2' : 'p1');\n    var root = document.documentElement;\n    if (root.getAttribute('data-dbk') && root.getAttribute('data-dbk') !== fam) root.setAttribute('data-dbk', fam);\n    window.DAYBOOK_THEME = fam;\n    root.setAttribute('data-dbk-look', look.t || '');   // which look is on, for the few things one look does its own way (2T's red bingo squares)\n    var key = JSON.stringify([look.t, look.c || '', f.id]);\n    var needs = !!r || !f.plain || applied;\n    if (!needs) { applied = null; if (now) guardAllNow(); else guardSoon(); return; }\n    state.map = r ? makeMap(r.fam, r.roles) : null; state.font = f; state.key = key;\n    ownTxCss(look.t === 'custom' && r && r.fam === 'p1' ? r.roles : null);\n    loadFont(f);\n    for (var i = 0; i < document.styleSheets.length; i++) remapSheet(document.styleSheets[i], state.map, f);\n    remapInline(state.map);\n    // the top bar color for the phone's status bar\n    try { var tc = document.querySelector('meta[name=\"theme-color\"]'); if (tc) { if (!tc.hasAttribute('data-dbk-o')) tc.setAttribute('data-dbk-o', tc.getAttribute('content') || ''); var oc = tc.getAttribute('data-dbk-o'); tc.setAttribute('content', state.map ? swapValue(fam === 'p2' ? '#06080b' : oc, state.map, 'background') : oc); } } catch (e) {}\n    applied = r || !f.plain ? key : null;\n    if (now) guardAllNow(); else guardSoon();\n  }\n  // style sheets and inline styles added later (pop-ups, add-ons) get the same treatment\n  var pending = null;\n  function later() { if (pending || !applied) return; pending = setTimeout(function () { pending = null; for (var i = 0; i < document.styleSheets.length; i++) remapSheet(document.styleSheets[i], state.map, state.font); remapInline(state.map); guardSoon(); }, 30); }\n  function watch() {\n    if (!window.MutationObserver) return;\n    // Anything that changes or appears gets its colors (and the readable-text check) before the screen\n    // updates, so a pop-up or menu never shows wrong colors first and then switches (no flash).\n    new MutationObserver(function (ms) {\n      var roots = [], moved = false, shownNow = false;\n      for (var i = 0; i < ms.length; i++) {\n        var m = ms[i], t = m.target.nodeType === 1 ? m.target : m.target.parentElement;\n        if (t === document.documentElement && m.attributeName === 'class' && /\\bdbk-loading\\b/.test(m.oldValue || '') && !building()) shownNow = true;\n        if (!t || (t.closest && t.closest('[data-dbk-keep]'))) continue;   // the picker and the rain map keep their own colors\n        if (m.type === 'attributes') {\n          if (m.attributeName === 'hidden') {\n            // put away: nothing to check (it shows nothing); it keeps its marks if it was showing until now\n            if (t.hasAttribute('hidden') && !t.getClientRects().length) { if (m.oldValue === null) { moved = true; if (t.parentElement && t.parentElement.getClientRects().length && kept.indexOf(t) < 0) kept.push(t); } continue; }\n            // shown again, unchanged since: its marks are still right\n            var ki = kept.indexOf(t); if (ki >= 0 && m.oldValue !== null && !t.hasAttribute('hidden')) { kept.splice(ki, 1); moved = true; continue; }\n          }\n          if (m.attributeName === 'style') { if (t._dbkSet === t.getAttribute('style')) continue; if (applied && state.map) remapOne(t, state.map); }\n          roots.push(t); continue;\n        }\n        if (m.type === 'characterData') { roots.push(t); continue; }\n        for (var j = 0; j < m.addedNodes.length; j++) {\n          var n = m.addedNodes[j];\n          if (n.nodeType !== 1) { roots.push(t); continue; }\n          if (n.tagName === 'STYLE') { if (applied && n.sheet) { try { remapSheet(n.sheet, state.map, state.font); } catch (e) {} } continue; }\n          if (n.tagName === 'LINK') { n.addEventListener('load', later); continue; }\n          if (n.tagName === 'SCRIPT') continue;\n          if (applied && state.map) remapIn(n, state.map);\n          roots.push(n);\n        }\n      }\n      if (kept.length) roots.forEach(keptDrop);\n      if (building()) { if (roots.length || moved) { heldAll = true; holdIdle(); } return; }\n      if (shownNow && heldAll) { guardAllNow(); return; }\n      if (roots.length) guardNow(roots);\n      else if (moved) { try { spread2T(); } catch (e) {} }   // (2T: which cards touch may have changed)\n    }).observe(document.documentElement, { childList: true, subtree: true, characterData: true, attributes: true, attributeOldValue: true, attributeFilter: ['style', 'class', 'hidden', 'open'] });   // (hidden, open: SWEEP-LOOK, a list shown by un-hiding it, like the Back Burner, was never checked)\n  }\n\n  function save(p, look) {\n    var o = { t: look.t, h: look.h || 'playfair', b: look.b || 'lora' }; if (look.ts && look.ts !== 1) o.ts = look.ts; if (look.t === 'custom') { o.c = look.c; if (look.off && look.off.length) o.off = look.off.slice(); }\n    o.fam = famFor(o) || 'p1';\n    try { localStorage.setItem('dbkLook_' + p, JSON.stringify(o)); } catch (e) {}\n    try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['dbkLook_' + p]); else if (typeof window.syncSettingsToFirebase === 'function') window.syncSettingsToFirebase(); } catch (e) {}\n    if (p === owner()) { apply(o, true); try { homeIcon(); } catch (e) {} }\n    try { window.parent && window.parent !== window && window.parent.dbkLook && window.parent.dbkLook.apply(); } catch (e) {}\n    return o;\n  }\n  function label(look) { var t = look.t === 'custom' ? 'Your own color' : (tpl(look.t) || {}).name || ''; return t + ' · ' + head(look.h).name + ' / ' + bodyF(look.b).name; }\n\n  /* ---------- the picker (Settings > Look, and the setup guide) ---------- */\n  function swatchCss(cols) { return 'conic-gradient(' + cols[1] + ' 0 33%,' + cols[2] + ' 33% 66%,' + cols[3] + ' 66% 100%)'; }\n  function mount(box, opts) {\n    opts = opts || {};\n    var p = opts.person || owner(), look = current(p);\n    function previewRoles() {\n      var r = rolesFor(look);\n      if (r) return r.fam === 'p2' ? { bg: r.roles.bg, card: r.roles.card, card2: r.roles.card2, card3: r.roles.card3, ink: r.roles.text, accent: r.roles.accent, bar: r.roles.deep, barInk: r.roles.text } : { bg: r.roles.page, card: r.roles.pink, card2: r.roles.sand, card3: r.roles.sageband, ink: r.roles.ink, accent: r.roles.accent, bar: r.roles.inkFill || r.roles.ink, barInk: r.roles.cream };\n      return look.t === 'midnight' ? { bg: '#0c1118', card: '#121c2b', card2: '#17263d', card3: '#10151c', ink: '#e6eaef', accent: '#8fc98a', bar: '#06080b', barInk: '#e6eaef' } : { bg: '#e4ded0', card: '#ead3cf', card2: '#e8e1d1', card3: '#c7c494', ink: '#2f3a2c', accent: '#9b5a62', bar: '#2f3a2c', barInk: '#f3eee4' };\n    }\n    var openDd = null, ddScroll = 0, ddQuiet = 0;\n    // fonts: a row of names you swipe sideways, each written in its own face; tap one to pick it. Nothing opens or\n    // floats, so nothing can hang off the pop-up (the designer, Oct 20: the drop-downs looked bad and spilled over)\n    var rowLeft = {};\n    function dd(k, label, list, cur, face) {\n      if (!list.some(function (x) { return x.id === cur; })) cur = list[0] && list[0].id;   // nothing picked yet: the first (default) font\n      return '<div class=\"dbk-look-dd\">' +\n        '<span class=\"dbk-look-ddl\">' + label + '</span>' +\n        '<div class=\"dbk-look-fr\" data-look-row=\"' + k + '\" role=\"radiogroup\" aria-label=\"' + label + '\">' + list.map(function (x) { loadGf(k + '-' + x.id, x.gf); return '<button type=\"button\" class=\"dbk-look-fc\" role=\"radio\" aria-checked=\"' + (x.id === cur) + '\" data-look-' + k + '=\"' + x.id + '\" style=\"--ff:' + face(x) + FB + '\">' + x.name + '</button>'; }).join('') + '</div>' +\n      '</div>';\n    }\n    function draw() {\n      [].forEach.call(box.querySelectorAll('[data-look-row]'), function (r) { rowLeft[r.getAttribute('data-look-row')] = r.scrollLeft; });\n      var pr = previewRoles(), f = fontsOf(look);\n      loadFont(f);\n      var custom = look.t === 'custom', cval = hex2rgb(look.c) ? look.c : '#7d93b0';\n      box.innerHTML =\n        '<div class=\"dbk-look\" data-dbk-keep>' +\n          '<div class=\"dbk-look-prev\" style=\"background:' + pr.bg + '\">' +\n            '<div class=\"dbk-look-bar\" style=\"background:' + pr.bar + ';color:' + pr.barInk + ';--ff:' + f.caps + FB + '\">Today</div>' +\n            '<div class=\"dbk-look-card\" style=\"background:' + pr.card + ';color:' + pr.ink + '\">' +\n              '<div class=\"dbk-look-t\" style=\"--ff:' + f.title + FB + '\">Good morning</div>' +\n              '<div class=\"dbk-look-l\" style=\"color:' + pr.accent + ';--ff:' + f.caps + FB + '\">Reminder</div>' +\n              '<div class=\"dbk-look-b\" style=\"--ff:' + f.body + FB + '\">Pick up the dry cleaning</div>' +\n            '</div>' +\n            '<div class=\"dbk-look-strip\"><span style=\"background:' + pr.card2 + '\"></span><span style=\"background:' + pr.card3 + '\"></span></div>' +\n          '</div>' +\n          '<div class=\"dbk-look-gl\">Colors</div>' +\n          '<div class=\"dbk-look-sws\" role=\"radiogroup\" aria-label=\"Colors\">' +\n            TEMPLATES.filter(function (t) { return SHOWN.indexOf(t.id) >= 0 || look.t === t.id; }).map(function (t) { return '<button type=\"button\" class=\"dbk-look-sw\" role=\"radio\" aria-checked=\"' + (look.t === t.id) + '\" data-look-t=\"' + t.id + '\"><span class=\"dbk-look-dot\" style=\"background:' + swatchCss(t.sw) + '\"></span><span class=\"dbk-look-nm\">' + t.name + '</span></button>'; }).join('') +\n            (OWN_ON || custom ? '<label class=\"dbk-look-sw dbk-look-own\" role=\"radio\" aria-checked=\"' + custom + '\"><span class=\"dbk-look-dot\" style=\"background:' + (custom ? cval : 'conic-gradient(#c96b6b,#d9b45a,#7fae7a,#6f97c4,#a07cc0,#c96b6b)') + '\"></span><span class=\"dbk-look-nm\">Your own</span><input type=\"color\" class=\"dbk-look-pick\" value=\"' + cval + '\" aria-label=\"Pick your own color\"></label>' : '') +\n          '</div>' +\n          (custom ? palRow() : '') +\n          // fonts: two small dropdowns; the open one lists every font in its own face, and the preview above\n          // stays pinned so each pick shows right away\n          dd('h', 'Heading font', HEADS, look.h, function (x) { return x.title; }) +\n          dd('b', 'Body font', BODIES, look.b, function (x) { return x.body; }) +\n          '<div class=\"dbk-look-gl\">Text size</div>' +\n          '<div class=\"dbk-look-ts\" role=\"radiogroup\" aria-label=\"Text size\">' + TEXT_SIZES.map(function (z, i) { var on = (+look.ts || 1) === z; return '<button type=\"button\" class=\"dbk-look-tsb\" role=\"radio\" aria-checked=\"' + on + '\" data-look-ts=\"' + z + '\" aria-label=\"' + ['Smaller', 'Normal', 'Larger', 'Largest'][i] + '\" style=\"font-size:' + Math.round(13 + i * 3.5) + 'px\">A</button>'; }).join('') + '</div>' +\n        '</div>';\n    }\n    // the colors made from your pick; tap one to remove it (its spots use a color you kept), tap again to bring it back\n    function palCols() { var r = customRoles(look.c), g = GROUPS[r.fam]; return { main: look.c, near: r.roles[g.near[0]], light: r.roles[g.light[0]], deep: r.roles[g.deep[0]] }; }\n    var PAL_NAMES = { main: 'Main', near: 'Neighbor', light: 'Lighter', deep: 'Deeper' };\n    function palRow() {\n      var cols = palCols(), off = look.off || [];\n      return '<div class=\"dbk-look-pal\" role=\"group\" aria-label=\"Your colors\">' + ['main'].concat(GROUP_ORDER).map(function (g) {\n        var isOff = off.indexOf(g) >= 0, main = g === 'main';\n        return '<button type=\"button\" class=\"dbk-look-pc' + (isOff ? ' is-off' : '') + '\"' + (main ? ' disabled aria-disabled=\"true\"' : ' data-look-off=\"' + g + '\" aria-pressed=\"' + !isOff + '\" aria-label=\"' + (isOff ? 'Bring back ' : 'Remove ') + PAL_NAMES[g].toLowerCase() + ' color\"') + '>' +\n          '<span class=\"dbk-look-pd\" data-pal=\"' + g + '\" style=\"background:' + cols[g] + '\">' + (main ? '' : isOff ? '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"M12 6v12M6 12h12\"/></svg>' : '<svg viewBox=\"0 0 24 24\" aria-hidden=\"true\"><path d=\"m7 7 10 10M17 7 7 17\"/></svg>') + '</span>' +\n          '<span class=\"dbk-look-pn\">' + PAL_NAMES[g] + '</span></button>';\n      }).join('') + '</div>';\n    }\n    // the open font list floats just below its button, over what's under it, so nothing in the pop-up moves\n    // (it used to sit in the flow, pushing everything below it down and running past the pop-up's bottom).\n    // It always opens downward and stops above the capture bar; a long list scrolls inside itself.\n    function placeDd() {\n      var m = box.querySelector('.dbk-look-ddm'), b = m && m.parentElement.querySelector('.dbk-look-ddb'); if (!m || !b) return;\n      var bg = null; for (var n = m.parentElement; n && n.nodeType === 1 && !bg; n = n.parentElement) { var c = rgbaOf(getComputedStyle(n).backgroundColor); if (c && c[3] >= 0.98) bg = getComputedStyle(n).backgroundColor; }\n      m.style.background = bg || '';\n      m.style.top = '0px'; m.style.left = '0px'; m.style.maxHeight = 'none';\n      var vh = window.dbkViewBottom ? window.dbkViewBottom() : window.visualViewport ? window.visualViewport.height : window.innerHeight, bar = document.querySelector('.dbk-capbar-global, .capture-sticky-bar, #ht-wiz-nav');\n      var br = bar && bar.getClientRects().length ? bar.getBoundingClientRect() : null;\n      // the capture bar only limits the list when it can be seen; behind a pop-up's veil the list may float over it\n      if (br) { var hit = document.elementFromPoint(br.left + br.width / 2, br.top + Math.min(br.height / 2, 20)); if (hit && !bar.contains(hit) && hit !== bar && !(hit.closest && hit.closest('.dbk-look-ddm'))) br = null; }\n      var limit = (br && br.top > vh / 2 ? br.top : vh) - 10;\n      // Kasey: the open list looked \"cut off\" (half a font name showing at its bottom). It now shows whole names\n      // only; when more names are below, a small arrow at its bottom says so (and hides at the end of the list).\n      var r = b.getBoundingClientRect(), top = r.bottom + 6;\n      // a button tapped right at the pop-up's bottom edge: bring it up just enough for a short list to fit below it\n      if (limit - top < 96) { var sc = b.closest('.dbk-infocard, [role=\"dialog\"]') || document.scrollingElement; var need = 96 - (limit - top); if (sc) { ddQuiet = Date.now() + 200; sc.scrollTop += need; r = b.getBoundingClientRect(); top = r.bottom + 6; } }\n      var rows = [].slice.call(m.querySelectorAll('.dbk-look-ddo')), more = m.querySelector('.dbk-look-ddmore'), cs = getComputedStyle(m);\n      var padB = (parseFloat(cs.paddingBottom) || 0) + (parseFloat(cs.borderBottomWidth) || 0) + (parseFloat(cs.borderTopWidth) || 0);\n      var rowH = rows.length ? rows[0].offsetHeight : 40, room = Math.max(rowH * 2 + 30, Math.min(340, limit - top));\n      var last = rows[rows.length - 1], all = last ? last.offsetTop + last.offsetHeight + padB : 0, fit = all;\n      if (more) more.style.display = all <= room ? 'none' : '';\n      if (all > room) { var mh = more ? more.offsetHeight : 0; fit = rowH + padB + mh; for (var i = 0; i < rows.length; i++) { var bot = rows[i].offsetTop + rows[i].offsetHeight + padB + mh; if (bot <= room) fit = bot; else break; } }\n      var o = m.getBoundingClientRect();\n      m.style.maxHeight = fit + 'px';\n      m.style.top = (top - o.top) + 'px';\n      m.style.left = (r.left + r.width / 2 - m.offsetWidth / 2 - o.left) + 'px';\n    }\n    function afterDraw() {\n      [].forEach.call(box.querySelectorAll('[data-look-row]'), function (r) {\n        var k = r.getAttribute('data-look-row');\n        if (rowLeft[k] != null) { r.scrollLeft = rowLeft[k]; return; }\n        var center = function () { var on = r.querySelector('[aria-checked=\"true\"]'); if (!on || r._dbkMoved) return; var a = on.getBoundingClientRect(), b = r.getBoundingClientRect(); r.scrollLeft += (a.left + a.width / 2) - (b.left + b.width / 2); };\n        center();\n        // drawn while the pop-up is still hidden (no width yet): center once it shows\n        if (!r.clientWidth && window.ResizeObserver) { var ro = new ResizeObserver(function () { if (r.clientWidth) { ro.disconnect(); center(); } }); ro.observe(r); }\n        // the fonts' widths change as they arrive: keep the chosen one centered until the person swipes the row\n        r.addEventListener('pointerdown', function () { r._dbkMoved = true; }, { once: true });\n        try { document.fonts.ready.then(center); } catch (e) {}\n        setTimeout(center, 400); setTimeout(center, 1200);\n      });\n    }\n    function closeDd() { if (!openDd) return; openDd = null; var w = box.querySelector('.dbk-look-dd.is-open'); if (!w) return; w.classList.remove('is-open'); var m = w.querySelector('.dbk-look-ddm'); if (m) m.remove(); var b = w.querySelector('.dbk-look-ddb'); if (b) b.setAttribute('aria-expanded', 'false'); }\n    // scrolling the pop-up, a tap anywhere else or Escape closes just the list\n    document.addEventListener('scroll', function (e) { if (openDd && Date.now() > ddQuiet && !(e.target.closest && e.target.closest('.dbk-look-ddm'))) closeDd(); }, true);\n    document.addEventListener('pointerdown', function (e) { if (openDd && !(e.target.closest && e.target.closest('.dbk-look-dd'))) closeDd(); }, true);\n    window.addEventListener('keydown', function (e) { if (openDd && e.key === 'Escape') { e.stopPropagation(); e.preventDefault(); closeDd(); } }, true);\n    window.addEventListener('resize', function () { if (openDd) placeDd(); });\n    window.addEventListener('dbk-viewport', function () { if (openDd) placeDd(); });   // the keyboard came up or went (app shell, daybook-theme.js)\n    function set(ch) { Object.keys(ch).forEach(function (k) { look[k] = ch[k]; }); look = save(p, look); draw(); afterDraw(); if (opts.onChange) opts.onChange(look); }\n    box.addEventListener('click', function (e) {\n      var tsb = e.target.closest('[data-look-ts]'); if (tsb) { set({ ts: +tsb.getAttribute('data-look-ts') }); return; }\n      var po = e.target.closest('[data-look-off]');\n      if (po) { var g = po.getAttribute('data-look-off'), off = (look.off || []).slice(), i = off.indexOf(g); if (i >= 0) off.splice(i, 1); else off.push(g); set({ off: off }); return; }\n      var t = e.target.closest('[data-look-t]'); if (t) { openDd = null; set({ t: t.getAttribute('data-look-t') }); return; }\n      var hb = e.target.closest('[data-look-h]'); if (hb) { set({ h: hb.getAttribute('data-look-h') }); return; }\n      var bb = e.target.closest('[data-look-b]'); if (bb) { set({ b: bb.getAttribute('data-look-b') }); return; }\n    });\n    // picking your own color: recolor the preview and the dot in place, so nothing in the pop-up moves\n    function paint() {\n      var pr = previewRoles(), q = function (s) { return box.querySelector(s); };\n      var pv = q('.dbk-look-prev'), bar = q('.dbk-look-bar'), cd = q('.dbk-look-card'), lb = q('.dbk-look-l'), st = box.querySelectorAll('.dbk-look-strip span'), dot = q('.dbk-look-own .dbk-look-dot');\n      if (!pv || !cd || !dot) { draw(); afterDraw(); return; }\n      pv.style.background = pr.bg; bar.style.background = pr.bar; bar.style.color = pr.barInk;\n      cd.style.background = pr.card; cd.style.color = pr.ink; lb.style.color = pr.accent;\n      if (st[0]) st[0].style.background = pr.card2; if (st[1]) st[1].style.background = pr.card3;\n      dot.style.background = look.c;\n      var pr0 = box.querySelector('.dbk-look-pal');\n      if (!pr0) { var sws = box.querySelector('.dbk-look-sws'); if (sws) sws.insertAdjacentHTML('afterend', palRow()); }\n      else { var pc = palCols(); [].forEach.call(pr0.querySelectorAll('[data-pal]'), function (d) { d.style.background = pc[d.getAttribute('data-pal')]; }); }\n      box.querySelectorAll('.dbk-look-sw').forEach(function (b) { b.setAttribute('aria-checked', String(b.classList.contains('dbk-look-own'))); });\n    }\n    var tmr = null;\n    box.addEventListener('input', function (e) {\n      if (!e.target.classList.contains('dbk-look-pick')) return;\n      var v = e.target.value; clearTimeout(tmr);\n      tmr = setTimeout(function () { look.t = 'custom'; look.c = v; look = save(p, look); paint(); if (opts.onChange) opts.onChange(look); }, 60);\n    });\n    draw(); afterDraw();\n    return { redraw: draw };\n  }\n\n  /* ---------- the home-screen icon in this person's look (Kasey, Oct 25: \"can the look of the icon change based on their\n     color scheme?\") ----------\n     A phone keeps the icon it was given when the app was added to the Home Screen and never asks again, so the icon\n     can only follow the look at that moment: the page's apple-touch-icon is set to one drawn in this person's look.\n     Ready-made looks use a file (icons/home-<look>.png, tools/make-icons.mjs); your own color is drawn here, the same\n     shapes and the same color rules as tools/make-icons.mjs (`iconColors`; a test keeps them equal). Nothing changes\n     until a look has been saved, so a copy's own icon (app.accent) stays until someone picks one. */\n  var HI_HEX = function (h) { return [1, 3, 5].map(function (i) { return parseInt(h.slice(i, i + 2), 16); }); };\n  var HI_TO = function (c) { return '#' + c.map(function (v) { v = Math.max(0, Math.min(255, Math.round(v))).toString(16); return v.length < 2 ? '0' + v : v; }).join(''); };\n  var HI_MIX = function (a, b, t) { var x = HI_HEX(a), y = HI_HEX(b); return HI_TO(x.map(function (v, i) { return v + (y[i] - v) * t; })); };\n  var HI_LUM = function (h) { var c = HI_HEX(h).map(function (v) { v /= 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); }); return 0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]; };\n  var HI_CON = function (a, b) { var x = HI_LUM(a), y = HI_LUM(b); return (Math.max(x, y) + 0.05) / (Math.min(x, y) + 0.05); };\n  function hiHsl(h) {\n    var c = HI_HEX(h).map(function (v) { return v / 255; }), r = c[0], g = c[1], b = c[2], mx = Math.max(r, g, b), mn = Math.min(r, g, b), l = (mx + mn) / 2, d = mx - mn;\n    if (!d) return [0, 0, l];\n    var s = d / (1 - Math.abs(2 * l - 1)), hh = mx === r ? ((g - b) / d + 6) % 6 : mx === g ? (b - r) / d + 2 : (r - g) / d + 4;\n    return [hh * 60, s, l];\n  }\n  function hiFromHsl(h, s, l) {\n    var c = (1 - Math.abs(2 * l - 1)) * s, x = c * (1 - Math.abs((h / 60) % 2 - 1)), m = l - c / 2;\n    var rgb = h < 60 ? [c, x, 0] : h < 120 ? [x, c, 0] : h < 180 ? [0, c, x] : h < 240 ? [0, x, c] : h < 300 ? [x, 0, c] : [c, 0, x];\n    return HI_TO(rgb.map(function (v) { return (v + m) * 255; }));\n  }\n  function hiSun(bg, l) { var h = hiHsl(bg); return hiFromHsl(h[0], h[1] < 0.08 ? h[1] : Math.max(h[1], 0.45), l); }\n  var HI_2T = { bg: '#2e241f', fg: '#fbf3e4', sun: '#ddb9e3', spine: '#a3263b', lines: '#a3263b', linesAlpha: 0.6 };\n  function iconColors(accent) {\n    if (!accent || !/^#[0-9a-f]{6}$/i.test(accent) || accent.toLowerCase() === '#2f3a2c') return Object.assign({}, HI_2T);\n    var bg = accent.toLowerCase(), cream = '#f6f1e7', l, t, sun, fg;\n    if (HI_CON(bg, cream) >= 3) {\n      sun = hiSun(bg, 0.76);\n      for (l = 0.8; HI_CON(sun, bg) < 2.2 && l <= 0.92; l += 0.03) sun = hiSun(bg, l);\n      return { bg: bg, fg: cream, sun: sun, spine: bg, lines: bg, linesAlpha: 0.45 };\n    }\n    // a light color: the book stays light (Kasey, Oct 25), the rays, spine and page lines a deep shade of it\n    fg = HI_MIX(bg, '#000000', 0.7);\n    for (t = 0.75; HI_CON(fg, bg) < 4.5 && t <= 0.95; t += 0.05) fg = HI_MIX(bg, '#000000', t);\n    sun = hiSun(bg, 0.6);\n    for (l = 0.56; HI_CON(sun, bg) < 1.8 && l >= 0.35; l -= 0.03) sun = hiSun(bg, l);\n    return { bg: bg, fg: '#fdfaf4', rays: fg, sun: sun, spine: fg, lines: fg, linesAlpha: 0.5, edge: HI_CON('#fdfaf4', bg) < 1.35 ? fg : '' };\n  }\n  // the same drawing as tools/make-icons.mjs (a 1024 box, everything 28 higher), drawn with the canvas\n  function drawIcon(size, c) {\n    var cv = document.createElement('canvas'); cv.width = cv.height = size;\n    var x = cv.getContext('2d'); if (!x) return '';\n    var k = size / 1024; x.scale(k, k); x.translate(0, -28);\n    x.fillStyle = c.bg; x.fillRect(0, 28, 1024, 1024);\n    x.lineCap = 'round'; x.strokeStyle = c.rays || c.fg; x.lineWidth = 13;\n    [[319.4, 493.0, 276.4, 476.6], [342.5, 449.0, 276.6, 403.5], [375.4, 411.8, 344.9, 377.4], [416.3, 383.6, 379.1, 312.8], [462.7, 366.0, 451.7, 321.3], [512.0, 360.0, 512.0, 280.0],\n     [561.3, 366.0, 572.3, 321.3], [607.7, 383.6, 644.9, 312.8], [648.6, 411.8, 679.1, 377.4], [681.5, 449.0, 747.4, 403.5], [704.6, 493.0, 747.6, 476.6]].forEach(function (r) { x.beginPath(); x.moveTo(r[0], r[1]); x.lineTo(r[2], r[3]); x.stroke(); });\n    x.fillStyle = c.sun; x.beginPath(); x.arc(512, 566, 172, 0, Math.PI * 2); x.fill();\n    x.fillStyle = c.fg; x.lineJoin = 'round';\n    [[446, 544, 336, 528, 206], [578, 544, 688, 528, 818]].forEach(function (q) {\n      x.beginPath(); x.moveTo(512, 590); x.bezierCurveTo(q[0], q[1], q[2], q[3], q[4], 552); x.lineTo(q[4], 768); x.bezierCurveTo(q[2], 744, q[0], 758, 512, 806); x.closePath();\n      if (c.edge) { x.strokeStyle = c.edge; x.lineWidth = 10; x.stroke(); }\n      x.fill();\n    });\n    x.lineCap = 'butt'; x.strokeStyle = c.spine; x.lineWidth = 9; x.beginPath(); x.moveTo(512, 592); x.lineTo(512, 806); x.stroke();\n    x.lineCap = 'round'; x.strokeStyle = c.lines; x.lineWidth = 7; x.globalAlpha = c.linesAlpha;\n    [[262, 614, 334, 602, 408, 608, 466, 630], [262, 656, 334, 644, 408, 650, 466, 672], [262, 698, 334, 686, 408, 692, 466, 714],\n     [558, 630, 616, 608, 690, 602, 762, 614], [558, 672, 616, 650, 690, 644, 762, 656], [558, 714, 616, 692, 690, 686, 762, 698]].forEach(function (l) { x.beginPath(); x.moveTo(l[0], l[1]); x.bezierCurveTo(l[2], l[3], l[4], l[5], l[6], l[7]); x.stroke(); });\n    try { return cv.toDataURL('image/png'); } catch (e) { return ''; }\n  }\n  var HOME_FILES = { stone: 1, midnight: 1, '2timelines': 1, coastal: 1, orchard: 1, berry: 1 };\n  var homeWas = null;\n  function homeIcon() {\n    if (window.top !== window) return;                       // only the page in the address bar is what the phone uses\n    var link = document.querySelector('link[rel=\"apple-touch-icon\"]'); if (!link) return;\n    var saved = read(); if (!saved) return;                 // no look picked yet: the copy's own icon stays\n    var look = current(), key = look.t === 'custom' ? 'c:' + look.c : look.t;\n    if (key === homeWas) return; homeWas = key;\n    var href = '';\n    if (look.t === 'custom' && hex2rgb(look.c)) href = drawIcon(180, iconColors(look.c));\n    else if (HOME_FILES[look.t]) href = 'icons/home-' + look.t + '.png';\n    if (href) link.setAttribute('href', href);\n  }\n  // Which look the Home Screen icon has (Kasey, Oct 25: the note should \"show as long as the icon doesn't match the color\n  // they've chosen\"). The phone can't tell a page its icon, so the home-screen app writes it down once (`dbkIconLook`,\n  // this phone only): a home-screen app's storage starts empty when it's added, so the first look it hears (once the\n  // person is known) is the one Safari gave the icon; an app that already had storage before this was added has the\n  // copy's own icon from before ('build'), which matches no look. 'pending' = added, no look heard yet.\n  function lookKeyOf(l) { return l ? (l.t === 'custom' ? 'c:' + String(l.c || '').toLowerCase() : String(l.t || '')) : ''; }\n  function homeApp() { try { return navigator.standalone === true || !!(window.matchMedia && window.matchMedia('(display-mode: standalone)').matches); } catch (e) { return false; } }\n  function iconRecord() {\n    if (window.top !== window || !homeApp()) return;\n    var r = null; try { r = localStorage.getItem('dbkIconLook'); } catch (e) { return; }\n    if (!r) {\n      var fresh = true; try { fresh = !localStorage.getItem('myPersonRole') && !localStorage.getItem('dbkLook_person1') && !localStorage.getItem('dbkLook_person2'); } catch (e) {}\n      r = fresh ? 'pending' : 'build'; try { localStorage.setItem('dbkIconLook', r); } catch (e) {}\n    }\n    if (r === 'pending' && read()) { try { localStorage.setItem('dbkIconLook', lookKeyOf(current())); } catch (e) {} }\n  }\n  window.dbkHomeIcon = { colors: iconColors, draw: drawIcon, set: homeIcon, key: lookKeyOf,\n    installed: function () { try { iconRecord(); } catch (e) {} try { return window.top.localStorage.getItem('dbkIconLook'); } catch (e) { try { return localStorage.getItem('dbkIconLook'); } catch (x) { return null; } } } };\n  try { homeIcon(); } catch (e) {}\n  try { iconRecord(); } catch (e) {}\n  window.addEventListener('storage', function (e) { if (e.key && (/^dbkLook_/.test(e.key) || e.key === 'myPersonRole')) { try { homeIcon(); iconRecord(); } catch (x) {} } });\n\n  window.dbkLook = { apply: function () { apply(null, true); }, current: current, save: save, mount: mount, label: label, templates: TEMPLATES, heads: HEADS, bodies: BODIES, rolesFor: rolesFor, contrast: contrast, famFor: famFor };\n  apply();\n  // style sheets the page links after this script (shared.css, the page's own) are put in the look the moment each one\n  // arrives, not only once the whole page has been read: on a weak signal the page's background showed in Stone for a\n  // second or more in between (Charlie's re-added home-screen app, Oct 29)\n  if (document.readyState === 'loading' && window.MutationObserver) {\n    var early = new MutationObserver(function (ms) {\n      for (var i = 0; i < ms.length; i++) for (var j = 0; j < ms[i].addedNodes.length; j++) {\n        var n = ms[i].addedNodes[j];\n        if (n.tagName === 'LINK' && /stylesheet/i.test(n.rel || '')) n.addEventListener('load', function () { if (applied && this.sheet) { try { remapSheet(this.sheet, state.map, state.font); } catch (e) {} } });\n        else if (n.tagName === 'STYLE' && applied && n.sheet) { try { remapSheet(n.sheet, state.map, state.font); } catch (e) {} }\n      }\n    });\n    try { early.observe(document.documentElement, { childList: true, subtree: true }); } catch (e) {}\n    document.addEventListener('DOMContentLoaded', function () { early.disconnect(); });\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', function () { apply(null, true); watch(); }); else watch();   // the page's first look already has its readable-text fix-ups (no switch a second later)\n  window.addEventListener('load', function () { if (applied) later(); });\n  // changed on another page or phone: follow along\n  window.addEventListener('storage', function (e) {\n    if (e.key && /^dbkLook_/.test(e.key) && e.key === 'dbkLook_' + owner()) { applied = applied || 'x'; apply(); return; }\n    // (the frame: who's here, or the look last shown, changed on a page: the address follows)\n    if (window.top === window && (e.key === 'myPersonRole' || e.key === 'dbkLookShown' || e.key === null)) { try { window.dbkLookCarry && window.dbkLookCarry.mark(); } catch (x) {} }\n  });\n})();\n","shared.js":"/* 2daysbook — shared page script. Loaded once in the <head> of every page, after modules.js.\n   Holds what every page used to carry its own copy of:\n     1. settings read from this phone (app name, names, app code, time zone)\n     2. window.HH: the small shared API pages and scripts call (names, escHtml, app lock, color helpers)\n     3. names and the app name filled into the page, and again when they change\n     4. the app lock: one lock screen drawn on every page (dbkLock), plus checkLogin for older page screens\n     5. lhToast / lhConfirm (notices and yes/no questions)\n     6. the Firebase flags scripts check before the Firebase module has loaded\n   Colors and fonts are not computed here any more: they are CSS custom properties in shared.css. */\n/* ── The app code (Settings > App code): a 4-6 number code the app asks for after 4 hours without use ──\n   (separate from the sign-in password). Each person's own, saved in the shared setting 'appCode_person1' / 'appCode_person2' as\n   \"c1.<how many numbers>.<rounds>.<salt>.<hash>\": PBKDF2 with SHA-256 and a random salt (WebCrypto), so the code\n   itself is never stored. How many numbers it has is kept so the lock screen knows when it's complete (the dots show\n   that anyway). Kept as its own block (between the dbk-code marks) so functions/test/app-code.test.mjs can run it. */\n/* dbk-code:start */\n(function (G) {\n  var ROUNDS = 150000;\n  function hex(b) { var s = ''; for (var i = 0; i < b.length; i++) s += (b[i] < 16 ? '0' : '') + b[i].toString(16); return s; }\n  function unhex(s) { var b = new Uint8Array(s.length / 2); for (var i = 0; i < b.length; i++) b[i] = parseInt(s.substr(i * 2, 2), 16); return b; }\n  function valid(code) { return /^[0-9]{4,6}$/.test(String(code == null ? '' : code)); }\n  function parse(stored) {\n    var m = /^c1\\.([4-6])\\.([0-9]{4,7})\\.([0-9a-f]{32})\\.([0-9a-f]{64})$/.exec(String(stored || ''));\n    if (!m || +m[2] < 1000 || +m[2] > 2000000) return null;\n    return { len: +m[1], rounds: +m[2], salt: m[3], hash: m[4] };\n  }\n  async function derive(code, salt, rounds) {\n    var c = G.crypto && G.crypto.subtle; if (!c) throw new Error('This browser can\\u2019t keep a code safely.');\n    var key = await c.importKey('raw', new G.TextEncoder().encode(String(code)), 'PBKDF2', false, ['deriveBits']);\n    return hex(new Uint8Array(await c.deriveBits({ name: 'PBKDF2', hash: 'SHA-256', salt: unhex(salt), iterations: rounds }, key, 256)));\n  }\n  async function make(code) {\n    if (!valid(code)) throw new Error('Use 4 to 6 numbers.');\n    var salt = new Uint8Array(16); G.crypto.getRandomValues(salt); var s = hex(salt);\n    return 'c1.' + String(code).length + '.' + ROUNDS + '.' + s + '.' + (await derive(code, s, ROUNDS));\n  }\n  async function check(code, stored) {\n    var p = parse(stored); code = String(code == null ? '' : code);\n    if (!p || !valid(code) || code.length !== p.len) return false;\n    var h; try { h = await derive(code, p.salt, p.rounds); } catch (e) { return false; }\n    var d = h.length ^ p.hash.length; for (var i = 0; i < h.length; i++) d |= h.charCodeAt(i) ^ p.hash.charCodeAt(i);\n    return d === 0;\n  }\n  // Each person has their own code, and only if they set one (Kasey, Oct 25: \"Partners need to be able to have separate\n  // codes, and the code should only turn on if they set it up\"). Kept in the shared settings 'appCode_person1' /\n  // 'appCode_person2': a hash from make(), or OFF for a person who turned theirs off.\n  // Before that there was one code for the household ('appCode', and before that a text password, 'password'). Nothing\n  // recorded who set it; it was always the owner (person1, who sets the app up), so it stays person1's lock until\n  // person1 sets or turns off a code of their own. It never locks person2, and it is never changed or deleted.\n  // get(key): reads a stored setting. role: 'person1', 'person2', or null (this phone hasn't confirmed who it is yet).\n  // Returns the lock for that person ({ kind: 'code' | 'pw', v: what's stored, key: where }) or null for none.\n  var OFF = 'off', MOVED = 'moved';\n  // Oct 25 (Kasey: \"for selling, security stuff should be as private as possible … password/code should be private\n  // between the 2\"): the person's own code now lives where only their login can read it (own_appcode_person1/2/data in\n  // the cloud, which firestore.rules keeps from the partner's login) and this phone's copy of it,\n  // 'dbkPrivate_appcode_<person>' ({ v, at }; never synced, never in a backup download). It wins over everything below,\n  // which is only read until it has been moved there (privMove in the lock code further down).\n  function priv(get, role) { var p = null; try { p = JSON.parse(get('dbkPrivate_appcode_' + role) || 'null'); } catch (e) {} return p && typeof p === 'object' && typeof p.v === 'string' ? p : null; }\n  function lockFor(get, role) {\n    if (role !== 'person1' && role !== 'person2') return null;\n    var pv = priv(get, role);\n    if (pv) { if (pv.v === OFF) return null; if (parse(pv.v)) return { kind: 'code', v: pv.v, key: 'private' }; }\n    var own = get('appCode_' + role);\n    if (own === OFF) return null;\n    if (parse(own)) return { kind: 'code', v: own, key: 'appCode_' + role };\n    // 'moved' (security, Oct 31): this person's code went to their private place, which this phone hasn't read yet (a\n    // new phone, or its copy was cleared). Until that place has answered once on this phone ('dbkPrivate_appcodeAsked_',\n    // set by codeSync) the app stays locked ('wait': a \"Checking your code\" screen); before, it opened with no code.\n    if (own === MOVED || (own == null && role === 'person1' && get('appCode') === MOVED)) return get('dbkPrivate_appcodeAsked_' + role) ? null : { kind: 'wait', v: '', key: 'private' };\n    if (role !== 'person1') return null;\n    var old = get('appCode'); if (parse(old)) return { kind: 'code', v: old, key: 'appCode' };\n    var pw = get('password'); if (pw) return { kind: 'pw', v: pw, key: 'password' };\n    return null;\n  }\n  // where this person's code was kept before it moved to their private place: their synced appCode_<person> (a hash or\n  // OFF), else for person1 the household's older appCode. null = nothing to move.\n  function legacyFor(get, role) {\n    if (role !== 'person1' && role !== 'person2') return null;\n    var own = get('appCode_' + role);\n    if (own === OFF || parse(own)) return { v: own, key: 'appCode_' + role };\n    if (role === 'person1') { var old = get('appCode'); if (parse(old)) return { v: old, key: 'appCode' }; }\n    return null;\n  }\n  G.dbkCode = { make: make, check: check, parse: parse, valid: valid, ROUNDS: ROUNDS, lockFor: lockFor, legacyFor: legacyFor, OFF: OFF, MOVED: MOVED };\n})(typeof window !== 'undefined' ? window : globalThis);\n/* dbk-code:end */\n(function () {\n  if (window._hhEngineLoaded) return;\n  window._hhEngineLoaded = true;\n\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html');\n\n  // Signing out (Settings > Account, dbk-account.js) removes this phone's copy of the household's things: every\n  // saved key except which online storage this copy uses. It runs once more on the next page load (before the page\n  // reads anything), in case a page saved something on its way out.\n  window.dbkWipeLocalData = function () {\n    var KEEP = /^(firebaseConfig|setupComplete|htSetupComplete|dbkWipeLocalDb|dbkAside|dbkLookShown|dbkPushDrop)$/;   // (dbkPushDrop: a notification sign-up a Sign out with no signal couldn't delete, pushDrop below)   // (dbkLookShown: only the colours and fonts last shown, so the sign-in screen is in the person's look, dbk-frame.js)\n    try {\n      var ks = []; for (var i = 0; i < localStorage.length; i++) ks.push(localStorage.key(i));\n      ks.forEach(function (k) { if (!KEEP.test(k)) localStorage.removeItem(k); });\n      var ss = []; for (var j = 0; j < sessionStorage.length; j++) ss.push(sessionStorage.key(j));\n      ss.forEach(function (k) { if (k !== 'dbkSignedOutNote') sessionStorage.removeItem(k); });\n      localStorage.setItem('dbkWipeLocalDb', '1');       // the on-phone database copy goes on the next load (firebase-init.js)\n      sessionStorage.setItem('dbkWipeAgain', '1');\n    } catch (e) {}\n  };\n  // Unsent changes (the same ones Settings > Sign out checks for): a shared list's note of changes (dbkPend:<list>),\n  // the Meals plan's and recipes' lists of changed days and recipes (*_dirty) and quick captures waiting to go\n  // (dbkCapQueue). When this phone has to let go of the household's things WITHOUT a normal sign-out (its sign-in\n  // ended, or the owner removed this person), these are put aside on the phone first, under the login they belong\n  // to ('dbkAside'), never deleted. If that login signs in again and is still in the household, they come back and\n  // are sent (dbkTakeBackAside, called by the sign-in check in daybook-theme.js).\n  var UNSENT = /^dbkPend:|_dirty$|^dbkCapQueue$/;\n  var jget = function (k, d) { try { var v = JSON.parse(localStorage.getItem(k)); return v == null ? d : v; } catch (e) { return d; } };\n  var emptyV = function (v) { return v == null || v === '' || (Array.isArray(v) ? !v.length : (typeof v === 'object' && !Object.keys(v).length)); };\n  // two copies of the same kind of note, older first: nothing in either is lost\n  var combine = function (k, older, newer) {\n    if (older == null) return newer; if (newer == null) return older;\n    try {\n      if (k.indexOf('dbkPend:') === 0 && window.dbkMerge) { var m = window.dbkMerge.addOps(older, newer); m.extra = newer.extra || older.extra; return m; }\n      if (k === 'workroom_dirty' && window.dbkMerge && window.dbkMerge.addDocOps) return window.dbkMerge.addDocOps(older, newer);   // the Work page's note\n      if (k === 'dbkCapQueue' && Array.isArray(older) && Array.isArray(newer)) { var ids = {}; newer.forEach(function (t) { if (t && t.id != null) ids[String(t.id)] = 1; }); return older.filter(function (t) { return !(t && t.id != null && ids[String(t.id)]); }).concat(newer); }\n      if (k === 'mealplan_recipes' && Array.isArray(older) && Array.isArray(newer)) {\n        var kf = function (r) { return r && (r.firebaseId != null ? r.firebaseId : (r.id != null ? r.id : r.lifeHubId)); }, have = {};\n        newer.forEach(function (r) { if (kf(r) != null) have[String(kf(r))] = 1; });\n        return older.filter(function (r) { return !(kf(r) != null && have[String(kf(r))]); }).concat(newer);\n      }\n      if (typeof older === 'object' && typeof newer === 'object' && !Array.isArray(older) && !Array.isArray(newer)) { var o = {}; for (var a in older) o[a] = older[a]; for (var b in newer) o[b] = newer[b]; return o; }\n    } catch (e) {}\n    return newer;\n  };\n  window.dbkKeepAside = function (uid) {\n    try {\n      var keep = {}, n = 0;\n      for (var i = 0; i < localStorage.length; i++) {\n        var k = localStorage.key(i); if (!k || !UNSENT.test(k)) continue;\n        var v = jget(k, null); if (emptyV(v)) continue;\n        keep[k] = v; n++;\n      }\n      if (!n) return false;\n      // the Meals plan days and recipes those lists name, and only those (the rest is in the cloud)\n      if (keep.mealplan_schedule_dirty) { var s = jget('mealplan_schedule', {}), sd = {}; Object.keys(keep.mealplan_schedule_dirty).forEach(function (d) { if (s[d] !== undefined) sd[d] = s[d]; }); keep.mealplan_schedule = sd; }\n      if (keep.mealplan_recipes_dirty) {\n        var rs = jget('mealplan_recipes', []), ks = window.dbkMerge && Array.isArray(rs) ? window.dbkMerge.keysOf(rs) : null;\n        keep.mealplan_recipes = ks ? rs.filter(function (r, j) { return ks[j] !== null && keep.mealplan_recipes_dirty[ks[j]]; }) : rs;\n      }\n      var all = jget('dbkAside', {}), id = uid || 'unknown', had = (all[id] && all[id].keys) || {};\n      for (var kk in keep) had[kk] = combine(kk, had[kk], keep[kk]);\n      all[id] = { at: Date.now(), keys: had };\n      localStorage.setItem('dbkAside', JSON.stringify(all));\n      return true;\n    } catch (e) { return false; }\n  };\n  // the same login is signed in again and is still in the household: its put-aside changes go back to being unsent\n  // changes (the pages send them on their next load). True when there was something to bring back.\n  // Put-aside changes are never let go by themselves (Oct 31 review: dropping another login's unsent changes after a\n  // while loses what they typed, which is worse than the leftover; only that login signing in again takes them back).\n  window.dbkTakeBackAside = function (uid) {\n    try {\n      var all = jget('dbkAside', {}), mine = uid && all[uid]; if (!mine || !mine.keys) return false;\n      Object.keys(mine.keys).forEach(function (k) {\n        var cur = jget(k, null), v;\n        // a plan day or recipe this phone already has from the cloud: the put-aside (unsent) copy goes on top\n        if (k === 'mealplan_schedule') v = combine(k, cur || {}, mine.keys[k]);\n        else if (k === 'mealplan_recipes') v = combine(k, cur || [], mine.keys[k]);\n        else v = combine(k, mine.keys[k], cur);\n        localStorage.setItem(k, JSON.stringify(v));\n      });\n      delete all[uid];\n      if (Object.keys(all).length) localStorage.setItem('dbkAside', JSON.stringify(all)); else localStorage.removeItem('dbkAside');\n      return true;\n    } catch (e) { return false; }\n  };\n  // Let go of the household's things on this phone without a normal sign-out: put unsent changes aside, close every\n  // open page's connection, sign out, remove this phone's copy and open the sign-in screen with a note saying why.\n  // why: 'removed' (the owner took this person out of the household) or 'ended' (the sign-in itself ended)\n  var lettingGo = false;\n  window.dbkLetGo = function (uid, why) {\n    if (lettingGo) return; lettingGo = true;\n    try { sessionStorage.setItem('dbkSigningOut', '1'); } catch (e) {}\n    window.dbkKeepAside(uid);\n    try { sessionStorage.setItem('dbkAsideUid', uid || 'unknown'); } catch (e) {}\n    var wins = [window];\n    try { var t0 = window.top; if (t0 !== window) wins.push(t0); for (var i = 0; i < t0.frames.length; i++) if (t0.frames[i] !== window) wins.push(t0.frames[i]); } catch (e) {}\n    var a = window.dbkAuth;\n    var closeAll = wins.reduce(function (p, w) { return p.then(function () { try { if (w.dbkAuth && w.dbkAuth !== a && w.dbkAuth.closeDb) return w.dbkAuth.closeDb(); } catch (e) {} }).catch(function () {}); }, Promise.resolve());\n    closeAll.then(function () { return a && a.signOut ? a.signOut() : null; }).catch(function () {}).then(function () {\n      try { if (a && a.closeDb) return a.closeDb(); } catch (e) {}\n    }).catch(function () {}).then(function () {\n      // removed from the household (not a sign-in that ended by itself): the browser's push sign-up goes too, so this\n      // phone stops getting the household's notifications (the server marks the dead sign-up when it next sends)\n      if (why === 'ended') return;\n      return Promise.race([new Promise(function (r) { setTimeout(r, 3000); }), (function () { try { return navigator.serviceWorker.getRegistration().then(function (g) { return g && g.pushManager ? g.pushManager.getSubscription() : null; }).then(function (x) { return x ? x.unsubscribe() : null; }).catch(function () {}); } catch (e) { return null; } })()]);\n    }).catch(function () {}).then(function () {\n      window.dbkKeepAside(uid);   // anything a page noted on its way out\n      // a sign-in that ended by itself (not Sign out, not removed) keeps this phone's notification sign-up: the same\n      // login signing in again finds its notifications still on (Kasey, Oct 23: \"they turned off on their own\")\n      var push = {};\n      if (why === 'ended') { try { ['dbkPushId', 'dbkPushWant', 'dbkPushOn', 'dbkNotify'].forEach(function (k) { var v = localStorage.getItem(k); if (v != null) push[k] = v; }); if (uid) push.dbkPushUid = uid; } catch (e) {} }\n      window.dbkWipeLocalData();\n      try { Object.keys(push).forEach(function (k) { localStorage.setItem(k, push[k]); }); } catch (e) {}\n      try { sessionStorage.setItem('dbkSignedOutNote', why || 'ended'); sessionStorage.setItem('dbkAsideUid', uid || 'unknown'); } catch (e) {}\n      // (Oct 31) the wipe runs once more on the next load (dbkWipeAgain below): the kept sign-up must survive that one too\n      try { if (Object.keys(push).length) sessionStorage.setItem('dbkPushHold', JSON.stringify(push)); } catch (e) {}\n      try { var t = window.top; t.location.hash = '#meal-plan.html'; t.location.reload(); } catch (e) { location.href = 'meal-plan.html'; }\n    });\n  };\n  // Firebase says nobody is signed in, on a phone that was confirmed in the household (dbkRoleUid) and wasn't signed\n  // out on purpose (Settings > Sign out and the other sign-out buttons set 'dbkSigningOut' first): let go (firebase-init.js)\n  window.dbkSignInEnded = function () {\n    var uid = null, out = null;\n    try { uid = localStorage.getItem('dbkRoleUid'); out = sessionStorage.getItem('dbkSigningOut'); } catch (e) {}\n    if (!uid || out) return false;\n    window.dbkLetGo(uid, 'ended');\n    return true;\n  };\n  try { if (sessionStorage.getItem('dbkWipeAgain')) {\n    sessionStorage.removeItem('dbkWipeAgain');\n    var asideUid = sessionStorage.getItem('dbkAsideUid'); if (asideUid) { window.dbkKeepAside(asideUid); sessionStorage.removeItem('dbkAsideUid'); }\n    // (only after a sign-in that ended by itself: Sign out says 'out' and its own wipe never keeps a sign-up)\n    var pushHold = null; try { pushHold = sessionStorage.getItem('dbkSignedOutNote') === 'ended' ? JSON.parse(sessionStorage.getItem('dbkPushHold') || 'null') : null; } catch (e) {}\n    try { sessionStorage.removeItem('dbkPushHold'); } catch (e) {}\n    window.dbkWipeLocalData(); sessionStorage.removeItem('dbkWipeAgain');\n    // a sign-in that ended by itself keeps this phone's notification sign-up (dbkLetGo 'ended'); Sign out never sets this\n    if (pushHold && typeof pushHold === 'object') { ['dbkPushId', 'dbkPushWant', 'dbkPushOn', 'dbkNotify', 'dbkPushUid'].forEach(function (k) { if (typeof pushHold[k] === 'string') localStorage.setItem(k, pushHold[k]); }); }\n  } } catch (e) {}\n\n  // First run on this phone: no Firebase settings and setup never finished -> the setup wizard (lives on the Meals page)\n  if (page === 'index.html' || page === '') {\n    try {\n      var ent0 = window.HEARTH_ENTITLEMENTS || {};\n      var hasCfg = !!localStorage.getItem('firebaseConfig') || !!(ent0.firebaseConfig && ent0.firebaseConfig.apiKey);\n      if (!hasCfg && !localStorage.getItem('htSetupComplete')) (window.__dbkLoc || location).replace('meal-plan.html');\n    } catch (e) {}\n  }\n\n  // Flags scripts may check before the Firebase module has loaded\n  window.firebaseReady = false;\n  window.firebaseError = null;\n  window.firebaseConfigEmpty = true;\n\n  // ── Color helpers (kept for the meal planner's own screens) ──\n  function h2r(h) { h = String(h).replace('#', ''); return [parseInt(h.substring(0, 2), 16), parseInt(h.substring(2, 4), 16), parseInt(h.substring(4, 6), 16)]; }\n  function r2h(r, g, b) { return '#' + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1); }\n  function clamp(v) { return Math.max(0, Math.min(255, Math.round(v))); }\n  function lighten(hex, pct) { var c = h2r(hex); return r2h(clamp(c[0] + (255 - c[0]) * pct), clamp(c[1] + (255 - c[1]) * pct), clamp(c[2] + (255 - c[2]) * pct)); }\n  function darken(hex, pct) { var c = h2r(hex); return r2h(clamp(c[0] * (1 - pct)), clamp(c[1] * (1 - pct)), clamp(c[2] * (1 - pct))); }\n  function luminance(hex) {\n    var c = h2r(hex);\n    var s = c.map(function (v) { v = v / 255; return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4); });\n    return 0.2126 * s[0] + 0.7152 * s[1] + 0.0722 * s[2];\n  }\n  function contrastRatio(a, b) { var la = luminance(a), lb = luminance(b); return (Math.max(la, lb) + 0.05) / (Math.min(la, lb) + 0.05); }\n  function ensureContrast(fg, bg, min) {\n    if (contrastRatio(fg, bg) >= min) return fg;\n    var bgL = luminance(bg), c = h2r(fg);\n    for (var i = 1; i <= 20; i++) {\n      var f = i * 0.05;\n      var adj = bgL > 0.3 ? r2h(clamp(c[0] * (1 - f)), clamp(c[1] * (1 - f)), clamp(c[2] * (1 - f)))\n                          : r2h(clamp(c[0] + (255 - c[0]) * f), clamp(c[1] + (255 - c[1]) * f), clamp(c[2] + (255 - c[2]) * f));\n      if (contrastRatio(adj, bg) >= min) return adj;\n    }\n    return bgL > 0.3 ? '#1a1a1a' : '#ffffff';\n  }\n  function rgbStr(hex) { var c = h2r(hex); return c[0] + ',' + c[1] + ',' + c[2]; }\n  function textOnColor(hex) { var L = luminance(hex); return ((1.05) / (L + 0.05)) >= ((L + 0.05) / 0.05) ? '#ffffff' : '#1a1412'; }\n  function boostText(hex, pct, isLight) {\n    if (!pct) return hex;\n    var t = Math.min(Math.max(pct, 0), 100) / 100, rgb = h2r(hex), target = isLight ? [0, 0, 0] : [255, 255, 255];\n    return r2h(Math.round(rgb[0] + (target[0] - rgb[0]) * t), Math.round(rgb[1] + (target[1] - rgb[1]) * t), Math.round(rgb[2] + (target[2] - rgb[2]) * t));\n  }\n  function boostRgba(rgbaStr, pct, isLight) {\n    if (!pct) return rgbaStr;\n    var m = String(rgbaStr).match(/rgba?\\(\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,\\s*(\\d+)\\s*,?\\s*([\\d.]*)\\s*\\)/); if (!m) return rgbaStr;\n    var t = Math.min(Math.max(pct, 0), 100) / 100, target = isLight ? 0 : 255;\n    var r = Math.round(parseInt(m[1]) + (target - parseInt(m[1])) * t), g = Math.round(parseInt(m[2]) + (target - parseInt(m[2])) * t), b = Math.round(parseInt(m[3]) + (target - parseInt(m[3])) * t);\n    var a = m[4] !== '' ? parseFloat(m[4]) : 1; a = Math.min(1, a + (1 - a) * t * 0.5);\n    return 'rgba(' + r + ',' + g + ',' + b + ',' + a.toFixed(2) + ')';\n  }\n\n  // Named palettes: only the meal planner's settings screens still list these\n  var ACCENT_HEX = { blush: '#d4919e', raspberry: '#b0607a', coral: '#d4887a', rosewood: '#b56b6b', wine: '#8c4a5a', brick: '#a8584c', crimson: '#b54d5a', apricot: '#e8b088', burntsienna: '#c97856', champagne: '#c9b078', amber: '#c4a050', sage: '#a3b899', moss: '#8a9c6b', olive: '#8a8a5e', softmint: '#a8d8c4', dustyteal: '#6d9e9e', powderblue: '#a4c2d8', denim: '#6888a8', periwinkle: '#8e9cc7', lavender: '#b0a0d0', dustylilac: '#c3a6c9', slate: '#8a8f98', warmgray: '#a09590', mutednavy: '#5c6b80', obsidian: '#181818', darkplum: '#3d2f31', storm: '#252830' };\n  var ACCENT_LABELS = { blush: 'Blush', raspberry: 'Raspberry', coral: 'Coral', rosewood: 'Rosewood', wine: 'Wine', brick: 'Brick', crimson: 'Crimson', apricot: 'Apricot', burntsienna: 'Burnt Sienna', champagne: 'Champagne', amber: 'Amber', sage: 'Sage', moss: 'Moss', olive: 'Olive', softmint: 'Soft Mint', dustyteal: 'Dusty Teal', powderblue: 'Powder Blue', denim: 'Denim', periwinkle: 'Periwinkle', lavender: 'Lavender', dustylilac: 'Dusty Lilac', slate: 'Slate', warmgray: 'Warm Gray', mutednavy: 'Muted Navy', obsidian: 'Obsidian', darkplum: 'Dark Plum', storm: 'Storm' };\n  var DEFAULT_SEC = { blush: 'raspberry', raspberry: 'sage', coral: 'sage', rosewood: 'sage', wine: 'sage', brick: 'dustyteal', crimson: 'sage', apricot: 'dustyteal', burntsienna: 'periwinkle', champagne: 'dustyteal', amber: 'dustyteal', sage: 'raspberry', moss: 'periwinkle', olive: 'dustylilac', softmint: 'burntsienna', dustyteal: 'blush', powderblue: 'burntsienna', denim: 'blush', periwinkle: 'burntsienna', lavender: 'sage', dustylilac: 'moss', slate: 'blush', warmgray: 'powderblue', mutednavy: 'blush', obsidian: 'blush', darkplum: 'sage', storm: 'blush' };\n  var BG_MAP = { dark: '#3d2f31', forest: '#1f2e2a', espresso: '#2b2220', storm: '#252830', midnight: '#141420', warmcocoa: '#362a28', deepteal: '#1a2e2e', dustymauve: '#332830', obsidian: '#181818', bordeaux: '#301820', wine: '#241418', slate: '#262a2e', ink: '#1a1a2e', linen: '#ebe5d7', rosewater: '#f3e6e4' };\n  var BG_DK_MAP = { dark: '#2a1f21', forest: '#15231f', espresso: '#1e1816', storm: '#1b1d24', midnight: '#0d0d16', warmcocoa: '#281e1c', deepteal: '#122020', dustymauve: '#261c24', obsidian: '#101010', bordeaux: '#221018', wine: '#1a0e12', slate: '#1c1e22', ink: '#101020', linen: '#e3dccd', rosewater: '#ead8d6' };\n  var BG_LABELS = { dark: 'Dark Plum', forest: 'Forest', espresso: 'Espresso', storm: 'Storm', midnight: 'Midnight', warmcocoa: 'Warm Cocoa', deepteal: 'Deep Teal', dustymauve: 'Dusty Mauve', obsidian: 'Obsidian', bordeaux: 'Bordeaux', wine: 'Wine', slate: 'Slate', ink: 'Ink', linen: 'Linen', rosewater: 'Rosewater' };\n  var BG_META = {};\n  Object.keys(BG_MAP).forEach(function (k) { BG_META[k] = { hex: BG_MAP[k], dark: BG_DK_MAP[k], label: BG_LABELS[k], light: luminance(BG_MAP[k]) > 0.5 }; });\n  var TEXT_MAP = {};\n  Object.keys(BG_MAP).forEach(function (k) { TEXT_MAP[k] = BG_META[k].light ? { t: '#2f3a2c', m: 'rgba(var(--lh-text-rgb),0.68)', f: 'rgba(var(--lh-text-rgb),0.48)' } : { t: k === 'wine' ? '#e8d4d0' : '#e0d2d0', m: 'rgba(var(--lh-text-rgb),0.6)', f: 'rgba(var(--lh-text-rgb),0.4)' }; });\n  var FONT_MAP = { philosopher: \"'Philosopher',Georgia,serif\", cormorant: \"'Cormorant Garamond',Georgia,serif\", worksans: \"'Work Sans',sans-serif\", baloo: \"'Baloo 2',cursive\", lora: \"'Lora',Georgia,serif\", cardo: \"'Cardo',Georgia,serif\", playfair: \"'Playfair Display',Georgia,serif\", kalam: \"'Kalam',cursive\", lobster: \"'Lobster',cursive\", indieflower: \"'Indie Flower',cursive\", gilda: \"'Gilda Display',Georgia,serif\", cormorantinfant: \"'Cormorant Infant',Georgia,serif\", dmserif: \"'DM Serif Display',Georgia,serif\", tenor: \"'Tenor Sans',sans-serif\", dancing: \"'Dancing Script',cursive\", satisfy: \"'Satisfy',cursive\", greatvibes: \"'Great Vibes',cursive\", abril: \"'Abril Fatface',Georgia,serif\" };\n  var FONT_URLS = {};\n\n  // ── Settings on this phone ──\n  function _ls(key) { try { return localStorage.getItem(key); } catch (e) { return null; } }\n  // the app's name: 2daysbook (Kasey, Oct 22; it was 2daybook). A copy that saved the old default reads as the new one.\n  var DBK_DEFAULT_NAME = '2daysbook';   // tools/build.mjs puts the copy's own name here\n  function _appName() { var a = _ls('appName'); return !a || a === '2daybook' ? DBK_DEFAULT_NAME : a; }\n  var appName = _appName();\n  var names; try { names = JSON.parse(_ls('userNames') || '{}'); } catch (e) { names = {}; }\n  names.name1 = names.name1 || 'Person 1';\n  names.name2 = names.name2 || 'Person 2';\n  var _ent = window.HEARTH_ENTITLEMENTS || {};\n  var ac = _ls('accentColor') || 'blush', sc = _ls('secondaryColor') || DEFAULT_SEC[ac] || 'sage', bc = _ls('bgColor') || 'espresso';\n  var ff = _ls('fontFamily') || 'philosopher', hf = _ls('headingFont') || 'playfair', fs = parseInt(_ls('fontSize') || '100', 10);\n\n  // One person: the second hub's menu links never show (modules.js hides the rest once the page is built)\n  if (!_ent.partner) { var st = document.createElement('style'); st.textContent = 'a.nav-link[href=\"person2-hub.html\"],a.nav-link-mobile[href=\"person2-hub.html\"]{display:none!important}\\n'; (document.head || document.documentElement).appendChild(st); }\n\n  // Week start is stored as '0' (Sunday) or '1' (Monday); older copies saved the words, which broke the\n  // meal planner's week math (opening tonight's recipe did nothing)\n  window.dbkWeekStartNum = function (v) { return v === 'sunday' ? '0' : v === 'monday' ? '1' : v; };\n  try { var _wsv = localStorage.getItem('weekStart'), _wsn = window.dbkWeekStartNum(_wsv); if (_wsn !== _wsv) localStorage.setItem('weekStart', _wsn); } catch (e) {}\n\n  // The settings every phone in the household shares (kept in settings/global, pulled on each open)\n  // (dbkKeep_person1/2: which lists that person keeps just for themselves, Settings > Sharing, dbk-sharing.js;\n  //  dbkPriv_person1/2: the same for the calendar, reminders, grocery list, recipes, bills and accounts. Since Nov 1 these\n  //  are only a copy, for the partner's phone and older code: each person's own choices live in own_sharing_<person>,\n  //  which only their login can write, and their own phone and the server read those; dbk-sharing.js shareSync)\n  // (appCode_person1/2: each person's own app code, Settings > App code; 'appCode' and 'password' are the household's older ones)\n  window.DBK_SETTINGS_KEYS = ['appName', 'userNames', 'timezone', 'weekStart', 'password', 'appCode', 'appCode_person1', 'appCode_person2', 'userLocation', 'userLocation2', 'archived', 'dashboardFeatures', 'dashboardOrder', 'challengeSet', 'dbkLook_person1', 'dbkLook_person2', 'dbkKeep_person1', 'dbkKeep_person2', 'dbkPriv_person1', 'dbkPriv_person2', 'listPins', 'dbkRecipeLook_person1', 'dbkRecipeLook_person2', 'dbkWorkIncomeAll', 'dbkMealNotes_person1', 'dbkMealNotes_person2', 'dbkWorkOrder_person1', 'dbkWorkOrder_person2', 'dbkWorkNew_person1', 'dbkWorkNew_person2', 'dbkWelcomeSeen_person1', 'dbkWelcomeSeen_person2', 'dbkMealsNew_person1', 'dbkMealsNew_person2'];   // dbkWorkNew_*: 'off' = that person's old Work page (none = the new one, work-new.js);   // dbkMealsNew_*: each person's Meals layout, 'off' = the old one (missing or 'on' = the new; meals-today.js, Oct 31);   // dbkWelcomeSeen_*: the getting-started cards were seen by that person (dbk-welcome.js; Oct 29, a re-added app showed them again);   // dbkWorkOrder_*: each person's order of the Work page's parts (Arrange, work-today.js);   // dbkMealNotes_*: each person's dinner reminders (meal-notes.js);   // dbkWorkIncomeAll: Work > Business money > Count all money in as work income; listPins: lists pinned to the top of the Lists page (our-dreams.html); dbkRecipeLook_*: Settings > Meals > Recipes look\n\n  // ── The app lock (an app code, or an older text app password; separate from the Firebase sign-in) ──\n  var LOCK_IDLE = 4 * 3600000;   // 4 hours without using the app\n  function isLoggedIn() {\n    try {\n      var ts = localStorage.getItem('hh_login_ts'); if (!ts) return false;\n      // unlocked stays unlocked while the app is used; after LOCK_IDLE with no use it asks again (Kasey, Oct 24: \"asked\n      // just like every 6 hours or so, or after a few hours of no activity\"; it was 30 days)\n      if (Date.now() - parseInt(ts, 10) > LOCK_IDLE) { localStorage.removeItem('hh_login_ts'); return false; }\n      // (refreshed at most every 5 minutes: every open page watches this value, so writing it each check would ping-pong)\n      if (Date.now() - parseInt(ts, 10) > 300000) localStorage.setItem('hh_login_ts', Date.now().toString());\n      return true;\n    } catch (e) { return false; }\n  }\n  function markLoggedIn() { try { localStorage.setItem('hh_login_ts', Date.now().toString()); } catch (e) {} }\n  function logout() { try { localStorage.removeItem('hh_login_ts'); } catch (e) {} }\n  async function hashString(input) {\n    try {\n      var data = new TextEncoder().encode(input);\n      var buf = await crypto.subtle.digest('SHA-256', data);\n      return Array.from(new Uint8Array(buf)).map(function (b) { return b.toString(16).padStart(2, '0'); }).join('');\n    } catch (e) { return input; }\n  }\n  // Whose lock this phone uses: the person it last confirmed is signed in ('myPersonRole', kept on the phone, so a page\n  // opening before this visit's sign-in check answers still knows). A copy for one person, or with no online storage,\n  // has only person1. A two-person copy that hasn't confirmed anyone on this phone yet (just signed in with the sign-in\n  // password, before the check answers) uses no code until it has; the check then saves the person and reloads.\n  function hasCloud() { try { return !!localStorage.getItem('firebaseConfig') || !!(_ent.firebaseConfig && _ent.firebaseConfig.apiKey); } catch (e) { return false; } }\n  function lockRole() {\n    var r = _ls('myPersonRole'); if (r === 'person1' || r === 'person2') return r;\n    return !twoPeople() || !hasCloud() ? 'person1' : null;\n  }\n  // this person's lock, read fresh each time: a code can be set or turned off on another page or phone while this one\n  // is open (dbkCode.lockFor: their own code, else for person1 the household's older code or older text password)\n  function curLock() { return window.dbkCode ? window.dbkCode.lockFor(_ls, lockRole()) : null; }\n  function curPassword() { var l = curLock(); return l && l.kind === 'pw' ? l.v : ''; }\n  function curCode() { var l = curLock(); return l && l.kind === 'code' ? l.v : ''; }\n  function lockOn() { return !!curLock(); }\n  // a new code for this person (from dbkCode.make), or OFF; the household's older code and password are left as they are.\n  // Returns the setting it saved (to name it when syncing), or '' when this phone doesn't know who it is yet.\n  // (Oct 25) saved to this person's private place, never to the shared settings: this phone's copy at once, the cloud's\n  // (own_appcode_<person>, only their login can read or write it) now or when this phone next can ('dbkPrivate_appcodeSend_')\n  function setCode(h) {\n    var r = lockRole(); if (!r) return '';\n    try { localStorage.setItem('dbkPrivate_appcode_' + r, JSON.stringify({ v: h, at: Date.now() })); localStorage.setItem('dbkPrivate_appcodeSend_' + r, '1'); } catch (e) { return ''; }\n    codeSync();\n    return 'private';\n  }\n  function clearCode() { return setCode(window.dbkCode.OFF); }\n  // The private copy in the cloud (own_appcode_<person>/data): sent when this phone changed it, taken in when it's newer,\n  // and on the first visit after this change the code moves there from the shared settings (privMove). Only for the person\n  // this phone has confirmed is signed in, and only that person's own document.\n  var codeBusy = false;\n  function codeSync() {\n    if (codeBusy) return;\n    var fi = window.firestoreImports, db = window.db;\n    if (!window.firebaseReady || !fi || !db || window.firebaseConfigEmpty) return;\n    if (window.dbkRoleOk && !window.dbkRoleOk()) return;\n    var r = _ls('myPersonRole'); if (r !== 'person1' && r !== 'person2') return;\n    var K = 'dbkPrivate_appcode_' + r, SEND = 'dbkPrivate_appcodeSend_' + r;\n    var ref = fi.doc(db, 'own_appcode_' + r, 'data');\n    var local = function () { try { var p = JSON.parse(localStorage.getItem(K) || 'null'); return p && typeof p.v === 'string' ? p : null; } catch (e) { return null; } };\n    codeBusy = true;\n    var done = function () { codeBusy = false; };\n    Promise.resolve(fi.getDoc(ref)).then(function (snap) {\n      var c = snap && snap.exists && snap.exists() ? snap.data() : null, l = local();\n      // the private place has answered on this phone: a 'moved' in the shared settings no longer holds the lock (lockFor)\n      // (only an answer from the server counts: a phone's cached \"nothing there\" isn't the private place answering)\n      var fromServer = !(snap && snap.metadata && snap.metadata.fromCache);\n      var asked = fromServer && !_ls('dbkPrivate_appcodeAsked_' + r); if (fromServer) try { localStorage.setItem('dbkPrivate_appcodeAsked_' + r, String(Date.now())); } catch (e) {}\n      if (asked && !c) lockCheck();\n      if (c && typeof c.v !== 'string') c = null;\n      if (l && _ls(SEND) && (!c || (l.at || 0) >= (c.at || 0))) {\n        // this phone's change goes up; the flag stays until the cloud has it\n        return Promise.resolve(fi.setDoc(ref, { v: l.v, at: l.at || Date.now() })).then(function () { try { if (JSON.stringify(local()) === JSON.stringify(l)) localStorage.removeItem(SEND); } catch (e) {} });\n      }\n      if (c) {\n        if (!l || (c.at || 0) > (l.at || 0) || (_ls(SEND) && (c.at || 0) > (l.at || 0))) { try { localStorage.setItem(K, JSON.stringify({ v: c.v, at: c.at || 0 })); localStorage.removeItem(SEND); } catch (e) {} lockCheck(); }\n        return privMove(r, fi, ref, null);\n      }\n      // nothing private yet: move the code from the shared settings (never lose a lock someone set)\n      var lg = window.dbkCode.legacyFor(_ls, r);\n      if (!lg || lg.v === window.dbkCode.MOVED) return;\n      var rec = { v: lg.v, at: Date.now(), from: lg.key };\n      return Promise.resolve(fi.setDoc(ref, rec)).then(function () {\n        try { if (!local()) localStorage.setItem(K, JSON.stringify({ v: rec.v, at: rec.at })); } catch (e) {}\n        return privMove(r, fi, ref, lg);\n      });\n    }).then(done, done);\n  }\n  // once the cloud holds this person's private code (the save above answered from the server, or it was already there),\n  // the shared settings no longer carry a copy the partner's login could read: appCode_<person> (and for person1 the\n  // household's older appCode) becomes 'moved'. Only a value that is still exactly what was moved, never a newer one.\n  function privMove(r, fi, ref, lg) {\n    var keys = ['appCode_' + r].concat(r === 'person1' ? ['appCode'] : []), changed = [];\n    return Promise.resolve(lg ? null : fi.getDoc(ref)).then(function (s2) {\n      var have = lg ? lg.v : (s2 && s2.exists && s2.exists() ? s2.data().v : null);\n      if (typeof have !== 'string') return;\n      keys.forEach(function (k) {\n        var v = _ls(k);\n        if (!v || v === window.dbkCode.MOVED) return;\n        // the household's older code is person1's; it moves only when it was what person1 had (or person1 has their own now)\n        if (v === have || k === 'appCode_' + r || (k === 'appCode' && window.dbkCode.parse(v))) { try { localStorage.setItem(k, window.dbkCode.MOVED); changed.push(k); } catch (e) {} }\n      });\n      if (changed.length && window.dbkSettings) try { window.dbkSettings.save(changed); } catch (e) {}\n    });\n  }\n  // After a Sign out (Oct 31 review): the service worker shows nothing while this phone is marked signed out (sw.js,\n  // 'dbk-flags'). Once someone's sign-in is confirmed here: a sign-up a Sign out with no signal couldn't delete\n  // ('dbkPushDrop') is deleted when it's this same login's; another login's can't be (the server checks whose it is),\n  // so the browser's own sign-up, still that one's, is dropped (the push service then refuses it and the server marks\n  // it dead). Then the mark is cleared and notifications work for whoever turns them on.\n  var FLAG = function () { return new URL('__dbk-signed-out', location.href).href; };\n  // the \"signed out\" flag goes the moment a sign-in is confirmed here (any login): its only job is to keep the service\n  // worker quiet while nobody is signed in on this phone. Turn on and dbkPushKeep wait for this before signing up.\n  window.dbkPushUnmute = function () { try { if (sessionStorage.getItem('dbkSigningOut')) return Promise.resolve(); } catch (e) {} try { return caches.open('dbk-flags').then(function (c) { return c.delete(FLAG()); }).catch(function () {}); } catch (e) { return Promise.resolve(); } };\n  var dropBusy = false;\n  function pushDrop() {\n    var fi = window.firestoreImports, db = window.db, a = window.dbkAuth, u = (a && a.user && a.user()) || window.firebaseUser;\n    if (!window.firebaseReady || !fi || !db || !u || !u.uid || (window.dbkRoleOk && !window.dbkRoleOk())) return;\n    try { if (sessionStorage.getItem('dbkSigningOut')) return; } catch (e) {}   // (a page still open while Sign out runs)\n    window.dbkPushUnmute();\n    if (dropBusy) return;\n    var mk = null; try { mk = JSON.parse(localStorage.getItem('dbkPushDrop') || 'null'); } catch (e) {}\n    if (!mk || !mk.id) return;\n    var done = function () { try { localStorage.removeItem('dbkPushDrop'); } catch (e) {} };\n    // another login's record can't be deleted from here (the rules check whose it is): the server drops it once the\n    // push service refuses it (the browser's sign-up went at Sign out)\n    if (mk.uid !== u.uid) { done(); return; }\n    dropBusy = true;\n    // only what's still there is deleted; refused or not there counts as done (the rules refuse deleting a missing one)\n    var gone = function (e) { var c = e && e.code; if (c === 'permission-denied' || c === 'not-found') done(); };\n    Promise.resolve(fi.getDoc(fi.doc(db, 'pushSubs', mk.id))).then(function (snap) {\n      if (!snap || !snap.exists || !snap.exists()) { if (!(snap && snap.metadata && snap.metadata.fromCache)) done(); return; }\n      return Promise.resolve(fi.deleteDoc(fi.doc(db, 'pushSubs', mk.id))).then(done, gone);\n    }, gone).catch(function () {}).then(function () { dropBusy = false; });\n  }\n  window.dbkPushDropNow = pushDrop;\n  window.addEventListener('dbkRoleOk', function () { setTimeout(pushDrop, 500); });\n  window.addEventListener('online', function () { setTimeout(pushDrop, 1500); });\n  window.addEventListener('firebaseReady', function () { setTimeout(pushDrop, 2500); });\n  window.addEventListener('firebaseReady', function () { setTimeout(codeSync, 1500); });\n  window.addEventListener('dbkRoleOk', function () { setTimeout(codeSync, 0); });\n  window.addEventListener('online', function () { setTimeout(codeSync, 500); });\n  document.addEventListener('visibilitychange', function () { if (document.visibilityState === 'visible') setTimeout(codeSync, 500); });\n  setTimeout(codeSync, 4000);\n  async function checkPassword(input) {\n    var code = curCode();\n    if (code) return window.dbkCode.check(input, code);\n    var pw = curPassword();\n    if (!pw) return true;\n    if (!input) return false;\n    // only the typed password counts (typing the stored code itself used to unlock too)\n    return (await hashString(input)) === pw;\n  }\n  // Pages with a #passwordScreen call this from their Unlock button\n  window.checkLogin = async function () {\n    var input = document.getElementById('loginPassword'); if (!input) return;\n    var ok = await checkPassword(input.value);\n    if (ok) {\n      markLoggedIn();\n      var scr = document.getElementById('passwordScreen'); if (scr) scr.style.display = 'none';\n      document.body.style.overflow = '';\n    } else {\n      var err = document.getElementById('loginError'); if (err) err.style.display = 'block';\n      input.value = ''; input.focus();\n    }\n  };\n\n  function escHtml(str) { if (!str) return ''; return String(str).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/\"/g, '&quot;').replace(/'/g, '&#39;'); }\n  // Security (Oct 31): a value from the cloud put inside an inline handler (onclick=\"f(...)\"). dbkJsStr gives the inside of a\n  // '...' or \"...\" JS string with every character that could end the string or the attribute written as \\uXXXX; dbkJsArg\n  // gives a whole argument: a plain number as it is (the Inbox's numeric ids), anything else as a quoted string.\n  function dbkJsStr(s) { return String(s == null ? '' : s).replace(/[\\\\'\"<>&`\\n\\r\\u2028\\u2029]/g, function (c) { return '\\\\u' + ('000' + c.charCodeAt(0).toString(16)).slice(-4); }); }\n  function dbkJsArg(v) { var s = String(v == null ? '' : v); return /^-?\\d{1,17}$/.test(s) ? s : \"'\" + dbkJsStr(s) + \"'\"; }\n\n  function onReady(fn) { if (document.readyState !== 'loading') fn(); else document.addEventListener('DOMContentLoaded', fn); }\n\n  // Names and the app name, filled in once the page exists, and again whenever they change\n  // (in Settings on this phone, or synced from the other phone) so going back to a page shows the new ones\n  var baseTitle = null;\n  function paintNames() {\n    var an = _appName(), nn; try { nn = JSON.parse(_ls('userNames') || '{}') || {}; } catch (e) { nn = {}; }\n    appName = an; names.name1 = nn.name1 || 'Person 1'; names.name2 = nn.name2 || 'Person 2';\n    if (window.HH) window.HH.appName = appName;\n    document.querySelectorAll('[data-hh-name=\"app\"]').forEach(function (el) { el.textContent = appName; });\n    document.querySelectorAll('[data-hh-name=\"person1\"]').forEach(function (el) { el.textContent = names.name1; });\n    document.querySelectorAll('[data-hh-name=\"person2\"]').forEach(function (el) { el.textContent = names.name2; });\n    var p1pill = document.getElementById('pillPerson1'); if (p1pill) p1pill.textContent = names.name1 + \"'s Hub\";\n    var p2pill = document.getElementById('pillPerson2'); if (p2pill) p2pill.textContent = names.name2 + \"'s Hub\";\n    // Today's greeting names whoever this phone belongs to\n    var hn = document.getElementById('homeNames');\n    // (nobody known on this phone yet: the person whose look it carries, dbk-frame.js; a re-added home-screen app opened\n    // for Charlie said \"Good evening, Kasey\" in his colours until he signed in, Oct 29)\n    var who = _ls('myPersonRole'); if (who !== 'person1' && who !== 'person2') { try { who = (window.dbkLookCarry && window.dbkLookCarry.who()) || who; } catch (e) {} }\n    if (hn && hn.textContent) hn.textContent = who === 'person2' ? names.name2 : names.name1;\n    if (baseTitle === null) baseTitle = document.title;\n    var title = baseTitle.replace('2daysbook', appName);\n    title = title.replace(\"Person 1's\", names.name1 + \"'s\").replace('Person 1', names.name1);\n    title = title.replace(\"Person 2's\", names.name2 + \"'s\").replace('Person 2', names.name2);\n    document.title = title;\n  }\n  onReady(function () { paintNames(); lockCheck(); });\n  window.addEventListener('storage', function (e) {\n    if (!e.key || e.key === 'userNames' || e.key === 'appName') paintNames();\n    if (!e.key || /^(password|appCode|appCode_person[12]|dbkPrivate_appcode_person[12]|hh_login_ts|myPersonRole)$/.test(e.key)) lockCheck();\n  });\n\n  // ── The app lock: one screen, drawn here on every page (Work and Money included). Unlocking on one page\n  // unlocks every page in the app at once (they all watch 'hh_login_ts'); removing the code lifts it.\n  // With an app code (the person's own, appCode_person1/2): dots, a number pad, and it opens as soon as the right numbers\n  // are in. Only a person who set a code is asked. Person1 in a household that set a text app password before codes\n  // existed keeps that screen (a password box) until they set a code.\n  function lockCheck() {\n    if (!document.body) return;\n    if (lockOn() && !isLoggedIn()) showLock(); else hideLock();\n  }\n  // a soft wait after 5 wrong tries in a row (30 seconds), kept on this phone so reopening the app doesn't skip it\n  var WRONG_MAX = 5, WAIT_MS = 30000;\n  function waitLeft() { try { var w = JSON.parse(localStorage.getItem('dbkCodeWait') || '{}'); return Math.max(0, (w.until || 0) - Date.now()); } catch (e) { return 0; } }\n  function wrongTry() {\n    try {\n      var w = JSON.parse(localStorage.getItem('dbkCodeWait') || '{}'); w.n = (w.n || 0) + 1;\n      if (w.n >= WRONG_MAX) { w.n = 0; w.until = Date.now() + WAIT_MS; }\n      localStorage.setItem('dbkCodeWait', JSON.stringify(w));\n    } catch (e) {}\n    return waitLeft();\n  }\n  function rightTry() { try { localStorage.removeItem('dbkCodeWait'); } catch (e) {} }\n  var ICON_DEL = '<svg width=\"26\" height=\"26\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M21 5H9l-6 7 6 7h12z\"/><path d=\"M17 9.5l-5 5M12 9.5l5 5\"/></svg>';\n  function lockMode() { var l = curLock(), p = l && l.kind === 'code' && window.dbkCode.parse(l.v); return p ? 'code' + p.len + ':' + l.key : l && l.kind === 'wait' ? 'wait' : l ? 'pw:' + l.key : ''; }\n  function lockCss() {\n    if (document.getElementById('dbkLockCss')) return;\n    var css = document.createElement('style'); css.id = 'dbkLockCss';\n    css.textContent = '#dbkLock{position:fixed;inset:0;z-index:100001;display:flex;align-items:center;justify-content:center;padding:16px;overflow-y:auto;scrollbar-width:none;background:var(--dbk-paper,#f4efe6);color:var(--dbk-green,#2f3a2c)}' +\n      '#dbkLock::-webkit-scrollbar{display:none}' +\n      '#dbkLock .dbk-lock-box{background:rgba(var(--dbk-green-rgb,47,58,44),.04);padding:36px 26px;border-radius:20px;text-align:center;max-width:380px;width:100%;box-sizing:border-box;border:1px solid rgba(var(--dbk-green-rgb,47,58,44),.35);margin:auto}' +\n      '#dbkLock h1{font-family:var(--dbk-caps,Georgia,serif);color:inherit;font-size:1.8em;margin:0 0 10px;font-weight:400;letter-spacing:.04em}' +\n      '#dbkLock p{color:inherit;opacity:.75;margin:0 0 20px;font-size:1em;line-height:1.45;text-wrap:balance}' +\n      '#dbkLock input{width:100%;padding:14px;border:0;border-radius:10px;font-size:16px;font-family:inherit;margin:0 0 10px;background:rgba(var(--dbk-green-rgb,47,58,44),.07);color:inherit;box-sizing:border-box;text-align:left;outline:0}' +\n      '#dbkLock button{width:100%;padding:14px;min-height:44px;background:var(--dbk-green,#2f3a2c);color:var(--dbk-paper,#fff);border:0;border-radius:10px;font-size:1.05em;font-family:var(--dbk-caps,inherit);letter-spacing:.05em;cursor:pointer}' +\n      '#dbkLock .dbk-lock-err{display:none;opacity:1;margin:12px 0 0;font-size:.9em}' +\n      '#dbkLock .dbk-lock-forgot{display:inline-block;vertical-align:middle;margin:6px 5px 0;background:none;border:1px solid currentColor;border-radius:10px;width:auto;min-height:44px;padding:10px 18px;color:inherit;font-family:var(--dbk-caps,inherit);font-size:1.05em;letter-spacing:.05em}' +\n      '#dbkLock .dbk-lock-help{display:none;margin:10px 0 0;font-size:.9em}' +\n      '#dbkLock .dbk-lock-again{display:inline-block;width:auto;padding:10px 28px;margin:6px 5px 0;vertical-align:middle}#dbkLock .dbk-lock-again[hidden],#dbkLock .dbk-lock-forgot[hidden]{display:none}' +\n      '#dbkLock .dbk-lock-note{margin:16px 0 0;font-size:.9em}' +\n      // forgot it: the sign-in password opens the app and sets a new code (dbkAuth, firebase-init.js)\n      '#dbkLock .dbk-lock-reset{display:none;margin-top:18px;text-align:center}' +\n      '#dbkLock .dbk-lock-reset p{margin:0 0 12px}' +\n      '#dbkLock .dbk-lock-acts{display:flex;flex-wrap:wrap;justify-content:center;gap:10px;margin-top:4px}' +\n      '#dbkLock .dbk-lock-acts button{width:auto;min-height:40px;padding:8px 12px;font-size:.8em;margin:0}' +\n      '@media (max-width:520px){#dbkLock .dbk-lock-box{padding:32px 16px}}' +\n      '#dbkLock .dbk-lock-acts .dbk-lock-ol{background:none;color:inherit;border:1px solid currentColor}' +\n      '#dbkLock .dbk-lock-msg{min-height:1.2em;margin:10px 0 0 !important;opacity:1 !important}' +\n      '#dbkLock button[type=submit]{display:inline-block;vertical-align:middle;width:auto;margin:6px 5px 0;padding:10px 28px}' +\n      // the code screen: dots for the numbers typed, a number pad; the message line keeps its room so nothing moves\n      '#dbkLock .dbk-lock-code p.dbk-lock-lead{margin:0 0 18px}' +\n      '#dbkLock .dbk-lock-dotsw{position:relative;display:inline-flex;gap:16px;justify-content:center;padding:6px 10px;cursor:text}' +\n      '#dbkLock .dbk-lock-dot{width:14px;height:14px;border-radius:50%;border:1.5px solid currentColor;box-sizing:border-box}' +\n      '#dbkLock .dbk-lock-dot.on{background:currentColor}' +\n      '#dbkLock input.dbk-lock-codein{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;opacity:0;color:transparent;caret-color:transparent;background:none;font-size:16px}' +\n      '#dbkLock .dbk-lock-code .dbk-lock-err{display:block;opacity:1;min-height:2.9em;margin:12px 0 6px;font-size:.92em}' +\n      '#dbkLock .dbk-lock-pad{display:grid;grid-template-columns:repeat(3,64px);gap:14px 22px;justify-content:center;margin:0 auto 14px}' +\n      '#dbkLock .dbk-lock-pad button{width:64px;height:64px;min-height:0;padding:0;border-radius:50%;background:rgba(var(--dbk-green-rgb,47,58,44),.07);color:inherit;border:1px solid rgba(var(--dbk-green-rgb,47,58,44),.3);font-family:var(--dbk-caps,inherit);font-size:1.55em;font-variant-numeric:lining-nums tabular-nums;letter-spacing:0;line-height:1;display:flex;align-items:center;justify-content:center;-webkit-tap-highlight-color:transparent;touch-action:manipulation}' +\n      '#dbkLock .dbk-lock-pad button.dbk-lock-del{background:none;border:0}' +\n      '#dbkLock .dbk-lock-pad button:disabled{opacity:.45;cursor:default}' +\n      '#dbkLock .dbk-lock-pad button.dbk-lock-hit{background:rgba(var(--dbk-green-rgb,47,58,44),.2)}' +\n      '@media (max-height:640px){#dbkLock .dbk-lock-pad{grid-template-columns:repeat(3,56px);gap:10px 20px}#dbkLock .dbk-lock-pad button{width:56px;height:56px}#dbkLock .dbk-lock-box{padding-top:22px;padding-bottom:22px}}';\n    (document.head || document.documentElement).appendChild(css);\n  }\n  function twoPeople() { return !!(window.HEARTH_ENTITLEMENTS || {}).partner || ((window.DAYBOOK_CONFIG || {}).people || []).length > 1; }\n  function showLock() {\n    var el = document.getElementById('dbkLock'), mode = lockMode();\n    // the code was set, changed or taken off on another phone while this screen was up: draw it again\n    // (not while someone is in the middle of Forgot code?)\n    if (el && el.getAttribute('data-mode') !== mode && el.querySelector('.dbk-lock-reset').style.display !== 'block') { clearTimeout(el._rest); el.remove(); el = null; }\n    if (!el) {\n      lockCss();\n      var isCode = mode.indexOf('code') === 0, len = isCode ? +mode.slice(4, 5) : 0;\n      el = document.createElement('div'); el.id = 'dbkLock'; el.setAttribute('role', 'dialog'); el.setAttribute('aria-modal', 'true'); el.setAttribute('aria-label', 'App locked');\n      el.setAttribute('data-mode', mode);\n      // (each person's code is their own, so the other person can't tell it to them)\n      var help = '<p class=\"dbk-lock-help\">This ' + (isCode ? 'code' : 'password') + ' can\\u2019t be looked up or reset from here.</p>';\n      if (mode === 'wait') {\n        // this person's code is in their private place and this phone hasn't read it yet: locked until it has\n        // (codeSync is asked again now; online it answers in a second or two, offline it says what to do)\n        el.innerHTML = '<form class=\"dbk-lock-box\" autocomplete=\"off\"><h1></h1><div class=\"dbk-lock-main\"><p class=\"dbk-lock-lead\">Checking your code\\u2026</p>' +\n          '<button type=\"button\" class=\"dbk-lock-again\" hidden>Try again</button><button type=\"button\" class=\"dbk-lock-forgot\" hidden>Forgot code?</button>' +\n          '<p class=\"dbk-lock-help\">This code can\\u2019t be looked up or reset from here.</p></div><div class=\"dbk-lock-reset\"></div></form>';\n        el.querySelector('h1').textContent = appName;\n        var lead = el.querySelector('.dbk-lock-lead'), again = el.querySelector('.dbk-lock-again'), forgot = el.querySelector('.dbk-lock-forgot');\n        // a way out (Oct 31 review): the sign-in password opens it and sets a new code, as on the code screen\n        forgot.addEventListener('click', function () { var a = window.dbkAuth, u = a && a.user && a.user(); if (u && u.email) lockReset(el, a, u); else el.querySelector('.dbk-lock-help').style.display = 'block'; });\n        var slow = function () { if (!el.isConnected) return; lead.textContent = navigator.onLine === false ? 'Connect to the internet to check your code, then the app opens.' : 'Still checking your code. Make sure you have a connection.'; again.hidden = false; forgot.hidden = false; };\n        again.addEventListener('click', function () { again.hidden = true; lead.textContent = 'Checking your code\\u2026'; codeSync(); clearTimeout(el._slow); el._slow = setTimeout(slow, 8000); });\n        el._slow = setTimeout(slow, 8000);\n        setTimeout(codeSync, 0);\n        document.body.appendChild(el);\n      } else {\n      if (isCode) {\n        var dots = ''; for (var d = 0; d < len; d++) dots += '<span class=\"dbk-lock-dot\"></span>';\n        var keys = ''; [1, 2, 3, 4, 5, 6, 7, 8, 9].forEach(function (n) { keys += '<button type=\"button\" data-k=\"' + n + '\">' + n + '</button>'; });\n        keys += '<span></span><button type=\"button\" data-k=\"0\">0</button><button type=\"button\" class=\"dbk-lock-del\" data-k=\"del\" aria-label=\"Delete\">' + ICON_DEL + '</button>';\n        el.innerHTML = '<form class=\"dbk-lock-box dbk-lock-code\" autocomplete=\"off\"><h1></h1><div class=\"dbk-lock-main\">' +\n          '<p class=\"dbk-lock-lead\">Enter your code</p>' +\n          '<div class=\"dbk-lock-dotsw\">' + dots + '<input type=\"password\" id=\"dbkLockPw\" class=\"dbk-lock-codein\" inputmode=\"numeric\" pattern=\"[0-9]*\" autocomplete=\"off\" maxlength=\"' + len + '\" aria-label=\"Your code\"></div>' +\n          '<p class=\"dbk-lock-err\" role=\"alert\"></p>' +\n          '<div class=\"dbk-lock-pad\">' + keys + '</div>' +\n          '<button type=\"button\" class=\"dbk-lock-forgot\">Forgot code?</button>' + help + '</div><div class=\"dbk-lock-reset\"></div></form>';\n      } else {\n        el.innerHTML = '<form class=\"dbk-lock-box\" autocomplete=\"on\"><h1></h1><div class=\"dbk-lock-main\"><p>Enter your app password</p>' +\n          '<input type=\"password\" id=\"dbkLockPw\" placeholder=\"App password\" autocomplete=\"current-password\" aria-label=\"App password\">' +\n          '<button type=\"submit\">Unlock</button><button type=\"button\" class=\"dbk-lock-forgot\">Forgot it?</button>' +\n          '<p class=\"dbk-lock-err\" role=\"alert\">That password isn\\u2019t right. Try again.</p>' + help +\n          '<p class=\"dbk-lock-note\">You can switch to a number code in Settings, App code.</p></div><div class=\"dbk-lock-reset\"></div></form>';\n      }\n      el.querySelector('h1').textContent = appName;\n      var inp = el.querySelector('#dbkLockPw'), err = el.querySelector('.dbk-lock-err'), busy = false;\n      var say = function (t) { err.textContent = t; if (!isCode) err.style.display = t ? 'block' : 'none'; };\n      var still = function (on) { inp.disabled = on; el.querySelectorAll('.dbk-lock-pad button, button[type=submit]').forEach(function (b) { b.disabled = on; }); };\n      // after 5 wrong tries: the pad and the box rest for 30 seconds (only the words change; nothing moves)\n      var resting = function () {\n        var left = waitLeft(); if (!left) return false;\n        still(true); say('Too many tries. Wait ' + Math.ceil(left / 1000) + ' seconds, then try again.');\n        clearTimeout(el._rest); el._rest = setTimeout(function () { still(false); say(''); if (finePointer()) try { inp.focus({ preventScroll: true }); } catch (e) {} }, left + 50);\n        return true;\n      };\n      el._resting = resting;\n      var paint = function () { var n = inp.value.length; el.querySelectorAll('.dbk-lock-dot').forEach(function (dt, i) { dt.classList.toggle('on', i < n); }); };\n      var tryIt = async function () {\n        if (busy || resting()) return;\n        busy = true; var v = inp.value, ok = false;\n        try { ok = await checkPassword(v); } catch (e) {}\n        busy = false;\n        if (ok) { rightTry(); say(''); markLoggedIn(); hideLock(); inp.value = ''; paint(); return; }\n        inp.value = ''; paint();\n        if (wrongTry()) resting(); else say(isCode ? 'That code isn\\u2019t right.' : 'That password isn\\u2019t right. Try again.');\n        if (!isCode || finePointer()) try { inp.focus({ preventScroll: true }); } catch (e) {}\n      };\n      if (isCode) {\n        inp.addEventListener('input', function () {\n          var v = inp.value.replace(/\\D/g, '').slice(0, len); if (v !== inp.value) inp.value = v;\n          if (v && err.textContent && !waitLeft()) say('');\n          paint(); if (v.length === len) tryIt();\n        });\n        // a finger presses a key the moment it touches it (Kasey, Oct 25: \"I had to touch numbers multiple times to get\n        // them to take\"): waiting for the click lost quick taps (the phone holds a click back after a tap, and the app's\n        // tap-while-scrolling guard dropped some). The click that follows a touch is then ignored; a mouse uses the click.\n        var pad = el.querySelector('.dbk-lock-pad'), touchAt = 0;\n        var press = function (b) {\n          if (!b || b.disabled || busy) return;\n          var k = b.getAttribute('data-k');\n          if (k === 'del') inp.value = inp.value.slice(0, -1);\n          else if (inp.value.length < len) inp.value += k;\n          inp.dispatchEvent(new Event('input'));\n          // a mouse: keep typing with the keyboard too; a finger: the pad stays, the phone's keyboard stays down\n          if (finePointer()) try { inp.focus({ preventScroll: true }); } catch (x) {}\n        };\n        pad.addEventListener('pointerdown', function (e) {\n          if (e.pointerType === 'mouse') return;\n          var b = e.target.closest('button[data-k]'); if (!b) return;\n          e.preventDefault(); touchAt = Date.now(); press(b);\n          b.classList.add('dbk-lock-hit'); setTimeout(function () { b.classList.remove('dbk-lock-hit'); }, 140);\n        });\n        pad.addEventListener('click', function (e) {\n          if (Date.now() - touchAt < 800) { e.preventDefault(); return; }   // the click after a touch: already pressed\n          press(e.target.closest('button[data-k]'));\n        });\n        // typing on a keyboard anywhere on the screen counts (not only in the box)\n        el.addEventListener('keydown', function (e) {\n          if (e.target === inp || (e.target.closest && e.target.closest('.dbk-lock-reset')) || inp.disabled) return;\n          if (/^[0-9]$/.test(e.key)) { e.preventDefault(); if (inp.value.length < len) { inp.value += e.key; inp.dispatchEvent(new Event('input')); } }\n          else if (e.key === 'Backspace') { e.preventDefault(); inp.value = inp.value.slice(0, -1); inp.dispatchEvent(new Event('input')); }\n        });\n      }\n      el.querySelector('form').addEventListener('submit', function (ev) { ev.preventDefault(); if (!isCode || inp.value.length === len) tryIt(); });\n      el.querySelector('.dbk-lock-forgot').addEventListener('click', function () {\n        var a = window.dbkAuth, u = a && a.user && a.user();\n        if (u && u.email) lockReset(el, a, u); else el.querySelector('.dbk-lock-help').style.display = 'block';\n      });\n      document.body.appendChild(el);\n      }\n    }\n    el.style.display = 'flex';\n    document.documentElement.classList.add('dbk-locked');\n    if (el._resting) el._resting();\n    // the page's own old lock screen stays hidden (the Meals page's sign-in screen is left alone)\n    var old = document.getElementById('passwordScreen'), em = document.getElementById('loginEmail');\n    if (old && (!em || em.style.display === 'none')) old.style.display = 'none';\n    // a code on a phone: the pad is the keyboard (the phone's own keyboard comes up only when the dots are tapped)\n    var wantFocus = el.getAttribute('data-mode').indexOf('pw') === 0 || finePointer();\n    try { if (wantFocus && (!window.frameElement || window.frameElement.classList.contains('on'))) setTimeout(function () { var i = document.getElementById('dbkLockPw'); if (i && !i.disabled && i.offsetParent) i.focus({ preventScroll: true }); }, 50); } catch (e) {}\n  }\n  function finePointer() { try { return window.matchMedia('(pointer: fine)').matches; } catch (e) { return false; } }\n  // Forgot the code: the person's own sign-in password (their account, checked by Firebase) proves it's them,\n  // then they choose a new code of their own (or turn theirs off). Forgot that too: a link to set a new one.\n  function lockReset(el, a, u) {\n    var box = el.querySelector('.dbk-lock-reset'), main = el.querySelector('.dbk-lock-main');\n    main.style.display = 'none';\n    var say = function (e) { return window.dbkAccount ? window.dbkAccount.say(e, 'lock') : (e && e.code === 'auth/network-request-failed' ? 'No connection. Try again when you have signal.' : 'That isn\\u2019t your sign-in password.'); };\n    var step1 = function () {\n      box.innerHTML = '<p>Type the password you sign in with (' + escHtml(u.email) + '). Then you can choose a new code. Forgot that too? We can email you a link to set a new one.</p>' +\n        '<input type=\"password\" class=\"dbk-lock-signpw\" placeholder=\"Sign-in password\" autocomplete=\"current-password\" aria-label=\"Sign-in password\">' +\n        '<div class=\"dbk-lock-acts\"><button type=\"button\" class=\"dbk-lock-ol\" data-l=\"back\">Back</button><button type=\"button\" data-l=\"check\">Continue</button></div>' +\n        '<div class=\"dbk-lock-acts\"><button type=\"button\" class=\"dbk-lock-ol\" data-l=\"mail\">Email me a link</button></div>' +\n        '<p class=\"dbk-lock-msg\" role=\"alert\"></p>';\n      box.style.display = 'block';\n      var i = box.querySelector('input'); try { i.focus(); } catch (e) {}\n      i.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); box.querySelector('[data-l=check]').click(); } });\n    };\n    var num = function (cls, ph) { return '<input type=\"password\" class=\"' + cls + '\" inputmode=\"numeric\" pattern=\"[0-9]*\" maxlength=\"6\" autocomplete=\"off\" placeholder=\"' + ph + '\" aria-label=\"' + ph + '\">'; };\n    var step2 = function () {\n      box.innerHTML = '<p>Choose a new code: 4 to 6 numbers.' + (twoPeople() ? '<br>It\\u2019s only for you.' : '') + '</p>' +\n        num('dbk-lock-n1', 'New code') + num('dbk-lock-n2', 'New code again') +\n        '<div class=\"dbk-lock-acts\"><button type=\"button\" class=\"dbk-lock-ol\" data-l=\"off\">Turn my code off</button><button type=\"button\" data-l=\"save\">Save and open</button></div>' +\n        '<p class=\"dbk-lock-msg\" role=\"alert\"></p>';\n      try { box.querySelector('input').focus(); } catch (e) {}\n      box.querySelectorAll('input').forEach(function (x) { x.addEventListener('keydown', function (e) { if (e.key === 'Enter') { e.preventDefault(); box.querySelector('[data-l=save]').click(); } }); });\n    };\n    var msg = function (t) { var m = box.querySelector('.dbk-lock-msg'); if (m) m.textContent = t; };\n    var back = function () { box.innerHTML = ''; box.style.display = 'none'; main.style.display = ''; };\n    var done = function (key) {\n      rightTry();\n      try { if (window.dbkSettings && key && key !== 'private') window.dbkSettings.save([key]); } catch (e) {}\n      markLoggedIn(); hideLock();\n      back(); // the normal lock screen for next time (drawn again if the code changed)\n    };\n    box.onclick = async function (e) {\n      var b = e.target.closest('[data-l]'); if (!b) return;\n      var w = b.getAttribute('data-l');\n      if (w === 'back') { back(); return; }\n      if (w === 'mail') { b.disabled = true; try { await a.sendReset(u.email); msg('Sent to ' + u.email + '. Set a new sign-in password from the link, then come back and use it here.'); } catch (er) { msg(say(er)); } b.disabled = false; return; }\n      if (w === 'check') {\n        var pw = box.querySelector('.dbk-lock-signpw').value; if (!pw) { msg('Type your sign-in password.'); return; }\n        b.disabled = true; msg('');\n        try { await a.reauth(pw); step2(); } catch (er) { b.disabled = false; msg(say(er)); }\n        return;\n      }\n      if (w === 'off') { var ko = clearCode(); if (!ko) { msg('That didn\\u2019t work. Try again.'); return; } done(ko); return; }\n      if (w === 'save') {\n        var n1 = box.querySelector('.dbk-lock-n1').value, n2 = box.querySelector('.dbk-lock-n2').value;\n        if (!window.dbkCode.valid(n1)) { msg(/\\D/.test(n1) ? 'Use numbers only.' : 'Use 4 to 6 numbers.'); return; }\n        if (n1 !== n2) { msg('The two codes don\\u2019t match.'); return; }\n        b.disabled = true;\n        var ks = ''; try { ks = setCode(await window.dbkCode.make(n1)); } catch (er) { b.disabled = false; msg((er && er.message) || 'That didn\\u2019t work. Try again.'); return; }\n        if (!ks) { b.disabled = false; msg('That didn\\u2019t work. Try again.'); return; }\n        done(ks);\n      }\n    };\n    step1();\n  }\n  function hideLock() {\n    var el = document.getElementById('dbkLock'); if (el) el.style.display = 'none';\n    if (document.documentElement.classList.contains('dbk-locked')) {\n      document.documentElement.classList.remove('dbk-locked');\n      var old = document.getElementById('passwordScreen'), em = document.getElementById('loginEmail');\n      if (old && old.style.display !== 'none' && (!em || em.style.display === 'none')) { old.style.display = 'none'; document.body.style.overflow = ''; }\n    }\n  }\n  // the 4 hours can run out while the app sits open in the background or on the table: checked on coming back and\n  // every minute; a tap or a key counts as using it (only while unlocked, so the lock screen's own taps never unlock)\n  document.addEventListener('visibilitychange', function () { if (document.visibilityState === 'visible') lockCheck(); });\n  setInterval(function () { if (document.visibilityState === 'visible') lockCheck(); }, 60000);\n  ['pointerdown', 'keydown'].forEach(function (t) { document.addEventListener(t, function () { try { if (lockOn() && localStorage.getItem('hh_login_ts')) lockCheck(); } catch (e) {} }, { capture: true, passive: true }); });\n\n  // Per-page and per-hub appearance overrides are stored but no longer change the look:\n  // colors and fonts come from shared.css (templates and the color picker live there)\n  function getPageOverride(pageId) { try { return JSON.parse(localStorage.getItem('pageAppearance_' + pageId) || '{}'); } catch (e) { return {}; } }\n  function setPageOverride(pageId, data) { try { localStorage.setItem('pageAppearance_' + pageId, JSON.stringify(data)); } catch (e) {} }\n\n  window.HH = {\n    appName: appName, names: names,\n    accentColor: ac, secondaryColor: sc, bgColor: bc, fontFamily: ff, headingFont: hf, fontSize: fs, textBrightness: 0,\n    person1Color: 'raspberry', person2Color: 'blush', person1Hex: ACCENT_HEX.raspberry, person2Hex: ACCENT_HEX.blush,\n    ACCENT_HEX: ACCENT_HEX, ACCENT_LABELS: ACCENT_LABELS, DEFAULT_SEC: DEFAULT_SEC, BG_MAP: BG_MAP, BG_DK_MAP: BG_DK_MAP, BG_META: BG_META, BG_LABELS: BG_LABELS, TEXT_MAP: TEXT_MAP, FONT_MAP: FONT_MAP, FONT_URLS: FONT_URLS,\n    bgIsLight: false, // the meal planner reads this as a flag: its base palette is a dark one\n    getName: function (p) { return p === 1 || p === 'person1' ? names.name1 : names.name2; },\n    escHtml: escHtml,\n    isLoggedIn: isLoggedIn, markLoggedIn: markLoggedIn, // the Meals page calls login() when the Firebase sign-in comes back; that is not the app password, so it never\n    // opens a locked app (the Meals page loads in the background, so it used to unlock every page)\n    login: function () { if (!lockOn()) markLoggedIn(); }, logout: logout, checkPassword: checkPassword, hashString: hashString,\n    // the app code (Settings > App code), this person's: is one set, how many numbers, save a new one (dbkCode.make's\n    // result) or turn it off (both return the setting saved, '' if this phone doesn't know who it is yet), which person\n    hasCode: function () { return !!curCode(); }, codeLength: function () { var p = window.dbkCode.parse(curCode()); return p ? p.len : 0; }, setCode: setCode, clearCode: clearCode,\n    hasOldPassword: function () { return !!curPassword(); }, codeWaiting: function () { var l = curLock(); return !!(l && l.kind === 'wait'); }, codeCheckNow: function () { codeSync(); }, codeRole: lockRole, codeTries: { left: waitLeft, wrong: wrongTry, right: rightTry },\n    lighten: lighten, darken: darken, h2r: h2r, rgbStr: rgbStr, luminance: luminance, contrastRatio: contrastRatio, ensureContrast: ensureContrast,\n    textOnColor: textOnColor, boostText: boostText, boostRgba: boostRgba,\n    getPageOverride: getPageOverride, setPageOverride: setPageOverride, applyPageOverride: function () {}, applyOverrideObj: function () {},\n    applyHubOverride: function () {}, getHubOverride: function (n) { try { return JSON.parse(localStorage.getItem('person' + n + 'Appearance') || '{}'); } catch (e) { return {}; } }\n  };\n  // this person's app lock as stored (their code's hash, or an older text password's), read fresh. Older code reads\n  // it only to know whether the app is locked.\n  Object.defineProperty(window.HH, 'password', { get: function () { return curCode() || curPassword(); }, enumerable: true });\n  window.HearthSettings = window.LifeHubSettings = { current: window.HH, accentHexMap: ACCENT_HEX, defaultSecMap: DEFAULT_SEC, getName: window.HH.getName };\n  window.escHtml = escHtml;\n  window.dbkJsStr = dbkJsStr; window.dbkJsArg = dbkJsArg;\n\n})();\n\n/* ── Household settings sync: each setting is saved on its own, with the time it was changed ──\n   settings/global.kv = { <setting>: { v: <the value as this phone stores it, or null when removed>, at: <ms> } }.\n   When two phones disagree, the newer change wins for that one setting, so a phone that saves\n   (or opens a page that pushes everything it has) can't put back older names, a removed password,\n   or someone else's choices. The plain fields next to kv (settings/global.userNames and so on) are\n   still written so older code that reads them (the Meals page, first sign-in on a new phone) keeps\n   working; this code only trusts kv.\n   This phone keeps 'dbkSettingsSync': the value and time of each setting as it last agreed with the\n   cloud. A setting whose value no longer matches it was changed here, and is sent up with the time\n   it was noticed. Loaded on every page; it starts once Firebase is signed in. */\n(function () {\n  if (window.dbkSettings) return;\n  var HOUSE = window.DBK_SETTINGS_KEYS || [];\n  // the meal planner's choices (set on the Meals page); kept in the same document\n  var MEALS = ['mealplan_hate_p1', 'mealplan_hate_p2', 'mealplan_spice_p1', 'mealplan_spice_p2', 'mealplan_skill', 'mealplan_budget',\n    'mealplan_equipment', 'mealplan_settings', 'mealplan_diet_reminders_v2', 'mealplan_goals', 'mealplan_notrack', 'deletedRecipeNames', 'mealShareTwo',\n    'showKids', 'kidProfiles', 'mealplan_pantry_staples'];  // the last three are set in Settings > Meals too\n  var KEYS = HOUSE.concat(MEALS.filter(function (k) { return HOUSE.indexOf(k) === -1; }));\n  window.DBK_SETTINGS_SYNCED = KEYS;\n  var BASE = 'dbkSettingsSync';\n  var last = null;          // the cloud copy last seen\n  var recent = [];          // the plain fields of the last few cloud copies (to spot old code copying them back)\n  var started = false;\n\n  function get(k) { try { return localStorage.getItem(k); } catch (e) { return null; } }\n  function put(k, v) { if (k === 'weekStart' && window.dbkWeekStartNum) v = window.dbkWeekStartNum(v); try { if (v === null || v === undefined) localStorage.removeItem(k); else localStorage.setItem(k, v); } catch (e) {} }\n  function plain(v) { return v === undefined ? undefined : v === null ? null : typeof v === 'object' ? JSON.stringify(v) : String(v); }\n  // (Nov 1 review: a time that can't be real, not a number or more than 2 days ahead of this clock, counts as no time, so a\n  // copy saved with a forged far-future time can't hold a setting against every later change)\n  function ts(v) { if (typeof v === 'string') v = new Date(v).getTime() || parseInt(v, 10); v = +v || 0; return isFinite(v) && v <= Date.now() + 2 * 864e5 ? v : 0; }\n  function loadBase() { try { var b = JSON.parse(get(BASE) || 'null'); return b && typeof b === 'object' ? b : null; } catch (e) { return null; } }\n  function saveBase(b) { try { localStorage.setItem(BASE, JSON.stringify(b)); } catch (e) {} }\n  function kvOf(remote) { var kv = remote && remote.kv; return kv && typeof kv === 'object' ? kv : {}; }\n  // Each person's own settings: their Sharing choices and their app code (person1's also the household's older code and\n  // password). This phone never sends the other person's (security audit, Oct 31; the rules don't check settings/global\n  // key by key, so nothing stops a login that tries: the person's own phone and the server trust each person's own\n  // place for these, own_appcode_ / own_sharing_<person>, Nov 1). The other person's always come from the cloud, and\n  // while this phone hasn't confirmed who is signed in it sends neither person's (they wait, and go once it has).\n  var OWN = { person1: ['dbkKeep_person1', 'dbkPriv_person1', 'appCode_person1', 'appCode', 'password'], person2: ['dbkKeep_person2', 'dbkPriv_person2', 'appCode_person2'] };\n  function whoHere() {\n    var r = get('myPersonRole'), u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n    return (r === 'person1' || r === 'person2') && u && u.uid && get('dbkRoleUid') === u.uid ? r : null;\n  }\n  // the keys this phone must not send now; theirs: only the other person's (confirmed), else null\n  function heldKeys() { var me = whoHere(); return me ? OWN[me === 'person1' ? 'person2' : 'person1'] : OWN.person1.concat(OWN.person2); }\n  function theirKeys() { var me = whoHere(); return me ? OWN[me === 'person1' ? 'person2' : 'person1'] : null; }\n  // Settings that are a list both of one person's devices add to (dinner reminders, meal-notes.js): newest-wins for the\n  // whole list lost one device's addition when both saved close together (overnight audit, Oct 23). They are joined\n  // item by item instead: by id, the newer of each (its `at`, or `gone` for one taken off, kept 14 days so an older copy\n  // can't bring it back). The result is the same text on every device, so they settle.\n  function joinNotes(a, b) {\n    var pa = [], pb = []; try { pa = JSON.parse(a || '[]'); } catch (e) {} try { pb = JSON.parse(b || '[]'); } catch (e) {}\n    if (!Array.isArray(pa)) pa = []; if (!Array.isArray(pb)) pb = [];\n    var by = {}, tm = function (n) { return +(n.gone || n.at || 0); }, cut = Date.now() - 14 * 864e5, cd = new Date(cut);\n    var dcut = cd.getFullYear() + '-' + ('0' + (cd.getMonth() + 1)).slice(-2) + '-' + ('0' + cd.getDate()).slice(-2);\n    pa.concat(pb).forEach(function (n) { if (!n || !n.id) return; var o = by[n.id]; if (!o || tm(n) > tm(o) || (tm(n) === tm(o) && JSON.stringify(n) > JSON.stringify(o))) by[n.id] = n; });\n    return JSON.stringify(Object.keys(by).sort().map(function (k) { return by[k]; }).filter(function (n) { return n.gone ? n.gone > cut : !(n.day && n.day < dcut); }));\n  }\n  // Meal goals (mealplan_goals) hold BOTH people's goals in one setting. Newest-wins for the whole thing let one phone's\n  // old copy (it hadn't heard the other person's goals yet, or Meals put back an older saved copy) go up as the newest\n  // and take the other person's goals away (Kasey, Oct 25: Charlie's portion came out smaller than hers). Joined person\n  // by person: the one saved last (`at`, put on every save since Oct 25) wins; with no times, goals beat no goals,\n  // else b (the cloud's copy) stays.\n  function joinGoals(a, b) {\n    var pa = {}, pb = {}; try { pa = JSON.parse(a || '{}') || {}; } catch (e) {} try { pb = JSON.parse(b || '{}') || {}; } catch (e) {}\n    if (typeof pa !== 'object' || Array.isArray(pa)) pa = {}; if (typeof pb !== 'object' || Array.isArray(pb)) pb = {};\n    var has = function (g) { return !!(g && typeof g === 'object' && (String(g.calories || '').trim() || String(g.protein || '').trim())); };\n    var out = {};\n    Object.keys(pb).concat(Object.keys(pa)).forEach(function (k) {\n      if (out.hasOwnProperty(k)) return;\n      var x = pa[k], y = pb[k];\n      if (k !== 'person1' && k !== 'person2') { out[k] = y !== undefined ? y : x; return; }\n      if (x === undefined || x === null) { out[k] = y; return; }\n      if (y === undefined || y === null) { out[k] = x; return; }\n      var tx = +(x && x.at) || 0, ty = +(y && y.at) || 0;\n      if (tx || ty) out[k] = tx > ty ? x : y;\n      else out[k] = has(x) && !has(y) ? x : y;\n    });\n    var o2 = {}; ['person1', 'person2'].concat(Object.keys(out).sort()).forEach(function (k) { if (out.hasOwnProperty(k) && !o2.hasOwnProperty(k) && out[k] !== undefined) o2[k] = out[k]; });\n    return JSON.stringify(o2);\n  }\n  function joinFor(k) { return /^dbkMealNotes_person[12]$/.test(k) ? joinNotes : k === 'mealplan_goals' ? joinGoals : null; }\n  window.dbkJoinNotes = joinNotes;\n  window.dbkJoinGoals = joinGoals;\n\n  // First time on this phone with this code: decide each setting from the old whole-document times\n  function firstBase(remote) {\n    var base = {}, kv = kvOf(remote), localTs = ts(get('_settingsLastSaved')), remoteTs = ts(remote && remote._lastUpdated);\n    KEYS.forEach(function (k) {\n      var v = get(k), r = kv[k], f = remote ? plain(remote[k]) : undefined;\n      if (r) {\n        // another phone already keeps per-setting times: trust those (the old whole-document time on this\n        // phone is moved forward by any page that pushes everything, so it can't tell which is newer)\n        base[k] = v === r.v ? { v: v, at: ts(r.at) } : { v: v, at: 0 };\n      } else if (f !== undefined && f !== null && f !== v && !(v !== null && localTs >= remoteTs)) {\n        put(k, f); base[k] = { v: f, at: remoteTs || 1, p: 1 };  // the cloud's plain field is newer\n      } else if (v !== null) {\n        base[k] = { v: v, at: (v === f ? remoteTs : localTs) || Date.now(), p: 1 };\n      }\n    });\n    return base;\n  }\n\n  // what this phone changed since it last agreed with the cloud; returns the settings it put back\n  // mine: the settings the person has just changed on this phone (Settings > What shows and the like). Those are\n  // never taken for old code copying a cloud value back: switching a setting back to what it was a minute ago\n  // matched an older cloud copy, so the switch jumped straight back while \"Saved\" showed (Do it together, Oct 22).\n  function stamp(base, changed, mine) {\n    var now = Date.now(), kv = kvOf(last), back = [];\n    KEYS.forEach(function (k) {\n      var v = get(k), b = base[k];\n      if (b ? b.v === v : v === null) return;\n      // older page code copied a plain field from the cloud over a household setting that kv already\n      // has newer: that is not a change made on this phone, so the kv value goes back\n      var r = kv[k];\n      if (r && HOUSE.indexOf(k) !== -1 && v !== r.v && (!b || b.v === r.v) && !(mine && mine.indexOf(k) !== -1) && recent.some(function (d) { return v === plain(d[k]); })) {\n        put(k, r.v); base[k] = { v: r.v, at: ts(r.at) }; back.push(k); return;\n      }\n      base[k] = { v: v, at: now, p: 1 };\n      if (changed) changed.push(k);\n    });\n    return back;\n  }\n\n  function announce(keys) {\n    // pages listen for 'storage' events; this window doesn't get one for its own writes, so it is sent here too\n    keys.forEach(function (k) { try { window.dispatchEvent(new StorageEvent('storage', { key: k, newValue: get(k) })); } catch (e) {} });\n    try { window.dispatchEvent(new CustomEvent('dbk-settings', { detail: { keys: keys } })); } catch (e) {}\n  }\n\n  function merge(remote) {\n    if (remote) {\n      last = remote;\n      var f = {}; HOUSE.forEach(function (k) { f[k] = remote[k]; }); recent.push(f); if (recent.length > 6) recent.shift();\n    }\n    var base = loadBase(), took = [];\n    if (!base) base = firstBase(last || {}); else took = stamp(base);\n    var kv = kvOf(last), out = {}, mirror = {}, fi = window.firestoreImports || {}, theirs = theirKeys();\n    KEYS.forEach(function (k) {\n      var b = base[k], r = kv[k];\n      if (r && typeof r !== 'object') r = null;\n      var rv = r ? (r.v === undefined ? null : r.v) : null;\n      if (theirs && theirs.indexOf(k) !== -1) {\n        // the other person's own: the cloud's copy is theirs, this phone only takes it\n        if (r) { if (get(k) !== rv) { put(k, rv); took.push(k); } base[k] = { v: rv, at: ts(r.at) }; }\n        else if (b && b.p) delete b.p;\n        return;\n      }\n      var jf = joinFor(k), cur = get(k);\n      if (jf && r && rv !== cur) {\n        // a list joined item by item: what only this device has stays and goes up, what the cloud has comes here\n        var mv = jf(cur, rv);\n        if (mv === rv) { put(k, rv); took.push(k); base[k] = { v: rv, at: ts(r.at) }; return; }\n        if (mv !== cur) { put(k, mv); took.push(k); }\n        var jat = Math.max(Date.now(), ts(r.at) + 1, b ? ts(b.at) : 0);\n        base[k] = { v: mv, at: jat, p: 1 }; out[k] = { v: mv, at: jat }; return;\n      }\n      if (r && (!b || ts(r.at) > ts(b.at))) {\n        if (get(k) !== rv) { put(k, rv); took.push(k); }\n        base[k] = { v: rv, at: ts(r.at) };\n      } else if (b && b.p && r && ts(r.at) === ts(b.at) && rv === b.v) {\n        delete b.p;                                             // already in the cloud\n      } else if (b && (b.p || !r)) {\n        if (b.v !== null || r) out[k] = { v: b.v, at: b.at };\n      } else if (b && r && ts(b.at) > ts(r.at) && b.v !== rv) {\n        // the cloud went back to an older change: another phone's save made offline arrived after this phone's newer one\n        // (an offline write lands blindly when the phone is back). This phone has the newer one: it goes up again\n        // (overnight audit, Oct 24: both phones showed one choice and the cloud kept the older, for any new sign-in)\n        out[k] = { v: b.v, at: b.at };\n      } else if (r && HOUSE.indexOf(k) !== -1 && plain(last[k]) !== (rv === null ? undefined : rv) && (rv !== null || fi.deleteField)) {\n        mirror[k] = rv;                                         // put the plain copy for older code right again\n      }\n    });\n    saveBase(base);\n    // the older Meals code compares this time before copying plain fields over this phone's settings\n    var rt = ts(last && last._lastUpdated);\n    if (rt && rt > ts(get('_settingsLastSaved'))) put('_settingsLastSaved', String(rt));\n    if (took.length) announce(took);\n    if (Object.keys(out).length || Object.keys(mirror).length) return write(out, mirror);\n    return Promise.resolve();\n  }\n\n  function write(out, mirror) {\n    var fi = window.firestoreImports;\n    if (!window.firebaseReady || !window.db || !fi || window.firebaseConfigEmpty) return Promise.resolve();\n    var held = heldKeys();\n    out = Object.assign({}, out); mirror = Object.assign({}, mirror || {});\n    held.forEach(function (k) { delete out[k]; delete mirror[k]; });\n    if (!Object.keys(out).length && !Object.keys(mirror).length) return Promise.resolve();\n    var now = Date.now(), data = { _lastUpdated: now }, kv = {};\n    function flat(k, v) { if (v === null) { if (fi.deleteField) data[k] = fi.deleteField(); } else data[k] = v; }\n    Object.keys(out).forEach(function (k) { kv[k] = { v: out[k].v, at: out[k].at }; flat(k, out[k].v); });\n    Object.keys(mirror || {}).forEach(function (k) { flat(k, mirror[k]); });\n    if (Object.keys(kv).length) data.kv = kv;\n    return fi.setDoc(fi.doc(window.db, 'settings', 'global'), data, { merge: true }).then(function () {\n      put('_settingsLastSaved', String(now));\n      var base = loadBase() || {};\n      Object.keys(out).forEach(function (k) { var b = base[k]; if (b && b.v === out[k].v && b.at === out[k].at) delete b.p; });\n      saveBase(base);\n    }).catch(function (e) { try { console.log('Settings sync failed:', e); } catch (x) {} });\n  }\n\n  function start() {\n    if (started || !window.firebaseReady || !window.db || !window.firestoreImports || window.firebaseConfigEmpty) return;\n    started = true;\n    var fi = window.firestoreImports, ref = fi.doc(window.db, 'settings', 'global');\n    try {\n      fi.onSnapshot(ref, function (snap) { if (!cacheOnly(snap)) merge(snap.exists() ? snap.data() : {}); }, function () { started = false; });\n      // (sixth review) the listener answers from the phone's cache first and, on real Firestore, says nothing more when the\n      // cloud's copy is the same, so it may never tell this page it heard the cloud itself: one read asks the cloud\n      // (window.dbkSettingsHeard, for the private mover in daybook-theme.js)\n      if (!window.dbkSettingsHeard && typeof fi.getDoc === 'function') Promise.resolve(fi.getDoc(ref)).then(function (snap) { if (!cacheOnly(snap)) merge(snap.exists() ? snap.data() : {}); }).catch(function () {});\n    } catch (e) {\n      started = false;\n      fi.getDoc(ref).then(function (snap) { if (!cacheOnly(snap)) merge(snap.exists() ? snap.data() : {}); }).catch(function () {});\n    }\n  }\n  // (Oct 31 review) with no signal the phone's cache can answer that the settings \"aren't there\" when it simply never read\n  // them: that's no answer at all. Taken for an empty cloud, a page opened offline sent every setting this phone holds,\n  // stamped now, and on reconnect put an older choice back over the other phone's newer one. The cloud's answer comes later.\n  // (fifth review, slice C) window.dbkSettingsHeard: this page has had the household's settings from the cloud itself\n  // (dbk-theme's private mover needs to know the other person's choices, not guess them from nothing)\n  function cacheOnly(snap) { if (snap && !(snap.metadata && snap.metadata.fromCache)) window.dbkSettingsHeard = Date.now(); return !!snap && !snap.exists() && !!(snap.metadata && snap.metadata.fromCache); }\n  window.addEventListener('firebaseReady', start);\n  // once this phone knows who is signed in, its own settings held back meanwhile (heldKeys) go up\n  window.addEventListener('dbkRoleOk', function () { if (last) setTimeout(function () { merge(null); }, 0); });\n\n  window.dbkSettings = {\n    keys: KEYS,\n    // read the cloud's settings now, once (just signed in: the names and the look are on this phone before Today is\n    // built, so Today never shows the copy's own names or another look first and then changes; dbk-frame.js dbkSignedInGo)\n    pull: function () {\n      var fi = window.firestoreImports; if (!window.db || !fi || !fi.getDoc) return Promise.resolve();\n      return Promise.resolve(fi.getDoc(fi.doc(window.db, 'settings', 'global'))).then(function (snap) { if (!cacheOnly(snap)) merge(snap.exists() ? snap.data() : {}); }).catch(function () {});\n    },\n    // call after changing any of the settings above on this phone; keys (optional): the ones the person just changed\n    save: function (keys) {\n      var base = loadBase();\n      // this page changed them, so it gets no 'storage' event of its own: tell it too (names repaint, etc.)\n      var mine = [];\n      if (base) { var back = stamp(base, mine, Array.isArray(keys) ? keys : null); saveBase(base); if (back.length || mine.length) announce(back.concat(mine)); }\n      else put('_settingsLastSaved', String(Date.now()));\n      if (!last) { start(); return Promise.resolve(); }\n      return merge(null);\n    },\n    start: start\n  };\n})();\n\n/* ── lhToast and lhConfirm: a short notice at the bottom of the screen, and a yes/no question ── */\n    (function() {\n    // ─── Toast Notification System ───\n    // Usage: lhToast('Saved!') or lhToast('Error occurred', 'error')\n    // Types: 'success' (default), 'error', 'warning', 'info'\n    var _toastStyleInjected = false;\n    var _toastContainer = null;\n\n    function _injectToastCSS() {\n        if (_toastStyleInjected) return;\n        _toastStyleInjected = true;\n        var css = document.createElement('style');\n        css.textContent =\n            '.dbk-notice{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(24px + env(safe-area-inset-bottom,0px));z-index:2147483000;display:flex;align-items:center;gap:14px;width:max-content;max-width:min(420px,calc(100vw - 32px));box-sizing:border-box;padding:10px 12px 10px 18px;border-radius:8px;background:var(--lh-bg-darker,#2a2320);color:var(--lh-text,#e8e0d4);border:1px solid rgba(var(--lh-accent-rgb,163,184,153),0.35);box-shadow:0 8px 28px rgba(0,0,0,0.35);font-family:var(--lh-font,system-ui);font-size:15px;line-height:1.35;text-align:left;-webkit-tap-highlight-color:transparent;}' +\n            '.dbk-notice.dbk-n-tap{cursor:pointer;}' +\n            '.dbk-n-msg{min-width:0;text-wrap:balance;}' +\n            '.dbk-n-sub{display:block;font-size:.85em;font-weight:400;margin-top:3px;}' +\n            '.dbk-notice .dbk-n-undo,.dbk-notice .lh-toast-undo,.dbk-notice .toast-undo{all:unset;box-sizing:border-box;flex:none;cursor:pointer;padding:6px 14px;margin:0;border:1.5px solid currentColor;border-radius:6px;font:inherit;font-weight:600;font-size:14px;line-height:1.2;white-space:nowrap;color:inherit;text-decoration:none;}' +\n            '.dbk-n-x{all:unset;flex:none;cursor:pointer;padding:2px 4px;font-size:20px;line-height:1;opacity:.75;color:inherit;}' +\n            '.lh-toast-wrap{position:fixed;bottom:0;left:0;right:0;display:flex;flex-direction:column-reverse;align-items:center;pointer-events:none;z-index:2147483000;padding:0 16px 24px;padding-bottom:max(24px,var(--dbk-safe-bottom, env(safe-area-inset-bottom,24px)));}' +\n            '.lh-toast{pointer-events:auto;max-width:420px;width:100%;padding:14px 20px;border-radius:12px;font-family:var(--lh-font,var(--font-main,system-ui));font-size:0.9em;font-weight:500;line-height:1.4;box-shadow:0 8px 30px rgba(0,0,0,0.35);opacity:0;transform:translateY(12px);transition:opacity 0.25s ease,transform 0.25s ease;margin-top:8px;display:flex;align-items:flex-start;gap:10px;}' +\n            '.lh-toast.show{opacity:1;transform:translateY(0);}' +\n            '.lh-toast.hide{opacity:0;transform:translateY(-8px);}' +\n            '.lh-toast-icon{flex-shrink:0;margin-top:1px;}' +\n            '.lh-toast-msg{flex:1;min-width:0;}' +\n            '.lh-toast-close{flex-shrink:0;background:none;border:none;color:inherit;opacity:0.5;cursor:pointer;padding:2px 4px;font-size:1.1em;line-height:1;touch-action:manipulation;}' +\n            '.lh-toast-close:active{opacity:1;}' +\n            '.lh-toast-success{background:var(--lh-bg-darker,#1e2a1e);color:var(--lh-accent,var(--lh-accent));border:1px solid var(--lh-accent-border,rgba(var(--lh-accent-rgb),0.3));}' +\n            '.lh-toast-error{background:#2a1e1e;color:#e88b8b;border:1px solid rgba(232,139,139,0.3);}' +\n            '.lh-toast-warning{background:#2a261e;color:#e8c56b;border:1px solid rgba(232,197,107,0.3);}' +\n            '.lh-toast-info{background:var(--lh-bg-darker,#1e1e2a);color:var(--lh-text,var(--lh-text));border:1px solid var(--lh-accent-border,rgba(var(--lh-accent-rgb),0.2));}' +\n            /* Confirm modal */\n            '.lh-confirm-overlay{position:fixed;inset:0;background:rgba(0,0,0,0.55);z-index:100000;display:flex;align-items:center;justify-content:center;padding:20px;opacity:0;transition:opacity 0.2s ease;}' +\n            '.lh-confirm-overlay.show{opacity:1;}' +\n            '.lh-confirm-box{background:var(--lh-bg-darker,#262022);border:1px solid var(--lh-accent-border,rgba(var(--lh-accent-rgb),0.2));border-radius:16px;padding:28px 24px 20px;max-width:380px;width:100%;box-shadow:0 16px 50px rgba(0,0,0,0.5);transform:scale(0.95);transition:transform 0.2s ease;}' +\n            '.lh-confirm-overlay.show .lh-confirm-box{transform:scale(1);}' +\n            '.lh-confirm-msg{font-family:var(--lh-font,var(--font-main,system-ui));font-size:0.95em;color:var(--lh-text,var(--lh-text));line-height:1.5;margin-bottom:22px;text-align:center;}' +\n            '.lh-confirm-btns{display:flex;gap:10px;justify-content:center;}' +\n            '.lh-confirm-btn{padding:11px 24px;border-radius:10px;font-family:var(--lh-font,var(--font-main,system-ui));font-size:0.9em;font-weight:600;cursor:pointer;border:none;transition:opacity 0.15s;touch-action:manipulation;min-height:44px;min-width:90px;}' +\n            '.lh-confirm-btn:active{opacity:0.75;}' +\n            '.lh-confirm-cancel{background:rgba(var(--lh-text-rgb),0.08);color:var(--lh-text-muted,#a09090);}' +\n            '.lh-confirm-ok{background:var(--lh-accent,var(--lh-accent));color:var(--lh-bg-darker,#1c1c1c);}' +\n            '.lh-confirm-danger{background:#c45;color:#fff;}';\n        document.head.appendChild(css);\n    }\n\n    function _getToastContainer() {\n        if (_toastContainer && document.body.contains(_toastContainer)) return _toastContainer;\n        _toastContainer = document.createElement('div');\n        _toastContainer.className = 'lh-toast-wrap';\n        document.body.appendChild(_toastContainer);\n        return _toastContainer;\n    }\n\n    var TOAST_ICONS = {\n        success: '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M20 6L9 17l-5-5\"/></svg>',\n        error: '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"15\" y1=\"9\" x2=\"9\" y2=\"15\"/><line x1=\"9\" y1=\"9\" x2=\"15\" y2=\"15\"/></svg>',\n        warning: '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\"><path d=\"M10.29 3.86L1.82 18a2 2 0 001.71 3h16.94a2 2 0 001.71-3L13.71 3.86a2 2 0 00-3.42 0z\"/><line x1=\"12\" y1=\"9\" x2=\"12\" y2=\"13\"/><line x1=\"12\" y1=\"17\" x2=\"12.01\" y2=\"17\"/></svg>',\n        info: '<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.5\" stroke-linecap=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"/><line x1=\"12\" y1=\"16\" x2=\"12\" y2=\"12\"/><line x1=\"12\" y1=\"8\" x2=\"12.01\" y2=\"8\"/></svg>'\n    };\n\n    /**\n     * Show a toast notification\n     * @param {string} message - Text to display\n     * @param {string} type - 'success' | 'error' | 'warning' | 'info'\n     * @param {number} duration - Auto-dismiss in ms (0 = manual close only)\n     */\n    // ─── One message spot for the whole app ───\n    // Every short notice (saved, deleted + Undo, errors, \"not signed in\") shows here: one place at the\n    // bottom just above the capture bar, one at a time. A new one takes the old one's place.\n    // It stays while a finger or mouse is on it. With Undo, tapping anywhere on it undoes.\n    var N = { el: null, timer: 0, endAt: 0, left: 0, held: false, banner: null, rrAt: 0 };\n    function nEsc(t) { return String(t == null ? '' : t).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n    function nArm(el, ms) { clearTimeout(N.timer); N.endAt = Date.now() + ms; N.timer = setTimeout(function () { nHide(el); }, ms); }\n    function nHide(el) {\n        if (!el || el !== N.el) return;\n        clearTimeout(N.timer); N.timer = 0; N.held = false;\n        if (el.parentNode) el.parentNode.removeChild(el);\n        N.el = null;\n        // a standing note (like \"not signed in\") comes back once the short one is gone\n        if (N.banner && !el._banner) setTimeout(function () { if (!N.el && N.banner) nBannerShow(); }, 0);\n    }\n    function nShow(msg, opts) {\n        // a pop-up of this page opened over another page (Work opening Today's forms): its messages, Undo too, show on\n        // the page underneath, the one on screen\n        try { var to = window.dbkNoticeTo && window.dbkNoticeTo(); if (to && to !== window && to.dbkNotice) return to.dbkNotice(msg, opts); } catch (e) {}\n        _injectToastCSS();\n        opts = opts || {};\n        if (N.el && N.el.parentNode) N.el.parentNode.removeChild(N.el);\n        clearTimeout(N.timer); N.held = false;\n        var html = opts.html ? String(msg) : nEsc(msg);\n        var hasUndo = !!opts.undo || /lh-toast-undo|toast-undo/.test(html);\n        var dur = opts.duration;\n        if (dur === undefined) dur = hasUndo ? 5000 : (opts.kind === 'error' ? 5000 : 3000);\n        if (hasUndo && dur > 0) dur = 5000;   // time to change your mind: always 5 seconds, whatever else is tapped (the designer)\n        var el = document.createElement('div');\n        el.className = 'dbk-notice' + (opts.kind === 'error' ? ' dbk-n-error' : '') + (hasUndo ? ' dbk-n-tap' : '');\n        el.id = 'dbkNotice';\n        el.setAttribute('role', 'status'); el.setAttribute('aria-live', 'polite');\n        el.innerHTML = '<span class=\"dbk-n-msg\">' + html + '</span>';\n        if (opts.undo) {\n            var u = document.createElement('button'); u.type = 'button'; u.className = 'dbk-n-undo'; u.textContent = 'Undo';\n            var f = opts.undo;\n            u.addEventListener('click', function (e) { e.stopPropagation(); if (!f) return; var g = f; f = null; nHide(el); try { g(); } catch (x) {} });\n            el.appendChild(u);\n        }\n        if (opts.action) {\n            var a = document.createElement('a'); a.className = 'dbk-n-undo'; a.textContent = opts.action.label; a.href = opts.action.href || '#';\n            if (opts.action.onClick) a.addEventListener('click', function (e) { e.preventDefault(); opts.action.onClick(); });\n            el.appendChild(a);\n        }\n        if (opts.close) {\n            var x = document.createElement('button'); x.type = 'button'; x.className = 'dbk-n-x'; x.setAttribute('aria-label', 'Dismiss'); x.innerHTML = '&times;';\n            x.addEventListener('click', function (e) { e.stopPropagation(); if (opts.onClose) opts.onClose(); nHide(el); });\n            el.appendChild(x);\n        }\n        // an Undo button that came inside the message closes it once tapped (its page does the undoing)\n        [].forEach.call(el.querySelectorAll('.lh-toast-undo, .toast-undo'), function (b) { b.addEventListener('click', function () { setTimeout(function () { nHide(el); }, 0); }); });\n        // tapping anywhere on a message with Undo is the same as tapping Undo\n        el.addEventListener('click', function (e) {\n            if (e.target.closest('button, a')) return;\n            var b = el.querySelector('.dbk-n-undo, .lh-toast-undo, .toast-undo'); if (b) b.click();\n        });\n        // stays while a finger or mouse is on it\n        var hold = function () { if (N.el !== el || N.held) return; N.held = true; if (N.timer) { clearTimeout(N.timer); N.timer = 0; N.left = Math.max(0, N.endAt - Date.now()); } };\n        var release = function () { if (N.el !== el || !N.held) return; N.held = false; if (el._dur > 0) nArm(el, Math.max(N.left, 2500)); };\n        el.addEventListener('pointerenter', hold); el.addEventListener('pointerdown', hold);\n        el.addEventListener('pointerleave', release); el.addEventListener('pointercancel', release);\n        el._dur = dur; el._banner = !!opts.banner; el._undo = hasUndo; el._at = Date.now();\n        if (hasUndo && Date.now() - N.rrAt < 2500) { N.rrAt = 0; nKeptLine(el); }\n        document.body.appendChild(el);\n        N.el = el;\n        if (dur > 0) nArm(el, dur);\n        return el;\n    }\n    // A bigger deletion (a business, a list, a recipe, a post, an event's every date, several things at once; see\n    // dbkRemoved.track in daybook-theme.js) says where it went, under its Undo message (Kasey, Oct 24). Whichever comes\n    // second, the message or the filing, puts the line on.\n    function nKeptLine(el) {\n        var m = el.querySelector('.dbk-n-msg'); if (!m || m.querySelector('.dbk-n-sub')) return;\n        var d = window.dbkRemovedDays || 5;\n        m.insertAdjacentHTML('beforeend', '<span class=\"dbk-n-sub\">Kept ' + d + ' days in Settings \\u203a Recently removed</span>');\n    }\n    function nKept() {\n        try { var to = window.dbkNoticeTo && window.dbkNoticeTo(); if (to && to !== window && to.dbkNotice && to.dbkNotice.kept) return to.dbkNotice.kept(); } catch (e) {}\n        if (N.el && N.el._undo && Date.now() - N.el._at < 2500) { nKeptLine(N.el); N.rrAt = 0; return; }\n        N.rrAt = Date.now();\n    }\n    function nBannerShow() {\n        var b = N.banner; if (!b) return;\n        nShow(b.msg, { duration: 0, banner: true, action: b.action, close: true, onClose: function () { N.banner = null; } });\n    }\n    // a note that stays until dismissed; it waits while a short message (like an Undo) is showing\n    function nBanner(msg, action) {\n        N.banner = { msg: msg, action: action };\n        if (!N.el || N.el._banner) nBannerShow();\n    }\n    window.dbkNotice = function (msg, opts) { return nShow(msg, opts); };\n    window.dbkNotice.hide = function (el) { nHide(el || N.el); };\n    window.dbkNotice.banner = nBanner;\n    window.dbkNotice.kept = nKept;\n\n    /**\n     * Show a short notice (all pages share the one message spot above)\n     * @param {string} message - Text (may hold a little HTML, e.g. an Undo button)\n     * @param {string} type - 'success' | 'error' | 'warning' | 'info'\n     * @param {number} duration - Auto-dismiss in ms (0 = manual close only)\n     */\n    function lhToast(message, type, duration) {\n        return nShow(message, { html: true, kind: type === 'error' ? 'error' : '', duration: duration, close: duration === 0 });\n    }\n\n    function dismissToast(el) {\n        if (el && el === N.el) return nHide(el);\n        if (!el || !el.parentNode) return;\n        if (el._timer) clearTimeout(el._timer);\n        el.parentNode.removeChild(el);\n    }\n\n    // Older notices built by hand (the meal planner's Undo, Settings' Undo, the \"not signed in\" note)\n    // are moved into the one message spot as soon as they appear.\n    function adopt(node) {\n        if (!node || node.nodeType !== 1 || node._dbkAdopted) return;\n        var id = node.id;\n        if (id !== 'undo-toast' && id !== 'undoToast' && id !== 'hh-signin-banner') return;\n        node._dbkAdopted = true;\n        node.style.setProperty('display', 'none', 'important');\n        var txt = (node.querySelector('span') || node).textContent.trim();\n        if (id === 'hh-signin-banner') {\n            var link = node.querySelector('a');\n            nBanner('This ' + (window.dbkDevice || 'device') + ' isn’t signed in. What you add stays on this ' + (window.dbkDevice || 'device') + '.', { label: 'Sign in', href: link ? link.getAttribute('href') : 'meal-plan.html' });\n            return;\n        }\n        var btn = node.querySelector('button');\n        nShow(txt, { undo: btn ? function () { btn.click(); } : null });\n    }\n    try {\n        new MutationObserver(function (list) {\n            list.forEach(function (m) { [].forEach.call(m.addedNodes, adopt); });\n        }).observe(document.documentElement, { childList: true, subtree: true });\n    } catch (e) {}\n\n    /**\n     * Show a confirm modal (replaces browser confirm())\n     * @param {string} message - Question text\n     * @param {object} opts - { onConfirm, onCancel, confirmText, cancelText, danger }\n     */\n    function lhConfirm(message, opts) {\n        _injectToastCSS();\n        opts = opts || {};\n        var confirmText = opts.confirmText || 'Confirm';\n        var cancelText = opts.cancelText || 'Cancel';\n        var isDanger = opts.danger !== false; // default to danger styling for destructive actions\n\n        var overlay = document.createElement('div');\n        overlay.className = 'lh-confirm-overlay';\n        overlay.innerHTML =\n            '<div class=\"lh-confirm-box\">' +\n                '<div class=\"lh-confirm-msg\">' + message + '</div>' +\n                '<div class=\"lh-confirm-btns\">' +\n                    '<button class=\"lh-confirm-btn lh-confirm-cancel\">' + cancelText + '</button>' +\n                    '<button class=\"lh-confirm-btn ' + (isDanger ? 'lh-confirm-danger' : 'lh-confirm-ok') + '\">' + confirmText + '</button>' +\n                '</div>' +\n            '</div>';\n\n        var btns = overlay.querySelectorAll('.lh-confirm-btn');\n        function close(confirmed) {\n            overlay.classList.remove('show');\n            setTimeout(function() { if (overlay.parentNode) overlay.parentNode.removeChild(overlay); }, 200);\n            if (confirmed && opts.onConfirm) opts.onConfirm();\n            if (!confirmed && opts.onCancel) opts.onCancel();\n        }\n        btns[0].onclick = function() { close(false); };\n        btns[1].onclick = function() { close(true); };\n        overlay.onclick = function(e) { if (e.target === overlay) close(false); };\n\n        document.body.appendChild(overlay);\n        requestAnimationFrame(function() {\n            requestAnimationFrame(function() { overlay.classList.add('show'); });\n        });\n\n        // Focus the cancel button for keyboard users\n        btns[0].focus();\n    }\n\n    window.lhToast = lhToast;\n\n    // Undo after anything that removes or clears something: one message with an Undo button, on top of\n    // everything, for 5 seconds. undoFn puts it back exactly (and saves it like a normal save).\n    window.dismissToast = dismissToast;\n    // Undo after anything that removes or clears something: a short message with an Undo button, for 5 seconds, whatever else is tapped meanwhile.\n    // undoFn puts it back exactly (and saves it like a normal save).\n    window.dbkUndo = function (message, undoFn) {\n        var used = false;\n        return nShow(message, { undo: function () { if (used) return; used = true; try { Promise.resolve(undoFn()).catch(function () {}); } catch (e) {} } });\n    };\n    window.lhConfirm = lhConfirm;\n    })();\n    \n","dbk-sharing.js":"/* 2daysbook Sharing (two-person copies only): which lists each person keeps just for themselves.\n   Settings > Sharing sets it; the Lists page, Today's Inbox, search and Recently removed read it through\n   window.dbkSharing.\n\n   Where the choice is kept: household settings (settings/global, synced like names and looks), one setting per\n   person: 'dbkKeep_person1' / 'dbkKeep_person2' = { <list>: <time it was made just theirs> }. Each person only ever\n   changes their own, so the two phones never overwrite each other's choice. No setting (every household made\n   before this) = every list shared, exactly as before.\n   Since Nov 1 each person's own choices are kept in their own place too (own_sharing_<person>/data, only their login\n   can write it; see shareSync below), and their own phone and the server trust only that; the household setting is a\n   copy for the partner's phone and older code.\n\n   What \"just mine\" does to a list (restaurants, places, travel, shows-movies, reading):\n   - Turning it off: this person gets their own copy of the list as it is now (dreams/<cat>_<person> in the cloud,\n     dreams_<cat>_<person> on the phone), except things marked as the partner's (by). The shared list (dreams/<cat>)\n     is left exactly as it is in the cloud, but the partner's phone now shows only the things on it marked as theirs\n     (partnerHides / listHidden, Kasey Oct 23: before, the partner kept seeing everything that was on it). From then on,\n     what this person adds or changes is only on their copy.\n   - Turning it back on: everything on their copy joins the shared list (added by id; an item they changed replaces\n     the shared one unless only the partner changed it). Nothing is taken off the shared list, and their copy stays\n     where it is (marked as merged), so nothing is ever deleted by a switch.\n   - Wishlists: each person's wishlist already has its own place; \"just mine\" only stops the partner's phone showing it.\n   The data move happens first and the setting changes only when it worked, so a failed switch changes nothing.\n   Their own copy is named ..._person1 / _person2, so it is only saved once the phone has checked who is signed in\n   (dbkRoleUid, daybook-theme.js).\n\n   \"Just mine\" means the app only shows it to its owner. Both people sign in to the same household account, so it\n   is not locked away from the partner (Settings says so).\n\n   The pure parts (familyOf, docFor, parseKeep, toMine, toShared) are tested in functions/test/sharing.test.mjs. */\n(function (root) {\n  var LISTS = {\n    restaurants: { cats: ['restaurants', 'our-restaurants'], name: 'Restaurants', mod: 'us', away: 'us:restaurants' },\n    places: { cats: ['places', 'our-places'], name: 'Places to go', mod: 'us', away: 'us:places' },\n    travel: { cats: ['travel', 'our-travel'], name: 'Travel', mod: 'travel', away: 'us:travel' },\n    'shows-movies': { cats: ['shows-movies', 'our-shows-movies'], name: 'TV and movies', mod: 'us', away: 'us:shows-movies' },\n    reading: { cats: ['reading'], name: 'Reading list', mod: 'us', away: 'us:reading' },\n    wishlists: { cats: [], name: 'Your wishlist', mod: 'us', away: 'us:wishlists', view: true }\n  };\n  var ORDER = ['restaurants', 'places', 'travel', 'shows-movies', 'reading', 'wishlists'];\n  var IMAGE_MAX = 150000;   // same as SYNC_IMAGE_MAX on the Lists page: bigger photos stay on the phone\n\n  function familyOf(cat) {\n    for (var f in LISTS) if (LISTS[f].cats.indexOf(cat) !== -1) return f;\n    return null;\n  }\n  // a choice's time as saved, or 0 when it can't be one (Nov 1 review: a forged settings copy could hold 1e300, past the\n  // point where +1 makes a later time, so the area could never be made private again): not a finite positive number,\n  // or more than 2 days ahead of this clock. Same rule on the server (functions/private-items.js okTime).\n  var AHEAD = 2 * 864e5;\n  function okTime(v) { v = +v; return isFinite(v) && v > 0 && v <= Date.now() + AHEAD ? v : 0; }\n  // { list: time } from whatever was saved; anything unreadable counts as \"nothing kept\" (everything shared)\n  function parseKeep(raw) {\n    var o = raw; if (typeof raw === 'string') { try { o = JSON.parse(raw); } catch (e) { o = null; } }\n    var out = {};\n    if (o && typeof o === 'object' && !Array.isArray(o)) Object.keys(o).forEach(function (k) { if (LISTS[k] && okTime(o[k])) out[k] = okTime(o[k]); });\n    return out;\n  }\n  // the cloud document (under dreams/) this person's phone reads and saves a list in\n  function docFor(cat, person, keep, people) {\n    if ((people || 1) < 2 || (person !== 'person1' && person !== 'person2')) return cat;\n    var f = familyOf(cat);\n    return f && !LISTS[f].view && keep && keep[f] ? cat + '_' + person : cat;\n  }\n\n  /* The partner's side of \"just mine\" (Kasey, Oct 23: \"I turned off the shared reading list … but he can still see my\n     reading list\"). The shared list stays as it was (nothing is ever deleted by a switch), but while one person keeps a\n     list just for themselves, the other person's phone only shows the things on the shared list marked as theirs\n     (by: 'person1' | 'person2', put on everything added from Oct 23). Things with no mark were on the list when it was\n     made just theirs, so they went with that person's own copy. keepOther: the other person's { list: time }. */\n  function partnerHides(item, fam, me, keepOther) {\n    return !!(fam && LISTS[fam] && !LISTS[fam].view && keepOther && keepOther[fam] && item && typeof item === 'object' && item.by !== me);\n  }\n  function clone(x) { return x == null ? x : JSON.parse(JSON.stringify(x)); }\n  // the same item always gives the same text, whatever order the cloud hands its fields back in\n  function stable(x) {\n    if (x === null || typeof x !== 'object') return JSON.stringify(x);\n    if (Array.isArray(x)) return '[' + x.map(stable).join(',') + ']';\n    return '{' + Object.keys(x).sort().filter(function (k) { return x[k] !== undefined; }).map(function (k) { return JSON.stringify(k) + ':' + stable(x[k]); }).join(',') + '}';\n  }\n  function hash(x) {\n    var s = stable(x), h = 0x811c9dc5;\n    for (var i = 0; i < s.length; i++) { h ^= s.charCodeAt(i); h = Math.imul(h, 0x01000193) >>> 0; }\n    return h.toString(36) + '.' + s.length.toString(36);\n  }\n  function keyOf(d) { return d && d.firebaseId ? 'k' + d.firebaseId : 'j' + stable(d); }\n  function cloudForm(d) { var c = clone(d); if (c && typeof c.image === 'string' && c.image.length > IMAGE_MAX) c.image = null; return c; }\n  function items(list) { return (Array.isArray(list) ? list : []).filter(function (d) { return d && typeof d === 'object'; }); }\n\n  // shared -> just mine. mine: what this person's own copy already holds (from an earlier time, or a second phone);\n  // meta: { seed, merged } from then. Returns the person's new copy: everything shared now, plus anything on their\n  // copy that never made it back to the shared list. seed = a fingerprint of each item, to tell later what changed.\n  function toMine(shared, mine, meta) {\n    shared = items(shared); mine = items(mine); meta = meta || {};\n    var seed = meta.seed || {}, merged = null;\n    if (meta.merged && Array.isArray(meta.merged.ids)) { merged = {}; meta.merged.ids.forEach(function (k) { merged[k] = 1; }); }\n    var out = shared.map(clone), at = {};\n    out.forEach(function (d, i) { at[keyOf(d)] = i; });\n    mine.forEach(function (m) {\n      var k = keyOf(m);\n      if (at[k] !== undefined) {\n        // on both: the shared one is the live one, unless this copy was changed and never went back\n        var s = out[at[k]];\n        if ((!merged || !merged[k]) && seed[k] && hash(m) !== seed[k] && hash(s) === seed[k]) out[at[k]] = clone(m);\n        return;\n      }\n      if (merged && merged[k]) return;   // went back to the shared list, then was taken off it there\n      at[k] = out.length; out.push(clone(m));\n    });\n    var nseed = {}; out.forEach(function (d) { nseed[keyOf(d)] = hash(d); });\n    return { items: out, seed: nseed };\n  }\n\n  // just mine -> shared. Returns the shared list with this person's copy added in, and which items changed\n  // (put: the ones to write). Nothing is taken off the shared list.\n  function toShared(shared, mine, meta) {\n    shared = items(shared); mine = items(mine); meta = meta || {};\n    var seed = meta.seed || {}, merged = null;\n    if (meta.merged && Array.isArray(meta.merged.ids)) { merged = {}; meta.merged.ids.forEach(function (k) { merged[k] = 1; }); }\n    var out = shared.map(clone), at = {}, put = [], ids = [];\n    out.forEach(function (d, i) { at[keyOf(d)] = i; });\n    mine.forEach(function (m) {\n      var k = keyOf(m); ids.push(k);\n      if (merged && merged[k]) return;                     // already went back once\n      if (at[k] === undefined) { at[k] = out.length; out.push(clone(m)); put.push(clone(m)); return; }\n      var s = out[at[k]];\n      if (stable(s) === stable(m)) return;\n      if (seed[k] && hash(m) === seed[k]) return;          // only the partner changed it: theirs stays\n      out[at[k]] = clone(m); put.push(clone(m));            // this person changed it: their version\n    });\n    return { items: out, put: put, ids: ids };\n  }\n  // photos too big for the cloud are kept on the phone: put them back from the phone's own copies\n  function withImages(list, locals) {\n    var img = {};\n    (locals || []).forEach(function (l) { items(l).forEach(function (d) { if (d.firebaseId && typeof d.image === 'string' && d.image) img[d.firebaseId] = d.image; }); });\n    return items(list).map(function (d) { var c = clone(d); if (!c.image && c.firebaseId && img[c.firebaseId]) c.image = img[c.firebaseId]; return c; });\n  }\n\n  /* ---------------- everyday areas: whose each thing is (Oct 20, Kasey: \"nothing has to be shared\") ----------------\n     Calendar events, reminders, the grocery list, recipes, and the bills and accounts added on Money are each ONE list\n     in the cloud that both phones save item by item (dbk-merge.js). \"Just mine\" for one of them doesn't move anything:\n     - the choice: household setting 'dbkPriv_person1' / 'dbkPriv_person2' = { <area>: { since, back } } (times).\n       Just mine = since is later than back. Each person only changes their own.\n     - whose a thing is (ownerMark): mine (added while that person kept the area just theirs, with mineAt), else by\n       (who added it: every phone puts it on what it adds from Oct 24), else for Money the account's \"whose\" (owner),\n       else for Work events and reminders whose Work it is (spaceBy). Things with none of these were there before the\n       marks: they go with whoever keeps the area just theirs (both: whoever did it first), as on the Lists page.\n     - while a person keeps an area just theirs, the other person's phone doesn't show what is theirs there, what was\n       there already too (Kasey, Oct 24: \"if they unshare something, it shouldn't stay shared\"): hiddenFor. Turning it\n       back on is only a new time, nothing moves: everything shows to both again. Accounts the bank sends (source\n       'simplefin') stay shared, like the bank connection and the budget.\n       A phone that hasn't heard the owner's choice yet keeps a thing marked mine hidden (the safe way round).\n     - mineIn: the area whose switch counts, when it isn't the list's own (a bill's reminder follows the bill; Money's\n       reminders with no mark count under Money too). */\n  var AREAS = {\n    calendar: { name: 'Calendar', cols: ['calendarEvents'] },\n    reminders: { name: 'Reminders', cols: ['lifeReminders'] },\n    groceries: { name: 'Grocery list', cols: ['groceries', 'mealGroceries'] },\n    recipes: { name: 'Recipes', cols: ['mealplan_recipes'], mod: 'meals' },\n    money: { name: 'Bills and accounts', cols: ['finance_bills', 'finance_accounts'], mod: 'finance' }\n  };\n  var AREA_ORDER = ['calendar', 'reminders', 'groceries', 'recipes', 'money'];\n  var COL_AREA = {}; AREA_ORDER.forEach(function (a) { AREAS[a].cols.forEach(function (c) { COL_AREA[c] = a; }); });\n  // 'calendarEvents/data' or 'calendarEvents' (a phone key) -> 'calendar'\n  function areaOf(pathOrKey) { var c = String(pathOrKey || '').split('/')[0]; return COL_AREA[c] || null; }\n  function parsePriv(raw) {\n    var o = raw; if (typeof raw === 'string') { try { o = JSON.parse(raw); } catch (e) { o = null; } }\n    var out = {};\n    if (o && typeof o === 'object' && !Array.isArray(o)) Object.keys(o).forEach(function (k) {\n      var r = o[k]; if (!AREAS[k] || !r || typeof r !== 'object') return;\n      var s = okTime(r.since), b = okTime(r.back); if (s > 0 || b > 0) out[k] = { since: s, back: b };\n    });\n    return out;\n  }\n  function privOn(rec, area) { var r = rec && rec[area]; return !!(r && r.since > (r.back || 0)); }\n  var PEOPLE = { person1: 1, person2: 1 };\n  // the area whose switch counts for this thing\n  function areaFor(x, area) {\n    if (AREAS[x.mineIn]) return x.mineIn;\n    if (area === 'reminders' && (x.fromFinance || x.fromSubs)) return 'money';\n    return area;\n  }\n  // the mark saying whose a thing is, or null (no mark: it was there before the marks)\n  function ownerMark(x, area) {\n    if (!x || typeof x !== 'object') return null;\n    if (PEOPLE[x.mine]) return x.mine;\n    if (PEOPLE[x.by]) return x.by;\n    if (areaFor(x, area) === 'money' && PEOPLE[x.owner]) return x.owner;\n    if (PEOPLE[x.spaceBy]) return x.spaceBy;\n    return null;\n  }\n  // who keeps this thing just for themselves right now (null: it's shared). privBy = { person1: parsePriv(...), person2: ... }\n  function ownerOf(x, area, privBy) {\n    if (!x || typeof x !== 'object' || x.source === 'simplefin') return null;\n    var a = areaFor(x, area), pb = privBy || {}, m = ownerMark(x, area);\n    if (m) {\n      var r = (pb[m] || {})[a];\n      if (PEOPLE[x.mine] && !r) return m;   // marked mine, and the owner's choice not heard yet: kept hidden\n      return privOn(pb[m], a) ? m : null;\n    }\n    var p1 = privOn(pb.person1, a), p2 = privOn(pb.person2, a);\n    if (p1 && p2) return (+pb.person2[a].since || 0) < (+pb.person1[a].since || 0) ? 'person2' : 'person1';\n    return p1 ? 'person1' : p2 ? 'person2' : null;\n  }\n  // is this item hidden from `me`? me = null (this phone doesn't know yet who is signed in): everything someone keeps\n  // just for themselves is hidden.\n  function hiddenFor(x, area, me, privBy) {\n    var o = ownerOf(x, area, privBy);\n    return !!o && o !== me;\n  }\n  // a Recently removed entry is hidden when what it holds is\n  function entryHidden(e, me, privBy) {\n    if (!e || typeof e !== 'object') return false;\n    var a = areaOf(e.key); if (!a) return false;\n    return (Array.isArray(e.items) ? e.items : []).some(function (x) { return hiddenFor(x, a, me, privBy); });\n  }\n  function visibleList(list, area, me, privBy, removed) {\n    if (!Array.isArray(list)) return list;\n    var hid = removed ? function (x) { return entryHidden(x, me, privBy); } : function (x) { return hiddenFor(x, area, me, privBy); };\n    for (var i = 0; i < list.length; i++) if (hid(list[i])) return list.filter(function (x) { return !hid(x); });\n    return list;\n  }\n  var MARK = ['mine', 'mineAt', 'mineIn', 'by'];\n  // marks for a list about to be saved. known: the items this phone last had from the cloud (any lists), so an edit\n  // that dropped the marks gets them back; keyOf: the merge layer's item key; inherit(x) -> marks to copy (a bill's\n  // reminder), or null. Items added get by: me (who added it), and mine + now while the area is just mine for `me`.\n  // by is only put on when this phone has the cloud's list to tell new from old (else an old thing could look new).\n  // Returns the list (a new array only when something changed).\n  function stampList(list, opts) {\n    if (!Array.isArray(list) || !opts || !opts.keyOf) return list;\n    var known = {}, kk, heard = false;\n    (opts.known || []).forEach(function (l) {\n      if (!Array.isArray(l)) return;\n      heard = true; kk = opts.keyOf(l);\n      l.forEach(function (x, i) { if (kk[i] !== null && x && typeof x === 'object' && (PEOPLE[x.mine] || PEOPLE[x.by] || !known[kk[i]])) known[kk[i]] = x; });\n    });\n    var lk = opts.keyOf(list), who = PEOPLE[opts.me] ? opts.me : null, on = who && privOn(opts.rec, opts.area), now = opts.now || Date.now(), out = null;\n    list.forEach(function (x, i) {\n      if (!x || typeof x !== 'object' || Array.isArray(x)) return;\n      var k = lk[i], prev = k !== null ? known[k] : null, m = {};\n      if (prev) {\n        if (PEOPLE[prev.mine] && !PEOPLE[x.mine]) { m.mine = prev.mine; m.mineAt = prev.mineAt; m.mineIn = prev.mineIn; }\n        if (PEOPLE[prev.by] && !PEOPLE[x.by]) m.by = prev.by;\n      } else if (!PEOPLE[x.mine] && !PEOPLE[x.by]) {\n        var inh = opts.inherit ? opts.inherit(x) : null;\n        if (inh && (PEOPLE[inh.mine] || PEOPLE[inh.by])) m = { mine: inh.mine, mineAt: inh.mineAt, mineIn: inh.mineIn, by: inh.by };\n        else if (on) m = { mine: who, mineAt: now };\n        if (!PEOPLE[m.by] && who && heard && k !== null) m.by = who;\n      }\n      var c = null;\n      MARK.forEach(function (f) {\n        if (m[f] === undefined || m[f] === null || ((f === 'mine' || f === 'by') && !PEOPLE[m[f]])) return;\n        if (!c) { c = {}; for (var y in x) c[y] = x[y]; }\n        c[f] = m[f];\n      });\n      if (!c) return;\n      out = out || list.slice(); out[i] = c;\n    });\n    return out || list;\n  }\n\n  /* ---------------- each person's choices in a place only they can write (Nov 1, security) ----------------\n     Until Nov 1 both people's choices lived only in the household settings (settings/global dbkPriv_<person> /\n     dbkKeep_<person>), which both logins can write, so the partner's login could switch the other person's areas back to\n     shared. Now each person's own choices are kept in own_sharing_<person>/data = { priv, keep, keepBack, at }\n     (firestore.rules: only that person's login reads or writes it) and this phone's copy 'dbkPrivate_sharing_<person>'\n     (never synced, never in a Backup download). Their own phone and the server trust only that. The household settings\n     still carry a copy (the \"mirror\"), written only by the person's own phone and only after the private place has it,\n     for the partner's phone, which has to know what to hide (it can't read the other's private place), and for phones\n     still on older code. The partner can still change that copy: that only changes what THEIR phone hides, which\n     they could read in the shared lists anyway until the things themselves move (a later step).\n     A record is joined with another by taking the later time of each choice (a choice is just mine while since > back,\n     a list kept while keep > keepBack), so two devices of one person, a phone that was offline and the first copy made\n     from the household settings all settle on the newest choice for each area and list, whatever order they arrive in. */\n  function shareRec(raw) {\n    var o = raw; if (typeof raw === 'string') { try { o = JSON.parse(raw); } catch (e) { o = null; } }\n    o = o && typeof o === 'object' && !Array.isArray(o) ? o : {};\n    return { priv: parsePriv(o.priv), keep: parseKeep(o.keep), keepBack: parseKeep(o.keepBack) };\n  }\n  function joinShare(a, b) {\n    a = shareRec(a); b = shareRec(b);\n    var priv = {}, keep = {}, keepBack = {};\n    Object.keys(a.priv).concat(Object.keys(b.priv)).forEach(function (k) {\n      var x = a.priv[k] || {}, y = b.priv[k] || {};\n      priv[k] = { since: Math.max(+x.since || 0, +y.since || 0), back: Math.max(+x.back || 0, +y.back || 0) };\n    });\n    var mx = function (out, p, q) { Object.keys(p).concat(Object.keys(q)).forEach(function (k) { out[k] = Math.max(+p[k] || 0, +q[k] || 0); }); };\n    mx(keep, a.keep, b.keep); mx(keepBack, a.keepBack, b.keepBack);\n    return shareRec({ priv: priv, keep: keep, keepBack: keepBack });\n  }\n  // the lists kept now, in the household settings' shape ({ list: time it was made just theirs })\n  function keptNow(rec) {\n    rec = shareRec(rec); var out = {};\n    Object.keys(rec.keep).forEach(function (l) { if (rec.keep[l] > (rec.keepBack[l] || 0)) out[l] = rec.keep[l]; });\n    return out;\n  }\n  function sameShare(a, b) { var x = shareRec(a), y = shareRec(b); return stable(x) === stable(y); }\n  // a person's choices as the household settings hold them (the per-setting kv entry wins, as the settings sync does)\n  function legacyShare(g, p) {\n    var kv = g && g.kv && typeof g.kv === 'object' ? g.kv : {};\n    var one = function (k) { return kv[k] && typeof kv[k] === 'object' ? kv[k].v : (g ? g[k] : null); };\n    return shareRec({ priv: one('dbkPriv_' + p), keep: one('dbkKeep_' + p) });\n  }\n\n  var core = { LISTS: LISTS, ORDER: ORDER, familyOf: familyOf, parseKeep: parseKeep, docFor: docFor, toMine: toMine, toShared: toShared, withImages: withImages, hash: hash, keyOf: keyOf, cloudForm: cloudForm,\n    AREAS: AREAS, AREA_ORDER: AREA_ORDER, areaOf: areaOf, parsePriv: parsePriv, privOn: privOn, hiddenFor: hiddenFor, ownerOf: ownerOf, ownerMark: ownerMark, entryHidden: entryHidden, visibleList: visibleList, stampList: stampList, partnerHides: partnerHides,\n    shareRec: shareRec, joinShare: joinShare, keptNow: keptNow, sameShare: sameShare, legacyShare: legacyShare };\n  if (typeof module !== 'undefined' && module.exports) module.exports = core;\n  if (typeof window === 'undefined' || !window.localStorage) return;\n\n  /* ---------------- in the app ---------------- */\n  function ls(k) { try { return localStorage.getItem(k); } catch (e) { return null; } }\n  function lset(k, v) { try { localStorage.setItem(k, v); return true; } catch (e) { return false; } }\n  function jget(k, d) { try { var v = JSON.parse(localStorage.getItem(k) || 'null'); return v == null ? d : v; } catch (e) { return d; } }\n  function people() {\n    if (window.dbkModule && window.dbkModule.people) return window.dbkModule.people;\n    var C = window.DAYBOOK_CONFIG; return C && Array.isArray(C.people) ? C.people.length || 1 : 2;\n  }\n  function me() { return ls('myPersonRole') === 'person2' ? 'person2' : 'person1'; }\n  function other(p) { return p === 'person2' ? 'person1' : 'person2'; }\n  // this phone's own person's choices (Nov 1): their private copy, and until the private place has answered on this phone\n  // (`heard`) joined with what the household settings said, so nothing they chose before is missing meanwhile. null: not\n  // this phone's person, or no private copy here yet (then the household settings' copy is all there is, as before).\n  var PK = function (p) { return 'dbkPrivate_sharing_' + p; };\n  function ownLocal(p) { var l = jget(PK(p), null); return l && typeof l === 'object' && !Array.isArray(l) ? l : null; }\n  function legacyHere(p) { return shareRec({ priv: ls('dbkPriv_' + p), keep: ls('dbkKeep_' + p) }); }\n  function ownShare(p) {\n    if (people() < 2 || p !== me()) return null;\n    var l = ownLocal(p); if (!l) return null;\n    return l.heard ? shareRec(l) : joinShare(l, legacyHere(p));\n  }\n  function keepOf(p) { if (people() < 2) return {}; var o = ownShare(p); return o ? keptNow(o) : parseKeep(ls('dbkKeep_' + p)); }\n  function kept(list, p) { return !!keepOf(p || me())[list]; }\n  function doc(cat, p) { p = p || me(); return docFor(cat, p, keepOf(p), people()); }\n  function cloudOn() { return !!(window.firebaseReady && window.db && window.firestoreImports && !window.firebaseConfigEmpty); }\n  function signedIn() { return !!(window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser)); }\n  // a choice is only changed once this phone knows for sure who is signed in (or, with no online storage set up\n  // at all, on the phone itself). A phone that is signed out, or still connecting, waits.\n  function noCloud() {\n    if (window.firebaseNotConfigured) return true;\n    var c = null; try { c = JSON.parse(ls('firebaseConfig') || 'null'); } catch (e) {}\n    var E = window.HEARTH_ENTITLEMENTS || {};\n    return !(c && c.apiKey && c.projectId) && !(E.firebaseConfig && E.firebaseConfig.apiKey);\n  }\n  function canChange() {\n    if (people() < 2) return false;\n    if (noCloud()) return true;\n    return cloudOn() && signedIn() && (!window.dbkRoleOk || window.dbkRoleOk());\n  }\n\n  function itemsFromDoc(data) {\n    if (data && data.byId && typeof data.byId === 'object') return Object.keys(data.byId).map(function (k) { return data.byId[k]; }).filter(function (d) { return d && typeof d === 'object'; });\n    return data && Array.isArray(data.items) ? data.items : null;\n  }\n  function byIdOf(list) { var o = {}; items(list).forEach(function (d) { if (d.firebaseId) o[d.firebaseId] = cloudForm(d); }); return o; }\n  function slow(p, ms) { return Promise.race([p, new Promise(function (_, rej) { setTimeout(function () { rej(new Error('offline')); }, ms); })]); }\n  // a read that counts: the cloud itself answered (never this phone's saved copy of it)\n  function live(ref) {\n    var fi = window.firestoreImports;\n    return slow(fi.getDoc(ref), 9000).then(function (s) { if (s && s.metadata && s.metadata.fromCache) throw new Error('offline'); return s; });\n  }\n\n  // move one list's items for this person (keep = true: shared -> mine; false: mine -> shared)\n  function moveCloud(list, p, keep) {\n    var fi = window.firestoreImports, db = window.db, cats = LISTS[list].cats;\n    var metaRef = fi.doc(db, 'dreams', 'keep_' + p);\n    return live(metaRef).then(function (ms) {\n      var meta = (ms.exists() && ms.data()) || {}, cm = (meta.cats && typeof meta.cats === 'object') ? clone(meta.cats) : {};\n      var chain = Promise.resolve(), localWrites = [];\n      cats.forEach(function (cat) {\n        chain = chain.then(function () {\n          var sRef = fi.doc(db, 'dreams', cat), mRef = fi.doc(db, 'dreams', cat + '_' + p);\n          return Promise.all([live(sRef), live(mRef)]).then(function (snaps) {\n            var sData = snaps[0].exists() ? snaps[0].data() : null, mData = snaps[1].exists() ? snaps[1].data() : null;\n            var shared = itemsFromDoc(sData) || [], mine = itemsFromDoc(mData) || [];\n            // the partner keeps it just theirs too: their things (no mark, or theirs) went with them, not into this copy\n            var ko = keepOf(other(p)), fam = familyOf(cat); if (keep) shared = shared.filter(function (d) { return !partnerHides(d, fam, p, ko) && !(d && d.by === other(p)); });   // (and what's marked as theirs stays theirs)\n            var locals = [jget('dreams_' + cat, []), jget('dreams_' + cat + '_' + p, [])];\n            if (keep) {\n              var r = toMine(shared, mine, cm[cat]);\n              cm[cat] = { seed: r.seed, at: Date.now() };\n              localWrites.push(['dreams_' + cat + '_' + p, withImages(r.items, locals)]);\n              return slow(fi.setDoc(mRef, { byId: byIdOf(r.items) }), 15000);\n            }\n            // what this phone's own copy holds that the cloud doesn't have yet (a save still on its way) goes back too\n            var inCloud = {}; mine.forEach(function (d) { if (d && d.firebaseId) inCloud[d.firebaseId] = 1; });\n            mine = mine.concat(items(locals[1]).filter(function (d) { return d.firebaseId && !inCloud[d.firebaseId]; }).map(cloudForm));\n            var t = toShared(shared, mine, cm[cat]);\n            cm[cat] = { seed: (cm[cat] && cm[cat].seed) || {}, merged: { at: Date.now(), ids: t.ids } };\n            localWrites.push(['dreams_' + cat, withImages(t.items, locals)]);\n            if (!t.put.length && sData && sData.byId) return null;\n            // an older-style shared list (one array) or none yet: write it whole, in the per-item form the page uses\n            if (!sData || !sData.byId) return slow(fi.setDoc(sRef, { byId: byIdOf(t.items) }), 15000);\n            var data = { byId: {} }, fields = [];\n            t.put.forEach(function (d) { if (d.firebaseId) { data.byId[d.firebaseId] = cloudForm(d); fields.push('byId.' + d.firebaseId); } });\n            return fields.length ? slow(fi.setDoc(sRef, data, { mergeFields: fields }), 15000) : null;\n          });\n        });\n      });\n      return chain.then(function () {\n        return slow(fi.setDoc(metaRef, { cats: cm, at: Date.now() }), 15000);\n      }).then(function () { localWrites.forEach(function (w) { lset(w[0], JSON.stringify(w[1])); }); });\n    });\n  }\n  // the same on a phone with no online storage (the live preview, or before sign-in is set up)\n  function moveLocal(list, p, keep) {\n    var cats = LISTS[list].cats, mk = 'dbkKeepMeta_' + p, cm = jget(mk, {}) || {};\n    var writes = [];\n    cats.forEach(function (cat) {\n      var shared = jget('dreams_' + cat, []), mine = jget('dreams_' + cat + '_' + p, []);\n      var ko = keepOf(other(p)), fam = familyOf(cat); if (keep) shared = items(shared).filter(function (d) { return !partnerHides(d, fam, p, ko) && d.by !== other(p); });\n      if (keep) { var r = toMine(shared, mine, cm[cat]); cm[cat] = { seed: r.seed, at: Date.now() }; writes.push(['dreams_' + cat + '_' + p, r.items]); }\n      else { var t = toShared(shared, mine, cm[cat]); cm[cat] = { seed: (cm[cat] && cm[cat].seed) || {}, merged: { at: Date.now(), ids: t.ids } }; writes.push(['dreams_' + cat, t.items]); }\n    });\n    // all or nothing: if the phone's storage is full, nothing changes\n    var before = writes.map(function (w) { return [w[0], ls(w[0])]; });\n    var ok = writes.every(function (w) { return lset(w[0], JSON.stringify(w[1])); }) && lset(mk, JSON.stringify(cm));\n    if (!ok) { before.forEach(function (b) { try { if (b[1] === null) localStorage.removeItem(b[0]); else localStorage.setItem(b[0], b[1]); } catch (e) {} }); throw new Error('full'); }\n  }\n\n  function announce(k) {\n    try { window.dispatchEvent(new StorageEvent('storage', { key: k, newValue: ls(k) })); } catch (e) {}\n    try { window.dispatchEvent(new CustomEvent('dbk-sharing', { detail: { key: k } })); } catch (e) {}\n  }\n  var busy = false;\n  // keep = true: make this list just mine; false: share it again. Resolves { ok, why } (why: 'role', 'offline', 'busy')\n  function setKept(list, keep) {\n    if (!LISTS[list] || people() < 2) return Promise.resolve({ ok: false, why: 'none' });\n    if (!canChange()) return Promise.resolve({ ok: false, why: 'role' });\n    var cloud = cloudOn();\n    if (!cloud && !noCloud()) return Promise.resolve({ ok: false, why: 'offline' });\n    var p = me(); keep = !!keep;\n    if (kept(list, p) === keep) return Promise.resolve({ ok: true });\n    if (busy) return Promise.resolve({ ok: false, why: 'busy' });\n    busy = true;\n    var move = LISTS[list].view ? Promise.resolve() : (cloud ? moveCloud(list, p, keep) : new Promise(function (res) { moveLocal(list, p, keep); res(); }));\n    return move.then(function () {\n      var now = Date.now();\n      if (!cloud) {\n        // no online storage (the preview): the phone's own settings are all there is\n        var k = keepOf(p); if (keep) k[list] = now; else delete k[list];\n        lset('dbkKeep_' + p, JSON.stringify(k)); lset('_settingsLastSaved', String(now));\n        announce('dbkKeep_' + p);\n        busy = false; return { ok: true };\n      }\n      // (Nov 1) into this person's own place: this phone's copy now, the cloud's straight after (shareSync), and the\n      // household settings' copy for the partner's phone once the cloud's is saved\n      // (the shown choices decide only the new time; just the change goes on top of this phone's own copy, see setArea)\n      var cur = ownShare(p) || legacyHere(p), ch = { keep: {}, keepBack: {} };\n      if (keep) ch.keep[list] = Math.max(now, (cur.keepBack[list] || 0) + 1);\n      else ch.keepBack[list] = Math.max(now, (cur.keep[list] || 0) + 1);\n      if (!putOwn(p, joinShare(ownLocal(p) || {}, ch))) { busy = false; return { ok: false, why: 'full' }; }\n      announce('dbkKeep_' + p);\n      shareSync();\n      busy = false; return { ok: true };\n    }, function (e) {\n      busy = false; return { ok: false, why: e && e.message === 'full' ? 'full' : 'offline' };\n    });\n  }\n\n  /* ---- everyday areas in the app ---- */\n  function privOf(p) { if (people() < 2) return {}; var o = ownShare(p); return o ? o.priv : parsePriv(ls('dbkPriv_' + p)); }\n  // (security review 2, Nov 1) a thing with no mark that BOTH keep just theirs counts as this phone's person's here: the\n  // other person's time for it is one their own login wrote (on this phone, from the forgeable household copy), so it\n  // never hides from this person something in the shared list that could be theirs. Only this person's own (trusted)\n  // choice can. The server decides where such a thing goes by the times it saw itself (functions/private-move.js\n  // withSeen) and moves it within 15 minutes; until then the other phone may show it, as the shared list it is in.\n  function privBy() {\n    var o = { person1: privOf('person1'), person2: privOf('person2') };\n    if (people() < 2) return o;\n    var m = me(), t = other(m), mine = o[m], theirs = {};\n    Object.keys(o[t]).forEach(function (a) { theirs[a] = o[t][a]; });\n    Object.keys(mine).forEach(function (a) {\n      if (privOn(mine, a) && privOn(theirs, a) && !(theirs[a].since > mine[a].since)) theirs[a] = { since: Math.max(mine[a].since + 1, (theirs[a].back || 0) + 1), back: theirs[a].back || 0 };\n    });\n    o[t] = theirs; return o;\n  }\n  // who this phone is, for hiding: only once it has checked who is signed in (else null: hide everything private)\n  function seer() {\n    if (people() < 2) return me();\n    if (noCloud()) return me();\n    return !window.dbkRoleOk || window.dbkRoleOk() ? me() : null;\n  }\n  function areaKept(area, p) { return privOn(privOf(p || me()), area); }\n  // the Settings switch. Only the choice changes (nothing is moved), so it works offline too; it needs online\n  // storage to be set up at all (in the preview both of you are the same browser, so nothing could be hidden).\n  function setArea(area, keep) {\n    if (!AREAS[area] || people() < 2) return Promise.resolve({ ok: false, why: 'none' });\n    if (noCloud()) return Promise.resolve({ ok: false, why: 'preview' });\n    if (!(signedIn() && (!window.dbkRoleOk || window.dbkRoleOk()))) return Promise.resolve({ ok: false, why: 'role' });\n    var p = me(), rec = privOf(p), r = rec[area] || { since: 0, back: 0 }, now = Date.now();\n    keep = !!keep;\n    if (privOn(rec, area) === keep) return Promise.resolve({ ok: true });\n    // (Nov 1) saved in this person's own place (see shareSync), never only in the household settings. Only the change\n    // goes on top of this phone's own copy: what's shown before the private place has answered also holds the household\n    // settings' copy, which the partner's login can change, and none of that may go into the person's own place (review).\n    // The shown times only decide the new time, so it's later than anything shown.\n    var raw = shareRec(ownLocal(p) || {}), rr = raw.priv[area] || { since: 0, back: 0 };\n    var nr = keep ? { since: Math.max(now, (r.back || 0) + 1), back: rr.back || 0 } : { since: rr.since || 0, back: Math.max(now, (r.since || 0) + 1) };\n    if (keep ? !(nr.since > (r.back || 0) && okTime(nr.since)) : !(nr.back > (r.since || 0) && okTime(nr.back))) return Promise.resolve({ ok: false, why: 'wait' });\n    var ch = { priv: {} }; ch.priv[area] = nr;\n    if (!putOwn(p, joinShare(raw, ch))) return Promise.resolve({ ok: false, why: 'full' });\n    announce('dbkPriv_' + p);\n    shareSync();\n    return Promise.resolve({ ok: true });\n  }\n\n  // this phone's copy of its person's choices; send: the cloud's copy doesn't have them yet. Returns false on a full phone.\n  function putOwn(p, rec, extra) {\n    var l = ownLocal(p) || {}, r = shareRec(rec);\n    var o = { priv: r.priv, keep: r.keep, keepBack: r.keepBack, at: Date.now(), heard: !!(extra && extra.heard !== undefined ? extra.heard : l.heard), send: extra && extra.send !== undefined ? !!extra.send : true };\n    // unchanged: not written again (every page on this phone hears a write, and redraws for it)\n    if (l.priv && sameShare(l, o) && !!l.heard === o.heard && !!l.send === o.send) return true;\n    return lset(PK(p), JSON.stringify(o));\n  }\n  /* The private place in the cloud (own_sharing_<person>/data): this phone's choices joined into it in one transaction,\n     the newer of each choice kept (joinShare). The first time (no document there yet, the first visit of this code on any\n     of the person's devices) it starts from what the household settings hold for them, as the cloud itself has it, and\n     from this phone's copy of those settings (an older change of theirs not sent yet), exactly as the app code moved\n     (shared.js codeSync / legacyFor): nothing in the household settings is deleted or changed by it. Only for the person\n     this phone has confirmed is signed in. Once the cloud has it, the household settings' copy (the mirror) is made to\n     match, for the partner's phone and older code. */\n  var shBusy = false, shAgain = false, shOk = false;\n  function offSeen(p, off) { lset('dbkPrivate_splitOff_' + p, off ? '1' : '0'); }\n  function shareSync() {\n    if (shBusy) { shAgain = true; return Promise.resolve(); }\n    var fi = window.firestoreImports, db = window.db;\n    if (people() < 2 || !cloudOn() || noCloud() || !signedIn()) return Promise.resolve();\n    if (window.dbkRoleOk && !window.dbkRoleOk()) return Promise.resolve();\n    var p = ls('myPersonRole'); if (p !== 'person1' && p !== 'person2') return Promise.resolve();\n    var ref = fi.doc(db, 'own_sharing_' + p, 'data'), gref = fi.doc(db, 'settings', 'global');\n    var before = ls(PK(p)), result = null, was = ownShare(p), firstSplit = false, cloudWas = null;\n    shBusy = true;\n    // what goes into the private place: the cloud's copy joined with this phone's; with no copy there yet, the household\n    // settings as the cloud has them (else this phone's copy of them) and this phone's copy of its own priv setting\n    var body = function (get, set) {\n      return Promise.resolve(get(ref)).then(function (s) {\n        var c = s && s.exists && s.exists() ? s.data() : null, l = ownLocal(p);\n        if (c) {\n          var j = joinShare(c, l || {}); result = j; cloudWas = shareRec(c).priv;\n          // (split: this person has a device on the code that keeps their private things in their own place, Nov 1, so the\n          // server may move them there: functions/private-move.js)\n          // (splitOff: the server is putting this person's private things back into the shared lists, a rollback: kept, and\n          // this phone puts nothing new in their own place, daybook-theme.js flushSplit)\n          offSeen(p, c.splitOff);\n          if (c.splitOff) { if (!sameShare(j, c)) return set(ref, { priv: j.priv, keep: j.keep, keepBack: j.keepBack, at: Date.now(), split: c.split || 0, splitOff: c.splitOff }); return; }\n          if (!c.split) firstSplit = true;\n          if (!sameShare(j, c) || !c.split) return set(ref, { priv: j.priv, keep: j.keep, keepBack: j.keepBack, at: Date.now(), split: 1 });\n          return;\n        }\n        return Promise.resolve(get(gref)).then(function (gs) {\n          var g = gs && gs.exists && gs.exists() ? gs.data() : null;\n          var j = joinShare(joinShare(g ? legacyShare(g, p) : legacyHere(p), { priv: ls('dbkPriv_' + p) }), l || {});\n          result = j;\n          firstSplit = true;\n          return set(ref, { priv: j.priv, keep: j.keep, keepBack: j.keepBack, at: Date.now(), from: 'settings', split: 1 });\n        });\n      });\n    };\n    var served = function (r) { return Promise.resolve(fi.getDoc(r)).then(function (x) { if (x && x.metadata && x.metadata.fromCache) throw new Error('offline'); return x; }); };\n    // a quick look first (most visits: nothing to change, so no transaction and no write); a phone's cached answer is no answer\n    var run = served(ref).then(function (s) {\n      var c = s && s.exists && s.exists() ? s.data() : null, l = ownLocal(p);\n      if (c) offSeen(p, c.splitOff);\n      if (c && (c.split || c.splitOff) && (!l || !l.send) && sameShare(joinShare(c, l || {}), c)) { result = shareRec(c); return; }\n      return fi.runTransaction\n        ? fi.runTransaction(db, function (tx) { return body(function (r) { return tx.get(r); }, function (r, v) { tx.set(r, v); }); })\n        : body(served, function (r, v) { return fi.setDoc(r, v); });\n    });\n    var done = function () { shBusy = false; if (shAgain) { shAgain = false; setTimeout(shareSync, 0); } };\n    return Promise.resolve(run).then(function () {\n      if (!result) return;\n      shOk = true;\n      // what this phone changed while the save was on its way stays to be sent next time\n      var moved = ls(PK(p)) !== before, l = ownLocal(p);\n      putOwn(p, moved && l ? joinShare(result, l) : result, { heard: true, send: moved });\n      if (moved) shAgain = true;\n      var now = ownShare(p);\n      var privChanged = !was || stable(was.priv) !== stable(now.priv);\n      if (privChanged) announce('dbkPriv_' + p);\n      // (the cloud's choice changed by this save, or this person's first visit of this code with something kept)\n      var cloudChanged = !!cloudWas && stable(cloudWas) !== stable(shareRec(result).priv);\n      if (cloudChanged || (firstSplit && Object.keys(now.priv).some(function (a) { return privOn(now.priv, a); }))) askSweep();\n      if (!was || stable(keptNow(was)) !== stable(keptNow(now))) announce('dbkKeep_' + p);\n      if (!moved) fixMirror(p);\n    }).then(done, done);\n  }\n  // (Nov 1, slice C) a choice reached this person's own place: the server moves what is now theirs alone into their own\n  // documents (or back into the shared lists) straight away, instead of within 15 minutes (functions/private-move.js)\n  function askSweep() {\n    var u = window.firebaseUser || (window.firebaseAuth && window.firebaseAuth.currentUser);\n    if (!u || !u.getIdToken || typeof fetch !== 'function') return;\n    setTimeout(function () {\n      Promise.resolve(u.getIdToken()).then(function (tok) {\n        return fetch('/api/private', { method: 'POST', headers: { authorization: 'Bearer ' + tok, 'content-type': 'application/json' }, body: JSON.stringify({ action: 'sweep' }) });\n      }).catch(function () {});\n    }, 300);\n  }\n  // the household settings' copy of this person's choices, made to match their own place (only once the cloud has it,\n  // and nothing waits to go up: otherwise one of the person's other devices could take an older one for the newest).\n  // A copy changed by anyone else (the partner's login, or this person's device still on older code) is put right.\n  // A changed copy can carry a time in the future (the newest time wins in the settings sync, so the person's own later\n  // choice would never get there again): then it's written with a time after that one.\n  function fixMirror(p) {\n    var l = ownLocal(p); if (!l || !l.heard || l.send) return;\n    var r = shareRec(l), keys = [];\n    if (stable(parsePriv(ls('dbkPriv_' + p))) !== stable(r.priv)) { lset('dbkPriv_' + p, JSON.stringify(r.priv)); keys.push('dbkPriv_' + p); }\n    var k = keptNow(r);\n    if (stable(parseKeep(ls('dbkKeep_' + p))) !== stable(k)) { lset('dbkKeep_' + p, JSON.stringify(k)); keys.push('dbkKeep_' + p); }\n    // (nothing differs here: nothing to do. A copy someone changed in the cloud reaches this phone through the settings\n    // sync first, which calls this again)\n    if (!keys.length) return;\n    var fi = window.firestoreImports, db = window.db;\n    var all = keys.slice();\n    Promise.resolve(fi.getDoc(fi.doc(db, 'settings', 'global'))).then(function (gs) {\n      // (the phone's cached copy says nothing of when the cloud's was changed: the ordinary save)\n      var cached = !!(gs && gs.metadata && gs.metadata.fromCache);\n      var g = !cached && gs && gs.exists && gs.exists() ? gs.data() || {} : {}, kv = g.kv && typeof g.kv === 'object' ? g.kv : {}, now = Date.now();\n      var late = {};\n      all.forEach(function (key) {\n        var e = kv[key], cv = e && typeof e === 'object' ? e.v : g[key];\n        var same = key.indexOf('dbkPriv_') === 0 ? stable(parsePriv(cv)) === stable(r.priv) : stable(parseKeep(cv)) === stable(k);\n        // (a time past 2 days ahead counts as no time in the settings sync, shared.js ts: the ordinary save beats it)\n        if (!same && e && +e.at >= now && +e.at <= now + AHEAD) late[key] = +e.at;\n      });\n      var lk = Object.keys(late);\n      if (lk.length) {\n        var data = { kv: {}, _lastUpdated: now };\n        lk.forEach(function (key) { var v = ls(key); data.kv[key] = { v: v, at: Math.max(now, late[key] + 1) }; data[key] = v; });\n        Promise.resolve(fi.setDoc(fi.doc(db, 'settings', 'global'), data, { merge: true })).catch(function () {});\n      }\n      var rest = keys.filter(function (key) { return !late[key]; });\n      if (!rest.length) return;\n      lset('_settingsLastSaved', String(now));\n      fixing = true;\n      try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(rest); } catch (e) {}\n      try { rest.forEach(announce); } finally { fixing = false; }\n    }).catch(function () {});\n  }\n  var fixing = false;\n  var shT = null;\n  function shareSoon(ms) { clearTimeout(shT); shT = setTimeout(shareSync, ms || 0); }\n  try {\n    window.addEventListener('firebaseReady', function () { shareSoon(1200); });\n    window.addEventListener('dbkRoleOk', function () { shareSoon(0); });\n    window.addEventListener('online', function () { shareSoon(600); });\n    document.addEventListener('visibilitychange', function () { if (document.visibilityState === 'visible') shareSoon(600); });\n    // the household settings' copy of this person's choices changed (the other device of theirs, or someone else): the\n    // private place is asked again, and the copy put right from it\n    var mirrorKey = function (k) { var p = ls('myPersonRole'); return !!k && (k === 'dbkPriv_' + p || k === 'dbkKeep_' + p); };\n    window.addEventListener('dbk-settings', function (e) { if (fixing) return; var ks = (e && e.detail && e.detail.keys) || []; if (ks.some(mirrorKey)) shareSoon(300); });\n    window.addEventListener('storage', function (e) { if (e && e.storageArea && mirrorKey(e.key)) shareSoon(300); });   // (native: from another page on this phone; this page's own notes come as dbk-settings)\n    setTimeout(function () { if (!shOk) shareSync(); }, 4000);   // (only if nothing has answered on this page yet)\n  } catch (e) {}\n  function itemHidden(area, x) { return people() > 1 && hiddenFor(x, area, seer(), privBy()); }\n  function visible(area, list) { return people() < 2 ? list : visibleList(list, area, seer(), privBy(), false); }\n  // a shared list as a page may see it ('calendarEvents/data' -> without the other person's private items)\n  function visibleAt(path, list) {\n    if (people() < 2 || !Array.isArray(list)) return list;\n    var c = String(path || '').split('/')[0];\n    if (c === 'dbkRemoved') return visibleList(list, null, seer(), privBy(), true);\n    var a = areaOf(c); return a ? visibleList(list, a, seer(), privBy(), false) : list;\n  }\n  // marks for a list this phone is about to save (see stampList). known: lists this phone last had from the cloud.\n  function stampAt(path, list, known) {\n    if (people() < 2 || !Array.isArray(list) || !window.dbkMerge) return list;\n    var c = String(path || '').split('/')[0], a = areaOf(c); if (!a) return list;\n    var who = seer();\n    var M = window.dbkMerge, field = c === 'finance_budgets' ? 'cat' : undefined;\n    var inherit = null;\n    if (c === 'lifeReminders') inherit = function (x) {\n      // a bill's reminder ('bill-<bill id>', made by Money) follows the bill it reminds about\n      if (!x || !x.fromFinance || typeof x.id !== 'string' || x.id.indexOf('bill-') !== 0) return null;\n      var bills = []; try { var d = JSON.parse(ls('dbkSnap:finance_bills/data') || 'null'); bills = d && Array.isArray(d.items) ? d.items : []; } catch (e) {}\n      try { var l = JSON.parse(ls('finance_bills') || 'null'); if (Array.isArray(l)) bills = bills.concat(l); } catch (e) {}\n      var want = x.id.slice(5), b = bills.filter(function (y) { return y && y.id != null && String(y.id).replace(/[^a-z0-9]/gi, '') === want && (PEOPLE[y.mine] || PEOPLE[y.by]); })[0];\n      if (b) return { mine: b.mine, mineAt: b.mineAt, mineIn: AREAS[b.mineIn] ? b.mineIn : 'money', by: b.by };\n      // a bill added a moment ago while Money is just mine (its own save may not be back yet)\n      return who && privOn(privOf(who), 'money') ? { mine: who, mineAt: Date.now(), mineIn: 'money' } : null;\n    };\n    return stampList(list, { area: a, me: who, rec: who ? privOf(who) : {}, known: known, keyOf: function (l) { return M.keysOf(l, field); }, inherit: inherit });\n  }\n  // a backup or download leaves out what the other person keeps just for themselves ('dbkSnap:calendarEvents/data')\n  function cleanSnap(key, raw) {\n    if (people() > 1 && /^dbkSnap:(financeTx\\/[^\\/]+|finance_subs\\/data|finance_loans\\/data|finance_savings\\/data)$/.test(key || '')) return cleanMoney(key, raw);\n    var m = /^dbkSnap:([^\\/]+)\\/data$/.exec(key || ''); if (!m || !(areaOf(m[1]) || m[1] === 'dbkRemoved') || people() < 2) return raw;\n    try { var d = JSON.parse(raw); if (!d || !Array.isArray(d.items)) return raw; var v = visibleAt(m[1] + '/data', d.items); if (v === d.items) return raw; d.items = v; delete d._gone; return JSON.stringify(d); } catch (e) { return raw; }\n  }\n  // Security (Oct 31): Money's other documents in a backup download, filtered as Money's own Download does (finance.js\n  // expHiddenAccts, work-money.js rowSeen): a month's payments drop the ones marked the other person's (mine) and the\n  // ones on an account of theirs that's hidden from this person; subscriptions, loans and savings drop the ones marked\n  // the other person's while they keep Money just theirs. Without this phone's copy of the accounts (a full\n  // phone lets go of it) while the other person keeps Money just theirs, only bank-synced payments go in (a typed-in\n  // account of theirs can't be told apart). Nothing saved changes: only what goes into the file.\n  function cleanMoney(key, raw) {\n    try {\n      var d = JSON.parse(raw); if (!d || !Array.isArray(d.items)) return raw;\n      var meP = me(), items = d.items, out;\n      if (/^dbkSnap:financeTx\\//.test(key)) {\n        var accts = null; try { var a0 = JSON.parse(ls('dbkSnap:finance_accounts/data') || 'null'); accts = a0 && Array.isArray(a0.items) ? a0.items : null; } catch (e) {}\n        var hid = {}; (accts || []).forEach(function (a) { if (a && a.id != null && itemHidden('money', a)) hid[a.id] = 1; });\n        var blind = !accts && areaKept('money', other(meP));\n        out = items.filter(function (t) {\n          if (!t || typeof t !== 'object') return false;\n          if (t.mine && t.mine !== meP) return false;\n          if (t.acct != null && hid[t.acct]) return false;\n          if (blind && t.acct != null && t.source !== 'simplefin') return false;\n          return true;\n        });\n      } else {\n        // only what is marked the other person's (mine, else who added it, else whose it is): Money itself lists the\n        // household's unmarked subscriptions, loans and savings to both, so they stay in both backups\n        var oth = other(meP), kept = areaKept('money', oth);\n        out = items.filter(function (x) { if (!x || typeof x !== 'object') return false; var o = x.mine || x.by || x.owner; return !(kept && o === oth); });\n      }\n      if (out.length === items.length) return raw;\n      d.items = out; delete d._gone; return JSON.stringify(d);\n    } catch (e) { return raw; }\n  }\n  // which areas this copy has (Recipes only with Meals, bills and accounts only with Money)\n  function areasHere() {\n    var M = window.dbkModule;\n    return AREA_ORDER.filter(function (a) { var m = AREAS[a].mod; return !m || !M || (M.on(m) && !(M.archived && M.archived('page:' + m))); });\n  }\n\n  // this phone's plain copies of the lists (read by Work, Meals' cooking heads-ups, the grocery list on Meals...):\n  // once the other person keeps an area just theirs, what is theirs comes out of these too, so nothing older shows it\n  // (the cloud copy and its _gone are untouched; only what this phone may see is written)\n  function tidyLocal() {\n    if (people() < 2 || !seer()) return;   // only once this phone knows who it is (never takes out its own)\n    // (and Recently removed's own copy, Nov 1: its entries hold what was removed, the other person's private things too)\n    ['calendarEvents', 'lifeReminders', 'groceries', 'dbkRemoved'].forEach(function (k) {\n      var l = jget(k, null); if (!Array.isArray(l)) return;\n      // Oct 25 audit (real Firestore): another page opening took Today's just-added event out of this copy (it has no\n      // marks here: they go on the copy that's saved), Today took the copy in, and its next save removed the event from\n      // the cloud. Marks come from the cloud's copy first, and a thing the cloud's copy doesn't have yet is this phone's\n      // own new thing, so it stays.\n      var snap = jget('dbkSnap:' + k + '/data', null), M = window.dbkMerge;\n      var cloud = snap && Array.isArray(snap.items) ? snap.items : null;\n      var l2 = l, ck = null;\n      if (M && cloud) {\n        ck = {}; var ckeys = M.keysOf(cloud); ckeys.forEach(function (x, i) { if (x !== null) ck[x] = cloud[i]; });\n        var lk = M.keysOf(l);\n        l2 = l.map(function (x, i) {\n          var c = lk[i] !== null ? ck[lk[i]] : null; if (!c || !x || typeof x !== 'object') return x;\n          var add = null; MARK.forEach(function (f) { if (c[f] !== undefined && x[f] === undefined) { add = add || {}; add[f] = c[f]; } });\n          if (!add) return x; var y = {}; for (var a in x) y[a] = x[a]; for (var b in add) y[b] = add[b]; return y;\n        });\n      }\n      var v = visibleAt(k + '/data', l2);\n      if (ck) {\n        var keep = {}; M.keysOf(v).forEach(function (x) { if (x !== null) keep[x] = 1; });\n        var l2k = M.keysOf(l2);\n        v = l2.filter(function (x, i) { var key = l2k[i]; return key === null || keep[key] || !ck[key]; });\n      }\n      if (v === l || JSON.stringify(v) === JSON.stringify(l)) return;\n      lset(k, JSON.stringify(v));\n    });\n  }\n  try {\n    window.addEventListener('storage', function (e) { if (e.key && /^dbkPriv_person[12]$|^dbkPrivate_sharing_person[12]$|^myPersonRole$|^dbkRoleUid$/.test(e.key)) setTimeout(tidyLocal, 0); });\n    window.addEventListener('dbkRoleOk', function () { setTimeout(tidyLocal, 0); });\n    setTimeout(tidyLocal, 0);\n  } catch (e) {}\n\n  root.dbkSharing = {\n    areas: AREAS, areaOrder: AREA_ORDER, areasHere: areasHere, areaOf: areaOf, areaKept: areaKept, setArea: setArea, privOf: privOf,\n    itemHidden: itemHidden, hiddenFor: hiddenFor, ownerMark: ownerMark,\n    // who keeps this thing just for themselves now ('person1' | 'person2'), or null when it's shared\n    ownerOf: function (area, x) { return people() < 2 ? null : ownerOf(x, area, privBy()); }, visible: visible, visibleAt: visibleAt, stampAt: stampAt, cleanSnap: cleanSnap, seer: seer,\n    lists: LISTS, order: ORDER, familyOf: familyOf, people: people, me: me, other: other,\n    keepOf: keepOf, kept: kept, canChange: canChange, noCloud: noCloud, set: setKept, sync: shareSync,\n    // where this phone keeps a list: the cloud document under dreams/, and the phone's own key\n    doc: doc, localKey: function (cat) { return 'dreams_' + doc(cat); },\n    // a thing on a shared list that this phone doesn't show, because the partner keeps that list just for themselves\n    listHidden: function (cat, item) {\n      if (people() < 2) return false; var f = familyOf(cat), m = me();\n      if (!f || kept(f, m)) return false;\n      return partnerHides(item, f, m, keepOf(other(m)));\n    },\n    partnerHides: partnerHides,\n    // a wishlist the partner keeps just for themselves isn't shown on this phone\n    hidden: function (cat) { var m = /^(person[12])-wishlist$/.exec(cat || ''); return !!m && people() > 1 && m[1] !== me() && kept('wishlists', m[1]); },\n    // the list a Recently removed entry belongs to ('dreams_reading_person1' -> 'reading')\n    catOfKey: function (k) { return String(k || '').replace(/^dreams_/, '').replace(/_person[12]$/, ''); }\n  };\n})(typeof window !== 'undefined' ? window : globalThis);\n","firebase-helpers.js":"/* 2daysbook — Firestore helpers shared by every page: syncToFirebase, loadFromFirebase, setupFirebaseListener,\n   syncSettingsToFirebase. Writes are suppressed from echoing back through listeners for a short window. */\n(function () {\n    // Write suppression: prevents Firebase listeners from overwriting during local saves\n    var _writingTo = {};\n    function startWrite(col) { _writingTo[col] = Date.now(); }\n    // the Workroom keeps everything in one document, so its writes get a longer quiet window\n    function writeWindow(col) { return col === 'workroom' ? 8000 : 3000; }\n    function isWriting(col) { return _writingTo[col] && (Date.now() - _writingTo[col]) < writeWindow(col); }\n    function endWrite(col) { setTimeout(function() { delete _writingTo[col]; }, col === 'workroom' ? 8000 : 1500); }\n    var _firestoreFailCount = 0;\n\n    // W-13: Surface persistent sync failures after 3 consecutive errors\n    function _showSyncWarning() {\n        var indicator = document.getElementById('syncStatusIndicator');\n        if (indicator) {\n            indicator.style.display = 'inline-block';\n            indicator.title = 'Cloud sync unavailable — your data is saved locally. Check your Firebase config in Settings.';\n        }\n    }\n    function _clearSyncWarning() {\n        _firestoreFailCount = 0;\n        var indicator = document.getElementById('syncStatusIndicator');\n        if (indicator) indicator.style.display = 'none';\n    }\n\n    // opts (optional): { fields: ['content', ...], size: n } writes only those parts of items and leaves the\n    // rest of the cloud copy as it is (size = the whole list's size, for the 1MB check). Resolves true once written.\n    // a copy that has its own online storage (not the live preview, which keeps everything in the browser)\n    function hasCloud() {\n        if (window.firebaseNotConfigured) return false;\n        try { var c = JSON.parse(localStorage.getItem('firebaseConfig') || 'null'); return !!(c && c.apiKey); } catch (e) { return false; }\n    }\n    // Oct 20: a change saved while this phone isn't signed in (or while a slow sign-in is still being checked) used\n    // to stay only in this phone's list and be thrown away when the cloud copy loaded at sign-in. Shared lists now\n    // note it item by item (daybook-theme.js dbkPendNote) and add it to the cloud copy once signed in.\n    function keepForLater(collectionName, data, opts) {\n        if (opts && opts.fields) return;\n        if (hasCloud() && typeof window.dbkPendNote === 'function') { try { window.dbkPendNote(collectionName, data); } catch (e) {} }\n    }\n    // lists shared by both phones are merged and size-checked item by item on the way out (daybook-theme.js)\n    var MERGED = /^(lifeReminders|calendarEvents|groceries|capturedThoughts|capturedThoughts_person[12]|routine_person[12]|futureTodos_person[12]|mealGroceries|finance_bills|finance_budgets|finance_accounts|dbkRemoved)$/;\n    async function syncToFirebase(collectionName, data, opts) {\n        if (window.firebaseConfigEmpty) { keepForLater(collectionName, data, opts); return false; }\n        startWrite(collectionName);\n        if (!window.firebaseReady) {\n            await waitForFirebase();\n        }\n        if (!window.firebaseReady || !window.db) { keepForLater(collectionName, data, opts); endWrite(collectionName); return false; }\n        var ok = false;\n        try {\n            var payload = JSON.stringify({ items: data });\n            var size = (opts && opts.size) || payload.length;\n            if (size > 900000 && !(MERGED.test(collectionName) && !(opts && opts.fields) && window.dbkMerge)) {\n                // Firestore keeps at most 1MB in one document: this list stays on this phone, and the person is told\n                // (the standard message spot, a note that stays until closed)\n                console.warn(collectionName + ' is approaching the Firestore document limit: ' + size + ' bytes.');\n                if (typeof window.dbkTooBig === 'function') window.dbkTooBig(collectionName + '/data');\n                else if (typeof window.lhToast === 'function') window.lhToast('Cloud sync paused: this list is getting large.', 'warning');\n                endWrite(collectionName);\n                return false;\n            }\n            var fi = window.firestoreImports;\n            var ref = fi.doc(window.db, collectionName, 'data');\n            if (opts && opts.fields) await fi.setDoc(ref, { items: data }, { mergeFields: opts.fields.map(function (k) { return 'items.' + k; }) });\n            else await fi.setDoc(ref, { items: data });\n            _clearSyncWarning(); // successful write — clear any previous warning\n            ok = true;\n        } catch (error) {\n            // Silent fail — app continues with localStorage\n            _firestoreFailCount = (_firestoreFailCount || 0) + 1;\n            if (_firestoreFailCount >= 3) { _showSyncWarning(); }\n        }\n        endWrite(collectionName);\n        return ok;\n    }\n\n\n    // Read the cloud's newest copy and write build(itsItems) in one transaction, so nothing another device saved in\n    // between is written over (Today's Three and Work's Three, one line at a time; build merges). Resolves with what was\n    // written. When a transaction can't run (offline, signed out, sign-in not checked yet, an old page), build(null)\n    // goes the usual way (queued by the database, or held until the sign-in check) and the listener merges later.\n    async function mergeSave(collectionName, build) {\n        var fi = window.firestoreImports;\n        var can = !window.firebaseConfigEmpty && window.firebaseReady && window.db && fi && typeof fi.runTransaction === 'function' &&\n            (!window.dbkRoleOk || window.dbkRoleOk());\n        if (can) {\n            startWrite(collectionName);\n            try {\n                var ref = fi.doc(window.db, collectionName, 'data');\n                var out = await fi.runTransaction(window.db, async function (t) {\n                    var s = await t.get(ref), cur = s && s.exists() ? (s.data() || {}).items : null;\n                    var v = build(cur === undefined ? null : cur);\n                    if (v != null) t.set(ref, { items: v });\n                    return v;\n                });\n                try { if (out != null) localStorage.setItem('dbkSnap:' + collectionName + '/data', JSON.stringify({ items: out })); } catch (e) {}\n                _clearSyncWarning();\n                endWrite(collectionName);\n                return out;\n            } catch (e) { endWrite(collectionName); }\n        }\n        var v0 = build(null);\n        if (v0 != null) await syncToFirebase(collectionName, v0);\n        return null;\n    }\n\n    // Shared Firebase-ready promise so multiple calls don't each create independent timers\n    var _firebaseReadyPromise = null;\n    function waitForFirebase() {\n        if (window.firebaseReady) return Promise.resolve(true);\n        if (!_firebaseReadyPromise) {\n            _firebaseReadyPromise = Promise.race([\n                new Promise(function(resolve) {\n                    if (window.firebaseReady) resolve(true);\n                    else window.addEventListener('firebaseReady', function() { resolve(true); }, { once: true });\n                }),\n                // as long as firebase-init.js waits to hear whether this phone is signed in (15s for a phone that was\n                // signed in before), so a page never falls back to the phone's copy and then later saves that\n                // copy over newer cloud data\n                new Promise(function(resolve) { var was = false; try { was = !!localStorage.getItem('dbkSignedIn'); } catch (e) {} setTimeout(function() { resolve(false); }, was ? 16000 : 5000); })\n            ]);\n        }\n        return _firebaseReadyPromise;\n    }\n\n    // draw from the phone's copy right away; the cloud is checked in the background (live listeners pick up changes)\n    async function loadFromFirebase(collectionName) {\n        var hit = window.dbkSnapItems ? window.dbkSnapItems(collectionName) : undefined;\n        if (hit !== undefined) { loadFromFirebaseLive(collectionName).catch(function () {}); return hit; }\n        var release = window.dbkGateHold ? window.dbkGateHold() : function () {};\n        try { return await loadFromFirebaseLive(collectionName); } finally { release(); }\n    }\n    async function loadFromFirebaseLive(collectionName) {\n        if (window.firebaseConfigEmpty) return null;\n        if (!window.firebaseReady) {\n            await waitForFirebase();\n        }\n        if (!window.firebaseReady || !window.db) return null;\n        try {\n            var fi = window.firestoreImports;\n            // Hard 5s cap: if Firestore can't be reached, fall back to localStorage\n            // instead of leaving the section blank. Live listeners still update later.\n            var docSnap = await Promise.race([\n                fi.getDoc(fi.doc(window.db, collectionName, 'data')),\n                new Promise(function(_, reject) { setTimeout(function() { reject(new Error('hh-timeout')); }, 5000); })\n            ]);\n            if (docSnap.exists()) return docSnap.data().items;\n        } catch (error) { /* Silent fail */ }\n        return null;\n    }\n\n    // True only when the cloud itself answered that this list doesn't exist yet. A slow or failed read,\n    // or an answer from the phone's own saved copy, is NOT \"missing\": a page must never upload its\n    // older copy over the cloud just because the cloud was slow to answer.\n    // (a name with a slash is a document's whole path, e.g. 'dreams/restaurants'; otherwise '<name>/data')\n    async function cloudMissing(collectionName) {\n        if (window.firebaseConfigEmpty) return false;\n        if (!window.firebaseReady) await waitForFirebase();\n        if (!window.firebaseReady || !window.db) return false;\n        try {\n            var fi = window.firestoreImports;\n            var parts = String(collectionName).indexOf('/') > -1 ? String(collectionName).split('/') : [collectionName, 'data'];\n            var snap = await Promise.race([\n                fi.getDoc(fi.doc.apply(null, [window.db].concat(parts))),\n                new Promise(function(_, reject) { setTimeout(function() { reject(new Error('hh-timeout')); }, 8000); })\n            ]);\n            return !snap.exists() && !(snap.metadata && snap.metadata.fromCache);\n        } catch (error) { return false; }\n    }\n\n    function setupFirebaseListener(collectionName, callback) {\n        if (window.firebaseConfigEmpty) return;\n        function doListen() {\n            if (!window.firebaseReady || !window.db) return;\n            try {\n                var fi = window.firestoreImports;\n                fi.onSnapshot(fi.doc(window.db, collectionName, 'data'), function(snap) {\n                    if (isWriting(collectionName)) return;\n                    if (snap.exists()) callback(snap.data().items);\n                });\n            } catch(e) { /* Silent fail */ }\n        }\n        if (window.firebaseReady) doListen();\n        else window.addEventListener('firebaseReady', doListen, { once: true });\n    }\n\n    // Send this phone's changed household settings up (each one with its own time; see dbkSettings in shared.js)\n    window.syncSettingsToFirebase = function syncSettingsToFirebase() {\n        if (window.dbkSettings) return window.dbkSettings.save();\n        return Promise.resolve();\n    };\n\n    window.syncToFirebase = syncToFirebase;\n    window.dbkMergeSave = mergeSave;\n    window.loadFromFirebase = loadFromFirebase;\n    // reads the cloud itself, never this phone's copy of it (for decisions like \"is today's habit card already there?\")\n    window.loadFromFirebaseLive = loadFromFirebaseLive;\n    window.setupFirebaseListener = setupFirebaseListener;\n    window.dbkCloudMissing = cloudMissing;\n    window.waitForFirebase = waitForFirebase;\n    window.isWriting = isWriting;\n    window.startWrite = startWrite;\n    window.endWrite = endWrite;\n    window._showSyncWarning = _showSyncWarning;\n})();\n","grocery-words.js":"/* 2daysbook grocery words: what a grocery store sells and which section it's in. A plain list, written by hand\n   (no dataset, nothing looked up, nothing sent). One list for the grocery list's sections (grocery-aisle.js) and the\n   Inbox's \"this is groceries\" guess (inbox-suggest.js, through grocery-aisle.js). About 6449 words and phrases.\n   - Comma separated, lower case; plurals, accents (jalapeño) and amounts are handled by grocery-aisle.js.\n   - \"first\" is the older list and wins where both name the same thing; \"more\" (Oct 25) only adds.\n   - Section names are the grocery list's own (Meals > Grocery groups by them): don't rename one. */\n(function (root) {\n  var W = {\n  first: {\n    \"Produce\": \"spinach, baby spinach, onion, red onion, yellow onion, white onion, sweet onion, vidalia onion, garlic, garlic bulb, garlic cloves, lemon, lime, carrot, baby carrot, strawberry, blueberry, berries, raspberry, blackberry, cranberry, banana, apple, honeycrisp, fuji apple, gala apple, granny smith, mango, pineapple, parsley, basil, cilantro, dill, mint, rosemary, thyme, sage, chives, ginger, ginger root, jalapeno, jalape\\u00f1o, serrano, poblano, habanero, tomato, cherry tomato, grape tomato, roma tomato, heirloom tomato, lettuce, romaine, iceberg, arugula, kale, collard greens, chard, swiss chard, spring mix, mixed greens, salad mix, salad kit, salad greens, bagged salad, zucchini, cucumber, english cucumber, celery, bell pepper, red bell pepper, green pepper, yellow pepper, orange pepper, broccoli, broccolini, cauliflower, sweet potato, yam, potato, russet, russet potato, red potato, yukon gold, gold potato, fingerling, baby potato, green onion, scallion, cabbage, red cabbage, napa cabbage, avocado, asparagus, mushroom, portobello, cremini, baby bella, shiitake, radish, beet, turnip, parsnip, squash, butternut squash, acorn squash, spaghetti squash, yellow squash, pumpkin, snap peas, snow peas, sugar snap peas, green beans, string beans, haricots verts, corn on the cob, sweet corn, ear of corn, shallot, leek, fennel, bok choy, watercress, endive, radicchio, artichoke, eggplant, okra, plantain, grapes, red grapes, green grapes, pear, peach, plum, nectarine, apricot, fig, pomegranate, watermelon, cantaloupe, honeydew, melon, clementine, cutie, tangerine, mandarin, navel orange, orange, grapefruit, kiwi, papaya, passion fruit, dragon fruit, cherry, coleslaw mix, cole slaw, coleslaw, jicama, bean sprouts, sprouts, alfalfa sprouts, microgreens, fresh herbs, herbs, produce, fruit, veggies, vegetables, veggie tray, fruit tray, brussels sprouts, tomatillo, lemongrass, horseradish, persimmon, guava, lychee, starfruit, rhubarb, kohlrabi, celery root\",\n    \"Protein\": \"chicken, whole chicken, rotisserie chicken, chicken breast, chicken thighs, chicken wings, chicken drumsticks, drumsticks, chicken tenders, chicken tenderloins, chicken legs, chicken quarters, cornish hen, turkey, ground turkey, turkey breast, beef, ground beef, ground chuck, ground sirloin, chuck roast, pot roast, brisket, stew meat, stew beef, short ribs, flank steak, skirt steak, sirloin, ribeye, filet mignon, tri tip, london broil, steak, salmon, salmon fillet, shrimp, prawns, fish, white fish, eggs, egg, egg whites, pork, pork chops, pork loin, pork tenderloin, pork shoulder, pork butt, pork belly, pulled pork, ground pork, ribs, baby back ribs, spare ribs, tuna steak, sausage, italian sausage, breakfast sausage, chicken sausage, bratwurst, brats, kielbasa, andouille, hot dogs, franks, bacon, turkey bacon, canadian bacon, lamb, ground lamb, lamb chops, tofu, firm tofu, extra firm tofu, silken tofu, tempeh, seitan, tilapia, cod, halibut, mahi mahi, trout, catfish, crab, crab meat, lobster, scallops, mussels, clams, oysters, bison, venison, duck, chorizo, prosciutto, salami, pepperoni, deli meat, lunch meat, lunchmeat, cold cuts, deli turkey, deli ham, sliced turkey, sliced ham, ham, spiral ham, ham steak, ground chicken, meatballs, beyond burger, impossible burger, veggie burgers, burger patties, hamburger patties, roast beef, corned beef, pastrami\",\n    \"Dairy\": \"cheese, yogurt, greek yogurt, plain yogurt, vanilla yogurt, yogurt cups, milk, whole milk, skim milk, 2% milk, 1% milk, lactose free milk, almond milk, oat milk, soy milk, cashew milk, chocolate milk, sour cream, cream, heavy cream, heavy whipping cream, whipping cream, light cream, butter, unsalted butter, salted butter, feta, parmesan, parmigiano, pecorino, mozzarella, fresh mozzarella, string cheese, cream cheese, cottage cheese, ricotta, gouda, cheddar, shredded cheddar, sharp cheddar, swiss, provolone, brie, camembert, goat cheese, blue cheese, gorgonzola, monterey jack, pepper jack, colby jack, mexican blend, shredded cheese, sliced cheese, american cheese, havarti, muenster, manchego, halloumi, queso fresco, cotija, half and half, half n half, whipped cream, coffee creamer, creamer, kefir, ghee, buttermilk, eggnog, egg nog, pudding cups, margarine, skyr, chobani, tillamook, kerrygold, philadelphia, babybel, laughing cow, french onion dip, dip, refrigerated dough, crescent rolls, biscuit dough, cookie dough\",\n    \"Grains & Bread\": \"rice, brown rice, white rice, jasmine rice, basmati rice, wild rice, arborio rice, instant rice, minute rice, oats, rolled oats, steel cut oats, quick oats, oatmeal, instant oatmeal, farro, quinoa, tortillas, flour tortillas, corn tortillas, bread, white bread, wheat bread, whole wheat bread, sourdough, rye bread, multigrain bread, french bread, italian bread, baguette, ciabatta, brioche, loaf, texas toast, garlic bread, spaghetti, pasta, penne, rigatoni, fusilli, rotini, farfalle, bowtie pasta, linguine, fettuccine, angel hair, macaroni, elbow macaroni, lasagna noodles, lasagna sheets, ziti, shells, orecchiette, gnocchi, ramen, ramen noodles, egg noodles, rice noodles, udon, soba, pita, naan, flatbread, wraps, buns, hamburger buns, hot dog buns, slider buns, rolls, dinner rolls, hoagie rolls, sub rolls, kaiser rolls, croissants, orzo, couscous, barley, bulgur, cornmeal, polenta, grits, granola, cereal, bagels, english muffins, croutons, breadcrumbs, bread crumbs, panko, pizza dough, pizza crust, stuffing, stuffing mix, mac and cheese, mac n cheese, boxed mac and cheese, kraft mac and cheese, cheerios, honey nut cheerios, frosted flakes, corn flakes, rice krispies, raisin bran, special k, chex, lucky charms, life cereal, kashi, shredded wheat, grape nuts, quaker oats, barilla, taco shells, hard taco shells, tostadas, pancake mix, waffle mix, bisquick, biscuit mix, muffins, donuts, doughnuts, cinnamon rolls\",\n    \"Canned & Jarred\": \"black beans, kidney beans, pinto beans, cannellini, cannellini beans, navy beans, white beans, great northern beans, garbanzo, garbanzo beans, chickpeas, refried beans, baked beans, beans, marinara, pasta sauce, spaghetti sauce, pizza sauce, alfredo sauce, vodka sauce, salsa, salsa verde, queso, chipotle, adobo, chipotles in adobo, roasted red peppers, tomato sauce, crushed tomatoes, diced tomatoes, whole tomatoes, stewed tomatoes, fire roasted tomatoes, canned tomatoes, tomato paste, rotel, broth, stock, bone broth, chicken broth, beef broth, vegetable broth, chicken stock, beef stock, vegetable stock, bouillon, soup, chicken noodle soup, tomato soup, cream of mushroom, cream of chicken, chili, canned chili, olives, kalamata olives, green olives, black olives, sun dried tomatoes, canned corn, creamed corn, enchilada sauce, coconut cream, coconut milk, peanut butter, almond butter, cashew butter, sunflower butter, nut butter, tahini, jam, jelly, preserves, fruit spread, capers, artichoke hearts, pumpkin puree, canned pumpkin, applesauce, pickles, dill pickles, relish, sauerkraut, kimchi, lentils, red lentils, green lentils, hummus, tuna, canned tuna, canned salmon, canned chicken, sardines, anchovies, spam, evaporated milk, sweetened condensed milk, condensed milk, nutella, jif, skippy, smuckers, raos, bushs, campbells, progresso, green chiles, diced green chiles, water chestnuts, bamboo shoots, mandarin oranges, fruit cups, canned fruit, canned peaches, cranberry sauce, gravy, ragu, prego, pesto\",\n    \"Frozen\": \"ice cream, gelato, sorbet, frozen yogurt, popsicles, ice pops, freezer pops, frozen pizza, frozen fruit, frozen berries, frozen mango, frozen vegetables, frozen veggies, frozen peas, frozen corn, frozen spinach, frozen broccoli, riced cauliflower, cauliflower rice, frozen waffles, eggo, eggo waffles, frozen meals, frozen dinners, tv dinners, lean cuisine, hot pockets, chicken nuggets, nuggets, fish sticks, tater tots, french fries, fries, frozen fries, hash browns, pie crust, frozen pie, cool whip, ice, bag of ice, ben and jerrys, halo top, ice cream bars, ice cream sandwiches, frozen burritos, pizza rolls, bagel bites, totinos, dumplings, pot stickers, potstickers, frozen shrimp, frozen fish, frozen chicken, edamame, egg rolls, frozen pancakes, frozen breakfast sandwiches, uncrustables, waffles, sweet potato fries, onion rings, mozzarella sticks, digiorno, red baron, stouffers, birds eye, frozen\",\n    \"Spices & Oils\": \"olive oil, extra virgin olive oil, cumin, chili powder, garlic powder, garlic salt, onion powder, oregano, cinnamon, paprika, smoked paprika, red pepper flakes, crushed red pepper, italian seasoning, salt, sea salt, kosher salt, pepper, black pepper, peppercorns, cayenne, turmeric, nutmeg, honey, maple syrup, syrup, pancake syrup, agave, soy sauce, tamari, hot sauce, vinegar, apple cider vinegar, balsamic, balsamic vinegar, rice vinegar, red wine vinegar, white vinegar, sesame oil, teriyaki, teriyaki sauce, ketchup, cornstarch, curry powder, garam masala, bay leaves, cloves, allspice, coriander, ground ginger, mustard, yellow mustard, dijon, dijon mustard, honey mustard, worcestershire, fish sauce, oyster sauce, hoisin, sriracha, sambal, gochujang, miso, coconut oil, avocado oil, cooking spray, pam, vegetable oil, canola oil, oil, spices, seasoning, taco seasoning, everything bagel seasoning, ranch seasoning, old bay, lemon pepper, cajun seasoning, steak seasoning, poultry seasoning, pumpkin pie spice, dried basil, dried oregano, dried thyme, dried parsley, dried dill, dried rosemary, ranch, ranch dressing, salad dressing, italian dressing, caesar dressing, balsamic vinaigrette, vinaigrette, dressing, blue cheese dressing, thousand island, bbq sauce, barbecue sauce, buffalo sauce, wing sauce, steak sauce, a1, mayo, mayonnaise, miracle whip, aioli, tartar sauce, cocktail sauce, sweet chili sauce, chili crisp, chili oil, marinade, heinz, hellmanns, franks red hot, franks redhot, tabasco, cholula, sauce\",\n    \"Baking & Snacks\": \"chocolate, dark chocolate, milk chocolate, chocolate chips, semi sweet chocolate chips, dark chocolate chips, baking chocolate, walnuts, almonds, chia seeds, flaxseed, flax seeds, hemp hearts, hemp seeds, cocoa, cocoa powder, cacao, trail mix, graham crackers, coconut flakes, shredded coconut, dates, medjool dates, pecans, cashews, pistachios, peanuts, sunflower seeds, pumpkin seeds, pepitas, pine nuts, mixed nuts, nuts, baking powder, baking soda, yeast, sugar, brown sugar, powdered sugar, confectioners sugar, coconut sugar, granulated sugar, flour, all purpose flour, bread flour, whole wheat flour, almond flour, coconut flour, cake flour, self rising flour, vanilla, vanilla extract, almond extract, food coloring, sprinkles, frosting, cake mix, brownie mix, muffin mix, cookie mix, marshmallows, chocolate syrup, caramel, dried cranberries, craisins, raisins, dried apricots, dried fruit, dried mango, prunes, popcorn, microwave popcorn, pretzels, tortilla chips, pita chips, chips, potato chips, kettle chips, corn chips, veggie chips, rice cakes, granola bars, protein bars, snack bars, cereal bars, fruit snacks, fruit leather, crackers, saltines, ritz, triscuits, wheat thins, cheez its, cheese crackers, goldfish, goldfish crackers, animal crackers, oreos, cookies, chips ahoy, candy, gummy bears, gummies, jelly beans, m&ms, reeses, snickers, kit kat, skittles, doritos, cheetos, lays, fritos, tostitos, pringles, sun chips, takis, kind bars, clif bars, larabars, rxbars, nature valley, nutri grain bars, pop tarts, poptarts, beef jerky, jerky, snacks, applesauce pouches, squeeze pouches\",\n    \"Supplements\": \"collagen supplement, l glutamine, glutamine, mct oil, whey protein, whey protein powder, protein powder, collagen, collagen peptides, creatine, fish oil, omega 3, multivitamin, vitamins, vitamin d, vitamin c, magnesium, zinc, iron supplement, probiotic, probiotics, electrolytes, liquid iv, bcaa, pre workout, preworkout, supplements, fiber supplement, metamucil, melatonin, elderberry, prenatal vitamins\",\n    \"Drinks\": \"coffee, coffee beans, coffee grounds, ground coffee, whole bean coffee, k cups, kcups, coffee pods, nespresso pods, cold brew, instant coffee, espresso, tea, green tea, black tea, herbal tea, chamomile, peppermint tea, tea bags, iced tea, sweet tea, chai, matcha, juice, orange juice, apple juice, cranberry juice, grape juice, lemonade, limeade, soda, pop, cola, coke, diet coke, coke zero, pepsi, sprite, ginger ale, root beer, dr pepper, mountain dew, sparkling water, seltzer, club soda, tonic, tonic water, mineral water, bottled water, water, water bottles, case of water, lacroix, la croix, bubly, spindrift, perrier, san pellegrino, pellegrino, topo chico, gatorade, powerade, sports drinks, energy drinks, red bull, celsius, monster, kombucha, coconut water, beer, wine, red wine, white wine, rose, champagne, prosecco, hard seltzer, white claw, liquor, vodka, tequila, whiskey, bourbon, rum, gin, hard cider, cider, sparkling cider, capri sun, juice boxes, vitamin water, smoothies, protein shakes, premier protein, fairlife shakes, drinks, oj\",\n    \"Household\": \"paper towels, toilet paper, tp, tissues, kleenex, napkins, paper plates, paper cups, plastic cups, plastic forks, plastic utensils, dish soap, dishwasher detergent, dishwasher pods, cascade, dawn, laundry detergent, detergent, laundry pods, tide, tide pods, dryer sheets, fabric softener, bleach, clorox, stain remover, oxiclean, shout, trash bags, garbage bags, glad bags, hefty, aluminum foil, foil, tin foil, plastic wrap, saran wrap, cling wrap, parchment paper, wax paper, ziploc, ziplocs, ziploc bags, zip lock bags, sandwich bags, freezer bags, storage bags, sponges, scrub brush, scrubber, steel wool, cleaning spray, all purpose cleaner, windex, lysol, disinfecting wipes, clorox wipes, glass cleaner, toilet bowl cleaner, swiffer, swiffer pads, mop pads, broom, dustpan, rubber gloves, batteries, aa batteries, aaa batteries, light bulbs, lightbulbs, candles, matches, lighter, air freshener, febreze, vacuum bags, water filter, brita filter, furnace filter, air filter, coffee filters, cupcake liners, foil pans, muffin liners, hand soap, soap, soap refill, bar soap, lint roller, duct tape, tape, bounty, charmin, scott, cottonelle, cleaning supplies, magic eraser, mr clean\",\n    \"Personal Care\": \"shampoo, conditioner, body wash, shower gel, toothpaste, toothbrush, toothbrushes, mouthwash, floss, dental floss, deodorant, antiperspirant, razors, razor blades, shaving cream, lotion, body lotion, moisturizer, sunscreen, sunblock, face wash, cleanser, makeup remover, cotton balls, cotton swabs, q tips, qtips, tampons, pads, pantyliners, panty liners, hair ties, bobby pins, hairspray, hair gel, dry shampoo, chapstick, lip balm, contact solution, eye drops, band aids, bandaids, bandages, first aid, tylenol, advil, ibuprofen, acetaminophen, aspirin, motrin, aleve, allergy medicine, claritin, zyrtec, benadryl, cough drops, cough syrup, nyquil, dayquil, tums, pepto, prescription, nail polish remover, face masks, hand sanitizer, purell, medicine, vaseline, aquaphor, neosporin\",\n    \"Pets\": \"cat food, dog food, kibble, wet food, cat litter, litter, kitty litter, dog treats, cat treats, dog bones, chew toys, rawhide, flea medicine, flea collar, heartworm, puppy pads, pee pads, poop bags, dog poop bags, pet food, fish food, bird seed, birdseed, purina, friskies, fancy feast, blue buffalo, milk bones, greenies, pedigree, iams, temptations\",\n    \"Baby\": \"diapers, baby wipes, pull ups, pullups, formula, baby formula, baby food, baby food pouches, diaper cream, desitin, baby shampoo, baby wash, baby lotion, pacifiers, sippy cups, teether, pampers, huggies, luvs, gerber, similac, enfamil\"\n  },\n  more: {\n    \"Produce\": \"flowers, fresh flowers, bouquet, bouquet of flowers, tulips, roses, apples, peas, green peas, sweet peas, pink lady, envy apple, jazz apple, mcintosh, red delicious, golden delicious, cosmic crisp, ambrosia apple, braeburn, macintosh, bartlett pear, bosc pear, anjou pear, asian pear, blood orange, cara cara, valencia orange, meyer lemon, key lime, kumquat, pomelo, ugli fruit, satsuma, white peach, donut peach, yellow peach, pluot, black plum, red plum, bing cherry, rainier cherry, sour cherry, gooseberry, currant, red currant, elderberries, mulberry, boysenberry, huckleberry, golden berry, kiwifruit, golden kiwi, mangoes, ataulfo mango, champagne mango, pineapple chunks, cut fruit, fruit cup fresh, mixed fruit, melon chunks, watermelon chunks, seedless watermelon, mini watermelon, galia melon, casaba melon, crenshaw melon, cherimoya, jackfruit, durian, rambutan, longan, mangosteen, tamarind, feijoa, quince, yuzu, finger lime, sugar cane, coconut whole, young coconut, avocado oil spray, hass avocado, mini avocado, bananas bunch, baby bananas, red bananas, plantains, green plantain, ripe plantain, frisee, escarole, mache, butter lettuce, bibb lettuce, boston lettuce, green leaf lettuce, red leaf lettuce, little gem, romaine hearts, hearts of romaine, iceberg lettuce, shredded lettuce, chopped salad, caesar salad kit, salad blend, spring greens, power greens, baby kale, lacinato kale, dinosaur kale, tuscan kale, curly kale, baby arugula, mustard greens, turnip greens, beet greens, dandelion greens, pea shoots, sunflower sprouts, broccoli sprouts, mung bean sprouts, baby bok choy, gai lan, chinese broccoli, yu choy, napa, savoy cabbage, green cabbage, broccoli florets, broccoli crowns, broccoli slaw, cauliflower florets, purple cauliflower, romanesco, baby carrots, rainbow carrots, carrot sticks, shredded carrots, matchstick carrots, celery sticks, celery hearts, english peas, fava beans, lima beans fresh, long beans, wax beans, yellow wax beans, cucumbers, persian cucumbers, mini cucumbers, kirby cucumber, pickling cucumbers, hothouse cucumber, mini peppers, sweet mini peppers, baby bell peppers, orange bell pepper, yellow bell pepper, green bell pepper, red peppers, peppers, anaheim pepper, hatch chiles, fresno chile, thai chili, thai chilies, bird's eye chili, scotch bonnet, ghost pepper, shishito peppers, padron peppers, banana pepper fresh, cubanelle, hungarian wax pepper, jalapenos, jalapeno peppers, serrano peppers, poblano peppers, chili peppers, hot peppers, chiles, green chili, red chili, sweet onions, red onions, white onions, yellow onions, pearl onions, cipollini, spring onions, ramps, garlic scapes, elephant garlic, peeled garlic, minced garlic, chopped garlic, garlic paste, ginger paste, galangal, turmeric root, fresh turmeric, horseradish root, wasabi root, potatoes, idaho potatoes, white potatoes, purple potatoes, petite potatoes, new potatoes, creamer potatoes, japanese sweet potato, garnet yam, jewel yam, taro, yuca, cassava, malanga, jerusalem artichoke, sunchoke, rutabaga, daikon, daikon radish, watermelon radish, french breakfast radish, golden beets, red beets, cooked beets, baby beets, kabocha, kabocha squash, delicata squash, hubbard squash, carnival squash, sugar pumpkin, pie pumpkin, pumpkins, gourds, chayote, summer squash, zucchini squash, baby zucchini, crookneck squash, pattypan, cherry tomatoes, grape tomatoes, beefsteak tomato, plum tomato, tomatoes on the vine, vine tomatoes, campari tomatoes, kumato, green tomatoes, sun gold tomatoes, white mushrooms, button mushrooms, sliced mushrooms fresh, oyster mushrooms, king oyster mushrooms, enoki, maitake, chanterelle, morels, porcini fresh, lion's mane, baby portobello, portabella, portobello caps, stuffed mushrooms, fresh basil, thai basil, holy basil, fresh parsley, flat leaf parsley, italian parsley, curly parsley, fresh cilantro, coriander leaves, fresh dill, fresh mint, spearmint, fresh rosemary, fresh thyme, fresh sage, fresh oregano, fresh chives, tarragon, chervil, marjoram, sorrel, lovage, curry leaves, kaffir lime leaves, makrut lime leaves, shiso, epazote, culantro, lemon verbena, bay leaf fresh, microgreen, edible flowers, salad toppers, guacamole fresh, pico de gallo, fresh salsa, fresh pico, cut vegetables, vegetable tray, crudite, stir fry vegetables, stir fry mix, zoodles, zucchini noodles, spiralized zucchini, butternut squash noodles, sweet potato noodles, cauliflower crumbles, mirepoix, soffritto, kale salad, apple slices, grapes red seedless, cotton candy grapes, concord grapes, black grapes, sugar snap pea, snow pea, english cucumber, okra pods, artichokes, baby artichoke, cardoon, celeriac, fiddleheads, nopales, cactus paddles, lotus root, burdock, water spinach, bitter melon, opo squash, chinese eggplant, japanese eggplant, italian eggplant, graffiti eggplant, white eggplant, sweet corn ears, corn ears, cob corn, husk cherries, physalis, tomatillos, lemons bag, limes bag, oranges bag, apples bag, potatoes bag, onions bag, grapefruits, tangelo, honeybell, sumo citrus, sumo orange, ruby red grapefruit, mandarins, halos, cuties, clementines, strawberries organic, blueberries pint, raspberries, blackberries, cranberries fresh, cherries, figs, black mission figs, persimmons, pomegranate seeds, pomegranate arils, dragonfruit, pitaya, starfruit, passionfruit, guavas, lychees, papayas, peaches, nectarines, plums, apricots, pears, kiwis, melons, cantaloupes, honeydews, watermelons, avocados, bananas, lemon, limes, celery stalk, celery bunch, scallions, leeks, shallots, fennel bulb, radishes, beets, turnips, parsnips, carrots, onions, garlic bulbs, ginger root fresh, lemongrass stalks, sprouts mixed, pea sprouts, fresh fruit, fresh vegetables, fresh produce, greens, leafy greens, baby greens, herb salad, mixed herbs, poultry herbs, herb blend fresh\",\n    \"Protein\": \"goetta, glier's goetta, mettwurst, metts, chicken breasts, boneless chicken breast, chicken cutlets, thin sliced chicken breast, chicken breast tenders, split chicken breast, bone in chicken breast, bone in chicken thighs, boneless chicken thighs, chicken thigh, chicken leg quarters, chicken wing, party wings, chicken drumettes, chicken gizzards, chicken livers, chicken hearts, chicken feet, chicken backs, ground chicken breast, chicken patties fresh, chicken kabobs, chicken fajita meat, marinated chicken, rotisserie, roast chicken, fried chicken, whole fryer, fryer chicken, roaster chicken, capon, game hens, ground turkey breast, turkey thighs, turkey legs, turkey wings, turkey necks, whole turkey, turkey tenderloin, turkey cutlets, turkey sausage, turkey burgers, turkey meatballs, ground beef 80/20, ground beef 90/10, ground beef 93/7, lean ground beef, extra lean ground beef, ground round, grass fed beef, grass fed ground beef, angus beef, wagyu, beef patties, beef tenderloin, tenderloin, beef roast, rump roast, eye of round, bottom round, top round, sirloin tip, top sirloin, sirloin steak, new york strip, ny strip, strip steak, porterhouse, t bone, t-bone, rib eye, ribeye steak, filet, beef filet, hanger steak, flat iron steak, flank, chuck steak, chuck eye, denver steak, cube steak, minute steak, round steak, sandwich steak, shaved steak, shaved beef, philly steak, carne asada, fajita steak, beef stir fry, stir fry beef, beef strips, beef cubes, kabob meat, beef shank, oxtail, beef cheeks, beef ribs, back ribs, prime rib, standing rib roast, rib roast, beef liver, soup bones, marrow bones, beef bones, ground veal, veal, veal cutlets, veal chops, osso buco, lamb shank, lamb leg, leg of lamb, rack of lamb, lamb loin, lamb shoulder, goat meat, ground bison, bison burgers, wild boar, quail, pheasant, duck breast, whole duck, pork chop, boneless pork chops, bone in pork chops, thick cut pork chops, pork roast, pork loin roast, pork sirloin, pork steak, pork cutlets, pork ribs, country style ribs, st louis ribs, rib tips, pork shoulder roast, boston butt, picnic roast, pork belly slices, pork hock, ham hock, ham hocks, smoked ham hock, pork neck bones, pigs feet, chitterlings, fatback, salt pork, lard, ground pork sausage, pork sausage, sausage links, sausage patties, breakfast links, breakfast patties, mild italian sausage, hot italian sausage, sweet italian sausage, smoked sausage, polish sausage, hillshire farm, johnsonville, jimmy dean, bob evans sausage, applegate, oscar mayer, ball park franks, nathans, hebrew national, beef franks, turkey franks, beef hot dogs, chicken hot dogs, corn dogs fresh, linguica, boudin, chicken apple sausage, merguez, bratwurst links, summer sausage, thick cut bacon, center cut bacon, peppered bacon, applewood bacon, maple bacon, bacon bits, pancetta, guanciale, lardons, jowl bacon, sliced deli turkey, smoked turkey, honey turkey, oven roasted turkey, deli chicken, sliced chicken, black forest ham, honey ham, virginia ham, smoked ham, cooked ham, boiled ham, deli roast beef, bologna, liverwurst, mortadella, capicola, coppa, soppressata, genoa salami, hard salami, sliced pepperoni, turkey pepperoni, charcuterie, charcuterie board, cured meats, boar's head, boars head, dietz and watson, hormel, sargento, land o frost, hillshire, columbus salami, ham salami, chicken salad, tuna salad, egg salad, shrimp salad, smoked salmon, lox, nova lox, salmon filets, atlantic salmon, sockeye salmon, coho salmon, king salmon, wild salmon, salmon steaks, salmon burgers, swordfish, tuna steaks, ahi tuna, yellowfin tuna, sea bass, chilean sea bass, striped bass, branzino, snapper, red snapper, grouper, flounder, sole, haddock, pollock, perch, walleye, orange roughy, arctic char, rainbow trout, monkfish, mackerel, sardines fresh, smelt, whitefish, cod fillets, tilapia fillets, catfish fillets, fish fillets, shrimp raw, raw shrimp, cooked shrimp, peeled shrimp, jumbo shrimp, large shrimp, tiger shrimp, shrimp cocktail, langostino, crawfish, crayfish, crab legs, snow crab, king crab, dungeness crab, soft shell crab, lump crab, imitation crab, crab sticks, lobster tails, lobster tail, bay scallops, sea scallops, calamari, squid, octopus, clams littleneck, steamer clams, oyster, mussels fresh, seafood mix, seafood, fish cakes, crab cakes, ground meat, meat, red meat, poultry, pork, beef, meatloaf mix, meatloaf, kabobs, burgers, hamburger, hamburger meat, burger meat, sliders patties, eggs dozen, dozen eggs, brown eggs, white eggs, large eggs, extra large eggs, jumbo eggs, cage free eggs, free range eggs, pasture raised eggs, organic eggs, liquid eggs, egg beaters, hard boiled eggs, quail eggs, duck eggs, vital farms, eggland's best, pete and gerry's, happy egg, tofu block, baked tofu, smoked tofu, tofu puffs, plant based meat, plant based burger, beyond meat, beyond sausage, impossible meat, gardein, morningstar, boca burgers, quorn, vegan sausage, vegan chicken, textured vegetable protein, tvp, jackfruit meat\",\n    \"Dairy\": \"mozz, parm, fresh mozz, milk gallon, gallon of milk, half gallon milk, 2 percent milk, reduced fat milk, nonfat milk, fat free milk, low fat milk, ultra filtered milk, fairlife, fairlife milk, lactaid, a2 milk, organic milk, raw milk, goat milk, strawberry milk, flavored milk, horizon organic, organic valley, silk almond milk, almond breeze, oatly, planet oat, califia, pea milk, coconut milk beverage, rice milk, hemp milk, macadamia milk, flax milk, non dairy milk, plant milk, dairy free milk, non dairy creamer, oat creamer, almond creamer, coffee mate, international delight, chobani creamer, natural bliss, sweet cream creamer, french vanilla creamer, hazelnut creamer, half & half, heavy cream pint, whipping cream heavy, clotted cream, creme fraiche, cr\\u00e8me fra\\u00eeche, mascarpone, quark, labneh, icelandic yogurt, siggis, oikos, fage, yoplait, dannon, activia, noosa, stonyfield, light and fit, greek yogurt cups, yogurt tubes, gogurt, go gurt, drinkable yogurt, yogurt drink, lassi, coconut yogurt, almond yogurt, oat yogurt, dairy free yogurt, vanilla greek yogurt, plain greek yogurt, honey greek yogurt, sour cream light, cottage cheese small curd, large curd cottage cheese, good culture, daisy sour cream, breakstone, land o lakes, kerrygold butter, irish butter, european butter, plugra, vermont creamery, butter sticks, whipped butter, vegan butter, country crock, i can't believe it's not butter, smart balance, earth balance, plant butter, cheddar cheese, mild cheddar, medium cheddar, extra sharp cheddar, white cheddar, aged cheddar, cheddar block, block cheese, cheese block, shredded mozzarella, mozzarella ball, burrata, bocconcini, ciliegine, mozzarella pearls, low moisture mozzarella, part skim mozzarella, string cheese sticks, cheese sticks, colby, colby jack cheese, monterey jack cheese, pepperjack, sliced provolone, sliced swiss, swiss cheese, baby swiss, jarlsberg, emmental, gruyere, gruy\\u00e8re, comte, fontina, asiago, romano, pecorino romano, grated parmesan, shaved parmesan, parmesan wedge, parmigiano reggiano, grana padano, shredded parmesan, kraft parmesan, ricotta salata, feta crumbles, crumbled feta, goat cheese crumbles, chevre, blue cheese crumbles, roquefort, stilton, smoked gouda, aged gouda, edam, port salut, raclette, taleggio, triple cream, boursin, laughing cow wedges, mini babybel, cheese slices, american slices, kraft singles, velveeta, cheese sauce fresh, nacho cheese, queso blanco, oaxaca cheese, panela, asadero, chihuahua cheese, paneer, cheese curds, cheese spread, pimento cheese, port wine cheese, cheese ball, cheese tray, cheese board, sargento cheese, tillamook cheese, cabot, cracker barrel cheese, kraft cheese, philadelphia cream cheese, whipped cream cheese, chive cream cheese, veggie cream cheese, neufchatel, dairy free cheese, vegan cheese, violife, daiya, miyoko's, follow your heart, reddi wip, reddi whip, whipped topping can, aerosol whipped cream, sour cream dip, spinach dip, onion dip, ranch dip, veggie dip, buffalo chicken dip, tzatziki, guacamole, guac, wholly guacamole, sabra, hummus cups, pudding, rice pudding, jello cups, jell-o cups, gelatin cups, snack pack, custard, flan, refrigerated pie crust, pillsbury, pillsbury crescent, grands biscuits, cinnamon roll dough, pizza dough refrigerated, pie dough, puff pastry dough, phyllo dough fresh, wonton wrappers, egg roll wrappers, dumpling wrappers, gyoza wrappers, fresh pasta, refrigerated pasta, fresh ravioli, ravioli, tortellini, fresh tortellini, buitoni, rana, egg substitute, orange juice fresh squeezed, kombucha refrigerated, butter milk, cultured buttermilk, eggnog light, lactose free yogurt, kefir milk, cream cheese spread, mozzarella shredded, colby jack shredded, mexican cheese, taco cheese, italian blend cheese, pizza cheese, four cheese blend, cheese\",\n    \"Grains & Bread\": \"white rice bag, long grain rice, short grain rice, sushi rice, sticky rice, glutinous rice, calrose rice, black rice, forbidden rice, red rice, parboiled rice, converted rice, uncle ben's, uncle bens, ben's original, mahatma, carolina rice, rice a roni, rice-a-roni, spanish rice, yellow rice, saffron rice, rice pilaf, microwave rice, ready rice, rice cups, instant brown rice, cauliflower rice shelf, rice mix, zatarain's, zatarains, dirty rice mix, jambalaya mix, red beans and rice mix, buckwheat, kasha, millet, amaranth, teff, sorghum, freekeh, wheat berries, spelt, pearl barley, israeli couscous, pearl couscous, whole wheat couscous, tabbouleh, polenta tube, cream of wheat, cream of rice, malt o meal, farina, grits instant, overnight oats, oat bran, wheat germ, muesli, granola bag, granola clusters, bear naked, nature's path, kind granola, cascadian farm, cereal box, kids cereal, frosted mini wheats, mini wheats, cinnamon toast crunch, cocoa puffs, cocoa pebbles, fruity pebbles, froot loops, fruit loops, apple jacks, trix, kix, golden grahams, reese's puffs, cap'n crunch, captain crunch, honey bunches of oats, honey bunches, honey smacks, corn pops, cracklin oat bran, wheaties, total cereal, fiber one, all bran, cheerios multigrain, peanut butter cheerios, chocolate cheerios, crispix, rice chex, corn chex, wheat chex, magic spoon, catalina crunch, three wishes, special k red berries, cinnamon life, quaker life, puffins, barbara's, kashi go lean, golean, post cereal, general mills, kellogg's, kelloggs, oatmeal packets, instant oatmeal packets, quaker instant oatmeal, oatmeal cups, bread loaf, sandwich bread, white sandwich bread, wheat sandwich bread, potato bread, honey wheat bread, oat bread, oatnut bread, 12 grain bread, 15 grain bread, seeded bread, ezekiel bread, sprouted bread, dave's killer bread, daves killer bread, nature's own, natures own, sara lee, wonder bread, pepperidge farm bread, arnold bread, oroweat, king's hawaiian, kings hawaiian, hawaiian rolls, sweet rolls, pull apart rolls, brown and serve rolls, parker house rolls, potato rolls, martin's potato rolls, brioche buns, pretzel buns, pretzel rolls, sesame buns, onion rolls, sandwich rolls, deli rolls, ciabatta rolls, french rolls, sourdough loaf, sourdough bread, rustic bread, artisan bread, country bread, boule, batard, focaccia, challah, pumpernickel, marble rye, raisin bread, cinnamon raisin bread, cinnamon bread, banana bread, zucchini bread, pumpkin bread, cornbread, corn bread, irish soda bread, gluten free bread, keto bread, low carb bread, thin sliced bread, sandwich thins, bagel thins, everything bagels, plain bagels, cinnamon raisin bagels, blueberry bagels, mini bagels, thomas, thomas english muffins, english muffin, crumpets, scones, biscuits, croissant, mini croissants, pastries, pastry, muffin, blueberry muffins, bran muffins, coffee cake, pound cake, angel food cake, sheet cake, cupcakes, apple pie, pumpkin pie, pecan pie, cheesecake, cookies bakery, bakery cookies, brownies, eclairs, cannoli, macarons, macaroons, donut holes, munchkins, kolache, strudel, turnovers, cream puffs, cinnamon buns, sticky buns, breadsticks, bread sticks, garlic knots, soft pretzels, pita bread, pita pockets, mini pitas, naan bread, garlic naan, lavash, tortilla wraps, spinach wraps, tomato basil wraps, low carb tortillas, carb balance tortillas, mission tortillas, street taco tortillas, flour tortilla, corn tortilla, uncooked tortillas, tortilla land, taco boats, stand n stuff, tostada shells, flatout, arepas, english muffins whole wheat, matzo, matzah, crispbread, rye crisps, melba toast, zwieback, rusks, bread crumbs italian, seasoned bread crumbs, panko bread crumbs, cracker crumbs, graham cracker crumbs, cornflake crumbs, stove top, stovetop stuffing, pastas, spaghetti noodles, thin spaghetti, spaghettini, bucatini, capellini, vermicelli, pappardelle, tagliatelle, mafaldine, campanelle, cavatappi, gemelli, radiatori, ditalini, acini di pepe, pastina, stelline, alphabet pasta, conchiglie, jumbo shells, pasta shells, manicotti, cannelloni, lasagna, no boil lasagna, oven ready lasagna, egg noodles wide, kluski, wide noodles, ziti rigate, penne rigate, mostaccioli, whole wheat pasta, whole wheat spaghetti, gluten free pasta, chickpea pasta, lentil pasta, banza, protein pasta, barilla protein, veggie pasta, rice pasta, brown rice pasta, ronzoni, de cecco, mueller's, muellers, san giorgio, creamette, kraft dinner, velveeta shells, annie's, annies mac and cheese, cup noodles, top ramen, maruchan, instant noodles, instant ramen, lo mein noodles, chow mein noodles, yakisoba, pad thai noodles, rice vermicelli, glass noodles, cellophane noodles, bean thread noodles, mung bean noodles, shirataki noodles, kelp noodles, soba noodles, udon noodles, ramen packs, couscous box, near east, pasta roni, knorr pasta sides, knorr rice sides, rice sides, pasta sides, hamburger helper, tuna helper, idahoan, instant potatoes, mashed potato flakes, potato flakes, au gratin potatoes box, scalloped potatoes box, pancake mix box, aunt jemima mix, pearl milling, krusteaz, kodiak cakes, buttermilk pancake mix, waffle mix box, crepes, tortillas corn, hard shells, old el paso shells, taco kit, taco dinner kit, gyro bread, wonder buns, bread, rolls, buns\",\n    \"Canned & Jarred\": \"canned beans, can of beans, black beans canned, low sodium black beans, refried black beans, vegetarian refried beans, rosarita, old el paso refried beans, chili beans, ranch style beans, pork and beans, butter beans, lima beans, butter beans canned, black eyed peas, black-eyed peas, field peas, crowder peas, mixed beans, three bean salad, four bean salad, fava beans canned, cannellini canned, kidney beans dark red, light red kidney beans, red beans, small red beans, pink beans, mayocoba beans, peruano beans, dried beans, dry beans, dried black beans, dried pinto beans, split peas, green split peas, yellow split peas, dried lentils, french lentils, beluga lentils, brown lentils, bush's baked beans, bush's beans, b&m baked beans, heinz beans, canned green beans, cut green beans canned, french style green beans, canned peas, sweet peas canned, canned carrots, canned potatoes, sliced potatoes canned, canned spinach, canned beets, pickled beets, canned yams, candied yams, canned sweet potatoes, canned mixed vegetables, veg-all, veg all, succotash, canned mushrooms, mushroom pieces and stems, sliced mushrooms canned, canned artichokes, marinated artichoke hearts, quartered artichoke hearts, hearts of palm, baby corn, canned baby corn, canned asparagus, canned sauerkraut, canned collard greens, canned turnip greens, canned okra, hominy, white hominy, yellow hominy, nopalitos, canned jalapenos, jarred jalapenos, pickled jalapenos, diced jalapenos, sliced jalapenos, nacho jalapenos, jalapeno slices, jalapeno nacho slices, la costena, la coste\\u00f1a, embasa, san marcos, herdez, chipotle peppers, chipotle peppers in adobo, chipotle chiles in adobo, chipotles, adobo sauce, chiles in adobo, diced green chilies, green chilies, whole green chiles, hatch green chiles canned, old el paso green chiles, ortega, ortega chiles, pepperoncini, peperoncini, banana peppers, sliced banana peppers, hot banana peppers, cherry peppers, hot cherry peppers, sweety drop peppers, peppadew, peppadews, mama lil's, giardiniera, hot giardiniera, roasted peppers, roasted red pepper, fire roasted peppers, pimientos, pimento, diced pimentos, tomatoes canned, canned diced tomatoes, petite diced tomatoes, diced tomatoes with green chiles, rotel tomatoes, ro-tel, fire roasted diced tomatoes, san marzano, san marzano tomatoes, whole peeled tomatoes, peeled tomatoes, plum tomatoes canned, tomato puree, tomato passata, passata, strained tomatoes, crushed tomato, tomato paste tube, tomato sauce can, hunt's, hunts, hunts tomato sauce, contadina, muir glen, cento, red gold, del monte, del monte tomatoes, tuttorosso, marinara sauce, tomato basil sauce, arrabbiata, puttanesca sauce, bolognese sauce, meat sauce, mushroom pasta sauce, four cheese sauce, classico, bertolli, newman's own sauce, rao's, rao's marinara, raos sauce, carbone sauce, victoria marinara, mezzetta, mezzetta peppers, alfredo, jarred alfredo, white sauce jar, pesto jar, sun dried tomato pesto, bruschetta topping, tapenade, olive tapenade, sliced black olives, sliced olives, ripe olives, pitted olives, castelvetrano olives, castelvetrano, manzanilla olives, stuffed olives, pimento stuffed olives, cocktail olives, olive mix, olive bar, nicoise olives, capers in brine, caperberries, cornichons, gherkins, sweet pickles, bread and butter pickles, pickle spears, pickle chips, kosher dill pickles, pickle slices, claussen, vlasic, mt olive, grillo's, sweet relish, dill relish, hot dog relish, chow chow, piccalilli, pickled onions, pickled red onions, pickled ginger, sushi ginger, pickled vegetables, pickled okra, pickled garlic, pickled eggs, pickled herring, pickled peppers, kimchee, gochujang paste jar, chili garlic sauce, sambal oelek, chili paste, curry paste, red curry paste, green curry paste, yellow curry paste, massaman curry paste, thai kitchen, tikka masala sauce, simmer sauce, korma sauce, butter chicken sauce, patak's, pataks, maya kaimal, enchilada sauce red, green enchilada sauce, las palmas, mole sauce, dona maria, salsa jar, chunky salsa, medium salsa, mild salsa, hot salsa, pace picante, picante sauce, tostitos salsa, herdez salsa, salsa casera, mango salsa jar, peach salsa, queso dip, queso jar, tostitos queso, cheese dip jar, nacho cheese sauce, cheese whiz, cheez whiz, bean dip, black bean dip, artichoke dip jar, spinach artichoke dip jar, canned soup, condensed soup, cream of celery, cream of potato, cream of broccoli, cheddar cheese soup, french onion soup, minestrone, split pea soup, lentil soup, black bean soup, vegetable soup, beef stew canned, beef barley soup, chicken and rice soup, chicken tortilla soup, clam chowder, corn chowder, chowder, bisque, tomato bisque, butternut squash soup, wedding soup, italian wedding soup, pho broth, ramen broth, miso soup packets, soup mix, onion soup mix, lipton onion soup mix, dry soup mix, bouillon cubes, chicken bouillon, beef bouillon, better than bouillon, knorr bouillon, stock cubes, broth carton, low sodium chicken broth, unsalted chicken stock, turkey stock, turkey broth, mushroom broth, fish stock, seafood stock, dashi, swanson, swanson broth, college inn, pacific foods, kitchen basics, imagine broth, campbell's, campbell's soup, chunky soup, progresso soup, amy's soup, healthy choice soup, wolf brand chili, hormel chili, chili with beans, chili no beans, skyline chili canned, gold star chili canned, cincinnati chili, chili sauce, hot dog chili, sloppy joe sauce, manwich, canned meat, vienna sausages, potted meat, corned beef hash, hash canned, deviled ham, canned ham, chicken breast canned, canned chicken breast, chunk chicken, chunk light tuna, solid white albacore, albacore tuna, tuna pouch, tuna packets, starkist, bumble bee, chicken of the sea, wild planet, safe catch, tuna in oil, tuna in water, salmon pouch, canned salmon pink, canned crab, canned clams, minced clams, clam juice, canned oysters, smoked oysters, canned shrimp, kippers, kipper snacks, herring, anchovy paste, anchovy fillets, sardines in oil, mackerel canned, canned mackerel, tinned fish, coconut milk can, light coconut milk, cream of coconut, coco lopez, thai coconut milk, canned pumpkin puree, libby's pumpkin, pumpkin pie filling, pie filling, cherry pie filling, apple pie filling, blueberry pie filling, lemon curd, canned peaches sliced, peach halves, canned pears, pear halves, fruit cocktail, canned pineapple, crushed pineapple, pineapple tidbits, pineapple rings, pineapple chunks canned, canned mandarin oranges, mandarin orange cups, mandarin cups, canned cherries, maraschino cherries, cocktail cherries, luxardo cherries, canned apricots, canned plums, canned figs, canned cranberries, jellied cranberry sauce, whole berry cranberry sauce, ocean spray cranberry sauce, applesauce jar, applesauce cups, mott's, motts, mott's applesauce, gogo squeez, unsweetened applesauce, cinnamon applesauce, fruit cups in juice, dole fruit cups, del monte fruit cups, peaches cups, diced peaches, diced pears, canned fruit cocktail, coconut cream can, sweetened condensed, eagle brand, carnation evaporated milk, dulce de leche, cajeta, marshmallow fluff, marshmallow creme, jif peanut butter, skippy peanut butter, peter pan, smucker's natural, natural peanut butter, crunchy peanut butter, creamy peanut butter, chunky peanut butter, powdered peanut butter, pb2, pb fit, justin's, almond butter jar, cashew butter jar, sunbutter, sun butter, wowbutter, cookie butter, biscoff spread, speculoos, chocolate hazelnut spread, hazelnut spread, apple butter, pumpkin butter, grape jelly, strawberry jam, strawberry preserves, raspberry jam, seedless raspberry jam, blackberry jam, apricot preserves, peach preserves, orange marmalade, marmalade, fig jam, pepper jelly, hot pepper jelly, mint jelly, welch's, welchs, smucker's, bonne maman, polaner, low sugar jam, sugar free jam, chia jam, honey jar, lemon curd jar, salsa verde jar, tomatillo salsa, chimichurri jar, harissa, harissa paste, ajvar, muhammara, baba ganoush, baba ghanoush, hummus tub, roasted red pepper hummus, garlic hummus, classic hummus, tahini paste, sesame paste, sun dried tomatoes in oil, oil packed sun dried tomatoes, julienne sun dried tomatoes, roasted garlic jar, minced garlic jar, jarred garlic, ginger jar, minced ginger jar, water chestnuts sliced, bamboo shoots sliced, bean sprouts canned, straw mushrooms, lychee canned, jackfruit canned, young green jackfruit, canned jackfruit, coconut water canned, canned corn whole kernel, whole kernel corn, cream style corn, mexicorn, fiesta corn, canned vegetables, canned goods, canned food\",\n    \"Frozen\": \"hashbrowns, hashbrown patties, frozen pizzas, frozen cheese pizza, frozen pepperoni pizza, french bread pizza, stouffer's, stouffers french bread pizza, totino's, totinos pizza rolls, jack's pizza, tombstone, freschetta, california pizza kitchen, cauliflower crust pizza, frozen flatbread, pizza bites, frozen garlic bread, frozen texas toast, frozen breadsticks, frozen dinner rolls, rhodes rolls, rhodes bread dough, frozen bread dough, frozen pie crusts, frozen pie shells, frozen puff pastry, puff pastry, puff pastry sheets, pepperidge farm puff pastry, phyllo dough, phyllo, fillo dough, filo, frozen phyllo cups, frozen biscuits, frozen cinnamon rolls, frozen croissants, frozen pancakes, frozen french toast, french toast sticks, frozen crepes, frozen breakfast burritos, breakfast burritos, jimmy dean sandwiches, breakfast sandwiches, sausage biscuits, frozen sausage, frozen hash browns, hash brown patties, shredded hash browns, potatoes o'brien, ore ida, ore-ida, frozen potatoes, crinkle fries, steak fries, shoestring fries, waffle fries, curly fries, seasoned fries, tater tots bag, tots, potato wedges, frozen onion rings, onion rings frozen, frozen mozzarella sticks, frozen appetizers, frozen egg rolls, frozen spring rolls, frozen dumplings, frozen potstickers, frozen gyoza, frozen wontons, frozen samosas, frozen pierogies, pierogies, pierogi, mrs t's, frozen ravioli, frozen tortellini, frozen lasagna, frozen mac and cheese, frozen meatballs, frozen meat balls, cooked meatballs, frozen chicken breasts, frozen chicken tenders, frozen chicken strips, frozen chicken wings, frozen wings, frozen chicken patties, chicken patties, popcorn chicken, tyson, tyson chicken, tyson nuggets, dino nuggets, dinosaur nuggets, perdue, perdue nuggets, frozen fish fillets, frozen salmon, frozen salmon fillets, frozen tilapia, frozen cod, frozen shrimp raw, frozen cooked shrimp, popcorn shrimp, breaded shrimp, coconut shrimp, gorton's, gortons, van de kamp's, fish sticks frozen, frozen crab, frozen lobster, frozen scallops, frozen burgers, frozen burger patties, frozen turkey burgers, frozen veggie burgers, frozen turkey, frozen ground beef, frozen burritos el monterey, el monterey, frozen taquitos, taquitos, delimex, frozen enchiladas, frozen tamales, tamales, frozen quesadillas, frozen chimichangas, frozen dinner, frozen entrees, frozen entree, marie callender's, marie callenders, banquet meals, healthy choice, smart ones, amy's, amys, evol, saffron road, p.f. chang's frozen, pf changs frozen, bertolli frozen, frozen skillet meals, skillet meal, frozen stir fry, frozen fried rice, frozen orange chicken, frozen pot pie, pot pies, chicken pot pie, marie callender's pot pie, frozen soup, frozen chili, frozen vegetables bag, frozen mixed vegetables, mixed vegetables, frozen green beans, frozen carrots, frozen peas and carrots, peas and carrots, frozen cauliflower, frozen brussels sprouts, frozen okra, breaded okra, frozen asparagus, frozen edamame, shelled edamame, frozen lima beans, frozen butternut squash, frozen sweet potatoes, frozen kale, frozen collard greens, frozen onions, frozen diced onions, frozen peppers, frozen pepper strips, frozen peppers and onions, fajita vegetables, frozen stir fry vegetables, frozen california blend, california blend, normandy blend, frozen broccoli florets, steamfresh, birds eye steamfresh, green giant, frozen corn on the cob, frozen riced cauliflower, frozen cauliflower rice, frozen zucchini noodles, frozen spinach chopped, frozen strawberries, frozen blueberries, frozen raspberries, frozen cherries, frozen peaches, frozen pineapple, frozen mixed berries, frozen mango chunks, frozen banana, frozen acai, acai packs, frozen smoothie packs, smoothie packs, frozen avocado, frozen guacamole, frozen fruit bars, fruit bars frozen, outshine, popsicle, push pops, ice cream cones frozen, drumsticks ice cream, klondike, klondike bars, ice cream cake, ice cream pints, pint of ice cream, ice cream tub, half gallon ice cream, gallon ice cream, vanilla bean ice cream, chocolate ice cream, mint chocolate chip ice cream, cookies and cream ice cream, breyers, edy's, edys, dreyer's, blue bell, tillamook ice cream, graeter's, graeters, haagen dazs, h\\u00e4agen-dazs, ben & jerry's, ben and jerry's, talenti, jeni's, jenis, so delicious, nada moo, oatly ice cream, dairy free ice cream, non dairy ice cream, frozen custard, sherbet, rainbow sherbet, italian ice, gelato pints, mochi, mochi ice cream, ice cream sandwich, choco taco, frozen yogurt bars, frozen yogurt bites, yasso, frozen cookie dough, frozen pies, frozen apple pie, frozen pumpkin pie, frozen cheesecake, frozen cake, sara lee cheesecake, mrs smith's, edwards pie, frozen cream pie, whipped topping, cool whip lite, frozen whipped topping, frozen waffles box, frozen eggo pancakes, kodiak frozen waffles, van's waffles, frozen hashbrowns, ice bag, bagged ice, ice cubes, dry ice, frozen meals, frozen food, frozen foods\",\n    \"Spices & Oils\": \"spice, salt and pepper, table salt, iodized salt, morton salt, pink salt, himalayan salt, himalayan pink salt, flaky salt, maldon, maldon salt, fleur de sel, celery salt, seasoned salt, lawry's, lawrys, garlic pepper, onion salt, smoked salt, truffle salt, msg, accent seasoning, white pepper, ground pepper, cracked pepper, peppercorn medley, pink peppercorns, ground black pepper, cumin seeds, ground cumin, ground coriander, coriander seeds, fennel seeds, mustard seeds, mustard powder, dry mustard, celery seed, caraway seeds, dill seed, poppy seeds, sesame seeds, black sesame seeds, toasted sesame seeds, nigella seeds, anise, star anise, anise seed, cardamom, cardamom pods, ground cardamom, whole cloves, ground cloves, ground nutmeg, whole nutmeg, mace, ground cinnamon, cinnamon sticks, saigon cinnamon, ceylon cinnamon, ground allspice, ground turmeric, turmeric powder, ginger powder, ground mustard, sweet paprika, hot paprika, hungarian paprika, spanish paprika, pimenton, chipotle powder, ancho chili powder, ancho powder, chili flakes, aleppo pepper, gochugaru, korean chili flakes, cayenne pepper, ground cayenne, crushed red pepper flakes, chile powder, new mexico chili powder, guajillo chiles, ancho chiles, dried chiles, dried chilies, chiles de arbol, pasilla chiles, dried oregano leaves, mexican oregano, dried marjoram, dried sage, rubbed sage, dried tarragon, dried chives, dried mint, dried cilantro, parsley flakes, dill weed, herbes de provence, fines herbes, italian herbs, bay leaf, dried bay leaves, saffron, sumac, za'atar, zaatar, ras el hanout, berbere, baharat, dukkah, five spice, chinese five spice, curry, madras curry powder, tandoori masala, chaat masala, tikka masala spice, biryani masala, chana masala, sambar powder, asafoetida, hing, fenugreek, fenugreek seeds, kasuri methi, amchur, mango powder, kashmiri chili powder, adobo seasoning, goya adobo, sazon, saz\\u00f3n, goya sazon, sofrito, recaito, achiote, annatto, chili lime seasoning, tajin, taj\\u00edn, everything but the bagel, everything bagel, trader joe's seasoning, montreal steak seasoning, mccormick, mccormick grill mates, grill mates, weber seasoning, lawry's seasoned salt, slap ya mama, tony chachere's, tony chacheres, zatarain's creole, creole seasoning, blackening seasoning, jerk seasoning, greek seasoning, cavender's, cavenders, mrs dash, dash seasoning, salt free seasoning, garlic and herb seasoning, lemon herb seasoning, herb seasoning, pizza seasoning, fajita seasoning, chili seasoning, chili seasoning mix, taco seasoning packet, taco mix, gravy mix, brown gravy mix, turkey gravy mix, country gravy mix, sausage gravy mix, au jus mix, ranch packet, ranch mix, hidden valley, hidden valley ranch, dip mix, sloppy joe mix, stroganoff mix, meatloaf seasoning, pot roast seasoning, crock pot seasoning, shake and bake, seasoned coating, fish fry, fish fry mix, breading mix, chicken breading, louisiana fish fry, crab boil, shrimp boil seasoning, zatarain's crab boil, poultry seasoning blend, pumpkin spice, apple pie spice, mulling spices, pickling spice, brining mix, brine, meat tenderizer, liquid smoke, kitchen bouquet, browning sauce, maggi, bragg's, braggs, liquid aminos, coconut aminos, low sodium soy sauce, dark soy sauce, light soy sauce, shoyu, kikkoman, ponzu, mirin, cooking wine, sherry vinegar, cooking sherry, marsala cooking wine, rice wine, shaoxing wine, sake cooking, malt vinegar, white wine vinegar, champagne vinegar, distilled vinegar, cleaning vinegar, balsamic glaze, balsamic reduction, extra virgin olive oil spray, light olive oil, olive oil spray, avocado oil, grapeseed oil, peanut oil, sunflower oil, safflower oil, corn oil, crisco, shortening, vegetable shortening, frying oil, toasted sesame oil, chili sesame oil, walnut oil, truffle oil, flaxseed oil, ghee jar, bacon grease, duck fat, beef tallow, tallow, cooking oil, pam spray, baking spray, nonstick spray, ketchup bottle, heinz ketchup, hunt's ketchup, sir kensington's, spicy ketchup, yellow mustard bottle, french's mustard, frenchs, spicy brown mustard, stone ground mustard, whole grain mustard, grey poupon, deli mustard, chinese mustard, mustard sauce, dijonnaise, mayo bottle, real mayonnaise, avocado mayo, vegan mayo, duke's, dukes mayo, kewpie, kewpie mayo, japanese mayo, best foods, sir kensington mayo, chipotle mayo, sriracha mayo, spicy mayo, garlic aioli, remoulade, comeback sauce, fry sauce, burger sauce, special sauce, big mac sauce, secret sauce, horseradish sauce, prepared horseradish, cream style horseradish, wasabi, wasabi paste, sweet and sour sauce, duck sauce, plum sauce, black bean sauce, hoisin sauce, oyster sauce bottle, stir fry sauce, general tso sauce, orange sauce, kung pao sauce, szechuan sauce, sesame ginger dressing, ginger dressing, yum yum sauce, eel sauce, unagi sauce, sushi sauce, katsu sauce, tonkatsu sauce, bulldog sauce, okonomiyaki sauce, korean bbq sauce, bulgogi sauce, gochujang sauce, sriracha sauce, huy fong, chili garlic, sambal paste, hot honey, mike's hot honey, texas pete, crystal hot sauce, louisiana hot sauce, valentina, tapatio, el yucateco, secret aardvark, truff, truff hot sauce, yellowbird, habanero sauce, green hot sauce, green tabasco, buffalo wing sauce, frank's buffalo, wing sauce mild, bbq sauce bottle, sweet baby ray's, sweet baby rays, stubb's, stubbs, kc masterpiece, kraft bbq, bulls eye bbq, montgomery inn sauce, carolina bbq sauce, alabama white sauce, honey bbq sauce, a.1., a1 sauce, heinz 57, lea & perrins, lea and perrins, worcestershire sauce, steak marinade, teriyaki marinade, soy vay, veri veri teriyaki, mojo marinade, lemon pepper marinade, italian marinade, chimichurri, pesto sauce, fish sauce bottle, golden mountain sauce, sweet chili, mae ploy, thai sweet chili, peanut sauce, satay sauce, curry sauce, salad dressings, ranch bottle, hidden valley ranch dressing, light ranch, bolthouse, bolthouse farms, marzetti, maries dressing, kens dressing, wishbone, wish-bone, newman's own dressing, primal kitchen, tessemae's, olive garden dressing, italian dressing bottle, zesty italian, greek dressing, greek vinaigrette, red wine vinaigrette, raspberry vinaigrette, poppyseed dressing, poppy seed dressing, honey mustard dressing, french dressing, catalina dressing, russian dressing, coleslaw dressing, slaw dressing, chunky blue cheese dressing, creamy caesar, green goddess, goddess dressing, sesame dressing, asian dressing, cilantro lime dressing, avocado ranch, buttermilk ranch, chipotle ranch, southwest dressing, salad spritzer, honey bear, raw honey, local honey, clover honey, manuka honey, honey sticks, honeycomb, maple syrup grade a, pure maple syrup, mrs butterworth's, mrs butterworths, log cabin, aunt jemima syrup, butter pecan syrup, sugar free syrup, blueberry syrup, fruit syrup, molasses, blackstrap molasses, sorghum syrup, golden syrup, light corn syrup, dark corn syrup, corn syrup, karo, karo syrup, agave nectar, date syrup, simple syrup, brown rice syrup, monk fruit syrup, condiments, condiment, hot sauce bottle, steak sauce bottle, tartar, cocktail sauce jar, relish tray, oil and vinegar, salad oil, seasonings, herbs and spices, dried herbs, spice blend, dry rub, bbq rub, steak rub, chicken rub, pork rub, brisket rub, grill seasoning\",\n    \"Baking & Snacks\": \"unbleached flour, gold medal, king arthur, king arthur flour, pillsbury flour, white lily, 00 flour, semolina, semolina flour, durum flour, rye flour, spelt flour, oat flour, rice flour, sweet rice flour, mochiko, tapioca flour, tapioca starch, potato starch, arrowroot, arrowroot powder, cassava flour, chickpea flour, besan, masa, masa harina, maseca, cornmeal mix, self rising cornmeal, jiffy, jiffy corn muffin mix, corn muffin mix, cornbread mix, gluten free flour, cup4cup, bob's red mill, bobs red mill, xanthan gum, vital wheat gluten, cream of tartar, active dry yeast, instant yeast, rapid rise yeast, fleischmann's, fleischmanns, red star yeast, baking chips, white chocolate chips, white chips, butterscotch chips, peanut butter chips, mint chips, toffee bits, heath bits, mini chocolate chips, chocolate chunks, nestle toll house, toll house, ghirardelli, guittard, baker's chocolate, bakers chocolate, unsweetened chocolate, bittersweet chocolate, semisweet chocolate, chocolate bar baking, candy melts, melting wafers, almond bark, vanilla bark, chocolate bark, dutch process cocoa, hershey's cocoa, cacao nibs, cacao powder, carob, carob chips, granulated sugar bag, cane sugar, raw sugar, turbinado, turbinado sugar, sugar in the raw, demerara sugar, light brown sugar, dark brown sugar, icing sugar, superfine sugar, caster sugar, sugar cubes, pearl sugar, sanding sugar, decorating sugar, coarse sugar, domino sugar, c&h, sugar substitute, sweetener, stevia, truvia, splenda, monk fruit, monk fruit sweetener, lakanto, erythritol, allulose, swerve, xylitol, sweet n low, sweet'n low, sugar packets, vanilla bean, vanilla beans, vanilla paste, vanilla bean paste, imitation vanilla, pure vanilla extract, lemon extract, peppermint extract, orange extract, coconut extract, maple extract, rum extract, butter extract, gel food coloring, wilton, sprinkles jar, jimmies, nonpareils, sugar pearls, edible glitter, cake decorations, cake toppers, icing, frosting tub, cream cheese frosting, chocolate frosting, vanilla frosting, buttercream, betty crocker, duncan hines, pillsbury funfetti, funfetti, yellow cake mix, chocolate cake mix, white cake mix, red velvet cake mix, spice cake mix, angel food cake mix, cupcake mix, brownie mix box, ghirardelli brownie mix, cookie mix pouch, cornbread mix box, pudding mix, instant pudding, jell-o pudding, jello pudding, vanilla pudding mix, chocolate pudding mix, cheesecake pudding, jello, jell-o, gelatin, knox gelatin, unflavored gelatin, pectin, sure jell, fruit pectin, canning jars, mason jars, canning lids, pie filling mix, graham cracker crust, oreo pie crust, ready crust, keebler ready crust, shortbread crust, phyllo shells, marshmallows mini, mini marshmallows, jumbo marshmallows, marshmallow, campfire marshmallows, jet-puffed, jet puffed, smores, s'mores, hot fudge, fudge sauce, caramel sauce, butterscotch sauce, ice cream topping, smucker's topping, magic shell, strawberry topping, whipped cream can, hershey's syrup, hersheys syrup, maraschino, cake flour box, almond meal, hazelnut meal, coconut chips, toasted coconut, sweetened coconut, unsweetened coconut, coconut flakes unsweetened, sliced almonds, slivered almonds, whole almonds, raw almonds, roasted almonds, salted almonds, smoked almonds, marcona almonds, blue diamond, chopped walnuts, walnut halves, pecan halves, chopped pecans, candied pecans, candied walnuts, glazed pecans, hazelnuts, filberts, macadamia nuts, macadamias, brazil nuts, pine nut, peanuts in shell, roasted peanuts, honey roasted peanuts, dry roasted peanuts, planters, boiled peanuts, cashew halves, roasted cashews, pistachios shelled, wonderful pistachios, mixed nuts deluxe, nut mix, deluxe mixed nuts, chex mix, gardetto's, gardettos, party mix, snack mix, trail mix bag, sunflower kernels, sunflower seeds in shell, david seeds, pumpkin seeds roasted, sesame sticks, corn nuts, wasabi peas, roasted chickpeas, biena, crunchy chickpeas, seaweed snacks, roasted seaweed, nori, seaweed sheets, sushi nori, dried blueberries, dried cherries, dried apples, apple chips, banana chips, dried pineapple, dried figs, dried dates, pitted dates, golden raisins, sun maid, sun-maid, raisin boxes, mixed dried fruit, fruit and nut mix, freeze dried fruit, freeze dried strawberries, crispy fruit, fruit strips, fruit by the foot, fruit roll ups, fruit rollups, gushers, welch's fruit snacks, annie's bunnies, bunny grahams, teddy grahams, nilla wafers, vanilla wafers, ginger snaps, gingersnaps, shortbread cookies, lorna doone, biscoff, biscoff cookies, lotus biscoff, fig newtons, newtons, nutter butters, nutter butter, oreo, double stuf oreos, golden oreos, thin mints, girl scout cookies, chips ahoy chewy, keebler, fudge stripes, e.l. fudge, famous amos, pepperidge farm cookies, milano cookies, milanos, tate's, tates cookies, chocolate chip cookies, oatmeal cookies, sugar cookies, snickerdoodles, sandwich cookies, wafer cookies, pirouline, little debbie, little debbie snacks, oatmeal creme pies, oatmeal cream pies, zebra cakes, swiss rolls, honey buns, cosmic brownies, twinkies, ding dongs, cupcakes hostess, snack cakes, tastykake, entenmann's, entenmanns, donettes, powdered donuts, mini muffins, muffin tops, rice krispies treats, rice krispie treats, granola bar, chewy bars, quaker chewy, nature valley bars, kind bar, clif bar, luna bars, larabar, rxbar, perfect bar, built bars, quest bars, one bars, think bars, power bars, pure protein bars, fiber one bars, nutrigrain, belvita, belvita biscuits, breakfast biscuits, pop-tarts, toaster pastries, toaster strudel, chips variety pack, snack variety pack, lays chips, lay's, ruffles, kettle brand, cape cod chips, utz, wise chips, herr's, sun chips multigrain, baked chips, baked lays, popchips, terra chips, plantain chips, veggie straws, sensible portions, pirate's booty, pirates booty, smartfood, smartfood popcorn, skinny pop, skinnypop, lesser evil, kettle corn, caramel corn, cracker jack, popcorn kernels, orville redenbacher, pop secret, cheese puffs, cheese curls, cheetos puffs, flamin hot cheetos, hot fries, funyuns, bugles, chex mix bold, pork rinds, chicharrones, cheese crisps, whisps, moon cheese, parmesan crisps, tortilla chips bag, restaurant style tortilla chips, tostitos scoops, on the border, mission chips, santitas, xochitl, siete chips, blue corn chips, multigrain chips, pita crisps, stacy's pita chips, stacys, bagel chips, pretzel sticks, pretzel rods, pretzel twists, pretzel crisps, snyder's, snyders, rold gold, dot's pretzels, dots pretzels, sourdough pretzels, peanut butter pretzels, yogurt pretzels, chocolate covered pretzels, crackers box, club crackers, town house, townhouse crackers, carr's water crackers, water crackers, table water crackers, rice crackers, nut thins, blue diamond nut thins, mary's gone crackers, simple mills, triscuit, wheat thin, cheez-its, cheez it, cheese nips, cheddar bunnies, oyster crackers, premium saltines, sesame crackers, everything crackers, sandwich crackers, lance crackers, peanut butter crackers, toast chee, ritz bits, graham crackers honey, honey maid, animal cookies, candy bars, candy bar, chocolate bars, hershey's, hersheys, hershey bar, hershey kisses, reese's cups, reeses cups, peanut butter cups, reese's pieces, m and ms, m&m's, peanut m&ms, snickers bars, twix, milky way, three musketeers, 3 musketeers, butterfinger, baby ruth, kit kats, almond joy, mounds, york peppermint patties, peppermint patties, heath bar, crunch bar, nestle crunch, toblerone, lindt, lindor, lindt truffles, ghirardelli squares, dove chocolate, godiva, ferrero rocher, ferrero, cadbury, cadbury eggs, tony's chocolonely, hu chocolate, lily's chocolate, dark chocolate bar, chocolate covered almonds, chocolate covered raisins, raisinets, junior mints, milk duds, whoppers, rolos, rolo, hershey's miniatures, fun size candy, halloween candy, candy corn, sour patch kids, sour patch, swedish fish, haribo, gummy worms, sour gummies, trolli, nerds, nerds clusters, skittles sour, starburst, laffy taffy, airheads, now and later, jolly ranchers, life savers, lifesavers, twizzlers, red vines, licorice, black licorice, good and plenty, mike and ike, hot tamales, dots candy, tootsie rolls, tootsie pops, dum dums, lollipops, blow pops, ring pops, pez, smarties, sweetarts, lemonheads, warheads, butterscotch candies, werther's, werthers, peppermints, starlight mints, altoids, tic tacs, tic tac, mints, breath mints, gum, chewing gum, bubble gum, trident, extra gum, orbit gum, 5 gum, ice breakers, cotton candy, rock candy, saltwater taffy, taffy, fudge, peanut brittle, caramels, kraft caramels, marshmallow peeps, peeps, jelly belly, chocolate coins, candy canes, hard candy, beef sticks, meat sticks, slim jims, slim jim, jack link's, jack links, chomps, epic bars, turkey jerky, salami sticks, snack sticks, cheese and crackers, lunchables, snack packs, hummus snack, guacamole cups, applesauce squeezers, kids snacks, toddler snacks, gerber puffs, yogurt melts, cereal bars kids, protein cookies, lenny and larry, protein chips, quest chips, keto snacks, snack food, nuts and seeds, baking supplies, baking mix, chips and salsa, chips and dip\",\n    \"Supplements\": \"vitamin b12, b12, vitamin b complex, b complex, vitamin e, vitamin a, vitamin k, vitamin d3, d3, calcium, calcium supplement, calcium chewables, potassium, iron pills, folic acid, folate, biotin, gummy vitamins, kids vitamins, flintstones vitamins, vitafusion, nature made, centrum, one a day, garden of life, olly, smartypants, men's multivitamin, women's multivitamin, prenatals, prenatal, postnatal vitamins, omega 3 fish oil, krill oil, cod liver oil, coq10, turmeric supplement, curcumin, ashwagandha, magnesium glycinate, magnesium citrate, glucosamine, chondroitin, msm, collagen powder, vital proteins, orgain, orgain protein, garden of life protein, plant protein powder, vegan protein powder, casein, pea protein, optimum nutrition, gold standard whey, isopure, ghost protein, protein scoops, mass gainer, beta alanine, citrulline, l-carnitine, carnitine, nitric oxide, pre-workout, c4, energy powder, greens powder, ag1, athletic greens, super greens, spirulina, chlorella, wheatgrass powder, beet powder, maca, maca powder, psyllium, psyllium husk, benefiber, fiber gummies, apple cider vinegar gummies, acv gummies, hair skin nails, sleep aid, sleep gummies, zzzquil, unisom, valerian, l theanine, theanine, 5 htp, sambucol, zicam, emergen-c, emergenc, vitamin c packets, zinc lozenges, echinacea, oregano oil, digestive enzymes, lactase, lactase pills, prebiotic, culturelle, align probiotic, florastor, electrolyte powder, electrolyte packets, lmnt, nuun, nuun tablets, pedialyte powder, liquid i.v., body armor powder, hydration multiplier, creatine monohydrate, protein supplement, sports nutrition, supplement, vitamin, gummies vitamins\",\n    \"Drinks\": \"coffee bag, ground coffee bag, dark roast, medium roast, light roast, decaf, decaf coffee, french roast, breakfast blend, colombian coffee, folgers, maxwell house, starbucks coffee, starbucks k cups, dunkin coffee, dunkin k cups, peet's, peets, caribou coffee, eight o'clock coffee, community coffee, cafe bustelo, caf\\u00e9 bustelo, lavazza, illy, death wish coffee, green mountain, donut shop k cups, keurig pods, k-cups, coffee k cups, nespresso, nespresso capsules, vertuo pods, espresso beans, espresso pods, instant espresso, nescafe, folgers instant, cold brew concentrate, chameleon cold brew, starbucks frappuccino, frappuccino, bottled frappuccino, iced coffee, canned coffee, coffee drinks, starbucks doubleshot, la colombe, stok cold brew, coffee syrup, torani, monin, flavored syrup, hot cocoa, hot chocolate, hot chocolate mix, cocoa mix, swiss miss, abuelita, ibarra, chai concentrate, tazo, tazo chai, oregon chai, tea k cups, lipton, lipton tea, bigelow, celestial seasonings, twinings, yogi tea, tazo tea, harney and sons, red rose tea, pg tips, yorkshire tea, earl grey, english breakfast tea, jasmine tea, oolong, white tea, rooibos, hibiscus tea, mint tea, ginger tea, lemon ginger tea, sleepytime, decaf tea, loose leaf tea, matcha powder, iced tea mix, tea pitcher bags, luzianne, gold peak, pure leaf, arizona tea, snapple, honest tea, sweet tea gallon, unsweet tea, lemonade mix, country time, crystal light, kool-aid, kool aid, mio, water enhancer, drink mix, juice box, apple juice boxes, honest kids, mott's juice, motts apple juice, tropicana, simply orange, simply lemonade, simply juice, minute maid, florida's natural, ocean spray, cranberry juice cocktail, cran apple, cran-grape, v8, v8 splash, tomato juice, vegetable juice, carrot juice, prune juice, pineapple juice, grapefruit juice, pomegranate juice, pom wonderful, tart cherry juice, cherry juice, mango juice, guava juice, passion fruit juice, white grape juice, welch's grape juice, fruit punch, hawaiian punch, sunny d, sunny delight, capri suns, kool-aid jammers, juicy juice, naked juice, bolthouse juice, odwalla, suja, green juice, cold pressed juice, celery juice, smoothie, smoothie bottles, protein smoothie, fairlife core power, core power, muscle milk, premier protein shakes, orgain shakes, glucerna, slimfast, slim fast, carnation breakfast essentials, instant breakfast, coke cans, coca cola, coca-cola, mexican coke, cherry coke, vanilla coke, diet pepsi, pepsi zero, cherry pepsi, sprite zero, 7up, 7 up, sierra mist, fanta, orange soda, grape soda, crush soda, sunkist, mug root beer, a&w, a&w root beer, barq's, cream soda, ginger beer, canada dry, schweppes, seagram's ginger ale, diet dr pepper, dr. pepper, mtn dew, mountain dew code red, fresca, big red, cheerwine, faygo, rc cola, olipop, poppi, zevia, culture pop, health ade, kevita, gt's kombucha, gts, synergy kombucha, humm kombucha, prebiotic soda, sparkling juice, izze, martinelli's, martinellis, sparkling apple cider, perrier water, polar seltzer, aha sparkling, bubly water, vintage seltzer, schweppes seltzer, sparkling ice, hint water, flavored water, smartwater, smart water, fiji water, voss, evian, essentia, core water, dasani, aquafina, poland spring, ozarka, crystal geyser, alkaline water, distilled water, gallon of water, gallon water, jug of water, spring water, purified water, water jug, water case, 24 pack water, sparkling mineral water, gerolsteiner, badoit, liquid death, boxed water, gatorade zero, g2, powerade zero, body armor, bodyarmor, prime hydration, prime drink, electrolyte drink, pedialyte, coconut water vita coco, vita coco, zico, harmless harvest, aloe vera drink, aloe juice, energy drink, monster energy, red bull sugar free, bang energy, celsius drink, alani nu, ghost energy, c4 energy, rockstar, 5 hour energy, nos energy, guayaki, yerba mate, club mate, matcha drink, beer cans, beer bottles, case of beer, six pack, 12 pack beer, craft beer, ipa, lager, pilsner, stout, ale, wheat beer, hefeweizen, sour beer, light beer, bud light, budweiser, coors light, coors, miller lite, michelob ultra, corona extra, modelo, modelo especial, pacifico, dos equis, heineken, stella artois, guinness, blue moon, sam adams, samuel adams, yuengling, pbr, pabst, busch light, natural light, keystone light, truly hard seltzer, white claws, bon and viv, vizzy, twisted tea, mike's hard lemonade, mikes hard lemonade, smirnoff ice, angry orchard, hard kombucha, non alcoholic beer, na beer, athletic brewing, heineken 0.0, mocktail, wine bottle, bottle of wine, box wine, boxed wine, cabernet, cabernet sauvignon, merlot, pinot noir, malbec, zinfandel, syrah, shiraz, red blend, chianti, rioja, sangiovese, chardonnay, sauvignon blanc, pinot grigio, pinot gris, riesling, moscato, white zinfandel, ros\\u00e9 wine, rose wine, sparkling wine, cava, brut, asti, lambrusco, port wine, vermouth, dry vermouth, sweet vermouth, sangria, mulled wine, sake, soju, mead, la marca, josh cellars, yellow tail, kendall jackson, meiomi, apothic, 19 crimes, kim crawford, cupcake wine, sutter home, franzia, bota box, vodka bottle, titos, tito's, absolut, smirnoff, grey goose, ketel one, svedka, tequila bottle, blanco tequila, reposado, anejo, a\\u00f1ejo, casamigos, don julio, jose cuervo, espolon, 1800 tequila, mezcal, rum bottle, white rum, dark rum, spiced rum, coconut rum, bacardi, captain morgan, whisky, scotch, rye whiskey, irish whiskey, crown royal, jack daniels, jack daniel's, jim beam, makers mark, maker's mark, bulleit, buffalo trace, woodford reserve, wild turkey, fireball, johnnie walker, gin bottle, tanqueray, bombay sapphire, hendricks, hendrick's, cognac, hennessy, liqueur, kahlua, bailey's, amaretto, disaronno, triple sec, cointreau, grand marnier, peach schnapps, schnapps, aperol, campari, st germain, limoncello, frangelico, chambord, jagermeister, sambuca, ouzo, absinthe, bitters, angostura, angostura bitters, margarita mix, bloody mary mix, mr and mrs t, zing zang, sour mix, sweet and sour mix, pina colada mix, daiquiri mix, mojito mix, cocktail mix, grenadine, rose's lime juice, roses lime, lime cordial, orgeat, mixers, cocktail onions, cocktail olives jar, ice tea, iced tea gallon, milk tea, boba, bubble tea, juice concentrate, frozen juice concentrate, frozen lemonade, frozen orange juice, coffee, tea, water, juice, soda, beer, wine\",\n    \"Household\": \"swiffer refills, swiffer wet refills, bug spray, bug repellent, off bug spray, deep woods off, citronella candles, mosquito repellent, paper towel, paper towel rolls, select a size, bounty paper towels, brawny, sparkle paper towels, toilet tissue, bath tissue, charmin ultra, cottonelle toilet paper, angel soft, quilted northern, scott toilet paper, seventh generation, flushable wipes, wet wipes adult, facial tissue, tissue boxes, puffs tissues, kleenex tissues, paper napkins, dinner napkins, cocktail napkins, party napkins, paper bowls, plastic plates, disposable plates, chinet, dixie cups, solo cups, red solo cups, party cups, plastic silverware, plastic spoons, plastic knives, disposable forks, cutlery, straws, paper straws, drinking straws, toothpicks, skewers, bamboo skewers, wooden skewers, popsicle sticks, cupcake liner, baking cups, muffin cups, parchment, parchment sheets, reynolds wrap, heavy duty foil, foil sheets, aluminum pans, disposable pans, foil roasting pan, roasting bags, oven bags, slow cooker liners, crock pot liners, reynolds liners, food storage containers, tupperware, glad containers, ziploc containers, rubbermaid, takeout containers, deli containers, mason jar lids, gallon bags, gallon ziploc, quart bags, quart ziploc, snack bags, ziploc sandwich bags, freezer ziploc, slider bags, reusable bags, grocery bags, paper bags, lunch bags, brown paper bags, trash bag, garbage bag, kitchen bags, tall kitchen bags, 13 gallon bags, 30 gallon bags, contractor bags, lawn bags, leaf bags, compost bags, recycling bags, hefty bags, glad trash bags, glad forceflex, drawstring bags, bin liners, small trash bags, dog waste bags, dish detergent, dishwashing liquid, dish liquid, dawn dish soap, dawn powerwash, palmolive, joy dish soap, mrs meyers, mrs. meyer's, method soap, method cleaner, seventh generation dish soap, dishwasher tabs, dishwasher tablets, finish pods, cascade pods, cascade platinum, cascade complete, rinse aid, jet dry, jet-dry, dishwasher cleaner, dishwasher salt, sponge, scrub sponges, scotch brite, scotch-brite, dobie, scouring pads, brillo, brillo pads, sos pads, steel wool pads, dish brush, bottle brush, dish cloths, dish towels, microfiber cloths, cleaning cloths, rags, shop towels, paper shop towels, rubber gloves dish, disposable gloves, nitrile gloves, latex gloves, laundry soap pods, tide liquid, tide free, tide free and clear, gain detergent, all detergent, all free clear, persil, arm and hammer detergent, arm & hammer, purex, seventh generation detergent, dreft, baby detergent, laundry sheets, laundry booster, borax, washing soda, oxi clean, oxiclean powder, stain stick, tide to go, shout spray, spray n wash, zout, color catcher, bluing, bleach alternative, clorox bleach, splash less bleach, color safe bleach, downy, downy unstopables, unstopables, scent beads, scent boosters, gain fireworks, bounce sheets, gain sheets, wool dryer balls, dryer balls, liquid fabric softener, fabric refresher, febreze fabric, starch, spray starch, niagara starch, wrinkle release, downy wrinkle releaser, lint brush, all purpose spray, multi surface cleaner, multi-surface, kitchen cleaner, bathroom cleaner, tub and tile, scrubbing bubbles, soft scrub, bar keepers friend, bar keeper's friend, bon ami, lime away, clr, tilex, mold remover, mildew remover, grout cleaner, shower spray, daily shower cleaner, toilet cleaner, lysol toilet cleaner, toilet bowl tablets, toilet brush, plunger, drain cleaner, drano, liquid plumr, drain snake, oven cleaner, easy off, easy-off, stainless steel cleaner, granite cleaner, wood polish, furniture polish, murphy oil soap, murphys oil soap, floor cleaner, swiffer wetjet, wetjet pads, swiffer dusters, swiffer sweeper, swiffer wet pads, swiffer dry pads, bona floor cleaner, pine sol, pine-sol, fabuloso, mr. clean, mr clean magic eraser, magic erasers, carpet cleaner, carpet shampoo, folex, spot remover, upholstery cleaner, glass wipes, windex wipes, lysol wipes, lysol spray, disinfectant spray, disinfectant wipes, sanitizing wipes, clorox spray, clorox clean up, bleach spray, hydrogen peroxide cleaner, rubbing alcohol cleaner, vinegar cleaner, cleaning vinegar gallon, mop, mop head, spin mop, broom and dustpan, dust pan, duster, dusters, feather duster, lint roller refill, vacuum filter, vacuum belt, dyson filter, roomba bags, air freshener spray, air wick, airwick, glade, glade plug ins, plug in refills, plugins, wax melts, scentsy, reed diffuser, candle, tea lights, tealights, votive candles, long lighter, grill lighter, bic lighter, fireplace matches, firestarters, charcoal, kingsford, lighter fluid, propane, wood pellets, firewood, ice melt, rock salt, salt pellets, water softener salt, softener salt, light bulb, led bulbs, led light bulbs, night light, aa battery, aaa battery, 9v battery, d batteries, c batteries, coin batteries, cr2032, duracell, energizer, extension cord, power strip, smoke detector battery, fly swatter, fly paper, fly strips, ant traps, ant bait, roach traps, bug spray house, mouse traps, mousetraps, rat traps, wasp spray, hornet spray, mosquito coils, citronella, citronella candles, zip ties, super glue, gorilla glue, krazy glue, glue sticks, scotch tape, packing tape, masking tape, painters tape, electrical tape, sharpies, sharpie, pens, pencils, printer paper, copy paper, envelopes, stamps, postage stamps, sticky notes, post its, post-it notes, index cards, notebooks, notebook, folders, binder, rubber bands, paper clips, staples, stapler, scissors, labels, gift wrap, wrapping paper, gift bags, tissue paper, gift tissue, ribbon, bows, balloons, party supplies, party plates, tablecloth, plastic tablecloth, trash can, wastebasket, laundry basket, hangers, clothes hangers, shoe polish, sewing kit, safety pins, command strips, command hooks, picture hangers, coffee filter, coffee filters basket, cone coffee filters, k cup filter, water filters, brita, brita filters, pur filter, fridge filter, refrigerator water filter, hvac filter, ac filter, humidifier filter, furnace filters, air purifier filter, baking soda box, arm and hammer baking soda, fridge deodorizer, odor eliminator, odor absorber, zero odor, moth balls, cedar blocks, shoe deodorizer, dish rack, drying mat, sink strainer, cleaning supplies kit, cleaning products, paper goods, paper products, household items, household supplies\",\n    \"Personal Care\": \"shampoo and conditioner, 2 in 1 shampoo, dandruff shampoo, head and shoulders, head & shoulders, pantene, herbal essences, dove shampoo, tresemme, tresemm\\u00e9, suave, garnier, garnier fructis, ogx, redken, olaplex, purple shampoo, clarifying shampoo, leave in conditioner, hair mask, deep conditioner, hair oil, argan oil, coconut oil hair, hair serum, hair mousse, styling cream, curl cream, pomade, hair wax, edge control, heat protectant, hair dye, hair color, box dye, root touch up, bleach kit, hair spray, texturizing spray, sea salt spray, detangler, detangling spray, kids shampoo, johnson's baby shampoo, body wash men, mens body wash, old spice, dove body wash, dove men, olay body wash, irish spring, dial soap, dove bar, dove soap, ivory soap, zest soap, lever 2000, safeguard, cetaphil, cerave, aveeno, eucerin, vaseline lotion, jergens, gold bond, curel, lubriderm, nivea, hand cream, hand lotion, foot cream, body butter, body oil, bath bombs, bubble bath, epsom salt, epsom salts, bath salts, loofah, bath pouf, shower pouf, washcloths, body scrub, exfoliator, face scrub, facial cleanser, cleansing wipes, makeup wipes, micellar water, toner face, face serum, retinol, vitamin c serum, hyaluronic acid, niacinamide, eye cream, night cream, face lotion, face moisturizer, spf, spf moisturizer, sunscreen spray, spray sunscreen, sunscreen stick, kids sunscreen, baby sunscreen, banana boat, coppertone, neutrogena, la roche posay, la roche-posay, supergoop, blue lizard, aloe vera gel, after sun, aloe gel, self tanner, tanning lotion, lip gloss, lipstick, lip liner, carmex, burt's bees, burts bees, blistex, aquaphor lip, mascara, eyeliner, eyeshadow, eye shadow, concealer, face powder, setting powder, blush, bronzer, highlighter makeup, setting spray, makeup primer, brow pencil, brow gel, false lashes, lash glue, makeup brushes, makeup sponge, beauty blender, cotton rounds, cotton pads, nail polish, nail polish remover pads, nail file, emery boards, nail clippers, cuticle oil, tweezers, eyebrow razor, razor, disposable razors, razor refills, razor cartridges, gillette, venus razor, schick, dollar shave club, shaving gel, shave gel, aftershave, after shave, beard oil, beard balm, trimmer, electric razor, waxing strips, wax strips, hair removal cream, nair, veet, deodorant stick, secret deodorant, dove deodorant, native deodorant, old spice deodorant, speed stick, right guard, clinical strength deodorant, body spray, perfume, cologne, fragrance, toothpaste tube, colgate, crest, sensodyne, aquafresh, tom's of maine, toms toothpaste, kids toothpaste, whitening toothpaste, whitening strips, crest whitestrips, electric toothbrush heads, toothbrush heads, sonicare heads, oral b, oral-b, waterpik, floss picks, flossers, plackers, interdental brushes, listerine, act mouthwash, mouth rinse, denture cleaner, polident, efferdent, denture adhesive, fixodent, retainer cleaner, orthodontic wax, tongue scraper, feminine pads, maxi pads, always pads, kotex, u by kotex, tampax, playtex tampons, o.b. tampons, menstrual cup, period underwear, panty liner, feminine wash, summer's eve, vagisil, monistat, pregnancy test, ovulation test, condoms, lubricant, personal lubricant, incontinence pads, poise pads, adult diapers, bed pads, contact lens solution, saline solution, opti free, biotrue, renu, contact lens case, reading glasses, lens wipes, eye wash, visine, refresh eye drops, systane, lubricant eye drops, ear drops, ear plugs, earplugs, debrox, nasal spray, saline spray, flonase, nasacort, afrin, neti pot, vicks, vicks vaporub, vapor rub, thermometer, digital thermometer, heating pad, ice pack, hot water bottle, elastic bandage, ace bandage, gauze, gauze pads, medical tape, first aid kit, neosporin ointment, triple antibiotic ointment, antibiotic ointment, hydrocortisone, hydrocortisone cream, cortizone, calamine lotion, anti itch cream, benadryl cream, bug bite cream, burn cream, blister bandages, moleskin, liquid bandage, butterfly bandages, hydrogen peroxide, rubbing alcohol, isopropyl alcohol, alcohol wipes, alcohol pads, cotton swab, epsom, witch hazel, tea tree oil, castor oil, mineral oil, petroleum jelly, a&d ointment, bag balm, icy hot, bengay, biofreeze, tiger balm, salonpas, voltaren, diclofenac gel, lidocaine patch, pain relief patch, pain reliever, advil liquid gels, motrin ib, aleve tablets, naproxen, excedrin, tylenol extra strength, tylenol pm, advil pm, kids tylenol, children's tylenol, infant tylenol, children's motrin, infant motrin, baby aspirin, low dose aspirin, bayer, midol, pamprin, allergy pills, xyzal, loratadine, cetirizine, fexofenadine, diphenhydramine, zyrtec d, claritin d, sudafed, mucinex, mucinex dm, robitussin, delsym, theraflu, alka seltzer, alka-seltzer, alka seltzer plus, coricidin, cold medicine, flu medicine, cough medicine, sore throat spray, chloraseptic, throat lozenges, ricola, luden's, zinc cough drops, cold sore cream, abreva, pepto bismol, pepto-bismol, imodium, kaopectate, gas x, gas-x, simethicone, beano, lactaid pills, antacid, antacids, rolaids, prilosec, nexium, pepcid, zantac, famotidine, omeprazole, miralax, dulcolax, colace, senokot, ex-lax, laxative, stool softener, fiber pills, preparation h, hemorrhoid cream, dramamine, motion sickness, bonine, emetrol, nicorette, nicotine gum, nicotine patches, sleep aids, melatonin gummies, unisom sleep, zzzquil liquid, diphenhydramine sleep, caffeine pills, no doz, vitamins pharmacy, medicine cabinet, pill organizer, pill box, blood pressure monitor, glucose tablets, glucose test strips, test strips, lancets, covid test, covid tests, at home covid test, rapid test, face mask, face masks medical, n95, n95 masks, kn95, hand sanitizer bottle, sanitizer, germ x, germx, hand wipes, wet ones, toiletries, travel size, travel toiletries, personal care, skincare, skin care, hair care, oral care, makeup, cosmetics\",\n    \"Pets\": \"greenies, dental chews, bully sticks, dry dog food, wet dog food, canned dog food, puppy food, senior dog food, dog kibble, dry cat food, wet cat food, canned cat food, kitten food, senior cat food, cat kibble, grain free dog food, raw dog food, freeze dried dog food, fresh dog food, the farmer's dog, farmers dog, nom nom, freshpet, freshpet dog food, dog food rolls, purina one, purina pro plan, pro plan, beneful, dog chow, cat chow, kitten chow, alpo, rachael ray nutrish, nutrish, hill's science diet, hills, science diet, royal canin, wellness core, merrick, orijen, acana, taste of the wild, nutro, nature's recipe, diamond naturals, kirkland dog food, stella and chewy's, stella & chewy's, ziwi peak, open farm, tiki cat, weruva, sheba, meow mix, nine lives, 9 lives, whiskas, cesar, cesar dog food, beggin strips, beggin, pup-peroni, puperoni, milk-bone, milkbone, dentastix, dental chews, dog dental chews, bully sticks, pig ears, antlers, nylabone, kong toy, dog toys, cat toys, catnip, cat nip, cat grass, cat scratcher, scratching post, chewies, dog chews, rawhide chews, jerky treats dog, training treats, zuke's, zukes, blue buffalo treats, temptations treats, churu, inaba churu, lickable treats, party mix temptations, cat litter clumping, clumping litter, scoopable litter, tidy cats, fresh step, arm and hammer litter, scoop away, dr elsey's, dr elseys, world's best cat litter, worlds best, pine litter, crystal litter, litter box, litter liners, litter bags, litter scoop, litter genie refill, litter mat, pee pads dog, training pads, wee wee pads, dog diapers, belly bands, poop bag refills, waste bags, dog bags, pooper scooper, flea and tick, flea shampoo, nexgard, simparica, bravecto, seresto, seresto collar, capstar, heartgard, heartworm medicine, dewormer, pet meds, pet medication, pet vitamins, joint supplement dog, cosequin, dasuquin, dog shampoo, cat shampoo, pet shampoo, pet wipes, grooming wipes, dog brush, cat brush, furminator, nail clippers dog, dog toothpaste, pet toothpaste, ear cleaner dog, dog bed, cat bed, pet bed, crate, dog crate, crate pad, dog leash, leash, dog collar, cat collar, harness, dog harness, id tag, pet carrier, dog bowl, cat bowl, water fountain pet, pet fountain filter, fish tank, fish flakes, betta food, goldfish food, tropical fish food, aquarium filter, water conditioner, tetra, hamster food, guinea pig food, rabbit food, rabbit pellets, timothy hay, bedding small animal, carefresh, small animal bedding, wood shavings, bird food, wild bird seed, suet, suet cakes, hummingbird food, parrot food, chicken feed, layer feed, scratch grains, mealworms, dried mealworms, crickets, reptile food, horse treats, pet supplies, pet food\",\n    \"Baby\": \"diaper, newborn diapers, size 1 diapers, size 2 diapers, size 3 diapers, size 4 diapers, size 5 diapers, size 6 diapers, overnight diapers, swim diapers, little swimmers, cloth diapers, diaper liners, diaper inserts, pampers swaddlers, pampers cruisers, huggies little snugglers, huggies little movers, hello bello, honest diapers, honest company, kirkland diapers, parents choice, up and up diapers, training pants, goodnites, ninjamas, pampers wipes, huggies wipes, water wipes, waterwipes, sensitive wipes, wipe warmer, diaper rash cream, boudreaux's, boudreaux's butt paste, butt paste, triple paste, a and d, desitin maximum, baby powder, cornstarch powder, baby oil, baby bath, baby bubble bath, baby body wash, aveeno baby, cetaphil baby, mustela, johnson's baby, baby sunscreen lotion, baby nail clippers, nasal aspirator, nosefrida, frida baby, gripe water, gas drops, mylicon, infant gas drops, baby vitamins, vitamin d drops, teething gel, teething tablets, orajel, teething toys, teething ring, infant formula, toddler formula, formula powder, ready to feed formula, liquid formula, similac advance, similac pro sensitive, enfamil neuropro, enfamil gentlease, gentlease, kirkland formula, byheart, kendamil, earth's best, earths best, happy baby, happy tot, plum organics, beech nut, beechnut, sprout organics, once upon a farm, little spoon, serenity kids, gerber puffs cereal, rice cereal, oatmeal cereal baby, baby cereal, baby oatmeal, baby puffs, teething wafers, yogurt bites, toddler milk, toddler snacks pouches, baby snacks, baby jars, stage 3 baby food, baby bottles, bottle nipples, nipples bottle, bottle brush baby, bottle liners, breast milk bags, breastmilk storage bags, nursing pads, breast pads, lanolin, nipple cream, lansinoh, breast pump parts, pump parts, pacifier, binky, pacifier clips, sippy cup, straw cups, toddler cups, baby spoons, bibs, baby bibs, burp cloths, onesies, baby socks, swaddle, swaddles, sleep sack, crib sheets, changing pad liners, diaper pail refills, diaper genie refills, diaper genie, ubbi bags, baby laundry detergent, baby shampoo and wash, baby lotion johnson\"\n  }\n  };\n  if (typeof module !== 'undefined' && module.exports) module.exports = W;\n  root.dbkGroceryWords = W;\n})(typeof window !== 'undefined' ? window : globalThis);\n","grocery-aisle.js":"/* Grocery list: which section of the store something goes in. Plain word rules on this phone, nothing sent.\n   aisle(\"2 lbs ground beef\") -> \"Protein\";  info(\"diced jalapeños\") -> { aisle: \"Canned & Jarred\", cover: 1 }\n   - The words it knows are in grocery-words.js (a few thousand things a US grocery store sells, brands too), the one\n     list the Inbox's \"this is groceries\" guess uses as well (inbox-suggest.js calls info()).\n   - Whole words only (\"shampoo\" never lands in meat because it has \"ham\" in it).\n   - Accents don't matter (jalapeño = jalapeno; Kasey, Oct 25: \"diced jalapeños\" went to Other because the ñ split\n     the word in two). Amounts, sizes, \"x2\", \"a dozen\", \"(for tacos)\" are ignored; plurals count as the same word.\n   - The longest phrase it knows wins (\"chicken broth\" is a carton, not chicken; \"peanut butter\" isn't dairy;\n     \"garlic powder\" is a spice), and when two match the last word decides, the way English works\n     (\"strawberry yogurt\" is yogurt, \"chocolate milk\" is milk).\n   - How it's sold: \"frozen ...\" is Frozen, \"canned / jarred / pickled ...\", \"can of ...\", \"jar of ...\" Canned & Jarred\n     (a can of soda stays a drink); diced or sliced jalapeños, diced tomatoes, sliced olives come in jars and cans,\n     fresh ones are Produce; dried herbs are spices, dried fruit a snack.\n   - cover says how much of the line it knew (1 = every word), so the Inbox can tell \"jalapeños\" (groceries) from\n     \"Pepper's vet appointment\" (not).\n   It replaces the planner's older categorizeIngredient(), which matched parts of words. */\n(function (root) {\n  function words0() { return root.dbkGroceryWords || (typeof module !== 'undefined' && typeof require === 'function' ? (function () { try { return require('./grocery-words.js'); } catch (e) { return null; } })() : null); }\n  // a word a cook adds that says how it's sold or cut: it never stops a line being known, and some decide the section\n  var PREP = { diced: 1, sliced: 1, chopped: 1, minced: 1, shredded: 1, grated: 1, crushed: 1, pickled: 1, roasted: 1, toasted: 1, stewed: 1, peeled: 1, cubed: 1, crumbled: 1, julienned: 1, julienne: 1, halved: 1, quartered: 1, shelled: 1, pitted: 1, seedless: 1, frozen: 1, canned: 1, jarred: 1, tinned: 1, dried: 1, dry: 1, cooked: 1, uncooked: 1, precooked: 1, boneless: 1, skinless: 1, marinated: 1, seasoned: 1, breaded: 1, smoked: 1, fresh: 1, organic: 1, raw: 1, ripe: 1, large: 1, small: 1, medium: 1, big: 1, jumbo: 1, mini: 1, local: 1, lean: 1, extra: 1, natural: 1, unsweetened: 1, sweetened: 1, unsalted: 1, salted: 1, plain: 1, light: 1, lite: 1, reduced: 1, low: 1, fat: 1, free: 1, sodium: 1, nonfat: 1, whole: 1, thin: 1, thick: 1, cut: 1, family: 1, size: 1, value: 1, store: 1, brand: 1, generic: 1, name: 1, wild: 1, caught: 1, farmed: 1, grass: 1, fed: 1, cage: 1, range: 1, pasture: 1, raised: 1, ready: 1, instant: 1, fire: 1, bone: 1, skin: 1, gluten: 1, dairy: 0, sugar: 0, vegan: 1, keto: 1, kosher: 1, regular: 1, classic: 1, original: 1, mild: 1, hot: 1, spicy: 1, flavored: 1, assorted: 1, variety: 1, bulk: 1, bag: 0 };\n  // words that say nothing about what it is\n  var FILLER = { a: 1, an: 1, the: 1, of: 1, in: 1, with: 1, w: 1, some: 1, more: 1, few: 1, couple: 1, x: 1, ea: 1, each: 1, ct: 1, count: 1, new: 1, another: 1, other: 1, good: 1, nice: 1, cheap: 1, that: 1, those: 1, these: 1, this: 1, any: 1, kind: 1, dozen: 1, doz: 1, please: 1, again: 1, too: 1, also: 1, just: 1, like: 1, maybe: 1, our: 1, my: 1, usual: 1 };\n  var UNIT = /^(lbs?|pounds?|oz|ounces?|fl|g|grams?|kg|kilos?|ml|l|liters?|litres?|gal|gallons?|qt|quarts?|pt|pints?|cups?|c|tbsp|tbs|tablespoons?|tsp|teaspoons?|cans?|jars?|tins?|bottles?|bags?|boxes|box|packs?|packages?|pkgs?|cartons?|containers?|tubs?|bunch|bunches|heads?|cloves?|loaf|loaves|sticks?|blocks?|slices?|pieces?|pcs?|rolls?|cases?|bars?|sleeves?)$/;\n\n  function fold(s) {\n    s = String(s || '').toLowerCase();\n    try { s = s.normalize('NFD').replace(/[̀-ͯ]/g, ''); } catch (e) {}\n    return s.replace(/[æ]/g, 'ae').replace(/[ø]/g, 'o').replace(/[ß]/g, 'ss');\n  }\n  function singular(w) {\n    if (/inis$/.test(w)) return w.slice(0, -1);   // zucchinis, paninis\n    if (w.length < 4 || /(ss|us|is|ous)$/.test(w)) return w;\n    if (/ilies$/.test(w)) return w.slice(0, -2);   // chilies -> chili\n    if (/ies$/.test(w)) return w.length <= 4 ? w.slice(0, -1) : w.slice(0, -3) + 'y';   // pies -> pie, berries -> berry\n    if (/ie$/.test(w) && w.length >= 5) return w.slice(0, -2) + 'y';   // cookie = cookies, brownie = brownies\n    if (/(oes|ches|shes|sses|xes|zes)$/.test(w)) return w.slice(0, -2);\n    if (/ves$/.test(w) && !/(olives|chives)$/.test(w)) return w.slice(0, -3) + 'f';\n    if (/s$/.test(w)) return w.slice(0, -1);\n    return w;\n  }\n  // the same words for a phrase in the list and a line on the grocery list\n  function tokens(text) {\n    return fold(text).replace(/[’'`´]/g, '').replace(/&/g, ' and ').replace(/[^a-z0-9%\\s]/g, ' ').split(/\\s+/)\n      .filter(function (x) { return x && !FILLER[x]; }).map(singular);\n  }\n  // a line as typed: \"2 lbs ground beef (for tacos)\", \"milk x2\", \"a can of diced tomatoes\", \"eggs - a dozen\"\n  function prep(text) {\n    var t = fold(text).replace(/[’'`´]/g, '').replace(/\\(.*?\\)|\\[.*?\\]/g, ' ').replace(/,.*$/, '')\n      .replace(/\\s[-–—:]\\s.*$/, ' ')   // \"eggs - a dozen\", \"milk: the big one\"\n      .replace(/\\s(for|to make|to use|from|at)\\s.*$/, ' ');   // \"ground beef for tacos\", \"bread from Kroger\"\n    var how = {};\n    // how it's sold, also when it's said in brackets or after a dash: \"jalapeños (jarred)\", \"peas - frozen\"\n    fold(text).replace(/[^a-z\\s]/g, ' ').split(/\\s+/).forEach(function (x) { if (PREP[x]) how[x] = 1; });\n    if (/\\b(can|cans|tin|tins|jar|jars) of\\b|\\bin (a |the )?(can|jar|tin)s?\\b/.test(fold(text))) how.can = 1;\n    t = t.replace(/\\bhalf gallons?\\b|\\bhalf dozen\\b/g, ' ');\n    t = t.replace(/\\b(in (a |the )?(can|jar|tin)s?)\\b/g, ' ');\n    t = t.replace(/[½¼¾⅓⅔⅛]/g, ' ').replace(/&/g, ' and ').replace(/[^a-z0-9%\\s.\\/-]/g, ' ').replace(/(\\d)-(?=\\d)/g, '$1 ').replace(/-/g, ' ');\n    // amounts and units: \"2 lbs\", \"1 1/2 cups\", \"x3\", \"3x\", \"16oz\", \"1.5\"\n    t = t.replace(/\\b\\d+(?:[.\\/]\\d+)?\\s*(?:x\\b|(?:lbs?|pounds?|oz|ounces?|g|grams?|kg|ml|l|liters?|gal|gallons?|qt|quarts?|pt|pints?|ct|pk|cans?|jars?|bottles?|bags?|boxes|box|packs?|cartons?|dozen|doz|count)\\b)?|\\bx\\s?\\d+\\b/g, ' ').replace(/[.\\/]/g, ' ');\n    var w = t.replace(/[’'`´]/g, '').split(/\\s+/).filter(Boolean);\n    while (w.length > 1 && (UNIT.test(w[0]) || FILLER[w[0]])) w.shift();   // \"can of\", \"bag of\", \"a jar of\"\n    w = w.filter(function (x) { return !FILLER[x]; });\n    while (w.length > 1 && UNIT.test(w[w.length - 1]) && !/^(rolls?|bars?|sticks?|cups?|bags?|boxes|box|tubs?|packs?|blocks?)$/.test(w[w.length - 1])) w.pop();   // \"milk gallon\"\n    w.forEach(function (x) { if (PREP[x]) how[x] = 1; });\n    return { words: w.map(singular), how: how };\n  }\n  function norm(text) { return prep(text).words.filter(function (x) { return !PREP[x]; }); }\n\n  // the phrase index: \"chicken broth\" -> Canned & Jarred, built once from grocery-words.js\n  var INDEX = null, FIX = null, HEADS = null;\n  function key(p) { return tokens(p).join(' '); }\n  function index() {\n    if (INDEX) return INDEX;\n    var W = words0();\n    var idx = {};\n    if (W) ['first', 'more'].forEach(function (part) {\n      Object.keys(W[part] || {}).forEach(function (cat) {\n        String(W[part][cat]).split(/\\s*,\\s*/).forEach(function (p) { var k = key(p); if (k && !(k in idx)) idx[k] = cat; });\n      });\n    });\n    FIX = {}; Object.keys(EXACT).forEach(function (k) { FIX[key(k)] = EXACT[k]; });\n    HEADS = {}; Object.keys(HEAD).forEach(function (k) { HEADS[key(k) || k] = HEAD[k]; });\n    if (W) INDEX = idx;   // not loaded yet: try again next time\n    return idx;\n  }\n  // words that mean something else in another section, or a phrase that needs to win over its parts\n  var EXACT = {\n    'pepper': 'Spices & Oils', 'black pepper': 'Spices & Oils', 'red pepper': 'Produce', 'red pepper flake': 'Spices & Oils', 'crushed red pepper': 'Spices & Oils',\n    'chip': 'Baking & Snacks', 'chocolate chip': 'Baking & Snacks', 'chocolate milk': 'Dairy', 'milk chocolate': 'Baking & Snacks',\n    'butter': 'Dairy', 'peanut butter': 'Canned & Jarred', 'almond butter': 'Canned & Jarred', 'nut butter': 'Canned & Jarred', 'apple butter': 'Canned & Jarred',\n    'cream': 'Dairy', 'ice cream': 'Frozen', 'cream cheese': 'Dairy', 'sour cream': 'Dairy', 'coconut cream': 'Canned & Jarred', 'shaving cream': 'Personal Care', 'diaper cream': 'Baby',\n    'coconut milk': 'Canned & Jarred', 'almond milk': 'Dairy', 'oat milk': 'Dairy', 'condensed milk': 'Canned & Jarred', 'evaporated milk': 'Canned & Jarred',\n    'coconut': 'Produce', 'shredded coconut': 'Baking & Snacks', 'coconut flake': 'Baking & Snacks', 'coconut water': 'Drinks', 'coconut oil': 'Spices & Oils',\n    'tuna': 'Canned & Jarred', 'tuna steak': 'Protein', 'salmon': 'Protein', 'canned salmon': 'Canned & Jarred',\n    'corn': 'Produce', 'canned corn': 'Canned & Jarred', 'frozen corn': 'Frozen', 'corn tortilla': 'Grains & Bread', 'corn chip': 'Baking & Snacks', 'corn flake': 'Grains & Bread', 'cornmeal': 'Grains & Bread',\n    'date': 'Produce', 'medjool date': 'Produce', 'cranberry': 'Produce', 'dried cranberry': 'Baking & Snacks',\n    'orange': 'Produce', 'mandarin orange': 'Produce', 'orange juice': 'Drinks', 'apple': 'Produce', 'apple juice': 'Drinks', 'apple cider vinegar': 'Spices & Oils', 'apple cider': 'Drinks',\n    'ginger': 'Produce', 'ground ginger': 'Spices & Oils', 'ginger ale': 'Drinks', 'garlic': 'Produce', 'garlic powder': 'Spices & Oils', 'garlic salt': 'Spices & Oils', 'garlic bread': 'Grains & Bread',\n    'onion': 'Produce', 'onion powder': 'Spices & Oils', 'green onion': 'Produce', 'french onion dip': 'Dairy',\n    'rosemary': 'Produce', 'basil': 'Produce', 'thyme': 'Produce', 'dried basil': 'Spices & Oils', 'dried thyme': 'Spices & Oils',\n    'cracker': 'Baking & Snacks', 'graham cracker': 'Baking & Snacks', 'goldfish': 'Baking & Snacks', 'goldfish cracker': 'Baking & Snacks',\n    'egg': 'Protein', 'egg noodle': 'Grains & Bread', 'eggplant': 'Produce', 'egg roll': 'Frozen', 'eggo': 'Frozen', 'eggo waffle': 'Frozen', 'eggnog': 'Dairy', 'egg nog': 'Dairy',\n    'chicken noodle soup': 'Canned & Jarred', 'chicken nugget': 'Frozen', 'chicken broth': 'Canned & Jarred', 'chicken stock': 'Canned & Jarred',\n    'hot dog bun': 'Grains & Bread', 'hamburger bun': 'Grains & Bread', 'hot dog': 'Protein', 'burger bun': 'Grains & Bread',\n    'mac and cheese': 'Grains & Bread', 'mac n cheese': 'Grains & Bread', 'cheese cracker': 'Baking & Snacks', 'cheez it': 'Baking & Snacks',\n    'pasta sauce': 'Canned & Jarred', 'spaghetti sauce': 'Canned & Jarred', 'pizza sauce': 'Canned & Jarred', 'pizza dough': 'Grains & Bread', 'pizza': 'Frozen', 'pizza roll': 'Frozen',\n    'lemon juice': 'Produce', 'lime juice': 'Produce', 'lemon pepper': 'Spices & Oils',\n    'water': 'Drinks', 'sparkling water': 'Drinks', 'water filter': 'Household', 'water chestnut': 'Canned & Jarred',\n    'rice': 'Grains & Bread', 'cauliflower rice': 'Frozen', 'riced cauliflower': 'Frozen', 'rice vinegar': 'Spices & Oils', 'rice cake': 'Baking & Snacks', 'rice krispie': 'Grains & Bread',\n    'sweet potato': 'Produce', 'potato chip': 'Baking & Snacks', 'sweet potato fry': 'Frozen',\n    'wipe': 'Household', 'baby wipe': 'Baby', 'disinfecting wipe': 'Household', 'clorox wipe': 'Household',\n    'bar': 'Baking & Snacks', 'bar of soap': 'Household', 'ice cream bar': 'Frozen', 'soap': 'Household', 'dish soap': 'Household', 'hand soap': 'Household',\n    'pad': 'Personal Care', 'swiffer pad': 'Household', 'puppy pad': 'Pets', 'pee pad': 'Pets', 'mop pad': 'Household',\n    'tea': 'Drinks', 'iced tea': 'Drinks', 'sweet tea': 'Drinks', 'filter': 'Household', 'coffee filter': 'Household',\n    'treat': 'Pets', 'dog treat': 'Pets', 'cat treat': 'Pets', 'litter': 'Pets', 'cat litter': 'Pets',\n    'sauce': 'Spices & Oils', 'soup': 'Canned & Jarred', 'dressing': 'Spices & Oils', 'seasoning': 'Spices & Oils', 'stuffing': 'Grains & Bread',\n    'cider': 'Drinks', 'roll': 'Grains & Bread', 'toilet paper roll': 'Household', 'egg white': 'Protein', 'protein powder': 'Supplements', 'protein bar': 'Baking & Snacks', 'protein shake': 'Drinks',\n    'salsa': 'Canned & Jarred', 'queso': 'Canned & Jarred', 'bean': 'Canned & Jarred', 'green bean': 'Produce', 'string bean': 'Produce', 'coffee bean': 'Drinks', 'jelly bean': 'Baking & Snacks', 'bean sprout': 'Produce', 'frozen green bean': 'Frozen',\n    'nut': 'Baking & Snacks', 'tater tot': 'Frozen', 'frozen': 'Frozen', 'hash brown': 'Frozen', 'fry': 'Frozen', 'french fry': 'Frozen',\n    'ham': 'Protein', 'shrimp': 'Protein', 'jerky': 'Baking & Snacks', 'beef jerky': 'Baking & Snacks', 'brussel sprout': 'Produce', 'brussels sprout': 'Produce',\n    'edamame': 'Frozen', 'cool whip': 'Frozen', 'whipped cream': 'Dairy', 'pie crust': 'Frozen', 'vanilla': 'Baking & Snacks', 'vanilla yogurt': 'Dairy', 'vanilla ice cream': 'Frozen',\n    'k cup': 'Drinks', 'chocolate': 'Baking & Snacks', 'fruit cup': 'Canned & Jarred', 'fruit snack': 'Baking & Snacks', 'mustard': 'Spices & Oils', 'honey mustard': 'Spices & Oils'\n  };\n  // a last word that settles it (\"... soup\", \"... chips\"), unless the whole name is known\n  var HEAD = { soup: 'Canned & Jarred', broth: 'Canned & Jarred', stock: 'Canned & Jarred', chip: 'Baking & Snacks', cracker: 'Baking & Snacks', cookie: 'Baking & Snacks',\n    dressing: 'Spices & Oils', seasoning: 'Spices & Oils', spice: 'Spices & Oils', vinegar: 'Spices & Oils', oil: 'Spices & Oils', juice: 'Drinks', soda: 'Drinks', tea: 'Drinks',\n    yogurt: 'Dairy', milk: 'Dairy', cheese: 'Dairy', creamer: 'Dairy', bread: 'Grains & Bread', cereal: 'Grains & Bread', pasta: 'Grains & Bread', noodle: 'Grains & Bread', tortilla: 'Grains & Bread', bun: 'Grains & Bread', bagel: 'Grains & Bread',\n    sausage: 'Protein', steak: 'Protein', breast: 'Protein', thigh: 'Protein', wing: 'Protein', fillet: 'Protein', filet: 'Protein', chop: 'Protein', bar: 'Baking & Snacks', ice: 'Frozen', detergent: 'Household', cleaner: 'Household',\n    shampoo: 'Personal Care', food: null, mix: null, sauce: 'Spices & Oils', jam: 'Canned & Jarred', jelly: 'Canned & Jarred', bean: 'Canned & Jarred', wipe: 'Household', bag: 'Household', pod: null };\n\n  // how it's sold decides it for some things: diced jalapeños come in a jar, \"jalapeños\" are fresh\n  var IN_JARS = {\n    jalapeno: /diced|sliced|pickled|crushed/, 'jalapeno pepper': /diced|sliced|pickled/, 'green chile': /diced|whole|roasted/, 'green chily': /diced|whole|roasted/, 'green chili': /diced|whole|roasted/, chile: /diced/, chily: /diced/, chili: /diced/,\n    tomato: /diced|crushed|stewed|peeled|fire|whole/, 'roma tomato': /diced|crushed|peeled/, 'plum tomato': /peeled|crushed|whole/, pepper: /roasted/, 'red pepper': /roasted/, 'bell pepper': /roasted/, 'red bell pepper': /roasted/,\n    olive: /sliced|pitted|chopped/, 'black olive': /sliced|chopped/, 'green olive': /sliced/, beet: /sliced|pickled|diced/, pineapple: /crushed|sliced|chunk/, peach: /sliced|diced/, pear: /sliced|diced/,\n    'banana pepper': /sliced|pickled/, pepperoncini: /sliced/, 'water chestnut': /sliced|diced|whole/, 'bamboo shoot': /sliced/, mushroom: /canned/, potato: /canned/, carrot: /canned/, corn: /canned/, pumpkin: /canned/\n  };\n  var HERB = { basil: 1, oregano: 1, thyme: 1, parsley: 1, rosemary: 1, dill: 1, sage: 1, mint: 1, chive: 1, cilantro: 1, tarragon: 1, marjoram: 1, 'bay leaf': 1, herb: 1, chile: 1, chily: 1, chili: 1, 'chili pepper': 1, onion: 1, garlic: 1, ginger: 1, lemongrass: 1 };\n  var FISH = { tuna: 1, salmon: 1, crab: 1, clam: 1, oyster: 1, sardine: 1, anchovy: 1, mackerel: 1, herring: 1 };\n\n  // which section, and how much of the line it knew\n  function info(text) {\n    var raw = String(text || '');\n    if (raw.indexOf('---') !== -1) return { aisle: null, cover: 0 };\n    if (!raw.trim()) return { aisle: 'Other', cover: 0 };\n    var P = prep(raw), w = P.words, how = P.how;\n    if (!w.length) return { aisle: 'Other', cover: 0 };\n    var idx = index(), n = w.length, covered = [], found = [];\n    var look = function (k) { return FIX[k] || idx[k]; };\n    // the longest phrases first, each word counted once (\"diced jalapeno\" before \"jalapeno\")\n    for (var len = Math.min(n, 6); len >= 1; len--) {\n      for (var i = 0; i + len <= n; i++) {\n        var free = true; for (var j = i; j < i + len; j++) if (covered[j]) { free = false; break; }\n        if (!free) continue;\n        var k = w.slice(i, i + len).join(' '), c = look(k);\n        if (!c || (len === 1 && (PREP[k] || k === 'and' || k === 'or') && n > 1) || k === 'and') continue;\n        for (j = i; j < i + len; j++) covered[j] = true;\n        found.push({ k: k, c: c, i: i, end: i + len, len: len });\n      }\n    }\n    // the words that are only how it's sold count as known\n    var known = 0, core = [];\n    for (var q = 0; q < n; q++) { if (covered[q] || PREP[w[q]]) known++; if (!PREP[w[q]]) core.push(w[q]); }\n    var lastAt = n - 1; while (lastAt > 0 && PREP[w[lastAt]] && !covered[lastAt]) lastAt--;\n    var last = w[lastAt], best = null;\n    found.forEach(function (f) {\n      // longer phrase wins; for the same length the one nearer the end (the head word) wins\n      if (!best || f.len > best.len || (f.len === best.len && f.end > best.end)) best = f;\n    });\n    var cat = best ? best.c : null;\n    // \"... soup\", \"... chips\": the last word decides when the best phrase didn't include it\n    if (HEADS[last] && (!best || (best.end <= lastAt && best.len < core.length))) { cat = HEADS[last]; covered[lastAt] = true; }\n    // \"dog food\", \"cat toy\", \"baby lotion\"\n    if (/^(dog|cat|puppy|kitten|pet)$/.test(core[0]) && core.length > 1 && (!best || best.len < core.length)) { cat = 'Pets'; known = n; }\n    else if (core[0] === 'baby' && core.length > 1 && cat !== 'Produce' && (!best || best.len < core.length)) cat = 'Baby';\n    // \"peppers\" are the vegetable, \"pepper\" the spice\n    if (best && best.k === 'pepper' && best.len === core.length && /\\bpeppers\\b/.test(fold(raw))) cat = 'Produce';\n    var whole = best && best.len + (n - core.length) >= n;   // the whole name, how it's sold aside\n    var bk = best ? best.k : '', has = function (re) { for (var h in how) if (re.test(h)) return true; return false; };\n    if (how.frozen && !(best && /frozen/.test(bk))) cat = 'Frozen';\n    else if ((how.canned || how.jarred || how.tinned || how.can || how.pickled) && !(best && /canned|jarred|pickled/.test(bk))) {\n      cat = /^(Drinks|Pets|Household|Baby|Personal Care|Frozen|Supplements)$/.test(cat) ? cat : 'Canned & Jarred';\n    } else if (best && whole && IN_JARS[bk] && has(IN_JARS[bk]) && !how.fresh) cat = 'Canned & Jarred';\n    else if ((how.dried || how.dry) && best && cat === 'Produce') cat = HERB[bk] ? 'Spices & Oils' : 'Baking & Snacks';\n    else if ((how.dried || how.dry) && best && /\\b(bean|lentil|pea|chickpea)\\b/.test(bk)) cat = 'Canned & Jarred';\n    else if (how.fresh && best && cat === 'Canned & Jarred' && FISH[bk]) cat = 'Protein';\n    else if (how.fresh && best && cat === 'Canned & Jarred' && whole && /jalapeno|chil|tomato|pepper|beet|pineapple|peach|pear|olive|corn|pumpkin/.test(bk)) cat = 'Produce';\n    var cover = 0; for (q = 0; q < n; q++) if (covered[q] || PREP[w[q]]) cover++;\n    if (!cat) return { aisle: 'Other', cover: 0 };\n    return { aisle: cat, cover: cat === 'Pets' && known === n ? 1 : cover / n };\n  }\n  function aisle(text) { return info(text).aisle; }\n\n  // is this exactly a thing the list knows by name? (\"oat milk\" yes, \"milk eggs\" no): the Inbox splits \"milk eggs bread\"\n  function known(text) { var k = key(text); if (!k) return false; var idx = index(); return !!(FIX[k] || idx[k]); }\n  var api = { aisle: aisle, info: info, norm: norm, fold: fold, key: key, known: known };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  root.dbkGroceryAisle = aisle;\n  root.dbkGroceryInfo = info;\n  root.dbkGroceryAisleApi = api;\n  // the planner (app.bundle.js) and the Meals grocery list call categorizeIngredient(): use these rules instead\n  if (typeof window !== 'undefined') window.categorizeIngredient = function (text) { return aisle(text); };\n})(typeof window !== 'undefined' ? window : globalThis);\n","known-titles.js":"/* 2daysbook inbox: well-known books, TV shows and movies, so a note that's just a title (\"Project Hail Mary\",\n   \"Severance\") is offered the right list (Kasey, Oct 23: \"it doesn't pick up on well known books and stuff like that\").\n   A plain list kept in the app: nothing is looked up online. Titles only (a title isn't anyone's to own). A title that\n   is both a book and a show or film is in both lists, and the note's own words (\"read\", \"watch\") decide.\n   Used by inbox-suggest.js; tests in functions/test/inbox-suggest.test.mjs. */\n(function (root) {\n  var BOOKS = [\n    // recent best sellers and book-club favourites\n    'Project Hail Mary', 'The Martian', 'Artemis', 'Fourth Wing', 'Iron Flame', 'Onyx Storm', 'A Court of Thorns and Roses', 'A Court of Mist and Fury',\n    'A Court of Wings and Ruin', 'A Court of Silver Flames', 'House of Earth and Blood', 'Throne of Glass', 'Lessons in Chemistry', 'Where the Crawdads Sing',\n    'Tomorrow, and Tomorrow, and Tomorrow', 'The Seven Husbands of Evelyn Hugo', 'Daisy Jones and the Six', 'Malibu Rising', 'Carrie Soto Is Back',\n    'It Ends with Us', 'It Starts with Us', 'Verity', 'Ugly Love', 'Reminders of Him', 'November 9', 'The Women', 'The Nightingale', 'The Four Winds',\n    'The Great Alone', 'Firefly Lane', 'The Midnight Library', 'Klara and the Sun', 'Remains of the Day', 'Never Let Me Go',\n    'Circe', 'The Song of Achilles', 'Atomic Habits', 'The Body Keeps the Score', 'Thinking, Fast and Slow', 'Sapiens', 'Homo Deus', 'Outliers',\n    'The Tipping Point', 'Talking to Strangers', 'Daring Greatly', 'Atlas of the Heart', 'The Gifts of Imperfection', 'Untamed', 'The Subtle Art of Not Giving a F*ck', 'Can\\'t Hurt Me', 'The 7 Habits of Highly Effective People', 'How to Win Friends and Influence People',\n    'The Power of Now', 'The Four Agreements', 'The Alchemist', 'Man\\'s Search for Meaning', 'Deep Work', 'Essentialism', 'The 5 Second Rule',\n    'The Let Them Theory', 'Rich Dad Poor Dad', 'The Psychology of Money', 'The Total Money Makeover', 'I Will Teach You to Be Rich', 'Die With Zero',\n    'Braiding Sweetgrass', 'Crying in H Mart', 'I\\'m Glad My Mom Died', 'The Woman in Me', 'Greenlights', 'Born a Crime', 'Know My Name',\n    'The Glass Castle', 'Eat Pray Love', 'Big Magic', 'Shoe Dog', 'Steve Jobs', 'Elon Musk', 'Into the Wild', 'Into Thin Air', 'Unbroken',\n    'The Boys in the Boat', 'Killers of the Flower Moon', 'The Immortal Life of Henrietta Lacks', 'Hidden Figures', 'The Wright Brothers',\n    'Fourth Wing', 'The Housemaid', 'The Housemaid\\'s Secret', 'The Silent Patient', 'The Maidens', 'Gone Girl', 'Sharp Objects', 'The Girl on the Train',\n    'Big Little Lies', 'Nine Perfect Strangers', 'Apples Never Fall', 'The Husband\\'s Secret', 'The Guest List', 'The Paris Apartment', 'Rock Paper Scissors',\n    'The Last Thing He Told Me', 'The Thursday Murder Club', 'The Inmate', 'None of This Is True', 'Mexican Gothic', 'The Only Good Indians',\n    'Beach Read', 'People We Meet on Vacation', 'Book Lovers', 'Happy Place', 'Funny Story', 'Red, White & Royal Blue', 'The Love Hypothesis',\n    'Twisted Love', 'Icebreaker', 'Better Than the Movies', 'The Spanish Love Deception', 'Part of Your World', 'Yours Truly', 'Things We Never Got Over',\n    'The Hunger Games', 'Catching Fire', 'Mockingjay', 'The Ballad of Songbirds and Snakes', 'Sunrise on the Reaping', 'Divergent', 'The Maze Runner',\n    'Harry Potter and the Sorcerer\\'s Stone', 'Harry Potter and the Chamber of Secrets', 'Harry Potter and the Prisoner of Azkaban', 'Harry Potter and the Goblet of Fire',\n    'Harry Potter and the Order of the Phoenix', 'Harry Potter and the Half-Blood Prince', 'Harry Potter and the Deathly Hallows', 'Percy Jackson and the Lightning Thief',\n    'The Lord of the Rings', 'The Fellowship of the Ring', 'The Two Towers', 'The Return of the King', 'The Hobbit', 'The Silmarillion', 'Dune', 'Dune Messiah',\n    'Children of Dune', 'Ender\\'s Game', 'The Hitchhiker\\'s Guide to the Galaxy', 'A Game of Thrones', 'A Clash of Kings', 'A Storm of Swords',\n    'The Name of the Wind', 'Mistborn', 'The Way of Kings', 'The Fifth Season', 'Babel', 'The Poppy War', 'Piranesi', 'Jonathan Strange & Mr Norrell',\n    'The Night Circus', 'The Invisible Life of Addie LaRue', 'A Little Life', 'The Goldfinch', 'The Secret History', 'Normal People', 'Conversations with Friends',\n    'Beautiful World, Where Are You', 'Intermezzo', 'Little Fires Everywhere', 'Everything I Never Told You', 'Our Missing Hearts', 'The Vanishing Half',\n    'The Covenant of Water', 'Cutting for Stone', 'Demon Copperhead', 'The Poisonwood Bible', 'Lonesome Dove', 'The Heaven & Earth Grocery Store',\n    'Remarkably Bright Creatures', 'A Man Called Ove', 'Anxious People', 'Britt-Marie Was Here', 'The Rosie Project', 'Eleanor Oliphant Is Completely Fine',\n    'The House in the Cerulean Sea', 'Under the Whispering Door', 'Legends & Lattes', 'The Ministry of Time', 'The God of the Woods', 'Intermezzo',\n    'All the Light We Cannot See', 'Cloud Cuckoo Land', 'The Book Thief', 'The Kite Runner', 'A Thousand Splendid Suns', 'Life of Pi', 'The Help',\n    'The Book of Lost Friends', 'The Last Letter from Your Lover', 'Me Before You', 'The Notebook', 'Where the Red Fern Grows', 'Charlotte\\'s Web', 'The Giver', 'Matilda', 'Little Women', 'Pride and Prejudice', 'Sense and Sensibility', 'Persuasion', 'Jane Eyre',\n    'Wuthering Heights', 'Rebecca', 'Frankenstein', 'Dracula', 'The Great Gatsby', 'To Kill a Mockingbird', '1984', 'Animal Farm', 'Brave New World',\n    'Fahrenheit 451', 'The Catcher in the Rye', 'Of Mice and Men', 'The Grapes of Wrath', 'East of Eden', 'The Color Purple', 'Moby Dick',\n    'Anna Karenina', 'War and Peace', 'Crime and Punishment', 'The Count of Monte Cristo', 'Les Miserables', 'One Hundred Years of Solitude', 'Lolita',\n    'The Handmaid\\'s Tale', 'The Testaments', 'Station Eleven', 'The Road', 'No Country for Old Men', 'Blood Meridian', 'The Stand', 'The Shining', 'Pet Sematary', 'Fairy Tale', '11/22/63', 'The Institute', 'Outlander', 'Bridgerton', 'Shadow and Bone', 'Six of Crows',\n    'The Cruel Prince', 'Caraval', 'Fifty Shades of Grey', 'The Da Vinci Code', 'Angels & Demons', 'The Girl with the Dragon Tattoo',\n    'Ready Player One', 'Recursion', 'Dark Matter', 'The Three-Body Problem', 'Hyperion', 'Neuromancer', 'Snow Crash', 'The Expanse',\n    'Leviathan Wakes', 'Red Rising', 'Sea of Tranquility', 'The Paper Palace', 'Hello Beautiful', 'Tom Lake', 'The Dutch House', 'Commonwealth',\n    'Bel Canto', 'Olive Kitteridge', 'Lucy by the Sea', 'The Overstory', 'Prophet Song', 'Orbital', 'Yellowface', 'Happy Place', 'Same as Ever'\n  ];\n  var SHOWS = [\n    'Severance', 'The Bear', 'Shogun', 'The Pitt', 'Abbott Elementary', 'Ted Lasso', 'Succession', 'The White Lotus', 'Yellowstone', '1923', '1883',\n    'Landman', 'Tulsa King', 'Mayor of Kingstown', 'Lioness', 'The Last of Us', 'House of the Dragon', 'Game of Thrones', 'The Rings of Power',\n    'Stranger Things', 'Wednesday', 'Bridgerton', 'Queen Charlotte', 'The Crown', 'Outlander', 'Virgin River', 'Sweet Magnolias', 'Ginny & Georgia',\n    'Gilmore Girls', 'The Office', 'Parks and Recreation', 'Brooklyn Nine-Nine', 'Schitt\\'s Creek', 'Seinfeld', 'New Girl', 'Modern Family',\n    'How I Met Your Mother', 'The Big Bang Theory', 'Young Sheldon', 'Grey\\'s Anatomy', 'Station 19', 'Chicago Fire', 'Chicago Med', 'Chicago P.D.',\n    'Law & Order', 'Law & Order: SVU', 'NCIS', 'Criminal Minds', 'Blue Bloods', 'The Rookie', 'This Is Us', 'Only Murders in the Building',\n    'Hacks', 'Shrinking', 'Slow Horses', 'The Morning Show', 'Silo', 'For All Mankind', 'Lessons in Chemistry', 'Bad Sisters', 'Fleabag',\n    'Killing Eve', 'Normal People', 'The Great British Bake Off', 'The Great British Baking Show', 'Love Is Blind', 'The Bachelor', 'The Bachelorette',\n    'Bachelor in Paradise', 'Love Island', 'The Amazing Race', 'Vanderpump Rules', 'The Real Housewives', 'Selling Sunset', 'Queer Eye',\n    'Below Deck', 'Squid Game', 'Money Heist', 'Narcos', 'Ozark', 'Breaking Bad', 'Better Call Saul', 'The Sopranos', 'The Wire', 'Mad Men', 'Six Feet Under', 'The West Wing', 'Downton Abbey', 'Call the Midwife', 'All Creatures Great and Small', 'Sherlock', 'Doctor Who', 'Black Mirror',\n    'The Boys', 'Invincible', 'Reacher', 'Jack Ryan', 'The Night Agent', 'Fallout', 'Arcane', 'The Mandalorian', 'Andor', 'Ahsoka', 'Loki', 'WandaVision',\n    'Daredevil', 'The Umbrella Academy', 'The Witcher', 'Shadow and Bone', 'Emily in Paris', 'Dead to Me', 'Russian Doll', 'The Good Place',\n    'Veep', 'Curb Your Enthusiasm', 'Barry', 'Insecure', 'Euphoria', 'Big Little Lies', 'Mare of Easttown', 'True Detective',\n    'The Handmaid\\'s Tale', 'Yellowjackets', 'Reservation Dogs', 'What We Do in the Shadows', 'Somebody Somewhere', 'The Gilded Age', 'Poldark',\n    'Heartstopper', 'Never Have I Ever', 'Outer Banks', 'The Summer I Turned Pretty', 'XO, Kitty', 'Gossip Girl', 'One Tree Hill', 'Dawson\\'s Creek',\n    'The Vampire Diaries', 'Supernatural', 'Buffy the Vampire Slayer', 'The X-Files', 'Twin Peaks', 'Bluey', 'Cocomelon', 'Paw Patrol', 'SpongeBob',\n    'The Simpsons', 'Bob\\'s Burgers', 'Family Guy', 'South Park', 'Rick and Morty', 'Futurama', 'Avatar: The Last Airbender', 'Adolescence', 'The Studio', 'Dept. Q', 'The Four Seasons', 'Nobody Wants This', 'Baby Reindeer', 'Ripley', 'The Gentlemen', 'The Diplomat',\n    'Mr. & Mrs. Smith', 'Masters of the Air', 'Band of Brothers', 'The Pacific', 'Chernobyl', 'Tiger King', 'Making a Murderer', 'The Jinx'\n  ];\n  var MOVIES = [\n    'Oppenheimer', 'Barbie', 'Dune', 'Dune: Part Two', 'Wicked', 'Wicked: For Good', 'Inside Out', 'Inside Out 2', 'Moana', 'Moana 2', 'Frozen II',\n    'Encanto', 'Toy Story', 'Finding Nemo', 'The Incredibles', 'Ratatouille', 'WALL-E', 'Elemental', 'Turning Red', 'Luca',\n    'Zootopia', 'Tangled', 'The Lion King', 'Beauty and the Beast', 'Aladdin', 'The Little Mermaid', 'Mulan', 'Spirited Away', 'My Neighbor Totoro',\n    'Howl\\'s Moving Castle', 'The Boy and the Heron', 'Everything Everywhere All at Once', 'Past Lives', 'Anora', 'Conclave', 'The Brutalist', 'Emilia Perez',\n    'A Complete Unknown', 'Killers of the Flower Moon', 'Poor Things', 'The Holdovers', 'Maestro', 'American Fiction', 'The Zone of Interest', 'Anatomy of a Fall',\n    'Top Gun: Maverick', 'Top Gun', 'Twisters', 'Twister', 'Deadpool & Wolverine', 'Avengers: Endgame', 'Avengers: Infinity War', 'Black Panther', 'Iron Man',\n    'Spider-Man: No Way Home', 'Spider-Man: Across the Spider-Verse', 'Guardians of the Galaxy', 'The Batman', 'The Dark Knight', 'Superman',\n    'Wonder Woman', 'Star Wars', 'The Empire Strikes Back', 'Return of the Jedi', 'Jurassic Park', 'Jaws', 'E.T.', 'Back to the Future', 'Indiana Jones',\n    'Raiders of the Lost Ark', 'The Godfather', 'The Godfather Part II', 'Goodfellas', 'Pulp Fiction', 'Fight Club', 'Forrest Gump', 'The Shawshank Redemption',\n    'Titanic', 'Avatar', 'Avatar: The Way of Water', 'Inception', 'Interstellar', 'Tenet', 'The Prestige', 'Memento', 'Gladiator', 'Gladiator II',\n    'The Matrix', 'Mad Max: Fury Road', 'Furiosa', 'John Wick', 'Mission: Impossible', 'The Fast and the Furious', 'Knives Out', 'Glass Onion', 'Wake Up Dead Man',\n    'Get Out', 'Hereditary', 'Midsommar', 'A Quiet Place', 'The Conjuring', 'Sinners', 'Nosferatu', 'The Substance', 'Longlegs',\n    'La La Land', 'Whiplash', 'The Greatest Showman', 'Mamma Mia!', 'Bohemian Rhapsody', 'Rocketman', 'A Star Is Born', 'Mean Girls', 'Clueless',\n    '10 Things I Hate About You', 'The Notebook', 'Pretty Woman', 'When Harry Met Sally', 'Sleepless in Seattle', 'You\\'ve Got Mail', 'Notting Hill',\n    'Love Actually', 'The Holiday', 'Home Alone', 'The Polar Express', 'It\\'s a Wonderful Life', 'A Christmas Story', 'National Lampoon\\'s Christmas Vacation',\n    'Hocus Pocus', 'Hocus Pocus 2', 'Practical Magic', 'Beetlejuice', 'Beetlejuice Beetlejuice', 'The Nightmare Before Christmas', 'Coraline', 'Wonka',\n    'Charlie and the Chocolate Factory', 'Paddington', 'Paddington 2', 'Paddington in Peru', 'The Wild Robot', 'Kung Fu Panda 4', 'Despicable Me 4', 'Minions',\n    'Shrek', 'How to Train Your Dragon', 'The Super Mario Bros. Movie', 'A Minecraft Movie', 'Lilo & Stitch', 'The Princess Bride', 'Little Women',\n    'Pride & Prejudice', 'Sense and Sensibility', 'The Devil Wears Prada', 'Legally Blonde', 'Bridesmaids', 'Crazy Rich Asians', 'Hidden Figures',\n    'The Help', 'Green Book', 'Parasite', 'Nomadland', 'CODA', 'Moonlight', 'Spotlight', 'The King\\'s Speech', 'Slumdog Millionaire', 'Lady Bird',\n    'Little Miss Sunshine', 'Napoleon Dynamite', 'Anchorman', 'Step Brothers', 'Superbad', 'The Hangover', 'Tropic Thunder', 'Ferris Bueller\\'s Day Off',\n    'The Breakfast Club', 'Dirty Dancing', 'The Sound of Music', 'The Wizard of Oz', 'Casablanca', 'Gone with the Wind', 'Rear Window',\n    'The Shining', 'The Silence of the Lambs', 'Se7en', 'Zodiac', 'Gone Girl', 'The Social Network', 'Moneyball', 'The Martian', 'Gravity', 'Arrival',\n    'Blade Runner', 'Blade Runner 2049', 'Terminator 2', 'Ford v Ferrari', 'F1', 'Remember the Titans',\n    'The Sandlot', 'Hoosiers', 'Rudy', 'Field of Dreams', 'A League of Their Own', 'The Hunger Games', 'Harry Potter', 'The Lord of the Rings'\n  ];\n  // more (Oct 27, \"Inbox needs to get smarter\"): best sellers, book-club picks and classics, shows and films 2015-2026,\n  // podcasts (the watch list keeps them) and video games (things to wish for)\n  var BOOKS2 = [\n    'James', 'The Anxious Generation', 'The Let Them Theory', 'Funny Story', 'Great Big Beautiful Life', 'Sunrise on the Reaping', 'The Frozen River', 'The Berry Pickers',\n    'All Fours', 'The Correspondent', 'Educated', 'Becoming', 'Caste', '$100M Offers', '$100M Leads', 'Building a StoryBrand', 'Profit First', 'The E-Myth Revisited', 'The Wager',\n    'Happy Place', 'Book Lovers', 'Beach Read', 'People We Meet on Vacation', 'Atmosphere', 'The Housemaid Is Watching', 'The Crash', 'Reckless', 'Lightlark', 'Powerless', 'The Serpent and the Wings of Night',\n    'Quicksilver', 'Alchemised', 'Katabasis', 'Wind and Truth', 'Rhythm of War', 'Oathbringer', 'Words of Radiance', 'The Final Empire', 'Mistborn: The Final Empire', 'Tress of the Emerald Sea', 'Yumi and the Nightmare Painter',\n    'A Fate Inked in Blood', 'House of Sky and Breath', 'House of Flame and Shadow', 'Crown of Midnight', 'Heir of Fire', 'Queen of Shadows', 'Empire of Storms', 'Tower of Dawn', 'Kingdom of Ash',\n    'The Atlas Six', 'Divine Rivals', 'Ruthless Vows', 'The Song of Achilles', 'Elektra', 'Babel', 'Yellowface', 'Fourth Wing', 'The Ballad of Songbirds and Snakes', 'The Hunger Games', 'Catching Fire', 'Mockingjay',\n    'Harry Potter and the Sorcerer\\'s Stone', 'Harry Potter and the Chamber of Secrets', 'Harry Potter and the Prisoner of Azkaban', 'Harry Potter and the Goblet of Fire', 'Harry Potter and the Order of the Phoenix', 'Harry Potter and the Half-Blood Prince', 'Harry Potter and the Deathly Hallows',\n    'Percy Jackson and the Lightning Thief', 'The Lightning Thief', 'Twilight', 'New Moon', 'Eclipse', 'Breaking Dawn', 'Midnight Sun', 'Divergent', 'The Maze Runner', 'The Fault in Our Stars', 'Looking for Alaska', 'Turtles All the Way Down',\n    'Wonder', 'Holes', 'The Hobbit', 'The Fellowship of the Ring', 'The Two Towers', 'The Return of the King', 'The Lion, the Witch and the Wardrobe', 'The Chronicles of Narnia', 'A Wrinkle in Time', 'The Secret Garden', 'Anne of Green Gables',\n    'Jane Eyre', 'Emma', 'Sense and Sensibility', 'Persuasion', 'Great Expectations', 'A Tale of Two Cities', 'Oliver Twist', 'A Christmas Carol', 'The Odyssey', 'The Iliad', 'Don Quixote', 'Ulysses', 'Beloved', 'Song of Solomon', 'Their Eyes Were Watching God',\n    'Invisible Man', 'Slaughterhouse-Five', 'Catch-22', 'The Sun Also Rises', 'The Old Man and the Sea', 'For Whom the Bell Tolls', 'A Farewell to Arms', 'The Bell Jar', 'Lord of the Flies', 'The Outsiders', 'Little House on the Prairie',\n    'Where the Wild Things Are', 'Goodnight Moon', 'The Very Hungry Caterpillar', 'Green Eggs and Ham', 'The Cat in the Hat', 'Diary of a Wimpy Kid', 'Dog Man', 'Magic Tree House', 'Junie B. Jones', 'Captain Underpants', 'The Wild Robot',\n    'The Seven Moons of Maali Almeida', 'The Bee Sting', 'Trust', 'The Overstory', 'Lincoln in the Bardo', 'The Underground Railroad', 'The Nickel Boys', 'Harlem Shuffle', 'Crook Manifesto', 'Hamnet', 'The Mirror and the Light', 'Wolf Hall',\n    'Pachinko', 'Free Food for Millionaires', 'The Midnight Library', 'The Four Winds', 'Lessons in Chemistry', 'The Last Thing He Told Me', 'Mad Honey', 'Small Great Things', 'My Sister\\'s Keeper', 'Nineteen Minutes', 'The Light We Lost',\n    'The Push', 'The Silent Patient', 'The Fury', 'The Maidens', 'The Woman in the Window', 'The Girl on the Train', 'Behind Closed Doors', 'The Couple Next Door', 'The Wife Between Us', 'The Perfect Marriage', 'The Perfect Son',\n    'Never Lie', 'The Coworker', 'The Boyfriend', 'The Teacher', 'Listen for the Lie', 'First Lie Wins', 'The Women in the Castle', 'The Henna Artist', 'The Lost Apothecary', 'The Rose Code', 'The Alice Network', 'The Huntress', 'The Diamond Eye',\n    'The Briar Club', 'The Kitchen Front', 'The Paris Library', 'The Personal Librarian', 'The Book Woman of Troublesome Creek', 'The Giver of Stars', 'The Great Believers', 'The Guest', 'The Hunting Party', 'The Midnight Feast', 'One by One',\n    'The Measure', 'Daisy Darker', 'Nine Liars', 'None of This Is True', 'The Inmate', 'The Housemaid\\'s Secret', 'Mrs. Everything', 'In Five Years', 'The Invisible Life of Addie LaRue', 'The Pairing', 'Red, White & Royal Blue', 'One Last Stop',\n    'Twisted Love', 'Twisted Games', 'Things We Never Got Over', 'Things We Hide from the Light', 'Things We Left Behind', 'Spread Me', 'Icebreaker', 'King of Wrath', 'Haunting Adeline', 'Den of Vipers', 'Credence', 'Archer\\'s Voice',\n    'The Love Hypothesis', 'Love, Theoretically', 'Check & Mate', 'Not in Love', 'Deep End', 'Part of Your World', 'Yours Truly', 'Just for the Summer', 'The Spanish Love Deception', 'The Unhoneymooners', 'Seven Days in June',\n    'Better Than the Movies', 'Love & Other Words', 'Every Summer After', 'Happily Ever Afters', 'Count My Lies', 'Bride', 'Swan Song', 'The Tenant', 'Bury Our Bones in the Midnight Soil', 'Heart the Lover', 'Wild Dark Shore',\n    'Remarkably Bright Creatures', 'Lessons in Chemistry', 'Horse', 'The Women', 'The Nightingale', 'Firefly Lane', 'The Great Alone', 'Under the Tuscan Sun', 'Eat, Pray, Love', 'Wild', 'Tiny Beautiful Things', 'Untamed',\n    'Atlas of the Heart', 'Dare to Lead', 'Rising Strong', 'Braving the Wilderness', 'The Courage to Be Disliked', 'Good to Great', 'Start with Why', 'Leaders Eat Last', 'Grit', 'Mindset', 'Drive', 'Quiet', 'Range', 'Outlive', 'Why We Sleep',\n    'The 4-Hour Workweek', 'Tools of Titans', 'The Obstacle Is the Way', 'Ego Is the Enemy', 'Meditations', 'The Art of War', 'The Prince', 'The 48 Laws of Power', 'The Laws of Human Nature', 'Never Split the Difference',\n    'Influence', 'Pre-Suasion', 'Made to Stick', 'Switch', 'Decisive', 'Blink', 'David and Goliath', 'The Lean Startup', 'Zero to One', 'The Hard Thing About Hard Things', 'Shoe Dog', 'Built to Last', 'Traction', 'Rework',\n    'Company of One', 'The Millionaire Next Door', 'The Simple Path to Wealth', 'Your Money or Your Life', 'Broke Millennial', 'The Richest Man in Babylon', 'Think and Grow Rich', 'The Compound Effect', 'Eat That Frog', 'The ONE Thing',\n    'Four Thousand Weeks', 'Slow Productivity', 'Digital Minimalism', 'So Good They Can\\'t Ignore You', 'Show Your Work', 'Steal Like an Artist', 'The War of Art', 'Big Magic', 'The Artist\\'s Way', 'Bird by Bird', 'On Writing',\n    'The Purpose Driven Life', 'Jesus Calling', 'Mere Christianity', 'The Screwtape Letters', 'Crazy Love', 'The Ruthless Elimination of Hurry', 'Boundaries', 'Set Boundaries, Find Peace', 'Attached', 'The Five Love Languages', 'The 5 Love Languages',\n    'Hold Me Tight', 'Mating in Captivity', 'Come as You Are', 'Burnout', 'Adult Children of Emotionally Immature Parents', 'The Mountain Is You', 'How to Do the Work', 'Maybe You Should Talk to Someone', 'Lost Connections',\n    'Hidden Potential', 'Think Again', 'Give and Take', 'Originals', 'Option B', 'Lean In', 'Bossypants', 'Yes Please', 'Is Everyone Hanging Out Without Me', 'Why Not Me', 'Born a Crime', 'Spare', 'Friends, Lovers, and the Big Terrible Thing',\n    'I\\'m Glad My Mom Died', 'The Woman in Me', 'A Promised Land', 'Becoming', 'Educated', 'The Year of Magical Thinking', 'When Breath Becomes Air', 'Tuesdays with Morrie', 'The Last Lecture', 'Night', 'The Diary of a Young Girl', 'Maus',\n    'Into the Wild', 'Into Thin Air', 'The Wager', 'Killers of the Flower Moon', 'The Devil in the White City', 'In Cold Blood', 'Say Nothing', 'Bad Blood', 'Empire of Pain', 'The Splendid and the Vile', 'Endurance', 'Unbroken', 'Seabiscuit',\n    'The Immortal Life of Henrietta Lacks', 'The Emperor of All Maladies', 'The Gene', 'Sapiens', 'Guns, Germs, and Steel', 'A Short History of Nearly Everything', 'The Sixth Extinction', 'An Immense World', 'Entangled Life', 'Braiding Sweetgrass',\n    'Kitchen Confidential', 'Salt, Fat, Acid, Heat', 'Medium Raw', 'The Joy of Cooking', 'Half Baked Harvest', 'Magnolia Table', 'Dinner in One', 'Ottolenghi Simple', 'Jerusalem', 'Plenty',\n    'Gone Girl', 'Dark Places', 'Sharp Objects', 'Big Little Lies', 'Rebecca', 'And Then There Were None', 'Murder on the Orient Express', 'Death on the Nile', 'The Murder of Roger Ackroyd', 'The Hound of the Baskervilles', 'The Talented Mr. Ripley',\n    'It', 'Carrie', 'Misery', 'Salem\\'s Lot', 'The Green Mile', 'Holly', 'Billy Summers', 'Later', 'Never Flinch', 'The Outsider', 'Mr. Mercedes', 'Under the Dome', 'Duma Key', 'Doctor Sleep', 'The Dark Tower',\n    'Jurassic Park', 'The Andromeda Strain', 'Sphere', 'The Firm', 'The Pelican Brief', 'A Time to Kill', 'The Client', 'Camino Island', 'The Boys from Biloxi', 'The Exchange', 'The Widow',\n    'The Bourne Identity', 'The Hunt for Red October', 'Lonesome Dove', 'The Pillars of the Earth', 'Shogun', 'Outlander', 'Dragonfly in Amber', 'Voyager', 'The Clan of the Cave Bear', 'Gone with the Wind',\n    'Dune Messiah', 'Foundation', 'I, Robot', 'Do Androids Dream of Electric Sheep', 'The Left Hand of Darkness', 'A Wizard of Earthsea', 'Kindred', 'Parable of the Sower', 'The Long Way to a Small, Angry Planet', 'All Systems Red', 'Murderbot',\n    'Children of Time', 'The Martian', 'Artemis', 'Project Hail Mary', 'Klara and the Sun', 'Cloud Atlas', 'The Time Traveler\\'s Wife', 'The Lovely Bones', 'The Five People You Meet in Heaven', 'The Shack', 'The Secret Life of Bees',\n    'Water for Elephants', 'The Help', 'Big Fish', 'The Notebook', 'A Walk to Remember', 'Dear John', 'The Lucky One', 'Safe Haven', 'The Longest Ride', 'Message in a Bottle', 'Counting Miracles',\n    'The Seven Sisters', 'The Thirteenth Tale', 'The Shadow of the Wind', 'The Name of the Rose', 'Rebecca', 'The Little Prince', 'Siddhartha', 'Steppenwolf', 'Norwegian Wood', 'Kafka on the Shore', '1Q84', 'The Wind-Up Bird Chronicle',\n    'Before the Coffee Gets Cold', 'Tomorrow, and Tomorrow, and Tomorrow', 'The Storied Life of A. J. Fikry', 'Where\\'d You Go, Bernadette', 'The Rosie Project', 'Lessons in Chemistry', 'Weyward', 'The Familiar', 'Practical Magic', 'The Rules of Magic',\n    'Hello Beautiful', 'The Most Fun We Ever Had', 'Fates and Furies', 'The Interestings', 'The Nix', 'The Great Gatsby', 'Of Mice and Men', 'The Things They Carried', 'A Separate Peace', 'The Remains of the Day',\n    'Atonement', 'Never Let Me Go', 'The Kite Runner', 'The Alchemist', 'Life of Pi', 'The Road', 'The Goldfinch', 'A Gentleman in Moscow', 'Rules of Civility', 'The Lincoln Highway', 'Table for Two', 'The Paris Wife',\n    'Circe', 'Mythos', 'Lore Olympus', 'The Secret History', 'If We Were Villains', 'Ninth House', 'Hell Bent', 'Six of Crows', 'Crooked Kingdom', 'Shadow and Bone', 'The Cruel Prince', 'Red Queen', 'An Ember in the Ashes',\n    'Legendborn', 'Children of Blood and Bone', 'The Priory of the Orange Tree', 'Uprooted', 'Spinning Silver', 'The Bear and the Nightingale', 'The Starless Sea', 'Mexican Gothic', 'Silver Nitrate', 'The Death of Jane Lawrence',\n    'Hidden Pictures', 'Horror Movie', 'How to Sell a Haunted House', 'The Southern Book Club\\'s Guide to Slaying Vampires', 'The Haunting of Hill House', 'We Have Always Lived in the Castle', 'House of Leaves', 'Bunny', 'Fever Dream',\n    'Wish You Were Here', 'Forever, Interrupted', 'Evidence of the Affair', 'Malibu Rising', 'After I Do', 'One True Loves', 'Maybe in Another Life', 'The Paper Palace', 'This Tender Land', 'Ordinary Grace',\n    'The Great Gatsby', 'Just Kids', 'Crying in H Mart', 'Heavy', 'The Glass Castle', 'Hillbilly Elegy', 'Educated', 'Know My Name', 'Wild Game', 'I Know Why the Caged Bird Sings', 'Between the World and Me', 'The Fire Next Time',\n    'How to Win Friends and Influence People', 'Who Moved My Cheese', 'The Go-Giver', 'Atomic Habits', 'Tiny Habits', 'The Power of Habit', 'Essentialism', 'Deep Work', 'Hyperfocus', 'Indistractable', 'Stolen Focus', 'Dopamine Nation',\n    'The Body Keeps the Score', 'What Happened to You', 'The Myth of Normal', 'Grain Brain', 'Fiber Fueled', 'How Not to Die', 'The Obesity Code', 'Glucose Revolution', 'Good Energy', 'Untamed', 'Love Warrior'\n  ];\n  var SHOWS2 = [\n    'The Studio', 'Adolescence', 'Nobody Wants This', 'Baby Reindeer', 'Shōgun', 'The Penguin', 'Outer Banks', 'The Summer I Turned Pretty', 'Yellowjackets', 'Severance', 'Andor', 'The Diplomat', 'Black Doves', 'The Day of the Jackal',\n    'Slow Horses', 'Bad Monkey', 'Disclaimer', 'Presumed Innocent', 'Ripley', 'Sugar', 'Mr. & Mrs. Smith', 'Fargo', 'True Detective', 'Mare of Easttown', 'The Undoing', 'Big Little Lies', 'Sharp Objects', 'Euphoria', 'The Idol',\n    'Paradise', 'The Four Seasons', 'Running Point', 'Dept. Q', 'Sirens', 'The Residence', 'Pulse', 'Zero Day', 'The Night Agent', 'Reacher', 'Tracker', 'High Potential', 'Matlock', 'Elsbeth', 'Will Trent', 'Fire Country', 'Brilliant Minds',\n    'St. Denis Medical', 'Poppa\\'s House', 'Ghosts', 'Abbott Elementary', 'Only Murders in the Building', 'The Golden Bachelor', 'The Golden Bachelorette', 'Survivor', 'Big Brother', 'The Voice', 'American Idol', 'Dancing with the Stars',\n    'Shark Tank', 'The Traitors', 'Squid Game: The Challenge', 'Physical: 100', 'Love on the Spectrum', 'Too Hot to Handle', 'Perfect Match', 'Married at First Sight', '90 Day Fiancé', 'Sister Wives', 'The Kardashians', 'Keeping Up with the Kardashians',\n    'The Secret Lives of Mormon Wives', 'Summer House', 'Southern Charm', 'Below Deck Mediterranean', 'Real Housewives of Beverly Hills', 'Real Housewives of New Jersey', 'Real Housewives of Salt Lake City', 'Dance Moms', 'Vanderpump Villa',\n    'Selling the OC', 'Love Is Blind', 'Ultimatum', 'The Ultimatum', 'Queer Eye', 'Nailed It', 'Is It Cake', 'Chopped', 'Beat Bobby Flay', 'Diners, Drive-Ins and Dives', 'Hell\\'s Kitchen', 'MasterChef', 'Kitchen Nightmares', 'Top Chef',\n    'Fixer Upper', 'Property Brothers', 'Love It or List It', 'House Hunters', 'Home Town', 'Bargain Block', 'Flip or Flop', 'Good Bones', 'Rehab Addict', 'Escape to the Chateau', 'Grand Designs', 'Tiny House Nation', 'Selling Sunset',\n    'Planet Earth', 'Planet Earth II', 'Planet Earth III', 'Our Planet', 'Blue Planet', 'Free Solo', 'Cosmos', 'Making a Murderer', 'Tiger King', 'The Jinx', 'Wild Wild Country', 'Don\\'t F**k with Cats', 'American Murder', 'The Staircase',\n    'Dirty John', 'Dateline', '20/20', '48 Hours', 'Forensic Files', 'Unsolved Mysteries', 'Evil Lives Here', 'Cold Case Files', 'Quiet on Set', 'Drive to Survive', 'Formula 1: Drive to Survive', 'Quarterback', 'Hard Knocks', 'Full Swing',\n    'Welcome to Wrexham', 'The Last Dance', 'Cheer', 'Last Chance U', 'Beckham', 'Stranger Things', 'Wednesday', 'Bridgerton', 'Outlander', 'Virgin River', 'Sweet Magnolias', 'Firefly Lane', 'Ginny & Georgia', 'Never Have I Ever',\n    'Sex Education', 'Heartstopper', 'Young Royals', 'Elite', 'Lupin', 'Dark', 'The OA', 'Mindhunter', 'Ozark', 'Maid', 'Unorthodox', 'The Queen\\'s Gambit', 'Beef', 'The Diplomat', 'The Gentlemen', 'Kaos', 'Monsters', 'Dahmer',\n    'The Haunting of Hill House', 'The Haunting of Bly Manor', 'Midnight Mass', 'The Fall of the House of Usher', 'You', 'Manifest', 'Lucifer', 'The Witcher', 'Cobra Kai', 'Avatar: The Last Airbender', 'One Piece', 'Arcane', 'Castlevania',\n    'BoJack Horseman', 'Big Mouth', 'Bluey', 'Paw Patrol', 'Peppa Pig', 'Cocomelon', 'Daniel Tiger\\'s Neighborhood', 'Sesame Street', 'Gabby\\'s Dollhouse', 'Ms. Rachel', 'Miraculous', 'SpongeBob SquarePants', 'The Simpsons', 'Family Guy',\n    'South Park', 'Bob\\'s Burgers', 'King of the Hill', 'Futurama', 'Rick and Morty', 'Archer', 'Abbott Elementary', 'The Office', 'Parks and Recreation', 'Superstore', 'Community', 'Arrested Development', 'Veep', 'Curb Your Enthusiasm',\n    'It\\'s Always Sunny in Philadelphia', 'What We Do in the Shadows', 'Reservation Dogs', 'Atlanta', 'Insecure', 'Barry', 'Silicon Valley', 'Girls', 'Sex and the City', 'And Just Like That', 'Friends', 'Frasier', 'Cheers', 'Golden Girls',\n    'The Golden Girls', 'Everybody Loves Raymond', 'Home Improvement', 'Full House', 'Fuller House', 'Boy Meets World', 'Saved by the Bell', 'The Fresh Prince of Bel-Air', 'Malcolm in the Middle', 'That \\'70s Show', 'Scrubs', 'ER',\n    'House', 'House M.D.', 'Grey\\'s Anatomy', 'Private Practice', 'The Good Doctor', 'New Amsterdam', 'The Resident', 'Nurse Jackie', 'Chicago Fire', 'Suits', 'The Good Wife', 'The Good Fight', 'Boston Legal', 'Lincoln Lawyer', 'The Lincoln Lawyer',\n    'Bosch', 'Bosch: Legacy', 'Justified', 'Sons of Anarchy', 'The Walking Dead', 'Fear the Walking Dead', 'Dexter', 'Dexter: Original Sin', 'Homeland', '24', 'Prison Break', 'Lost', 'Heroes', 'Alias', 'Fringe', 'The X-Files', 'Twin Peaks',\n    'Buffy the Vampire Slayer', 'Charmed', 'Supernatural', 'The Vampire Diaries', 'Gossip Girl', 'Pretty Little Liars', 'One Tree Hill', 'The O.C.', 'Dawson\\'s Creek', 'Gilmore Girls', 'Friday Night Lights', 'Parenthood', 'Brothers & Sisters',\n    'This Is Us', 'A Million Little Things', 'Nashville', 'Hart of Dixie', 'Jane the Virgin', 'Crazy Ex-Girlfriend', 'The Marvelous Mrs. Maisel', 'Mrs. Maisel', 'Fleabag', 'Killing Eve', 'Broadchurch', 'Luther', 'Sherlock', 'Doctor Who',\n    'Peaky Blinders', 'The Crown', 'Downton Abbey', 'The Gilded Age', 'Call the Midwife', 'All Creatures Great and Small', 'Poldark', 'Victoria', 'The Great', 'The Tudors', 'Vikings', 'The Last Kingdom', 'Rome', 'Band of Brothers',\n    'The Pacific', 'Masters of the Air', 'Chernobyl', 'Generation Kill', 'John Adams', 'The Leftovers', 'Westworld', 'Watchmen', 'Station Eleven', 'Severance', 'Silo', 'Foundation', 'For All Mankind', 'Invasion', 'Pachinko', 'Hijack',\n    'Bad Sisters', 'Shrinking', 'Loot', 'Mythic Quest', 'Dickinson', 'Servant', 'Black Bird', 'The Last Thing He Told Me', 'Lessons in Chemistry', 'Palm Royale', 'Platonic', 'Slow Horses', 'Tehran', 'Defending Jacob', 'The Afterparty',\n    'The Boys', 'Gen V', 'The Rings of Power', 'Jack Ryan', 'The Terminal List', 'Fallout', 'Invincible', 'Good Omens', 'The Marvelous Mrs Maisel', 'Mr. & Mrs. Smith', 'Daisy Jones & the Six', 'Daisy Jones and the Six', 'The Summer I Turned Pretty',\n    'Citadel', 'Hazbin Hotel', 'The Wheel of Time', 'Outer Range', 'Upload', 'Fleabag', 'Hacks', 'The Last of Us', 'House of the Dragon', 'The Penguin', 'Dune: Prophecy', 'Peacemaker', 'Task', 'The Chair Company', 'Industry',\n    'Somebody Somewhere', 'The Righteous Gemstones', 'Barry', 'Succession', 'Euphoria', 'The White Lotus', 'Big Little Lies', 'Watchmen', 'Lovecraft Country', 'The Flight Attendant', 'Hacks', 'Sex Lives of College Girls', 'Mare of Easttown',\n    'Poker Face', 'Twisted Metal', 'Yellowstone', '1923', '1883', 'Landman', 'Lioness', 'Tulsa King', 'Mayor of Kingstown', 'Dexter: Resurrection', 'Star Trek: Strange New Worlds', 'Star Trek: Picard', 'Tracker', 'Ghosts', 'Young Sheldon',\n    'Georgie & Mandy\\'s First Marriage', 'NCIS', 'NCIS: Origins', 'FBI', 'S.W.A.T.', 'The Equalizer', 'Blue Bloods', 'Boston Blue', 'Survivor', 'The Amazing Race', 'Ted Lasso', 'The Bear', 'Shōgun', 'Severance',\n    'Ozark', 'Squid Game', 'Wednesday', 'Emily in Paris', 'Nobody Wants This', 'The Night Agent', 'Ginny & Georgia', 'Kaos', 'Black Mirror', 'Love, Death & Robots', 'Altered Carbon', 'Sense8', 'The Crown',\n    'Taskmaster', 'The Great Pottery Throw Down', 'Hot Ones', 'Saturday Night Live', 'SNL', 'Jeopardy', 'Wheel of Fortune', 'The Tonight Show', 'Last Week Tonight', 'Hell\\'s Kitchen', 'The Masked Singer', 'Lego Masters', 'Blown Away', 'Forged in Fire', 'Alone', 'Naked and Afraid', 'Deadliest Catch', 'Gold Rush', 'Pawn Stars', 'American Pickers', 'Antiques Roadshow', 'Ghost Adventures', 'Mythbusters', 'How It\\'s Made', 'Dirty Jobs', 'Bluey Minisodes', 'Only Murders', 'OMITB', 'Grey\\'s', 'SVU', 'The Great British Baking Show', 'GBBO', 'The Real World', 'Jersey Shore', 'Jersey Shore: Family Vacation', 'The Hills', 'Laguna Beach', 'The Simple Life'\n  ];\n  var MOVIES2 = [\n    'Wicked', 'Wicked: For Good', 'Sinners', 'Weapons', 'Superman', 'Thunderbolts*', 'F1', 'The Gorge', 'KPop Demon Hunters', 'Happy Gilmore 2', 'Wake Up Dead Man', 'Mission: Impossible – The Final Reckoning', 'Mission Impossible',\n    'Anora', 'Conclave', 'The Brutalist', 'A Complete Unknown', 'The Substance', 'Dune: Part Two', 'Dune Part Two', 'Inside Out 2', 'Inside Out', 'Deadpool & Wolverine', 'Twisters', 'Wicked Part One', 'Gladiator II', 'Moana 2', 'Moana',\n    'Mufasa', 'The Wild Robot', 'Beetlejuice Beetlejuice', 'Beetlejuice', 'It Ends with Us', 'Furiosa', 'Civil War', 'Challengers', 'Longlegs', 'Smile 2', 'Nosferatu', 'A Real Pain', 'Emilia Pérez', 'Nickel Boys', 'September 5',\n    'Mickey 17', 'Snow White', 'Lilo & Stitch', 'How to Train Your Dragon', 'Jurassic World Rebirth', 'Jurassic World', 'Jurassic Park', 'The Fantastic Four: First Steps', 'Fantastic Four', 'Freakier Friday', 'Freaky Friday', 'The Naked Gun',\n    'Final Destination Bloodlines', '28 Years Later', '28 Days Later', 'Materialists', 'Eddington', 'One Battle After Another', 'The Long Walk', 'Frankenstein', 'Hamnet', 'Marty Supreme', 'Avatar: Fire and Ash', 'Avatar', 'Avatar: The Way of Water',\n    'Zootopia 2', 'Zootopia', 'Elio', 'Bugonia', 'Jay Kelly', 'Springsteen: Deliver Me from Nowhere', 'The Running Man', 'Tron: Ares', 'Predator: Badlands', 'Now You See Me', 'Five Nights at Freddy\\'s', 'The Conjuring: Last Rites', 'The Conjuring',\n    'Oppenheimer', 'Barbie', 'Killers of the Flower Moon', 'Past Lives', 'The Holdovers', 'Poor Things', 'Saltburn', 'Maestro', 'American Fiction', 'Anatomy of a Fall', 'The Zone of Interest', 'May December', 'Priscilla', 'Wonka',\n    'The Boys in the Boat', 'The Color Purple', 'Air', 'Elemental', 'Spider-Man: Across the Spider-Verse', 'Across the Spider-Verse', 'Spider-Man: Into the Spider-Verse', 'Spider-Man: No Way Home', 'The Super Mario Bros. Movie',\n    'Guardians of the Galaxy Vol. 3', 'Guardians of the Galaxy', 'John Wick', 'John Wick: Chapter 4', 'Asteroid City', 'Talk to Me', 'Scream VI', 'Scream', 'Evil Dead Rise', 'M3GAN', 'Cocaine Bear', 'Barbarian', 'Nope', 'Get Out', 'Us', 'Smile',\n    'Top Gun: Maverick', 'Top Gun', 'Everything Everywhere All at Once', 'The Banshees of Inisherin', 'Tár', 'Elvis', 'The Fabelmans', 'Glass Onion', 'Knives Out', 'The Menu', 'Women Talking', 'Avatar 2', 'Black Panther', 'Black Panther: Wakanda Forever',\n    'The Batman', 'Turning Red', 'Encanto', 'Luca', 'Soul', 'Coco', 'Onward', 'Toy Story', 'Toy Story 4', 'Toy Story 5', 'Frozen', 'Frozen II', 'Frozen 2', 'Tangled', 'Ratatouille', 'Up', 'WALL-E', 'Finding Nemo', 'Finding Dory', 'Monsters, Inc.',\n    'The Incredibles', 'Incredibles 2', 'Cars', 'Shrek', 'Kung Fu Panda', 'Kung Fu Panda 4', 'Despicable Me', 'Despicable Me 4', 'Minions', 'Sing', 'Sing 2', 'The Secret Life of Pets', 'Puss in Boots: The Last Wish', 'The Bad Guys', 'Migration',\n    'Trolls', 'The Lion King', 'Aladdin', 'Beauty and the Beast', 'The Little Mermaid', 'Mulan', 'Cinderella', 'Lady and the Tramp', '101 Dalmatians', 'Cruella', 'Maleficent', 'Mary Poppins', 'Mary Poppins Returns', 'Hocus Pocus', 'Hocus Pocus 2',\n    'Halloweentown', 'The Nightmare Before Christmas', 'Coraline', 'Corpse Bride', 'Edward Scissorhands', 'Casper', 'Ghostbusters', 'Ghostbusters: Frozen Empire', 'Practical Magic', 'The Addams Family', 'Addams Family Values',\n    'Elf', 'Home Alone', 'Home Alone 2', 'It\\'s a Wonderful Life', 'The Grinch', 'How the Grinch Stole Christmas', 'The Polar Express', 'Love Actually', 'The Holiday', 'Christmas Vacation', 'National Lampoon\\'s Christmas Vacation',\n    'A Christmas Story', 'Miracle on 34th Street', 'The Santa Clause', 'Klaus', 'Red One', 'Die Hard', 'Four Christmases', 'Last Christmas', 'Jingle All the Way', 'White Christmas', 'Arthur Christmas', 'The Muppet Christmas Carol', 'Fred Claus',\n    'Spirited', 'Noelle', 'Christmas with the Kranks', 'The Family Stone', 'Happiest Season', 'A Castle for Christmas', 'The Princess Switch', 'Falling for Christmas', 'Single All the Way', 'The Christmas Chronicles',\n    'Titanic', 'The Notebook', 'Pretty Woman', 'Sleepless in Seattle', 'You\\'ve Got Mail', 'When Harry Met Sally', 'Notting Hill', 'Bridget Jones\\'s Diary', 'Bridget Jones: Mad About the Boy', '10 Things I Hate About You', 'She\\'s All That',\n    'Clueless', 'Mean Girls', 'Legally Blonde', 'The Devil Wears Prada', 'The Devil Wears Prada 2', 'Crazy Rich Asians', 'To All the Boys I\\'ve Loved Before', 'Anyone but You', 'The Proposal', 'How to Lose a Guy in 10 Days', 'Crazy, Stupid, Love',\n    '27 Dresses', 'Sweet Home Alabama', 'Princess Diaries', 'The Princess Diaries', 'Enchanted', 'Mamma Mia', 'Mamma Mia! Here We Go Again', 'La La Land', 'The Greatest Showman', 'A Star Is Born', 'Bohemian Rhapsody', 'Rocketman',\n    'Pitch Perfect', 'Grease', 'Footloose', 'Hairspray', 'Chicago', 'Moulin Rouge', 'Les Misérables', 'West Side Story', 'In the Heights', 'Tick, Tick... Boom!', 'Hamilton', 'Dear Evan Hansen', 'The Phantom of the Opera', 'Cats',\n    'The Godfather', 'The Godfather Part II', 'Goodfellas', 'The Departed', 'Casino', 'Scarface', 'Pulp Fiction', 'Reservoir Dogs', 'Kill Bill', 'Inglourious Basterds', 'Django Unchained', 'Once Upon a Time in Hollywood', 'The Hateful Eight',\n    'Fight Club', 'The Matrix', 'Inception', 'Interstellar', 'The Dark Knight', 'Batman Begins', 'The Dark Knight Rises', 'Memento', 'The Prestige', 'Dunkirk', 'Tenet', 'Shutter Island', 'The Wolf of Wall Street', 'Catch Me If You Can',\n    'Forrest Gump', 'Cast Away', 'Saving Private Ryan', 'Schindler\\'s List', 'The Green Mile', 'The Shawshank Redemption', 'Good Will Hunting', 'Dead Poets Society', 'Jerry Maguire', 'A Few Good Men', 'Top Gun', 'Rain Man', 'Big',\n    'Back to the Future', 'E.T.', 'Jaws', 'Raiders of the Lost Ark', 'Indiana Jones', 'Star Wars', 'The Empire Strikes Back', 'Return of the Jedi', 'Rogue One', 'The Force Awakens', 'Gremlins', 'The Goonies', 'Stand by Me', 'Ghost',\n    'The Princess Bride', 'Hook', 'Jumanji', 'Jumanji: Welcome to the Jungle', 'Mrs. Doubtfire', 'The Parent Trap', 'Matilda', 'Honey, I Shrunk the Kids', 'The Mighty Ducks', 'Sandlot', 'Space Jam', 'Remember the Titans', 'The Blind Side',\n    'Friday Night Lights', 'Miracle', 'Rocky', 'Creed', 'Rudy', 'Moneyball', 'Field of Dreams', 'Bull Durham', 'Caddyshack', 'Happy Gilmore', 'Billy Madison', 'The Waterboy', 'Grown Ups', 'Click', 'Elf', 'Old School', 'Wedding Crashers',\n    'Bridesmaids', 'The Hangover', 'Superbad', 'Step Brothers', 'Talladega Nights', 'Anchorman', 'Zoolander', 'Dodgeball', 'Office Space', 'Napoleon Dynamite', 'Tommy Boy', 'Dumb and Dumber', 'Ace Ventura', 'The Mask', 'Liar Liar',\n    'Avengers: Endgame', 'Avengers: Infinity War', 'The Avengers', 'Iron Man', 'Captain America: Brave New World', 'Thor: Ragnarok', 'Doctor Strange', 'Black Widow', 'Captain Marvel', 'The Marvels', 'Ant-Man', 'Eternals', 'Shang-Chi',\n    'Wonder Woman', 'Aquaman', 'Joker', 'Joker: Folie à Deux', 'The Suicide Squad', 'Man of Steel', 'Logan', 'X-Men', 'Deadpool', 'Venom', 'Spider-Man', 'Morbius', 'Madame Web', 'Kraven the Hunter', 'Blue Beetle', 'The Flash',\n    'Harry Potter and the Sorcerer\\'s Stone', 'Fantastic Beasts', 'The Lord of the Rings: The Fellowship of the Ring', 'The Hobbit: An Unexpected Journey', 'The Hunger Games: Catching Fire', 'The Ballad of Songbirds & Snakes', 'Twilight',\n    'The Fault in Our Stars', 'Divergent', 'The Maze Runner', 'Ready Player One', 'The Martian', 'Gravity', 'Arrival', 'Interstellar', 'Edge of Tomorrow', 'Prey', 'Alien', 'Aliens', 'Alien: Romulus', 'Predator', 'Terminator', 'RoboCop',\n    'A Quiet Place', 'A Quiet Place Part II', 'A Quiet Place: Day One', 'Hereditary', 'Midsommar', 'The Witch', 'It Follows', 'The Babadook', 'The Exorcist', 'The Ring', 'The Grudge', 'Saw', 'Insidious', 'Sinister', 'The Others',\n    'The Sixth Sense', 'Signs', 'Split', 'Glass', 'Knock at the Cabin', 'Trap', 'Old', 'The Village', 'Psycho', 'Vertigo', 'North by Northwest', 'Rear Window', 'The Birds', 'Citizen Kane', 'Casablanca', 'Singin\\' in the Rain',\n    'Roman Holiday', 'Breakfast at Tiffany\\'s', 'Some Like It Hot', 'Sunset Boulevard', 'The Wizard of Oz', 'Gone with the Wind', 'Lawrence of Arabia', 'Ben-Hur', '2001: A Space Odyssey', 'A Clockwork Orange', 'Taxi Driver', 'Raging Bull',\n    'Apocalypse Now', 'Platoon', 'Full Metal Jacket', 'Heat', 'The Fugitive', 'Speed', 'Die Hard', 'Lethal Weapon', 'Point Break', 'Twister', 'Armageddon', 'Independence Day', 'Men in Black', 'Bad Boys', 'Bad Boys: Ride or Die',\n    'Fast & Furious', 'Fast X', 'The Fast and the Furious', 'Mad Max: Fury Road', 'Gladiator', 'Braveheart', 'Troy', '300', 'The Last of the Mohicans', 'Dances with Wolves', 'Unforgiven', 'Tombstone', 'True Grit', 'No Country for Old Men',\n    'There Will Be Blood', 'Fargo', 'The Big Lebowski', 'O Brother, Where Art Thou?', 'Little Miss Sunshine', 'Juno', 'Lady Bird', 'Little Women', 'Booksmart', 'Eighth Grade', 'The Edge of Seventeen', 'The Perks of Being a Wallflower',\n    'Call Me by Your Name', 'Brokeback Mountain', 'Moonlight', 'Portrait of a Lady on Fire', 'Parasite', 'Roma', 'The Shape of Water', 'Birdman', 'Whiplash', 'Spotlight', '12 Years a Slave', 'Argo', 'The Artist', 'The King\\'s Speech',\n    'Slumdog Millionaire', 'Green Book', 'CODA', 'Nomadland', 'Everything Everywhere', 'The Power of the Dog', 'Belfast', 'Licorice Pizza', 'Drive My Car', 'Triangle of Sadness', 'Aftersun', 'The Whale', 'Banshees of Inisherin',\n    'Ford v Ferrari', 'Rush', 'Le Mans \\'66', 'Days of Thunder', 'Hidden Figures', 'The Social Network', 'Steve Jobs', 'The Big Short', 'Margin Call', 'The Founder', 'Tetris', 'BlackBerry', 'Air', 'Flamin\\' Hot', 'Moneyball',\n    'Free Guy', 'Red Notice', 'The Adam Project', 'The Gray Man', 'Extraction', 'Glass Onion: A Knives Out Mystery', 'Enola Holmes', 'Don\\'t Look Up', 'Leave the World Behind', 'Rebel Moon', 'Damsel', 'Hit Man', 'The Six Triple Eight',\n    'Carry-On', 'Back in Action', 'Happy Gilmore 2', 'The Life List', 'A Merry Little Ex-Mas', 'The Old Guard', 'The Irishman', 'Marriage Story', 'Roma', 'Okja', 'Bird Box', 'Murder Mystery', 'Murder Mystery 2', 'The Mother',\n    'Nimona', 'Wish', 'Strange World', 'Raya and the Last Dragon', 'Lightyear', 'Elemental', 'Inside Out 2', 'Moana 2', 'Dog Man', 'The Bad Guys 2', 'Paddington', 'Paddington 2', 'Paddington in Peru', 'Wallace & Gromit',\n    'Sonic the Hedgehog', 'Sonic the Hedgehog 3', 'A Minecraft Movie', 'The Super Mario Galaxy Movie', 'Garfield', 'The Garfield Movie', 'Kung Fu Panda', 'IF', 'Wonka', 'Willy Wonka & the Chocolate Factory', 'Charlie and the Chocolate Factory',\n    'The Sound of Music', 'Annie', 'Matilda the Musical', 'Mean Girls (2024)', 'Hairspray', 'Rent', 'Chicago', 'Into the Woods', 'Enchanted', 'Disenchanted', 'Encanto', 'Coco'\n  ];\n  var SHOWS3 = ['The Night Manager', 'Dept. Q', 'Mare of Easttown', 'The Gilded Age', 'Big Little Lies', 'The Morning Show', 'Bad Sisters', 'Slow Horses', 'The Day of the Jackal', 'The Agency', 'Landman', 'The Four Seasons', 'Mobland', 'MobLand', 'Long Bright River', 'Untamed', 'The Better Sister', 'Sirens', 'The Last Frontier', 'Murderbot', 'Alien: Earth', 'Wednesday', 'The Chosen', 'The Gentlemen', 'House of Guinness', 'Black Rabbit', 'The Paper', 'Nobody Wants This', 'Pluribus', 'IT: Welcome to Derry', 'Welcome to Derry', 'The Beast in Me', 'All Her Fault', 'The Diplomat', 'The Last Thing He Told Me', 'Platonic', 'Overcompensating', 'Shifting Gears', 'Elsbeth', 'Matlock', 'Ghosts', 'Abbott Elementary', 'Shrinking', 'Hacks', 'The Rehearsal', 'Love on the Spectrum', 'Too Much', 'Wayward', 'The Hunting Wives', 'Leanne', 'Wednesday season 2', 'Peacemaker', 'Gen V', 'Chief of War', 'Dope Thief', 'Your Friends & Neighbors', 'Department Q', 'Adolescence', 'Toxic Town', 'Zero Day', 'Running Point', 'Apple Cider Vinegar', 'The Residence', 'Wolf King', 'Pulse', 'Dying for Sex', 'The Last of Us', 'Andor', 'Daredevil: Born Again', 'Ironheart', 'Task', 'Mid-Century Modern', 'The Pitt', 'Severance', 'Yellowjackets', 'Reacher', 'Squid Game', 'Ginny & Georgia', 'Outer Banks', 'The Night Agent', 'Lioness', 'Tulsa King', 'Dexter: Resurrection', 'Shoresy', 'Letterkenny', 'Heartland', 'When Calls the Heart', 'Blue Lights', 'Happy Valley', 'Line of Duty', 'Bodyguard', 'The Fall', 'Broadchurch', 'Vera', 'Shetland', 'Grantchester', 'Father Brown', 'Death in Paradise', 'Midsomer Murders', 'Unforgotten', 'Endeavour', 'Inspector Morse', 'Ted Lasso', 'Derry Girls', 'Gavin & Stacey', 'The IT Crowd', 'Peep Show', 'Fawlty Towers', 'Blackadder', 'Downton Abbey', 'Sanditon', 'Bridgerton', 'Queen Charlotte', 'The Great', 'Our Flag Means Death', 'The Last Kingdom', 'Vikings: Valhalla', 'Shogun', 'Tokyo Vice', 'Pachinko', 'Beef', 'Mr. Robot', 'Halt and Catch Fire', 'The Americans', 'Homeland', 'The Leftovers', 'Sharp Objects', 'True Detective: Night Country', 'Fargo', 'Justified', 'Longmire', 'Bosch', 'Goliath', 'Ozark', 'Narcos', 'Peaky Blinders', 'Boardwalk Empire', 'Succession', 'Veep', 'Silicon Valley', 'Barry', 'Atlanta', 'Insecure', 'Girls', 'Lovecraft Country', 'Euphoria', 'The Wire', 'Treme', 'Deadwood', 'The Sopranos', 'Six Feet Under', 'Entourage', 'Curb Your Enthusiasm', 'Sex and the City', 'Gossip Girl', 'Pretty Little Liars', 'Riverdale', 'The Vampire Diaries', 'The Originals', 'Grey\\'s Anatomy', 'Station 19', 'Chicago Fire', 'The Good Doctor', 'This Is Us', 'Parenthood', 'Friday Night Lights', 'Nashville', 'Dallas', 'Dynasty', 'Yellowstone', 'Firefly', 'Battlestar Galactica', 'Star Trek', 'The Expanse', 'Doctor Who', 'Sherlock', 'Lupin', 'Money Heist', 'Dark', 'Elite', 'Narcos: Mexico', 'Queen of the South', 'Big Mouth', 'BoJack Horseman', 'Rick and Morty', 'Bob\\'s Burgers', 'The Simpsons', 'Family Guy', 'South Park', 'Futurama', 'King of the Hill', 'Archer', 'Arcane', 'Blue Eye Samurai', 'Invincible', 'Hazbin Hotel', 'Bluey', 'Peppa Pig', 'Paw Patrol', 'Cocomelon', 'Ms. Rachel', 'Gabby\\'s Dollhouse', 'Daniel Tiger', 'Sesame Street', 'Mickey Mouse Clubhouse', 'Spidey and His Amazing Friends', 'Doc McStuffins', 'Sofia the First', 'Vampirina', 'Puppy Dog Pals', 'Paw Patrol: The Movie'];\n  var MOVIES3 = ['The Outrun', 'From Dusk Till Dawn', 'The French Dispatch', 'Midnight in Paris', 'The Grand Budapest Hotel', 'Moonrise Kingdom', 'The Royal Tenenbaums', 'Fantastic Mr. Fox', 'Isle of Dogs', 'The Darjeeling Limited', 'Rushmore', 'Annie Hall', 'Manhattan', 'Vicky Cristina Barcelona', 'Blue Jasmine', 'Match Point', 'Lost in Translation', 'Marie Antoinette', 'The Virgin Suicides', 'Eternal Sunshine of the Spotless Mind', 'Being John Malkovich', 'Adaptation', 'Amélie', 'Amelie', 'Pan\\'s Labyrinth', 'The Shape of Water', 'Crimson Peak', 'Pacific Rim', 'Hellboy', 'Pinocchio', 'Spirited Away', 'My Neighbor Totoro', 'Howl\\'s Moving Castle', 'Kiki\\'s Delivery Service', 'Princess Mononoke', 'Ponyo', 'The Boy and the Heron', 'Akira', 'Your Name', 'Godzilla Minus One', 'Godzilla x Kong', 'Kong: Skull Island', 'King Kong', 'Jaws 2', 'Close Encounters of the Third Kind', 'Jurassic World Dominion', 'Jurassic World Rebirth', 'The Lost World', 'Lilo & Stitch', 'Lilo and Stitch', 'How to Train Your Dragon', 'How to Train Your Dragon 2', 'The Sandlot', 'The Mighty Ducks', 'Little Giants', 'The Rookie', 'A League of Their Own', 'Major League', 'Field of Dreams', 'Bull Durham', 'The Natural', 'Hoosiers', 'Rudy', 'Remember the Titans', 'We Are Marshall', 'Invincible', 'The Blind Side', 'Coach Carter', 'Glory Road', 'Miracle', 'Cool Runnings', 'Rocky IV', 'Creed III', 'Raging Bull', 'Million Dollar Baby', 'The Fighter', 'Warrior', 'Southpaw', 'Ali', 'Seabiscuit', 'Secretariat', 'Dreamer', 'War Horse', 'Black Beauty', 'Marley & Me', 'A Dog\\'s Purpose', 'A Dog\\'s Way Home', 'A Dog\\'s Journey', 'Hachi: A Dog\\'s Tale', 'Eight Below', 'Turner & Hooch', 'Beethoven', 'Air Bud', 'Homeward Bound', 'Lassie', 'Old Yeller', 'Where the Red Fern Grows', 'Togo', 'Balto', 'Bolt', 'Lady and the Tramp', 'Isle of Dogs', 'Red Dog', 'Arthur the King', 'The Art of Racing in the Rain', 'Benji', 'Shiloh', 'Because of Winn-Dixie', 'My Dog Skip', 'Clifford the Big Red Dog', 'Garfield', 'Puss in Boots', 'The Aristocats', 'Oliver & Company', 'Cats & Dogs', 'The Secret Life of Pets 2', 'Super Pets', 'Strays', 'Mean Girls', 'Clueless', 'Heathers', 'Easy A', 'She\\'s the Man', 'Aquamarine', 'John Tucker Must Die', 'Bring It On', 'Legally Blonde 2', 'Miss Congeniality', 'Sweet Home Alabama', 'The Wedding Planner', 'The Wedding Singer', '50 First Dates', 'Just Go with It', 'Blended', 'Pixels', 'Hotel Transylvania', 'Murder Mystery', 'Uncut Gems', 'Hustle', 'Spaceman', 'Sandy Wexler', 'The Longest Yard', 'Big Daddy', 'Mr. Deeds', 'Anger Management', 'You Don\\'t Mess with the Zohan', 'Grown Ups 2', 'Jack and Jill', 'The Notebook', 'Dear John', 'The Last Song', 'A Walk to Remember', 'Safe Haven', 'The Lucky One', 'The Best of Me', 'The Choice', 'Me Before You', 'The Fault in Our Stars', 'Five Feet Apart', 'If I Stay', 'P.S. I Love You', 'The Vow', 'Letters to Juliet', 'Dear Evan Hansen', 'Just Mercy', 'Hidden Figures', 'Harriet', 'Selma', 'The Help', 'Mudbound', 'Fences', 'Ma Rainey\\'s Black Bottom', 'King Richard', 'Origin', 'The Color Purple', 'The Woman King', 'Till', 'Rustin', 'Sound of Freedom', 'Jesus Revolution', 'The Chosen', 'I Can Only Imagine', 'War Room', 'Courageous', 'Fireproof', 'Facing the Giants', 'The Shack', 'Heaven Is for Real', 'Miracles from Heaven', 'God\\'s Not Dead', 'Unbroken', 'Hacksaw Ridge', 'Saving Private Ryan', '1917', 'Dunkirk', 'Fury', 'Midway', 'Pearl Harbor', 'Black Hawk Down', 'American Sniper', 'Lone Survivor', 'Zero Dark Thirty', 'The Hurt Locker', 'Greyhound', 'Top Gun', 'The Fall Guy', 'Twisters', 'Bullet Train', 'Nobody', 'The Equalizer', 'The Equalizer 3', 'John Wick: Chapter 3', 'Ballerina', 'Atomic Blonde', 'Salt', 'Red Sparrow', 'Mr. & Mrs. Smith', 'The Bourne Ultimatum', 'Casino Royale', 'Skyfall', 'Spectre', 'No Time to Die', 'Goldfinger', 'Mission: Impossible – Fallout', 'Mission: Impossible – Dead Reckoning', 'Top Five', 'The Holiday', 'The Proposal', 'While You Were Sleeping', 'Serendipity', 'Kate & Leopold', 'Maid in Manhattan', 'Runaway Bride', 'Hitch', 'Two Weeks Notice', 'Music and Lyrics', 'The Lake House', 'About Time', 'Love Actually', 'Notting Hill', 'Four Weddings and a Funeral', 'Bridget Jones: The Edge of Reason', 'The Holdovers', 'Past Lives', 'Aftersun', 'The Worst Person in the World', 'Drive', 'Nightcrawler', 'Prisoners', 'Sicario', 'Enemy', 'Gone Baby Gone', 'The Town', 'Mystic River', 'Shutter Island', 'The Departed', 'Heat', 'Collateral', 'The Gentlemen', 'Snatch', 'Lock, Stock and Two Smoking Barrels', 'Layer Cake', 'In Bruges', 'Seven Psychopaths', 'Three Billboards Outside Ebbing, Missouri', 'The Banshees of Inisherin', 'The Lobster', 'The Favourite', 'Kinds of Kindness', 'Poor Things', 'Saltburn', 'Promising Young Woman', 'The Menu', 'Bodies Bodies Bodies', 'Ready or Not', 'Knives Out', 'Clue', 'Murder on the Orient Express', 'Death on the Nile', 'A Haunting in Venice', 'See How They Run', 'The Thursday Murder Club', 'Gone Girl', 'The Girl on the Train', 'The Woman in the Window', 'Rebecca', 'The Others', 'Hereditary', 'Talk to Me', 'Smile', 'Longlegs', 'Heretic', 'Companion', 'Weapons', 'Bring Her Back', 'Final Destination', 'The Conjuring 2', 'Annabelle', 'The Nun', 'Insidious', 'Sinister', 'Get Out', 'Nope', 'Us', 'Candyman', 'It Chapter Two', 'Pet Sematary', 'Doctor Sleep', 'The Shining', 'Carrie', 'Misery', 'Stand by Me', 'The Shawshank Redemption', 'The Green Mile', 'Hocus Pocus', 'Practical Magic', 'The Craft', 'Beetlejuice', 'The Addams Family', 'Edward Scissorhands', 'Sleepy Hollow', 'Corpse Bride', 'Coraline', 'ParaNorman', 'Monster House', 'Casper', 'Halloweentown', 'Twitches', 'Hubie Halloween', 'Trick \\'r Treat', 'Scream', 'I Know What You Did Last Summer', 'Friday the 13th', 'A Nightmare on Elm Street', 'The Texas Chain Saw Massacre', 'The Exorcist', 'Poltergeist', 'The Ring', 'The Blair Witch Project', 'Paranormal Activity', 'The Cabin in the Woods', 'Evil Dead', 'Army of Darkness', 'Shaun of the Dead', 'Hot Fuzz', 'The World\\'s End', 'Zombieland', 'Warm Bodies', 'World War Z', '28 Days Later', 'I Am Legend', 'Train to Busan', 'A Quiet Place', 'Bird Box', 'The Mist', 'Signs', 'The Village', 'Split', 'Old', 'Knock at the Cabin', 'Trap', 'Elf', 'The Santa Clause 2', 'Jingle Jangle', 'The Night Before', 'Office Christmas Party', 'Bad Moms Christmas', 'Deck the Halls', 'Christmas with the Kranks', 'Surviving Christmas', 'Love the Coopers', 'The Holiday', 'Last Holiday', 'Holidate', 'Let It Snow', 'Klaus', 'The Polar Express', 'Arthur Christmas', 'Rise of the Guardians', 'Frosty the Snowman', 'Rudolph the Red-Nosed Reindeer', 'A Charlie Brown Christmas', 'It\\'s the Great Pumpkin, Charlie Brown', 'A Charlie Brown Thanksgiving', 'Planes, Trains and Automobiles', 'Home for the Holidays', 'Pieces of April', 'Free Birds'];\n  var BOOKS3 = ['The 5AM Club', 'The 5 AM Club', 'Can\\'t Hurt Me', 'Never Finished', 'Extreme Ownership', 'The Mountain Is You', 'The Courage to Be Disliked', 'The Daily Stoic', 'The Obstacle Is the Way', 'Stillness Is the Key', 'Discipline Is Destiny', 'Right Thing, Right Now', 'Make Your Bed', 'The Subtle Art of Not Giving a F*ck', 'Everything Is F*cked', 'Greenlights', 'The Light We Carry', 'Becoming', 'The Year of Yes', 'Untamed', 'Love Warrior', 'Carry On, Warrior', 'Girl, Wash Your Face', 'Girl, Stop Apologizing', 'You Are a Badass', 'You Are a Badass at Making Money', 'The High 5 Habit', 'The Let Them Theory', 'Good Inside', 'Hunt, Gather, Parent', 'The Whole-Brain Child', 'How to Talk So Kids Will Listen', 'No Drama Discipline', 'Raising Good Humans', 'Cribsheet', 'Expecting Better', 'What to Expect When You\\'re Expecting', 'Bringing Up Bébé', 'Simplicity Parenting', 'The Montessori Toddler', 'Fair Play', 'The Gottman Method', 'The Seven Principles for Making Marriage Work', 'Eight Dates', 'Hold Me Tight', 'Wired for Love', 'Polysecure', 'The Body Keeps the Score', 'Complex PTSD', 'It Didn\\'t Start with You', 'Adult Children of Emotionally Immature Parents', 'Codependent No More', 'The Drama of the Gifted Child', 'Running on Empty', 'Lost Connections', 'Feeling Good', 'The Happiness Trap', 'The Untethered Soul', 'Wherever You Go, There You Are', 'Radical Acceptance', 'When Things Fall Apart', 'The Book of Joy', 'Ikigai', 'The Midnight Library', 'The Seven Moons', 'Lessons in Chemistry', 'Remarkably Bright Creatures', 'The Women', 'The Nightingale', 'The Four Winds', 'Firefly Lane', 'Home Front', 'Night Road', 'The Great Alone', 'Between Sisters', 'Fly Away', 'Winter Garden', 'Summer Island', 'True Colors', 'Not My Daughter', 'The Ex-Wife', 'The Teacher', 'The Tenant', 'The Boyfriend', 'The Crash', 'Never Lie', 'The Locked Door', 'Ward D', 'The Recruiter', 'The Housemaid\\'s Wedding', 'The Intruder', 'Dear Debbie', 'The Hunting Wives', 'The Perfect Couple', 'The Hotel Nantucket', 'Golden Girl', 'Swan Song', 'The Five-Star Weekend', 'Here\\'s to Us', 'Summer of \\'69', 'The Rumor', 'The Blue Bistro', 'Beautiful Day', 'The Island', 'Same Beach, Next Year', 'Wish You Were Here', 'Practice Makes Perfect', 'Mad Love', 'Love Theoretically', 'Bride', 'Deep End', 'The Paradise Problem', 'Better Than Fiction', 'Happy Place', 'Funny Story', 'Book Lovers', 'Atmosphere', 'Daisy Jones & the Six', 'Carrie Soto Is Back', 'The Seven Husbands of Evelyn Hugo', 'Malibu Rising', 'After I Do', 'Just Kids', 'The Sun and Her Flowers', 'Milk and Honey', 'Home Body', 'The Prophet', 'Leaves of Grass', 'The Odyssey', 'The Iliad', 'Beowulf', 'Hamlet', 'Romeo and Juliet', 'Macbeth', 'Othello', 'King Lear', 'A Midsummer Night\\'s Dream', 'The Canterbury Tales', 'Paradise Lost', 'Inferno', 'The Divine Comedy', 'Les Misérables', 'The Hunchback of Notre-Dame', 'The Three Musketeers', 'Treasure Island', 'Robinson Crusoe', 'Gulliver\\'s Travels', 'Alice\\'s Adventures in Wonderland', 'Peter Pan', 'The Wind in the Willows', 'Winnie-the-Pooh', 'Charlie and the Chocolate Factory', 'James and the Giant Peach', 'The BFG', 'Fantastic Mr Fox', 'Charlotte\\'s Web', 'Stuart Little', 'The Phantom Tollbooth', 'Bridge to Terabithia', 'Hatchet', 'Island of the Blue Dolphins', 'Number the Stars', 'The Westing Game', 'From the Mixed-Up Files of Mrs. Basil E. Frankweiler', 'A Series of Unfortunate Events', 'The Babysitters Club', 'Goosebumps', 'Nancy Drew', 'The Hardy Boys', 'Amelia Bedelia', 'Pete the Cat', 'If You Give a Mouse a Cookie', 'Chicka Chicka Boom Boom', 'Brown Bear, Brown Bear', 'Guess How Much I Love You', 'Love You Forever', 'The Giving Tree', 'Where the Sidewalk Ends', 'Oh, the Places You\\'ll Go', 'The Lorax', 'The Gruffalo', 'Llama Llama Red Pajama', 'The Day the Crayons Quit', 'The Rainbow Fish', 'Corduroy', 'Madeline', 'Curious George', 'The Polar Express', 'The Night Before Christmas', 'How the Grinch Stole Christmas'];\n  var PODCASTS = [\n    'Call Her Daddy', 'Crime Junkie', 'Serial', 'S-Town', 'This American Life', 'The Daily', 'Up First', 'Armchair Expert', 'SmartLess', 'The Joe Rogan Experience', 'Huberman Lab', 'The Mel Robbins Podcast', 'We Can Do Hard Things',\n    'Unlocking Us', 'Dare to Lead podcast', 'On Purpose', 'The Diary of a CEO', 'How I Built This', 'Planet Money', 'Freakonomics Radio', 'Stuff You Should Know', 'Radiolab', 'Hidden Brain', '99% Invisible', 'Revisionist History',\n    'My Favorite Murder', 'Morbid', 'Casefile', 'Dateline: Missing in America', 'Up and Vanished', 'Dr. Death', 'Dirty John', 'The Dropout', 'Wondery', 'Conan O\\'Brien Needs a Friend', 'Wait Wait... Don\\'t Tell Me', 'New Heights',\n    'Pod Save America', 'The Ezra Klein Show', 'Hard Fork', 'Lex Fridman Podcast', 'The Tim Ferriss Show', 'The School of Greatness', 'Rich Roll', 'The Skinny Confidential', 'Girls Gotta Eat', 'Not Skinny But Not Fat', 'Two Hot Takes',\n    'Las Culturistas', 'Normal Gossip', 'You\\'re Wrong About', 'Maintenance Phase', 'Sword and Scale', 'Rotten Mango', 'The Rewatchables', 'Office Ladies', 'Fake Doctors, Real Friends', 'Bad Friends', 'Theo Von', 'Shawn Ryan Show',\n    'Pardon My Take', 'The Bill Simmons Podcast', 'Mike and Mike', 'The Pat McAfee Show', 'Bachelor Happy Hour', 'Scrubbing In', 'Dumb Blonde', 'Unwell', 'Ladies Who Lunch', 'The Ramsey Show', 'ChooseFI', 'BiggerPockets',\n    'Marketing School', 'Online Marketing Made Easy', 'Goal Digger', 'The Brand Builder Show', 'Social Media Marketing Podcast', 'The Side Hustle Show', 'Smart Passive Income', 'Entrepreneurs on Fire', 'The Pet Sitter Podcast'\n  ];\n  var GAMES = [\n    'The Legend of Zelda: Tears of the Kingdom', 'Tears of the Kingdom', 'Breath of the Wild', 'Mario Kart 8', 'Mario Kart World', 'Super Mario Bros. Wonder', 'Animal Crossing', 'Animal Crossing: New Horizons', 'Stardew Valley',\n    'Minecraft', 'Fortnite', 'Roblox', 'Pokemon Scarlet', 'Pokemon Violet', 'Pokémon Legends: Z-A', 'Donkey Kong Bananza', 'Super Smash Bros. Ultimate', 'Elden Ring', 'Nightreign', 'Baldur\\'s Gate 3', 'Hogwarts Legacy',\n    'Grand Theft Auto VI', 'GTA 6', 'GTA VI', 'Red Dead Redemption 2', 'The Last of Us Part II', 'God of War Ragnarok', 'Spider-Man 2', 'Marvel\\'s Spider-Man 2', 'Astro Bot', 'Ghost of Yotei', 'Ghost of Tsushima', 'Death Stranding 2',\n    'Call of Duty', 'Black Ops 6', 'Black Ops 7', 'Battlefield 6', 'Madden 26', 'Madden NFL 26', 'EA Sports College Football 26', 'College Football 25', 'NBA 2K26', 'EA FC 26', 'MLB The Show 25', 'Hollow Knight: Silksong', 'Silksong',\n    'Hades', 'Hades II', 'Cyberpunk 2077', 'The Witcher 3', 'Starfield', 'Skyrim', 'Fallout 4', 'Balatro', 'It Takes Two', 'Split Fiction', 'Overcooked', 'Kirby and the Forgotten Land', 'Metroid Prime 4', 'Pikmin 4', 'Sims 4', 'The Sims 4',\n    'Clair Obscur: Expedition 33', 'Expedition 33', 'Monster Hunter Wilds', 'Assassin\\'s Creed Shadows', 'Kingdom Come: Deliverance II', 'Dragon Age: The Veilguard', 'Final Fantasy VII Rebirth', 'Final Fantasy XVI', 'Palworld',\n    'Helldivers 2', 'Lethal Company', 'Among Us', 'Fall Guys', 'Rocket League', 'Valorant', 'League of Legends', 'Apex Legends', 'Overwatch 2', 'Destiny 2', 'Halo Infinite', 'Forza Horizon 5', 'Gran Turismo 7', 'Sea of Thieves'\n  ];\n  // authors people write with a title (\"the women kristin hannah\", \"colleen hoover verity\")\n  var AUTHORS = 'kristin hannah|colleen hoover|emily henry|taylor jenkins reid|sally rooney|freida mcfadden|rebecca yarros|sarah j maas|sjm|stephen king|james patterson|john grisham|nicholas sparks|jojo moyes|liane moriarty|lucy foley|ruth ware|riley sager|alex michaelides|' +\n    'harlan coben|lee child|david baldacci|dan brown|michael connelly|louise penny|tana french|gillian flynn|paula hawkins|jodi picoult|elin hilderbrand|ann patchett|barbara kingsolver|percival everett|abraham verghese|' +\n    'brit bennett|celeste ng|kazuo ishiguro|andy weir|blake crouch|brandon sanderson|v e schwab|leigh bardugo|suzanne collins|jk rowling|j k rowling|rick riordan|john green|madeline miller|rf kuang|r f kuang|' +\n    'matt haig|fredrik backman|shelby van pelt|bonnie garmus|delia owens|gabrielle zevin|ali hazelwood|abby jimenez|carley fortune|tessa bailey|lauren asher|ana huang|elsie silver|hannah grace|lynn painter|' +\n    'james clear|brene brown|mel robbins|glennon doyle|michelle obama|tara westover|jennette mccurdy|britney spears|matthew mcconaughey|matthew perry|prince harry|bessel van der kolk|jonathan haidt|morgan housel|' +\n    'malcolm gladwell|adam grant|cal newport|ryan holiday|mark manson|david goggins|alex hormozi|donald miller|mike michalowicz|michael gerber|simon sinek|dave ramsey|robert kiyosaki|ramit sethi|' +\n    'erik larson|david grann|jon krakauer|laura hillenbrand|walter isaacson|ron chernow|doris kearns goodwin|yuval noah harari|robin wall kimmerer|mary roach|bill bryson|jane austen|charles dickens|f scott fitzgerald|' +\n    'ernest hemingway|harper lee|john steinbeck|george orwell|toni morrison|maya angelou|agatha christie|jrr tolkien|j r r tolkien|cs lewis|c s lewis|kristan higgins|mary kay andrews|kate quinn|lisa wingate|' +\n    'chris whitaker|claire keegan|miranda july|hanya yanagihara|donna tartt|ottessa moshfegh|kiley reid|ashley elston|allison montclair|richard osman|anthony horowitz|ava reid|alice feeney|shari lapena|lisa jewell|' +\n    'b a paris|jp delaney|karin slaughter|nora roberts|danielle steel|debbie macomber|karen kingsbury|beverly lewis|sarah adams|ali rosen|emily giffin|jennifer weiner|kristin harmel|fiona davis|marie benedict|' +\n    'kevin kwan|xiran jay zhao|tj klune|tasha suri|samantha shannon|katherine arden|naomi novik|erin morgenstern|silvia moreno-garcia|grady hendrix|jason rekulak|stephen graham jones|tj newman|joe hill|' +\n    'paulo coelho|mitch albom|eckhart tolle|don miguel ruiz|viktor frankl|marcus aurelius|dale carnegie|stephen covey|napoleon hill|gary chapman|lori gottlieb|nedra glover tawwab|amir levine|esther perel|emily nagoski|' +\n    'peter attia|matthew walker|anna lembke|gabor mate|bruce perry|oprah|oprah winfrey|reese|reese witherspoon|jenna bush hager|read with jenna|reese\\'s book club|good morning america';\n  var ALIASES = { '4 hour work week': 'The 4-Hour Workweek', 'the 4 hour work week': 'The 4-Hour Workweek', '4 hour workweek': 'The 4-Hour Workweek', acotar: 'A Court of Thorns and Roses', acomaf: 'A Court of Mist and Fury', acowar: 'A Court of Wings and Ruin', acosf: 'A Court of Silver Flames', tog: 'Throne of Glass', hotd: 'House of the Dragon', got: null, lotr: 'The Lord of the Rings',\n    himym: 'How I Met Your Mother', b99: 'Brooklyn Nine-Nine', oitnb: 'Orange Is the New Black', ahs: 'American Horror Story', tsitp: 'The Summer I Turned Pretty', omitb: 'Only Murders in the Building', gbbo: 'The Great British Baking Show', svu: 'Law & Order: SVU',\n    'white lotus': 'The White Lotus', 'the white lotus': 'The White Lotus', 'stranger things 5': 'Stranger Things', 'severance season 2': 'Severance', 'squid game 3': 'Squid Game', 'gta 6': 'Grand Theft Auto VI', 'tears of the kingdom': 'The Legend of Zelda: Tears of the Kingdom',\n    'shogun': 'Shōgun', 'thunderbolts': 'Thunderbolts*', 'wicked 2': 'Wicked: For Good', 'wicked part 2': 'Wicked: For Good', 'wicked for good': 'Wicked: For Good', 'mission impossible final reckoning': 'Mission: Impossible – The Final Reckoning', 'mission impossible 8': 'Mission: Impossible – The Final Reckoning',\n    'dune 2': 'Dune: Part Two', 'dune part 2': 'Dune: Part Two', 'inside out two': 'Inside Out 2', 'top gun maverick': 'Top Gun: Maverick', 'knives out 3': 'Wake Up Dead Man', 'kpop demon hunters': 'KPop Demon Hunters', 'k pop demon hunters': 'KPop Demon Hunters',\n    'the holiday': 'The Holiday', 'harry potter': 'Harry Potter', 'percy jackson': 'Percy Jackson and the Lightning Thief', 'hunger games': 'The Hunger Games', 'the hunger games': 'The Hunger Games', 'great british bake off': 'The Great British Bake Off', 'mrs maisel': 'The Marvelous Mrs. Maisel',\n    'happy gilmore two': 'Happy Gilmore 2', 'the bear': 'The Bear', 'f1 movie': 'F1', 'the f1 movie': 'F1', 'housemaid': 'The Housemaid', 'the housemaid': 'The Housemaid', 'its a wonderful life': 'It\\'s a Wonderful Life', 'schitts creek': 'Schitt\\'s Creek' };\n  // the kinds: what a title of more than one is first (a book made into a film is a book first, unless the film is the one people mean)\n  var SCREEN_FIRST = { 'wicked': 1, 'harry potter': 1, 'the hunger games': 1, 'jurassic park': 1, 'the godfather': 1, 'the shining': 1, 'gone girl': 1, 'the martian': 1, 'dune': 0, 'little women': 0, 'the notebook': 1, 'it ends with us': 0, 'twilight': 1, 'shogun': 1, 'the green mile': 1, 'frankenstein': 0, 'matilda': 1, 'the help': 1, 'big little lies': 1, 'sharp objects': 1, 'normal people': 0, 'the outsiders': 0, 'the color purple': 1, 'lessons in chemistry': 0, 'the women': 0, 'hamnet': 0, 'the wild robot': 1, 'outlander': 1, 'yellowstone': 1, 'the boys in the boat': 0, 'killers of the flower moon': 0, 'reacher': 1, 'bridgerton': 1, 'the summer i turned pretty': 1, 'daisy jones and the six': 0, 'the last thing he told me': 0, 'the handmaids tale': 1, 'station eleven': 0, 'the fault in our stars': 0, 'divergent': 0, 'the maze runner': 0, 'ready player one': 0, 'jaws': 1, 'it': 1, 'carrie': 1, 'misery': 1, 'the hobbit': 0, 'the lord of the rings': 1, 'the lion the witch and the wardrobe': 0, 'fight club': 1, 'forrest gump': 1, 'the princess bride': 1, 'mary poppins': 1, 'the devil wears prada': 1, 'crazy rich asians': 1, 'where the crawdads sing': 0, 'the help ': 1, 'the housemaid': 0, 'verity': 0, 'the silent patient': 0, 'the godfather ': 1, 'the great gatsby': 0, 'pride and prejudice': 0, 'emma': 0, 'big fish': 1, 'the time travelers wife': 0, 'the secret garden': 0 };\n  var norm = function (s) { var t = String(s || ''); try { t = t.normalize('NFD').replace(/[̀-ͯ]/g, ''); } catch (e) {} return t.toLowerCase().replace(/[’']/g, '').replace(/&/g, 'and').replace(/\\*/g, '').replace(/[^a-z0-9$]+/g, ' ').trim().replace(/^(the|a|an) /, '').replace(/ (ii|iii|iv|v|vi)$/, function (x) { return ' ' + { ii: 2, iii: 3, iv: 4, v: 5, vi: 6 }[x.trim()]; }); };\n  var idx = {}, longest = 1;\n  var put = function (list, kind) { list.forEach(function (t) { var k = norm(t); if (k.length < 3 && !/\\d/.test(k)) return; var e = (idx[k] = idx[k] || {}); if (!e[kind]) e[kind] = t; longest = Math.max(longest, k.split(' ').length); }); };\n  put(BOOKS, 'book'); put(SHOWS, 'show'); put(MOVIES, 'movie');\n  put(BOOKS2, 'book'); put(SHOWS2, 'show'); put(MOVIES2, 'movie'); put(PODCASTS, 'show'); put(SHOWS3, 'show'); put(MOVIES3, 'movie'); put(BOOKS3, 'book'); put(GAMES, 'game');\n  Object.keys(ALIASES).forEach(function (a) { var to = ALIASES[a]; if (!to) return; var hit = idx[norm(to)]; if (hit) idx[norm(a)] = hit; });\n  var SF = {}; Object.keys(SCREEN_FIRST).forEach(function (k) { if (SCREEN_FIRST[k]) SF[norm(k)] = 1; });\n  var AUTH = {}; AUTHORS.split('|').forEach(function (a) { AUTH[norm(a)] = 1; });\n  // words that are ordinary words more than titles when a note is only that (\"frozen\", \"up\", \"signs\")\n  var PLAIN = { salt: 1, drive: 1, enemy: 1, ali: 1, task: 1, pulse: 1, sirens: 1, strays: 1, benji: 1, dreamer: 1, togo: 1, balto: 1, shiloh: 1, bolt: 1, origin: 1, till: 1, fences: 1, fury: 1, midway: 1, greyhound: 1, nobody: 1, clue: 1, heretic: 1, companion: 1, annabelle: 1, candyman: 1, scream: 1, pinocchio: 1, hellboy: 1, ponyo: 1, akira: 1, inferno: 1, madeline: 1, corduroy: 1, hamlet: 1, wayward: 1, leanne: 1, overcompensating: 1, untamed: 1, beef: 1, dope: 1, max: 1, invincible: 1, hustle: 1, spaceman: 1, blended: 1, pixels: 1, harriet: 1, selma: 1, fireproof: 1, courageous: 1, salt: 1, nightcrawler: 1, prisoners: 1, sicario: 1, collateral: 1, snatch: 1, mudbound: 1, dallas: 1, dynasty: 1, firefly: 1, vera: 1, shetland: 1, grantchester: 1, endeavour: 1, goliath: 1, treme: 1, deadwood: 1, entourage: 1, insecure: 1, riverdale: 1, homeland: 1, heartland: 1, archer: 1, cocomelon: 0, office: 1, frozen: 1, signs: 1, heat: 1, speed: 1, big: 1, cars: 1, glass: 1, split: 1, old: 1, trap: 1, nope: 1, smile: 1, us: 1, it: 1, saw: 1, wish: 1, soul: 1, up: 1, emma: 1, rent: 1, annie: 1, chicago: 1, fargo: 1, nashville: 1, ghost: 1, matilda: 1, drive: 1, grit: 1, burnout: 1, trust: 1, horse: 1, bride: 1, holly: 1, later: 1, james: 1, night: 1, influence: 1, quiet: 1, range: 1, switch: 1, dark: 1, sugar: 1, house: 1, elite: 1, maid: 1, beef: 1, task: 1, pulse: 1, sirens: 1, paradise: 1, lost: 1, heroes: 1, friends: 1, girls: 1, community: 1, survivor: 1, chopped: 1, cheers: 1, scrubs: 1, mindset: 1, boundaries: 1, attached: 1, educated: 1, becoming: 1, caste: 1, verity: 0, wicked: 0, elf: 0, alien: 1, prey: 1, air: 1, leo: 1, if: 1, minions: 0, rush: 1, crash: 1, reckless: 1, powerless: 1, eclipse: 1, twilight: 0, wonder: 1, holes: 1, wild: 1, night: 1, misery: 1, carrie: 1, foundation: 1, kindred: 1, horror: 1, monsters: 1, ghosts: 1, citadel: 1, upload: 1, invasion: 1, hijack: 1, servant: 1, loot: 1, platonic: 1, cosmos: 1, dateline: 1, cheer: 1, bosch: 0, house: 1, suits: 1, alias: 1, fringe: 1, charmed: 1, victoria: 1, rome: 1, vikings: 1, dexter: 0, lucifer: 0, you: 1, manifest: 1, dahmer: 0, monsters: 1, kaos: 0, lupin: 1, ozark: 0, cocomelon: 0, bluey: 0, joker: 0, garfield: 0, paddington: 0, coco: 1, luca: 1, onward: 1, brave: 1, tangled: 0, sing: 1, trolls: 1, cats: 1, hook: 1, big: 1, rocky: 0, creed: 1, rudy: 1, miracle: 1, click: 1, glass: 1, old: 1, belfast: 1, roma: 1, juno: 1, air: 1, tetris: 1, blackberry: 1, leo: 1, nimona: 0, wish: 1, damsel: 1, extraction: 1, venom: 0, logan: 1, morbius: 0, prey: 1, predator: 0, terminator: 0, halloween: 1, psycho: 0, vertigo: 0, ghost: 1, speed: 1, armageddon: 0, twister: 1, troy: 1, gladiator: 0, tombstone: 0, grease: 0, chicago: 1, hairspray: 1, rent: 1, hamilton: 1, cats: 1, mulan: 0, cinderella: 0, aladdin: 0, superman: 0, barbie: 0, oppenheimer: 0, sinners: 0, weapons: 1, conclave: 0, anora: 0, f1: 0, elvis: 0, maestro: 0, priscilla: 0, wonka: 0, saltburn: 0, challengers: 0, longlegs: 0, nosferatu: 0, frankenstein: 0, hamnet: 0, bugonia: 0, eddington: 0, materialists: 0, smile: 1, nope: 1, us: 1, split: 1, signs: 1, minecraft: 0, fortnite: 0, roblox: 0, hades: 0, balatro: 0, palworld: 0, skyrim: 0, starfield: 0 };\n  // the title in a note: the whole note (less \"read\" / \"watch\" / \"season 2\", who wrote it, where it streams and the like),\n  // or a known title inside it (two words or more after \"watch\", \"read\", \"book\", \"show\"…; three or more anywhere).\n  // Returns { title, book, show, movie, game, whole, weak } or null.\n  var CUE = /\\b(see|seen|saw|read|reread|watch|rewatch|binge|stream|finish|book|novel|audiobook|kindle|movie|film|show|series|season|episode|netflix|hulu|max|hbo|prime|disney|peacock|apple tv|paramount|play|playing|game|podcast|listen)\\b/i;\n  function strip(t) {\n    var s = ' ' + norm(t) + ' ';\n    var prev;\n    do {\n      prev = s;\n      s = s.replace(/^ (hey|ok|so|also|note|idea|maybe|lets|let s|someday|i|we|really|still|finally|def|definitely|prob|probably|need to|have to|gotta|got to|should|must|want to|wanna|would like to|d like to|would love to|d love to|go|try|start|finish|finally|go see|see|watch|rewatch|re watch|binge|stream|read|reread|re read|listen to|play|catch up on|finish watching|finish reading|start watching|start reading|to)(?= )/, '')\n        .replace(/^ (my |the )?[a-z]+( and [a-z]+)? (said|says|recommended|recommends|suggested|suggests|mentioned|told me|told us|loves|swears by|raves about)( to| that| we should| i should)?(?= )/, '')\n        .replace(/^ (the )?(rest of|last episode of|next episode of|finale of|first season of|last season of|new season of|season \\d+ of|season \\w+ of|episode \\d+ of|book \\d+ of|part \\d+ of)(?= )/, '')\n        .replace(/^ (movie|film|book|show|tv show|series|tv|audiobook|audio book|kindle book|book club pick|book club|movie night pick|movie night|movie for tonight|movie to watch|show to watch|book to read|podcast|game|new book|new show|new movie|documentary|docuseries|rec|recommendation|tbr)(?= )/, '')\n        .replace(/\\s+$/, '')\n        .replace(/ (season|series|s|part|vol|volume|book) ?\\d+( .*)?$/, ' ').replace(/ (new|next|final|last) season( .*)?$/, ' ')\n        .replace(/ (the )?(book|novel|movie|film|show|series|tv show|tv series|audiobook|audio book|rewatch|re watch|documentary|doc|docuseries|podcast|game|on kindle|on audible|on libby|on netflix|on hulu|on max|on hbo|on hbo max|on prime|on prime video|on amazon|on disney|on disney plus|on apple|on apple tv|on peacock|on paramount|on paramount plus|on youtube|on switch|on ps5|on xbox|netflix|hulu|hbo|max|prime|apple tv|disney plus|peacock|for halloween|for christmas|for the holidays|tonight|this weekend|sometime|again|next|soon|asap|first|next time|with charlie|with kasey|with the kids|with the family|on the plane|for book club|for the trip)$/, ' ')\n        .replace(/\\s+$/, '').replace(/ (finale|premiere|season finale|series finale|new episodes?|episodes|special|reunion|trailer|spinoff|spin off|sequel|prequel|remake|when it comes out|when its out|when it s out|comes out|before the movie|before the show|before it comes out|before watching|is out|coming out|in theaters|in theatres|at the movies|at the theater|on blu ray|on vinyl|audiobook version|paperback|hardcover|series|trilogy|books|movies|for the kids|for the family|with the kids|with the fam|for date night|for movie night|for me|for us|for kasey|for charlie|for emma|for mom|for dad)$/, '').replace(/ by [a-z.]+( [a-z.]+){0,3}$/, '') + ' ';\n      // who wrote it, either end\n      var w = s.trim().split(' ');\n      for (var n = 4; n >= 2; n--) {\n        if (w.length > n && AUTH[w.slice(w.length - n).join(' ')]) { w = w.slice(0, w.length - n); break; }\n        if (w.length > n && AUTH[w.slice(0, n).join(' ')]) { w = w.slice(n); break; }\n      }\n      s = ' ' + w.join(' ') + ' ';\n      s = ' ' + norm(s) + ' ';\n    } while (s !== prev);\n    return s.trim();\n  }\n  function make(hit, whole, key) {\n    var kinds = { book: !!hit.book, show: !!hit.show, movie: !!hit.movie, game: !!hit.game };\n    var title = hit.book || hit.show || hit.movie || hit.game;\n    if (kinds.book && (kinds.show || kinds.movie) && SF[key]) title = hit.show || hit.movie;\n    return { title: title, book: kinds.book, show: kinds.show, movie: kinds.movie, game: kinds.game, whole: whole, weak: PLAIN[key] === 1, screenFirst: !!SF[key] };\n  }\n  function find(text) {\n    var t = String(text || '').replace(/^\\s*[^:\\n]{0,40}\\b(movie|film|book|show|series|read|watch|pick|rec|recommended|audiobook|podcast|game)\\b[^:\\n]{0,25}[:\\-–]\\s+/i, function (x) { return /[:]/.test(x) || /\\s[\\-–]\\s/.test(x) ? '' : x; });\n    var core = strip(t), hit = idx[core];\n    if (hit) return make(hit, true, core);\n    if (core !== norm(text) && (hit = idx[norm(text)])) return make(hit, true, norm(text));\n    // \"survivor 48\", \"the bear 4\": a show and its season number\n    var nonum = core.replace(/ \\d{1,2}$/, '');\n    if (nonum !== core && (hit = idx[nonum]) && (hit.show)) return make(hit, true, nonum);\n    // a title, then who's in it or made it (\"the studio seth rogen\", \"f1 with brad pitt\", \"the substance demi moore\")\n    var cw = core.split(' ');\n    for (var p = cw.length - 1; p >= 1; p--) {\n      var pre = cw.slice(0, p).join(' '), rest = cw.slice(p);\n      if (!idx[pre] || rest.length > 4 || PLAIN[pre] === 1) continue;\n      if (p === 1 && !/^\\s*the\\s/i.test(t) && !/^(with|starring|w|feat|ft)$/.test(rest[0])) continue;\n      if (/^(with|starring|w|by|from|feat|ft|directed)$/.test(rest[0]) || (rest.length === 2 && !/^(and|or|to|for|at|in|on|is|was|tonight|tomorrow|today|this|next|season|part|lodge|park|hotel|resort|house|night)$/.test(rest[0] + '') && !/^(lodge|park|hotel|resort|house|night|nights|party|trip|day)$/.test(rest[1]))) return make(idx[pre], true, pre);\n    }\n    // a known title inside the note (\"Mom recommended Project Hail Mary\", \"need to finish the penguin on max\")\n    var w = norm(t).split(' '), cue = CUE.test(t);\n    for (var n = Math.min(longest, w.length); n >= (cue ? 2 : 3); n--) {\n      for (var i = 0; i + n <= w.length; i++) {\n        var k = w.slice(i, i + n).join(' ');\n        if (idx[k] && !(n === 2 && /^(the|a|an|my|our|new)$/.test(w[i]))) return make(idx[k], false, k);\n      }\n    }\n    return null;\n  }\n  var api = { find: find, count: function () { return Object.keys(idx).length; } };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  root.dbkKnownTitles = api;\n})(typeof window !== 'undefined' ? window : globalThis);\n","inbox-words.js":"/* 2daysbook inbox: the words the Inbox's guess knows by name (inbox-suggest.js). A plain list kept in the app, written\n   by hand; nothing is looked up online and nothing leaves the phone. Lower case, accents left off, \"|\" between entries.\n     rest    places to eat and drink: US chains, and Cincinnati / Northern Kentucky's own (a template copy anywhere\n             else just never sees those)\n     place   somewhere to go nearby: named attractions (Cincinnati area and a few everyone knows)\n     go      kinds of outings (\"pumpkin patch\", \"escape room\"): Places to go\n     trip    somewhere to travel to: countries, US states, cities, national parks, islands, regions\n     local   towns and neighbourhoods around Cincinnati: never a trip (\"sushi place in Florence\")\n     want    things people wish for: gadgets, brands, gifts (the Wishlist), never groceries\n   Loaded on the Today page only (index.html), before inbox-suggest.js. Tests: functions/test/inbox-suggest.test.mjs. */\n(function (root) {\n  var W = {\n    rest: [\n      // national and regional chains\n      'chipotle|chipotle mexican grill|qdoba|moe\\'s|moes southwest grill|taco bell|del taco|el pollo loco|chick fil a|chickfila|mcdonald\\'s|burger king|wendy\\'s|five guys|shake shack|in n out|innout|whataburger|culver\\'s|sonic|sonic drive in|arby\\'s|jack in the box|carl\\'s jr|hardees|white castle|steak n shake|smashburger|red robin|habit burger|the habit|popeyes|kfc|raising cane\\'s|canes|zaxby\\'s|bojangles|wingstop|buffalo wild wings|bdubs|b dubs|hooters|subway|jersey mike\\'s|jimmy john\\'s|firehouse subs|potbelly|penn station|which wich|panera|panera bread|sweetgreen|cava|chopt|noodles and company|noodles & company|panda express|p.f. chang\\'s|p f changs|pei wei|olive garden|cheesecake factory|the cheesecake factory|red lobster|outback|outback steakhouse|longhorn|longhorn steakhouse|texas roadhouse|logan\\'s roadhouse|applebee\\'s|chili\\'s|tgi fridays|ruby tuesday|bj\\'s|bj\\'s brewhouse|bj\\'s restaurant|cracker barrel|bob evans|ihop|denny\\'s|waffle house|first watch|perkins|golden corral|dominos|pizza hut|papa john\\'s|little caesars|marco\\'s|marco\\'s pizza|mod pizza|blaze pizza|jet\\'s pizza|hungry howie\\'s|donatos|papa murphy\\'s|fazoli\\'s|starbucks|dunkin|dunkin donuts|tim hortons|dutch bros|biggby|caribou coffee|peet\\'s|7 brew|seven brew|scooter\\'s coffee|krispy kreme|crumbl|crumbl cookies|insomnia cookies|nothing bundt cakes|dairy queen|cold stone|baskin robbins|rita\\'s|smoothie king|tropical smoothie|tropical smoothie cafe|jamba|jamba juice|cinnabon|auntie anne\\'s|benihana|kona grill|maggiano\\'s|carrabba\\'s|bonefish grill|ruth\\'s chris|morton\\'s|capital grille|the capital grille|fogo de chao|cooper\\'s hawk|yard house|twin peaks|hopdoddy|torchy\\'s|torchy\\'s tacos|chuy\\'s|on the border|velvet taco|condado|condado tacos|city barbeque|city bbq|mission bbq|sonnys bbq|dickeys|famous daves|cheddar\\'s|o\\'charley\\'s|bahama breeze|seasons 52|eddie v\\'s|eddie merlot\\'s|melting pot|the melting pot|j. alexander\\'s|tupelo honey|dave and buster\\'s|dave & buster\\'s|chuck e cheese|main event|bar louie|millers ale house|old chicago|rock bottom|gordon biersch|world of beer|del frisco\\'s|fleming\\'s|ocean prime|ra sushi|kura sushi|gyu kaku|hattie b\\'s|dave\\'s hot chicken|slim chickens|pdq|church\\'s chicken|freddy\\'s|checkers|rallys|krystal|cookout|cook out|burgerfi|bgr|fatburger|jason\\'s deli|mcalister\\'s|mcalister\\'s deli|zoes kitchen|newks|taco john|taco johns|qdoba mexican eats|buca di beppo|bravo|brio|bravo italian|another broken egg|snooze|snooze an am eatery|original pancake house|the original pancake house|keke|keke\\'s|maple street biscuit|duck donuts|jeni\\'s|jeni\\'s ice cream|handel\\'s|handels ice cream|bruster\\'s|marble slab|menchie\\'s|sweet frog|yogurtland|kona ice|ruths chris steak house|morton s|top golf grill|pies & pints|pies and pints|mellow mushroom|bar taco|true food kitchen|north italia|fox and hound|cheddars scratch kitchen|portillo\\'s|lou malnati\\'s|giordano\\'s|primanti bros|skyline on the levee',\n      // Cincinnati and Northern Kentucky\n      'skyline|skyline chili|gold star|gold star chili|camp washington chili|blue ash chili|dixie chili|price hill chili|empress chili|pleasant ridge chili|chili time|montgomery inn|montgomery inn boathouse|the boathouse|jeff ruby\\'s|jeff ruby|the precinct|carlo & johnny|carlo and johnny|boca|sotto|nada|pepp & dolores|pepp and dolores|abigail street|senate|bakersfield|bakersfield otr|the eagle|the eagle otr|eagle otr|krueger\\'s tavern|krueger s tavern|holtman\\'s|holtman\\'s donuts|tom+chee|tom and chee|tom & chee|gomez salsa|taft\\'s ale house|taft\\'s|taft s ale house|rhinegeist|madtree|madtree brewing|braxton|braxton brewing|fifty west|50 west|urban artifact|rivertown brewing|bircus|bircus brewing|hofbrauhaus|hofbrauhaus newport|the hofbrauhaus|moerlein lager house|arnold\\'s|arnold\\'s bar and grill|arnold\\'s bar & grill|mecklenburg gardens|zip\\'s|zip\\'s cafe|terry\\'s turf club|quatman|quatman cafe|eli\\'s bbq|eli\\'s|lucius q|smoke justis|queen city whip|sweets & meats|sweets and meats|pontiac bbq|zula|otto\\'s|otto\\'s covington|bouquet|libby\\'s|libby\\'s southern comfort|goose & elder|goose and elder|coppin\\'s|frida 602|frida|anchor grill|the anchor grill|the gruff|gruff|keystone bar & grill|keystone bar and grill|tickle pickle|mita\\'s|salazar|kaze|the anchor otr|nicola\\'s|primavista|boi na braza|orchids at palm court|the golden lamb|golden lamb|aglamesis|aglamesis bros|graeter\\'s|ugly cream|dojo gelato|taste of belgium|maplewood|maplewood kitchen|sleepy bee|sleepy bee cafe|the echo|bluebird bakery|brown bear bakery|a tavola|goodfellas pizzeria|dewey\\'s|dewey\\'s pizza|larosa\\'s|snappy tomato|mio\\'s|adriatico\\'s|catch a fire pizza|harvest pizzeria|mazunte|el camino|agave & rye|agave and rye|teller s|tellers|the littlefield|littlefield|longfellow|the comet|the mercer|crown republic|lalo|la mexicana|el rancho grande|el toro|los cabos|nicholson\\'s|the summit|eighth & english|8th & english|the golden pony|metropole|jeff ruby s|losantiville|the lackman|lackman|bauhaus|madison s|mama mimis|the pickled pig|cork n bottle|cock & bull|cock and bull|cock & bull public house|newport syndicate|the syndicate|pompilio\\'s|pompilio s|dee felice cafe|dee felice|mainstrasse bars|the hannaford|hannaford|ludlow garage|la soupe|fireside pizza|mac s pizza pub|macs pizza pub|half cut|the baker s table|bakers table|commonwealth bistro|stoney s|riverside korean|ichiban|kyoto|sushi cincinnati|wild ginger|asian paradise|jean ro|jean robert|daveed s|orchids|nada otr|sotto cincinnati|eli s bbq|holtman s|graeter s|larosa s|dewey s'\n    ].join('|'),\n    place: [\n      'kings island|kings island haunt|halloween haunt|winterfest|cincinnati zoo|the zoo|zoo lights|festival of lights|pnc festival of lights|newport aquarium|the aquarium|krohn conservatory|krohn|american sign museum|cincinnati art museum|art museum|contemporary arts center|taft museum|taft museum of art|museum center|cincinnati museum center|union terminal|ark encounter|the ark|ark encounter museum|creation museum|big bone lick|big bone lick state park|devou park|eden park|ault park|smale park|smale riverfront park|washington park|fountain square|findlay market|coney island|sawyer point|purple people bridge|roebling bridge|newport on the levee|the levee|mainstrasse|mainstrasse village|bb riverboats|cincinnati observatory|cincinnati nature center|parky\\'s farm|burger farm|burger farms|gorman heritage farm|winton woods|sharon woods|miami whitewater|kincaid lake|rabbit hash|jungle jim\\'s|jungle jim s|music hall|aronoff|aronoff center|taft theatre|riverbend|icon music center|bogart\\'s|paycor stadium|great american ball park|gabp|tql stadium|heritage bank center|freedom center|underground railroad freedom center|harriet beecher stowe house|carew tower|cincinnati playhouse|playhouse in the park|ensemble theatre|spring grove|mt airy forest|mount airy forest|glenwood gardens|voice of america park|boone woods|middleton mills|the beach waterpark|perfect north|perfect north slopes|kentucky horse park|keeneland|churchill downs|kentucky derby museum|louisville slugger museum|buffalo trace|bourbon trail|the bourbon trail|red river gorge|natural bridge|cumberland falls|hocking hills|air force museum|national museum of the us air force|ohio caverns|kings island water park|soak city|holiday in lights|light up the levee|christmas market|cincideutsch christmas market|great wolf lodge|newport aquarium penguins|cincinnati ballet|cincinnati symphony|cso|cincinnati opera|broadway in cincinnati|krohn butterfly show|butterfly show|cincinnati reds hall of fame|reds hall of fame|national voice of america museum|pyramid hill|pyramid hill sculpture park|loveland castle|chateau laroche|loveland bike trail|little miami bike trail|the banks|over the rhine|otr|mount adams|mt adams|lunken airport|lunken playfield|cincinnati observatory center|ark encounter zip line|creation museum zip line|enchanted ice castle|holiday junction|ezzard charles|the rookwood|rookwood|e 1 skating|ice rink at fountain square',\n      'rock and roll hall of fame|rock & roll hall of fame|columbus zoo|cleveland zoo|indianapolis zoo|the children s museum of indianapolis|children\\'s museum of indianapolis|cosi'\n    ].join('|'),\n    go: 'museum|art museum|history museum|science museum|childrens museum|kids museum|zoo|aquarium|park|state park|dog park|playground|splash pad|trail|bike trail|nature trail|hike|hiking trail|nature center|nature preserve|preserve|arboretum|botanical garden|botanical gardens|garden tour|conservatory|observatory|planetarium|farm|petting zoo|pumpkin patch|corn maze|hayride|hay ride|apple picking|strawberry picking|berry picking|pick your own|u pick|orchard|sunflower field|lavender farm|tulip festival|winery|vineyard|distillery|distillery tour|brewery tour|cidery|escape room|topgolf|top golf|axe throwing|bowling|bowling alley|mini golf|putt putt|go karts|go karting|arcade|laser tag|trampoline park|sky zone|urban air|climbing gym|rock climbing|bouldering gym|roller skating|ice skating|skating rink|sledding|tubing|ski|skiing|zip line|ziplining|zipline|zip lining|ziplines|kayaking|canoe trip|canoeing|paddle boarding|horseback riding|theme park|amusement park|water park|waterpark|haunted house|haunted trail|ghost tour|walking tour|food tour|history tour|boat tour|riverboat|dinner cruise|festival|fall festival|street fair|county fair|state fair|art fair|craft fair|craft show|flea market|farmers market|antique mall|antique store|thrift store|bookstore|book store|used bookstore|record store|christmas market|holiday market|light show|christmas lights|lights display|drive thru lights|drive through lights|drive in|drive in movie|comedy club|comedy show|improv show|the symphony|the ballet|the opera|the theater|the theatre|a play|musical|broadway|off broadway|open mic|jazz club|piano bar|art walk|gallery|art gallery|art show|exhibit|exhibition|lake|waterfall|waterfalls|scenic drive|overlook|lookout|lighthouse|castle|historic site|historic home|cemetery tour|cave tour|caverns|caves|sculpture park|rose garden|japanese garden|dog beach|beach day|pool day|picnic spot|picnic|spa day|the spa|day spa|pottery class|paint and sip|painting class|cooking class|dance class|glass blowing|candle making class|craft class|wine tasting|bourbon tasting|beer garden|biergarten|botanical|gardens',\n    trip: [\n      // countries\n      'mexico|canada|ireland|italy|france|spain|portugal|greece|germany|austria|switzerland|scotland|england|wales|united kingdom|the uk|uk|iceland|norway|sweden|denmark|finland|netherlands|holland|belgium|croatia|czech republic|czechia|poland|hungary|egypt|morocco|south africa|kenya|tanzania|israel|jordan|dubai|uae|india|thailand|vietnam|japan|south korea|korea|china|singapore|bali|indonesia|philippines|australia|new zealand|fiji|tahiti|bora bora|costa rica|belize|panama|colombia|peru|machu picchu|brazil|argentina|patagonia|ecuador|galapagos|the galapagos|bahamas|the bahamas|jamaica|aruba|curacao|bonaire|barbados|st lucia|saint lucia|st thomas|st john|usvi|bvi|virgin islands|turks and caicos|turks & caicos|cayman islands|grand cayman|antigua|dominican republic|punta cana|puerto rico|cuba|bermuda|cozumel|cancun|tulum|playa del carmen|riviera maya|cabo|cabo san lucas|los cabos|puerto vallarta|mexico city|oaxaca|sayulita|isla mujeres|london|paris|rome|florence italy|venice|milan|amalfi|amalfi coast|lake como|tuscany|sicily|cinque terre|barcelona|madrid|seville|lisbon|porto|the algarve|athens|santorini|mykonos|crete|amsterdam|brussels|bruges|berlin|munich|vienna|prague|budapest|copenhagen|stockholm|oslo|reykjavik|dublin|galway|edinburgh|the highlands|scottish highlands|dubrovnik|split croatia|zurich|the alps|swiss alps|interlaken|lucerne|nice france|provence|the french riviera|normandy|bordeaux|tokyo|kyoto|osaka|seoul|bangkok|phuket|hanoi|singapore|hong kong|sydney australia|melbourne|great barrier reef|queenstown|marrakech|cairo|cape town|banff|jasper|lake louise|vancouver|victoria bc|toronto|montreal|quebec city|quebec|niagara falls|nova scotia|prince edward island|whistler|europe|asia|africa|south america|central america|the caribbean|caribbean|scandinavia|the mediterranean|mediterranean|the uk and ireland',\n      // US states and regions\n      'alabama|alaska|arizona|arkansas|california|colorado|connecticut|delaware|florida|hawaii|idaho|illinois|iowa|kansas|louisiana|maine|maryland|massachusetts|michigan|minnesota|mississippi|missouri|montana|nebraska|nevada|new hampshire|new jersey|new mexico|new york state|north carolina|north dakota|oklahoma|oregon|pennsylvania|rhode island|south carolina|south dakota|tennessee|texas|utah|vermont|virginia|washington state|west virginia|wisconsin|wyoming|new england|the pacific northwest|pacific northwest|the pnw|pnw|the outer banks|outer banks|obx|the keys|florida keys|the smokies|smokies|smoky mountains|the smoky mountains|great smoky mountains|blue ridge|blue ridge parkway|the blue ridge mountains|cape cod|martha\\'s vineyard|nantucket|the hamptons|the berkshires|the adirondacks|adirondacks|the catskills|finger lakes|upper peninsula|the upper peninsula|door county|lake michigan|lake tahoe|tahoe|lake geneva|lake of the ozarks|the ozarks|ozarks|napa|napa valley|sonoma|big sur|pch|highway 1|route 66|the gulf coast|gulf coast|emerald coast|30a|the panhandle|the poconos|poconos|the black hills|black hills|mount rushmore|mt rushmore|the grand tetons|jackson hole|sun valley|park city|vail|aspen|breckenridge|telluride|steamboat|steamboat springs|keystone colorado|estes park|moab|lake powell|monument valley|antelope canyon|horseshoe bend|death valley|joshua tree|palm springs|the everglades|everglades|hawaii big island|the big island|maui|oahu|kauai|honolulu|waikiki|alaska cruise|juneau|anchorage|denali',\n      // US cities and beach towns (not Cincinnati's own area)\n      'nashville|chicago|asheville|savannah|charleston|charleston sc|destin|gulf shores|orange beach|panama city beach|pcb|myrtle beach|hilton head|hilton head island|tybee|tybee island|key west|key largo|islamorada|marathon fl|disney world|walt disney world|disneyland|disney cruise|orlando|universal orlando|tampa|clearwater|clearwater beach|st pete|st petersburg|siesta key|sarasota|anna maria island|naples fl|naples florida|fort myers|sanibel|sanibel island|marco island|miami|miami beach|south beach|fort lauderdale|palm beach|daytona|daytona beach|st augustine|jacksonville|amelia island|new york|new york city|nyc|manhattan|brooklyn|boston|salem|portland maine|bar harbor|kennebunkport|newport ri|providence|philadelphia|philly|washington dc|dc|d c|baltimore|annapolis|pittsburgh|williamsburg|virginia beach|richmond va|outer banks nc|wilmington nc|raleigh|charlotte nc|greenville sc|atlanta|birmingham|new orleans|nola|memphis|chattanooga|knoxville|gatlinburg|pigeon forge|sevierville|townsend|sedona|scottsdale|phoenix|tucson|flagstaff|santa fe|taos|albuquerque|denver|boulder|colorado springs|salt lake city|las vegas|vegas|reno|san diego|los angeles|hollywood|malibu|santa barbara|san francisco|sf|monterey|carmel|carmel by the sea|yosemite|sequoia|seattle|portland|portland oregon|bend oregon|austin|austin texas|san antonio|dallas|houston|fredericksburg|galveston|south padre|south padre island|minneapolis|milwaukee|madison wisconsin|detroit|traverse city|mackinac|mackinac island|holland michigan|grand rapids|saugatuck|south haven|put in bay|put-in-bay|kelley\\'s island|cleveland|columbus ohio|indianapolis|st louis|kansas city|branson|omaha|louisville|lexington ky|bourbon country|french lick|hot springs|eureka springs|savannah ga|jekyll island|st simons|st simons island|sea island|hilton head sc|beaufort|kiawah|kiawah island|folly beach|isle of palms|bald head island|ocracoke|nags head|kitty hawk|duck nc|corolla|chincoteague|ocean city|rehoboth|rehoboth beach|cape may|lake placid|niagara|branson mo|helen ga|blue ridge ga|boone nc|blowing rock|banner elk|highlands nc|cashiers nc|lake lure|chimney rock',\n      // national parks\n      'yellowstone national park|yellowstone np|grand canyon|grand canyon national park|zion|zion national park|bryce|bryce canyon|arches|arches national park|canyonlands|capitol reef|glacier|glacier national park|acadia|acadia national park|olympic national park|mount rainier|mt rainier|crater lake|redwoods|redwood national park|yosemite national park|grand teton|grand teton national park|rocky mountain national park|great sand dunes|mesa verde|badlands|the badlands|great smoky mountains national park|shenandoah|shenandoah national park|new river gorge|mammoth cave|mammoth cave national park|hot springs national park|big bend|carlsbad caverns|white sands|saguaro|petrified forest|joshua tree national park|death valley national park|sequoia national park|kings canyon|channel islands|haleakala|volcanoes national park|denali national park|glacier bay|kenai fjords|isle royale|voyageurs|indiana dunes|cuyahoga valley|congaree|biscayne|dry tortugas|everglades national park|virgin islands national park|national park|national parks|dollywood|anakeesta|ober mountain|ripley\\'s aquarium|disney springs|epcot|magic kingdom|hollywood studios|animal kingdom|universal studios|sea world|seaworld|lego land|legoland|cedar point|holiday world|zoombezi bay|the louvre|the met|central park|the smithsonian|the national mall|grand ole opry|the ryman|the parthenon|navy pier|millennium park|the bean|the field museum|shedd aquarium|busch gardens|busch gardens williamsburg|busch gardens tampa|six flags|kings dominion|carowinds|silver dollar city|disneyland paris|tokyo disney|great wolf lodge|kalahari|kalahari resort|the wizarding world of harry potter|wizarding world|houseboat|lake house|lake cabin|beach house|ski lodge|northern lights|the northern lights|aurora borealis|safari|african safari|machu picchu|great wall of china|the pyramids|eiffel tower|colosseum|stonehenge|niagara|the alps|fjords|norwegian fjords'\n    ].join('|'),\n    local: 'cincinnati|cincy|cinci|nky|northern kentucky|covington|newport|bellevue|dayton ky|fort thomas|ft thomas|fort mitchell|ft mitchell|fort wright|park hills|ludlow|erlanger|elsmere|florence|union|burlington|hebron|independence|edgewood|crestview hills|lakeside park|villa hills|crescent springs|highland heights|cold spring|alexandria|wilder|southgate|taylor mill|walton|richwood|petersburg|hyde park|oakley|mt lookout|mount lookout|over the rhine|otr|downtown|mainstrasse|the banks|clifton|northside|walnut hills|east walnut hills|mariemont|madeira|kenwood|blue ash|montgomery|mason|west chester|liberty township|loveland|milford|anderson|mt washington|norwood|pleasant ridge|kennedy heights|college hill|westwood|price hill|delhi|cheviot|harrison|fairfield|hamilton|lebanon|springboro|sharonville|evendale|reading|wyoming|glendale|indian hill|terrace park|newtown|batavia|amelia|eastgate|beechmont|columbia tusculum|east end|mt adams|mount adams|pendleton|corryville|avondale|bond hill|roselawn|silverton|deer park|kenwood mall|rookwood|florence mall|crestview|ft wright|madison|madison road|madison ave',\n    // bills by who sends them (\"duke energy\", \"spectrum\"): a reminder to pay\n    bill: 'duke energy|duke|spectrum|charter spectrum|at&t|att|at and t|verizon|t-mobile|tmobile|sprint|cricket|xfinity|comcast|cincinnati bell|altafiber|greater cincinnati water works|water works|gcww|sanitation district|sd1|nku water|northern kentucky water|nkwd|rumpke|waste management|republic services|cinergy|ohio valley electric|owen electric|kentucky power|aep|columbia gas|delta gas|progressive|geico|state farm|allstate|usaa|nationwide|liberty mutual|farmers insurance|erie insurance|travelers|sallie mae|navient|nelnet|mohela|aidvantage|great lakes|fedloan|student loan|student loans|car loan|car note|auto loan|mortgage|heloc|amex|american express|discover card|capital one|chase sapphire|chase card|citi card|synchrony|care credit|carecredit|affirm|klarna|afterpay|sezzle|upstart|sofi|lending club|ally|ally auto|toyota financial|honda financial|ford credit|hoa|hoa dues|hoa fee|property taxes|ring subscription|adt|simplisafe|apple card',\n    want: 'airpods|airpods pro|airpods max|kindle|kindle paperwhite|kindle scribe|ipad|ipad pro|ipad air|ipad mini|iphone|new iphone|macbook|macbook pro|macbook air|apple watch|apple watch ultra|apple tv|homepod|airtag|airtags|apple pencil|dyson|dyson airwrap|airwrap|dyson vacuum|dyson supersonic|shark flexstyle|stanley|stanley cup|stanley tumbler|yeti|yeti cooler|yeti tumbler|yeti rambler|owala|hydro flask|ninja creami|creami|ninja foodi|ninja air fryer|air fryer|instant pot|vitamix|kitchenaid|kitchenaid mixer|stand mixer|le creuset|dutch oven|staub|all clad|cast iron skillet|nespresso|nespresso machine|espresso machine|breville|keurig|ember mug|lululemon|lululemon belt bag|belt bag|align leggings|ugg|uggs|ugg slippers|ugg tasman|tasman slippers|north face|north face puffer|puffer jacket|patagonia|patagonia fleece|columbia jacket|carhartt|oura ring|oura|whoop|fitbit|garmin|garmin watch|apple fitness|peloton|treadmill|rowing machine|weighted blanket|heated blanket|heated vest|heated jacket|electric blanket|cozy earth|cozy earth sheets|brooklinen|parachute sheets|silk pillowcase|robot vacuum|roomba|robot mop|furbo|furbo camera|pet camera|dog camera|orthopedic dog bed|dog bed|dog beds|cat tree|solo stove|blackstone|blackstone griddle|traeger|traeger grill|pellet grill|smoker|big green egg|weber grill|new grill|fire pit|patio heater|pizza oven|ooni|ooni pizza oven|hot tub|sauna|massage chair|theragun|massage gun|hypervolt|ring light|tripod|camera lens|camera|new camera|mirrorless camera|canon camera|sony camera|gopro|polaroid|instax|drone|dji drone|standing desk|office chair|ergonomic chair|herman miller|second monitor|ultrawide monitor|mechanical keyboard|gaming chair|gaming pc|ps5|playstation|playstation 5|xbox|xbox series x|nintendo switch|switch 2|nintendo switch 2|steam deck|meta quest|vr headset|headphones|noise cancelling headphones|sony xm5|sony xm5s|xm5s|bose headphones|bose quietcomfort|beats|sonos|sonos speaker|bluetooth speaker|record player|turntable|vinyl|new tv|oled tv|65 inch tv|smart tv|e reader|ereader|lego set|lego|lego flowers|lego bouquet|lego flower bouquet|jellycat|squishmallow|squishmallows|barbie dreamhouse|american girl doll|hot wheels track|nerf|birkenstocks|birkenstock|on clouds|on cloud|on cloud sneakers|hokas|hoka|new balance|nike|jordans|air force 1s|sambas|adidas sambas|vejas|running shoes|new running shoes|sneakers|new sneakers|boots|cowboy boots|doc martens|blundstones|chelsea boots|new purse|purse|handbag|tote bag|coach bag|kate spade|michael kors|longchamp|marc jacobs tote|wallet|new wallet|watch|engraved watch|rolex|smart watch|necklace|earrings|bracelet|tennis bracelet|diamond studs|pearl earrings|perfume|cologne|robe|pajamas|matching pajamas|slippers|new mattress|mattress|tempur pedic|purple mattress|new couch|couch|sectional|recliner|patio furniture|outdoor furniture|patio set|new furniture|furniture|dining table|dining set|bookshelf|bookcase|dresser|nightstand|accent chair|area rug|floor lamp|bed frame|headboard|bike|ebike|e bike|electric bike|kayak|paddleboard|paddle board|golf clubs|new golf clubs|golf bag|rangefinder|telescope|binoculars|new phone|phone case|laptop|new laptop|chromebook|gift card|spa gift card|massage gift card|amazon gift card|subscription box|wine club|jewelry|ring|charm bracelet|pandora bracelet|scarf|cashmere sweater|sweater|new coat|winter coat|rain jacket|leggings|yoga mat|dumbbells|kettlebell|adjustable dumbbells|bowflex|cricut|cricut maker|sewing machine|embroidery machine|3d printer|label maker|air purifier|humidifier|diffuser|candle warmer|electric kettle|milk frother|coffee grinder|pour over|chemex|aeropress|wine fridge|beverage fridge|mini fridge|ice maker|nugget ice maker|stand up paddle board|camping gear|tent|hammock|eno hammock|backpack|carry on|carry on luggage|luggage|suitcase|away suitcase|duffel bag|ray bans|sunglasses|apple airpods|kitchen gadget|cuisinart|food processor|waffle maker|bread maker|slow cooker|crockpot|rice cooker|sous vide|toaster oven|smart lock|ring doorbell|video doorbell|security camera|nest thermostat|smart thermostat|echo dot|alexa|google home|smart display|digital frame|digital photo frame|aura frame|label printer'\n  };\n  var api = W;\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  root.dbkInboxWords = api;\n})(typeof window !== 'undefined' ? window : globalThis);\n","inbox-suggest.js":"/* 2daysbook inbox: where does a note belong? Plain word rules on this phone (nothing leaves it, nothing looked up, no\n   AI), plus what this household chose before: every time a note is sent somewhere, its words, its pairs of words and\n   the whole note are remembered with that place, so the next note like it is offered the same place first.\n   guess(text, opts) -> { best, ranked, score, title, titleFor(dest), date, time, freq, dow, items, known }\n     opts.dests   the places that are on in this copy (ids below); others are never offered\n     opts.tag     the note's tag, if any\n     opts.memory  { word | \"two words\" | \"#whole note\": { dest: count } } from learn()\n     opts.today   a Date (for \"Friday\", \"the 22nd\")\n   Place ids: event, reminder, grocery, hub (Back Burner), wrcontent, wrspark (Work),\n              list:shows-movies, list:restaurants, list:places, list:reading, list:wishlist, list:travel\n   How (Oct 27, \"Inbox needs to get smarter. Way smarter.\"): the note is read the way people type on a phone first\n   (tmrw, appt, w/, @, b4, pls, eod, weds, typos, emoji) without changing the words that go along; then its date and\n   time; then what the note starts with (call = a reminder, watch = TV and movies, try + a place to eat = Restaurants);\n   then the names it knows (inbox-words.js: restaurants, places to go, trips, things people wish for;\n   known-titles.js: books, shows, films; grocery-words.js through grocery-aisle.js: groceries); then the word rules\n   below; then what the household chose before (never more than a clear rule). Too little to go on = no guess.\n   Tests: functions/test/inbox-suggest.test.mjs, grocery-smart.test.mjs; score: node tools/inbox-score.mjs. */\n(function (root) {\n  var DAYS = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];\n  var MONTHS = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];\n  var MON = '(jan(?:uary)?|feb(?:ruary)?|mar(?:ch)?|apr(?:il)?|may|june?|july?|aug(?:ust)?|sept?(?:ember)?|oct(?:ober)?|nov(?:ember)?|dec(?:ember)?)\\\\.?';\n  var WD = '(sunday|monday|tuesday|wednesday|thursday|friday|saturday)';\n  var STOP = { the: 1, and: 1, for: 1, with: 1, that: 1, this: 1, from: 1, into: 1, our: 1, your: 1, their: 1, about: 1, some: 1, need: 1, have: 1, get: 1, got: 1, out: 1, off: 1, too: 1, just: 1, maybe: 1, also: 1, then: 1, them: 1, its: 1, was: 1, are: 1, will: 1, can: 1, not: 1, all: 1, any: 1, more: 1, new: 1, one: 1, two: 1, next: 1, at: 1, on: 1, in: 1, to: 1, of: 1, a: 1, an: 1, my: 1, me: 1, we: 1, us: 1, it: 1, is: 1, be: 1, do: 1, up: 1 };\n\n  // ---- how people type on a phone: each word as typed -> the word it means (the note's own words still go along) ----\n  var SHORT = {\n    tmrw: 'tomorrow', tmr: 'tomorrow', tmrrw: 'tomorrow', tmw: 'tomorrow', tmrow: 'tomorrow', '2morrow': 'tomorrow', '2moro': 'tomorrow', '2mrw': 'tomorrow', tomorow: 'tomorrow', tommorow: 'tomorrow', tommorrow: 'tomorrow', tomorro: 'tomorrow', tmorrow: 'tomorrow', tomm: 'tomorrow', tomo: 'tomorrow',\n    tonite: 'tonight', tnite: 'tonight', '2nite': 'tonight', '2night': 'tonight', tdy: 'today', tday: 'today',\n    mon: 'monday', mondy: 'monday', tue: 'tuesday', tues: 'tuesday', teus: 'tuesday', tuseday: 'tuesday', tuesdy: 'tuesday', wed: 'wednesday', weds: 'wednesday', wensday: 'wednesday', wendsday: 'wednesday', wednsday: 'wednesday', wedensday: 'wednesday', wednesay: 'wednesday', wedsday: 'wednesday',\n    thu: 'thursday', thur: 'thursday', thurs: 'thursday', thrus: 'thursday', thrusday: 'thursday', thursay: 'thursday', thursdy: 'thursday', fri: 'friday', firday: 'friday', fridy: 'friday', sat: 'saturday', saturaday: 'saturday', satuday: 'saturday', satur: 'saturday', sunady: 'sunday',\n    wknd: 'weekend', wkend: 'weekend', wkd: 'weekend', wk: 'week', wks: 'weeks', nxt: 'next', mos: 'months', mths: 'months', yr: 'year', yrs: 'years', hr: 'hour', hrs: 'hours',\n    appt: 'appointment', appts: 'appointments', apt: 'appointment', appointmnet: 'appointment', appoitment: 'appointment', apointment: 'appointment', appontment: 'appointment', appoinment: 'appointment', appointement: 'appointment',\n    mtg: 'meeting', mtgs: 'meetings', mtng: 'meeting', meetin: 'meeting', 'w/': 'with', w: 'with', 'w/o': 'without', wo: 'without', '@': 'at', b4: 'before', bfr: 'before', pls: 'please', plz: 'please', pleas: 'please',\n    bday: 'birthday', bdays: 'birthdays', 'b-day': 'birthday', \"b'day\": 'birthday', birthdy: 'birthday', bdy: 'birthday', anniv: 'anniversary', anniversery: 'anniversary', aniversary: 'anniversary', xmas: 'christmas', 'x-mas': 'christmas', chrismas: 'christmas', christmass: 'christmas', thanksgivng: 'thanksgiving', halloweeen: 'halloween', haloween: 'halloween',\n    dr: 'doctor', 'dr.': 'doctor', drs: 'doctors', doc: 'doctor', docs: 'doctors', docter: 'doctor', doctr: 'doctor', dentest: 'dentist', rx: 'prescription', presciption: 'prescription', perscription: 'prescription', prescripton: 'prescription', prescrip: 'prescription', meds: 'meds',\n    pmt: 'payment', pymt: 'payment', pymnt: 'payment', payement: 'payment', eod: 'end of day', eow: 'end of week', eom: 'end of month', eoy: 'end of year',\n    txt: 'text', msg: 'message', vm: 'voicemail', fb: 'facebook', ig: 'instagram', insta: 'instagram', yt: 'youtube', biz: 'business', acct: 'account', ppl: 'people', abt: 'about', convo: 'conversation', hw: 'homework', bc: 'because', 'b/c': 'because', u: 'you', ur: 'your', thru: 'through',\n    recieve: 'receive', remeber: 'remember', rember: 'remember', remmber: 'remember', schedual: 'schedule', shedule: 'schedule', scedule: 'schedule', schedul: 'schedule', resturant: 'restaurant', restaraunt: 'restaurant', resteraunt: 'restaurant', restraunt: 'restaurant',\n    groceris: 'groceries', grocerys: 'groceries', grocieries: 'groceries', electic: 'electric', elec: 'electric', renw: 'renew', vaccum: 'vacuum', vacume: 'vacuum', vaccuum: 'vacuum', laundary: 'laundry', insurence: 'insurance', insurace: 'insurance', ins: 'insurance', registation: 'registration', calender: 'calendar',\n    tickts: 'tickets', tix: 'tickets', reservaton: 'reservation', resevation: 'reservation', rezzy: 'reservation', res: 'reservation', movei: 'movie', moive: 'movie', seaon: 'season', sesaon: 'season', epsiode: 'episode', wathc: 'watch', whatch: 'watch', cll: 'call', emial: 'email', emali: 'email', 'e-mail': 'email',\n    wit: 'with', wth: 'with', pickup: 'pick up', dropoff: 'drop off', 'drop-off': 'drop off', 'pick-up': 'pick up', followup: 'follow up', 'follow-up': 'follow up', signup: 'sign up', checkup: 'checkup', 'check-up': 'checkup', haircut: 'haircut',\n    chiken: 'chicken', bannanas: 'bananas', bananna: 'banana', banannas: 'bananas', avacado: 'avocado', avacados: 'avocados', avocadoes: 'avocados', brocoli: 'broccoli', brocolli: 'broccoli', tomatos: 'tomatoes', potatos: 'potatoes', ceral: 'cereal', mlik: 'milk', yougurt: 'yogurt', yogart: 'yogurt', yoghurt: 'yogurt', lettice: 'lettuce', cheeze: 'cheese',\n    choclate: 'chocolate', chocolat: 'chocolate', spinich: 'spinach', jalepeno: 'jalapeno', jalepenos: 'jalapenos', jalapeno: 'jalapeno', zuchini: 'zucchini', zuchinni: 'zucchini', parmesean: 'parmesan', mozarella: 'mozzarella', mozzerella: 'mozzarella', sandwhich: 'sandwich', vegtables: 'vegetables', veggies: 'veggies', sause: 'sauce',\n    detergant: 'detergent', deoderant: 'deodorant', towles: 'towels', tolet: 'toilet', tp: 'toilet paper', pt: 'pt', oj: 'orange juice', pb: 'peanut butter', evoo: 'olive oil', '&': 'and', '+': 'and', n: 'and', 'n\\'': 'and', thx: 'thanks', ty: 'thanks', asap: 'asap', nye: \"new year's eve\", tgiving: 'thanksgiving', vday: \"valentine's day\", 'v-day': \"valentine's day\"\n  };\n  // a few things an emoji says (\"🎂 dad\" is a birthday, \"📞 dentist\" a call)\n  var EMOJI = { '🎂': 'birthday', '🎉': 'party', '🥳': 'party', '🎁': 'gift', '🦷': 'dentist', '📚': 'book', '📖': 'book', '🎬': 'movie', '🍿': 'movie', '📺': 'show', '✈': 'trip', '🏖': 'beach trip', '🏝': 'beach trip', '🗺': 'trip', '🛒': 'groceries', '💡': 'idea', '📞': 'call', '☎': 'call', '📱': 'text', '💊': 'meds', '🎃': 'halloween', '🎄': 'christmas', '🦃': 'thanksgiving', '💸': 'pay', '💵': 'pay', '📧': 'email', '✉': 'email', '📸': 'post', '🎥': 'video', '🍽': 'restaurant', '🏥': 'doctor', '🐾': 'pet', '🧹': 'clean', '🧺': 'laundry' };\n  var EMO_RE = /(?:[←-⇿⌀-⏿①-⓿■-➿⤀-⥿⬀-⯿〰〽㊗㊙️‍⃣]|\\uD83C[\\uDC00-\\uDFFF]|\\uD83D[\\uDC00-\\uDFFF]|\\uD83E[\\uDC00-\\uDFFF])+/g;\n\n  function pad(n) { return (n < 10 ? '0' : '') + n; }\n  function iso(d) { return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()); }\n  // jalapeño = jalapeno, café = cafe (Kasey, Oct 25: the ñ split \"jalapeños\" in two and nothing matched)\n  function fold(text) { var t = String(text || ''); try { t = t.normalize('NFD').replace(/[̀-ͯ]/g, ''); } catch (e) {} return t; }\n  function words(text) {\n    return fold(text).toLowerCase().replace(/[’']/g, '').split(/[^a-z0-9$]+/).filter(function (w) { return w.length > 2 && !STOP[w] && !/^\\d+$/.test(w); });\n  }\n  function esc(s) { return String(s).replace(/[.*+?^${}()|[\\]\\\\\\/]/g, '\\\\$&'); }\n\n  // the note read as words: each token as typed (`o`) and what it means (`c`, lower case); emoji become hint words\n  function read(text) {\n    var hints = [];\n    var s = String(text || '').replace(/[’‘]/g, \"'\").replace(/[“”]/g, '\"').replace(EMO_RE, function (e) {\n      for (var k in EMOJI) if (e.indexOf(k) !== -1) hints.push(EMOJI[k]);\n      return ' ';\n    });\n    s = s.replace(/(\\S)@/g, '$1 @').replace(/@(\\S)/g, '@ $1').replace(/\\bw\\/(?=[a-z])/gi, 'w/ ');\n    // \"fri-sun\", \"thurs-sun\": a run of days, the first one counts\n    s = s.replace(/\\b(mon|tues?|weds?|thu|thurs?|fri|sat|sun)(day)?\\s*[-–]\\s*(mon|tues?|weds?|thu|thurs?|fri|sat|sun)(day)?\\b/gi, '$1$2');\n    var toks = [], parts = s.split(/\\s+/).filter(Boolean);\n    parts.forEach(function (o, i) {\n      var core = fold(o).toLowerCase().replace(/^[(\"'\\[<*_~]+/, '').replace(/[)\"'\\]>.,!?;:*_~]+$/, '');\n      if (/^(dr|st|mt|ft|mr|mrs|ms|jr)\\.$/i.test(o)) core = o.toLowerCase().replace(/\\.$/, '');\n      var c = SHORT.hasOwnProperty(core) ? SHORT[core] : core;\n      if (core === 'dr.' || core === 'dr') c = 'doctor';\n      if (core === 'cal' && i === 0) c = 'call';\n      // \"sun\" is Sunday, unless it's the sun (\"sun hat\", \"sun screen\")\n      if (core === 'sun' && !/^(screen|hat|hats|glasses|dress|tea|roof|porch|room|block|lamp|chips|shade)/.test((parts[i + 1] || '').toLowerCase())) c = 'sunday';\n      // \"res\" only as a reservation after a meal or with a time (\"dinner res\")\n      if (core === 'res' && !/^(at|for)$/.test((parts[i + 1] || '').toLowerCase())) c = 'res';\n      if (core === 'n' && !(i > 0 && i < parts.length - 1)) c = 'n';\n      if (core === 'w' && !(i > 0 && i < parts.length - 1)) c = 'w';\n      toks.push({ o: o, c: c, core: core, punct: /[,;:]$/.test(o) });\n    });\n    var c = '', at = [];\n    var all = hints.map(function (h) { return { o: '', c: h, hint: true }; }).concat(toks);\n    all.forEach(function (t) { at.push(c.length + (c ? 1 : 0)); c += (c ? ' ' : '') + t.c; });\n    return { toks: all, c: c, at: at, hints: hints.length, text: s };\n  }\n\n  // ---- the date and time written in a note (and which words said it, so a title can leave them out) ----\n  var NUMW = { one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9, ten: 10, eleven: 11, twelve: 12, a: 1, an: 1, couple: 2, few: 3 };\n  function when(text, today, R) {\n    R = R || read(text);\n    today = today ? new Date(today.getTime()) : new Date(); today.setHours(12, 0, 0, 0);\n    var c = ' ' + R.c + ' ', date = null, time = null, used = {}, m, monthOnly = false, holidayHit = false, deadline = false;\n    var add = function (n) { var d = new Date(today.getTime()); d.setDate(d.getDate() + n); return d; };\n    // mark the words (by their place in c) a match used\n    var use = function (from, to) {\n      from -= 1; to -= 1;   // c has a leading space\n      for (var i = 0; i < R.toks.length; i++) { var s = R.at[i], e = s + R.toks[i].c.length; if (e > from && s < to) used[i] = 1; }\n    };\n    var hit = function (re) { re.lastIndex = 0; var x = re.exec(c); if (x) use(x.index + (x[0].charAt(0) === ' ' ? 1 : 0), x.index + x[0].length); return x; };\n    var dayOf = function (name) { return DAYS.indexOf(name); };\n    var comp = / (black friday|cyber monday|small business saturday|good friday)(?= )/.exec(c);\n    if (comp) { var h0 = holiday(c, today); if (h0 && !h0.thing) { date = h0.date; holidayHit = h0.word; } }\n    if (date) { /* a holiday named after a weekday */ }\n    else if ((m = hit(/ (today|tonight|this evening|this afternoon|this morning|end of day|by tonight)(?= )/))) date = today;\n    else if ((m = hit(/ (the )?day after tomorrow(?= )/))) date = add(2);\n    else if ((m = hit(/ tomorrow( morning| afternoon| evening| night)?(?= )/))) date = add(1);\n    // a date written out beats the weekday beside it (\"sat nov 14\", \"Saturday the 14th\"): the weekday word just goes with it\n    else if (new RegExp(' ' + MON + ' \\\\d{1,2}(st|nd|rd|th)?(?= )| \\\\d{1,2}(st|nd|rd|th)? of ' + MON + '(?= )| ' + WD + ',? the \\\\d{1,2}(st|nd|rd|th)(?= )| ' + WD + ',? \\\\d{1,2}\\\\/\\\\d{1,2}(?= )| \\\\d{1,2}\\\\/\\\\d{1,2} ' + WD + '(?= )').test(c)) { hit(new RegExp(' ' + WD + '(?=,? )')); }\n    else if ((m = hit(new RegExp(' (next |this |on |this coming )?' + WD + '( morning| afternoon| evening| night|s)?(?= )')))) {\n      var wd = dayOf(m[2]);\n      // \"next Friday\" is the Friday of next week (Sunday to Saturday); \"Friday\" and \"this Friday\" the coming one, a week\n      // on when it's today (\"call mom Monday\" on a Monday)\n      if (m[2] && m[3] === 's') { date = null; }   // \"mondays\": how often, not a day\n      else {\n        var diff = m[1] === 'next ' ? 7 - today.getDay() + wd : (wd - today.getDay() + 7) % 7;\n        if (diff === 0 && m[1] !== 'this ') diff = 7;\n        date = add(diff);\n      }\n    }\n    if (!date && !/ (website|site|logo|built|done|made|launched|ready|room|kitchen) in (a|an|one) (day|week|weekend)/.test(c) && (m = hit(/ in (a|an|one|two|three|four|five|six|seven|eight|nine|ten|a couple( of)?|a few|\\d{1,2}) (days?|weeks?|months?)(?= )/))) {\n      var nn = NUMW[m[1].replace(/^a /, '').replace(/ of$/, '')] || +m[1] || 1, unit = m[3].charAt(0);\n      if (unit === 'd') date = add(nn); else if (unit === 'w') date = add(nn * 7); else { var mm = today.getMonth() + nn; date = new Date(today.getFullYear(), mm, Math.min(today.getDate(), new Date(today.getFullYear(), mm + 1, 0).getDate()), 12); }   // Jan 31 + a month is Feb 28, not Mar 3\n    }\n    if (!date && (m = hit(/ (a|one|two|three|\\d) (days?|weeks?) from (now|today)(?= )/))) { var n2 = NUMW[m[1]] || +m[1]; date = add(m[2].charAt(0) === 'd' ? n2 : n2 * 7); }\n    // \"this weekend\", \"on the weekend\" (not \"chicago weekend\", \"thanksgiving weekend\", \"weekend in louisville\")\n    if (!date && (m = / (this |next |the |on the |over the |for the |by the |until the )?weekend(?= )(?! (getaway|getaways|trip|trips|away|plans|ideas|bag|vibes|project|warrior|in|at))/.exec(c)) && !/ every weekend /.test(c) && (m[1] || / (rake|mow|clean|do|paint|finish|fix|wash|plant|build|organize)\\b/.test(c) && !/ \\w+ weekend /.test(c.replace(/ (the|this|next) weekend /, ' '))) && m[1] !== 'the ') {\n      hit(new RegExp(esc(m[0]))); date = add((6 - today.getDay() + 7) % 7 + (m[1] === 'next ' ? 7 : 0)); }\n    if (!date && (m = hit(/ next week(?= )/))) { date = add(8 - (today.getDay() || 7)); monthOnly = true; }\n    if (!date && (m = hit(/ (by )?(the )?end of (the )?week(?= )/))) { date = add((5 - today.getDay() + 7) % 7); }\n    if (!date && (m = hit(/ (by )?(the )?end of (the )?month(?= )/))) { date = new Date(today.getFullYear(), today.getMonth() + 1, 0, 12); }\n    if (!date && (m = hit(/ next month(?= )/))) { date = new Date(today.getFullYear(), today.getMonth() + 1, 1, 12); monthOnly = true; }\n    // the Fourth of July is a holiday's name: it stays in a calendar title\n    if (!date && / (the )?(4th|fourth) of july | july (4th|4|fourth) /.test(c)) { date = monthDay(today, 6, 4); holidayHit = 'july 4'; }\n    if (!date && !/ (4th|fourth) of july | july (4th|4|fourth) /.test(c) && (m = hit(new RegExp(' ' + MON + ' (\\\\d{1,2})(st|nd|rd|th)?(?:-\\\\d{1,2}(?:st|nd|rd|th)?)?(,? (20\\\\d\\\\d))?(?= )')))) {\n      date = m[4] ? new Date(+m[4], MONTHS.indexOf(m[1].slice(0, 3)), +m[2], 12) : monthDay(today, MONTHS.indexOf(m[1].slice(0, 3)), +m[2]);\n    } else if (!date && !/ (4th|fourth) of july /.test(c) && (m = hit(new RegExp(' (the )?(\\\\d{1,2})(st|nd|rd|th)? (of )?' + MON + '(?= )')))) {\n      date = monthDay(today, MONTHS.indexOf(m[5].slice(0, 3)), +m[2]);\n    } else if (!date && (m = hit(/ (\\d{1,2})\\/(\\d{1,2})(?:\\/(\\d{2,4}))?(?= )/))) {\n      var mo = +m[1] - 1, dy = +m[2];\n      if (mo >= 0 && mo < 12 && dy >= 1 && dy <= 31) date = m[3] ? new Date(+(m[3].length === 2 ? '20' + m[3] : m[3]), mo, dy, 12) : monthDay(today, mo, dy);\n    } else if (!date && !/\\$/.test(c) && (m = hit(/ (1[0-2]|0?[1-9])\\.([0-2]?\\d|3[01])(?= )/))) {\n      date = monthDay(today, +m[1] - 1, +m[2]);\n    } else if (!date && (m = hit(new RegExp(' (in|by|this|next|early|late|mid-?|before|until|starting|in early|in late|in mid-?|end of) ' + MON + '(?= )')))) {\n      var mo2 = MONTHS.indexOf(m[2].slice(0, 3));\n      if (mo2 >= 0) { date = mo2 === today.getMonth() ? today : monthDay(today, mo2, 1); monthOnly = true; }\n    } else if (!date && (m = hit(new RegExp(' (?:(?:on |by |due )?the |(?:on|by|due) |' + WD + ',? the )(\\\\d{1,2})(st|nd|rd|th)(?= )')))) {\n      if (m[2] && !/^\\d/.test(m[1])) m = [m[0], m[2], m[3]];\n      // \"on the 22nd\", and the shorthand \"due 15th\", \"by 3rd\"\n      var day = +m[1];\n      // the next month that has that day: \"the 31st\" in November is Dec 31, not Dec 1 (Oct 24)\n      if (day >= 1 && day <= 31) { var d0 = null; for (var k = day < today.getDate() ? 1 : 0; k < 13 && !d0; k++) { var c0 = new Date(today.getFullYear(), today.getMonth() + k, day, 12); if (c0.getDate() === day) d0 = c0; } if (d0) date = d0; }\n      if (/^ due /.test(m[0]) || / due$/.test(c.slice(0, m.index))) { /* keep \"due\" in the title */ }\n    } else if (!date && !/ for (january|february|march|april|june|july|august|september|october|november|december) /.test(c) && (m = hit(new RegExp(' ' + MON + '(?= )'))) && /^(january|february|march|april|june|july|august|september|october|november|december)$/.test(m[1]) && R.toks.length <= 6) {\n      // a month on its own (\"renew registration march\")\n      var mo3 = MONTHS.indexOf(m[1].slice(0, 3)); date = mo3 === today.getMonth() ? today : monthDay(today, mo3, 1); monthOnly = true;\n    }\n    if (!date) {\n      var hol = holiday(c, today);\n      if (hol) {\n        // \"christmas gift ideas\", \"halloween costume\", \"thanksgiving groceries\": the holiday names a thing, not a day\n        if (!hol.thing && !date) { date = hol.date; holidayHit = hol.word; if (/^july/.test(hol.word)) hit(new RegExp(' ' + esc(hol.word) + '(?= )')); if (hol.before) { deadline = true; hit(new RegExp(' (before|by|for|until) ' + esc(hol.word) + '(?= )')); holidayHit = 'before'; } }\n      }\n    }\n    // ---- the time ----\n    var night = /\\b(dinner|supper|drinks|party|concert|show|game|night|tonight|evening|happy hour|date night|bar|movie|bunco|cards|poker|trivia|karaoke|gala|fundraiser|reception|hockey|basketball|bengals|reds|cyclones|haunt|comedy)\\b/.test(c);\n    var morn = /\\b(breakfast|brunch|morning|yoga|gym|workout|flight|drop off|drop|school|dentist|doctor|appointment|class|bloodwork|fasting|church|coffee|run|walk|groomer|grooming|daycare|meeting|standup|stand up|call|zoom|surgery|vet)\\b/.test(c);\n    var hour = function (h, mi, ap, ctx) {\n      h = +h; mi = +(mi || 0);\n      if (h > 23 || mi > 59) return null;\n      if (ap) { h = h % 12; if (ap === 'p') h += 12; }\n      else if (h >= 1 && h <= 12) {\n        if (/ in the morning| am /.test(ctx || '')) { if (h === 12) h = 0; }\n        else if (/ in the (evening|afternoon)| tonight | at night /.test(ctx || '')) { if (h < 12) h += 12; }\n        else if (h <= 6) h += 12;\n        else if (h === 7) { if (!morn || night) h += 12; }\n        // 8 to 11 is the morning unless the note says evening (\"dinner sat 8\", \"drinks at 9\"); a game or a fitting \"sat 11\" is the morning\n        else if (h <= 11 && /\\b(dinner|supper|drinks|party|concert|night|tonight|evening|bar|comedy|happy hour|date night|gala|reception|karaoke|trivia|bunco|poker|haunt|show at|movie at)\\b/.test(c) && !morn) h += 12;\n      }\n      return pad(h) + ':' + pad(mi);\n    };\n    if ((m = hit(/ (at |around |by |from |@ )?(\\d{1,2})(?::(\\d\\d))?\\s?(am|pm|a\\.m\\.|p\\.m\\.|a|p)(?= )/))) {\n      time = hour(m[2], m[3], m[4].charAt(0), c);\n    } else if ((m = hit(/ (at |by |until |till |before |after |from |around )?(noon|midnight)(?= )/)) && (m[1] || date || /^ (noon|midnight) $/.test(c))) {\n      time = m[2] === 'noon' ? '12:00' : '00:00';\n    } else if ((m = hit(/ (at |@ |around |by |from |starting at )?(\\d{1,2}):(\\d\\d)( ?(?:-|to|–) ?\\d{1,2}(?::\\d\\d)?)?( in the (?:morning|evening|afternoon))?(?= )/))) {\n      time = hour(m[2], m[3], null, ' ' + (m[5] || '') + ' ' + c);\n    } else if ((m = hit(/ (at |@ |around |starting at |by )(\\d{1,2})( ?ish| o'?clock)?( in the (?:morning|evening|afternoon))?(?= )(?! (st|nd|rd|th|days?|weeks?|months?|years?|min|mins|minutes?|hours?|hrs?|people|kids|items?|stores?|places?|things?|of|percent|pm|am)\\b)/)) && !/^ at \\d{1,2} (\\/|:)/.test(m[0])) {\n      time = hour(m[2], 0, null, ' ' + (m[4] || '') + ' ' + c);\n    } else if ((m = hit(/ (between |from )?(\\d{1,2})(?::(\\d\\d))? ?(?:-|to|–) ?(\\d{1,2})(?::\\d\\d)?( ?(?:am|pm))?(?= )/)) && +m[2] <= 12 && +m[4] <= 12 && (date || m[1]) && !/\\//.test(m[0])) {\n      // \"sat 1-3\", \"between 8-12\": from the first hour (\"8-12\" ends at noon, so 8 is the morning)\n      var a = +m[2], b = +m[4], ap0 = m[5] ? m[5].trim().charAt(0) : null;\n      if (ap0) time = hour(a, m[3], a > b && ap0 === 'p' ? 'a' : ap0, c);\n      else if (b === 12 && a >= 7) time = pad(a) + ':' + pad(+(m[3] || 0));\n      else time = hour(a, m[3], null, c);\n    } else if ((m = hit(/ (\\d{1,2})( ?ish| o'?clock)(?= )/))) {\n      time = hour(m[1], 0, null, c);\n    } else if (date && (m = hit(new RegExp(' (' + 'today|tonight|tomorrow|' + WD.slice(1, -1) + ')( morning| afternoon| evening| night)? (\\\\d{1,2})(?= )(?! (st|nd|rd|th|days?|weeks?|months?|years?|min|mins|minutes?|hours?|hrs?|people|kids|items?|lbs?|pounds?|stores?|of)\\\\b)')))) {\n      // \"sat 7\", \"tmrw 9\", \"fri 7 dinner\": a bare hour right after the day\n      if (+m[3] >= 1 && +m[3] <= 12) time = hour(m[3], 0, null, ' ' + (m[2] || '') + ' ' + c);\n    } else if ((m = hit(/ (at )?(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)( thirty| fifteen| forty[- ]five| o'?clock)(?= )/)) || (m = hit(/ (at )(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)(?= )/))) {\n      var mins = !m[3] ? 0 : /thirty/.test(m[3]) ? 30 : /fifteen/.test(m[3]) ? 15 : /forty/.test(m[3]) ? 45 : 0;\n      time = hour(NUMW[m[2]], mins, null, c);\n    }\n    // \"in the morning\" after the time, \"this week\": words that said when\n    hit(/ in the (morning|evening|afternoon)(?= )/);\n    if (!date) hit(/ (this week|later this week|sometime this week)(?= )/);\n    // \"every Tuesday\", \"monthly\": how often a reminder comes back (the reminder form's choices), and those words\n    var freq = null, dow = null, rm = null, fre = function (re) { re.lastIndex = 0; var x = re.exec(c); return x; };\n    if ((rm = fre(new RegExp(' (every|each|on) ' + WD + 's?(?= )'))) && (rm[1] !== 'on' || / (every|each) /.test(c) || /days?s /.test(rm[0] + ' '))) { freq = 'weekly'; dow = dayOf(rm[2]); if (rm[1] === 'on' && !/s$/.test(rm[0])) { rm = null; freq = null; dow = null; } }\n    if (!freq && (rm = fre(/ (every|each) (3|three) months| quarterly(?! (taxes|tax|estimated|report|review|meeting|payments?|filing|newsletter|goals|check-in|business))/))) freq = 'quarterly';\n    else if (!freq && (rm = fre(/ (every|each) (6|six) months| twice a year/))) freq = 'twice';\n    else if (!freq && (rm = fre(/ (every|each|once a) week| weekly(?![ -][a-z]+)/))) { freq = 'weekly'; dow = (date || today).getDay(); }\n    else if (!freq && (rm = fre(/ (every|each|once a) month| monthly(?![ -][a-z]+)/))) freq = 'monthly';\n    else if (!freq && (rm = fre(/ (every|each|once a) year| yearly| annually/))) freq = 'yearly';\n    if (rm) { use(rm.index + 1, rm.index + rm[0].length); if (freq === 'weekly' && rm[2] && date && date.getDay() === dow && !/ next /.test(c)) { /* the day said how often */ } }\n    // a connector just before what was used goes with it (\"on\", \"at\", \"by\", \"this\"…)\n    var CONN = { on: 1, at: 1, by: 1, this: 1, next: 1, around: 1, for: 1, from: 1, starting: 1, until: 1, till: 1, between: 1, before: 1, '-': 1, '–': 1 };\n    for (var i = R.toks.length - 1; i > 0; i--) if (used[i] && !used[i - 1] && CONN[R.toks[i - 1].c] && R.toks[i - 1].c !== 'for' && !(R.toks[i - 1].c === 'before' && !deadline && !monthOnly && !date)) used[i - 1] = 1;\n    // \"due\" stays (\"water bill due 11/5\"); a holiday's name stays in a calendar title, but \"before Thanksgiving\" goes from a to-do's\n    var usedWords = [];\n    for (var j = 0; j < R.toks.length; j++) if (used[j] && R.toks[j].o) usedWords.push(R.toks[j].o);\n    return { date: date ? iso(date) : null, time: time, used: usedWords, usedIdx: used, monthOnly: monthOnly, holiday: !!holidayHit && holidayHit !== 'before', deadline: deadline, freq: freq, dow: dow };\n  }\n  // the holidays people write instead of a date (US)\n  function nthWeekday(y, mo, wd, n) {\n    if (n > 0) { var d = new Date(y, mo, 1, 12); return new Date(y, mo, 1 + (wd - d.getDay() + 7) % 7 + (n - 1) * 7, 12); }\n    var e = new Date(y, mo + 1, 0, 12); return new Date(y, mo, e.getDate() - ((e.getDay() - wd + 7) % 7), 12);\n  }\n  function easter(y) { var a = y % 19, b = Math.floor(y / 100), c = y % 100, d = Math.floor(b / 4), e = b % 4, f = Math.floor((b + 8) / 25), g = Math.floor((b - f + 1) / 3), h = (19 * a + b - d - g + 15) % 30, i = Math.floor(c / 4), k = c % 4, l = (32 + 2 * e + 2 * i - h - k) % 7, mm = Math.floor((a + 11 * h + 22 * l) / 451), mo = Math.floor((h + l - 7 * mm + 114) / 31), dy = ((h + l - 7 * mm + 114) % 31) + 1; return new Date(y, mo - 1, dy, 12); }\n  var HOLIDAYS = [\n    [/ new year'?s eve /, function (y) { return new Date(y, 11, 31, 12); }],\n    [/ new year'?s( day)? /, function (y) { return new Date(y, 0, 1, 12); }],\n    [/ (mlk|martin luther king)( jr\\.?)? day /, function (y) { return nthWeekday(y, 0, 1, 3); }],\n    [/ valentine'?s( day)? | valentines /, function (y) { return new Date(y, 1, 14, 12); }],\n    [/ (presidents'?|president's) day /, function (y) { return nthWeekday(y, 1, 1, 3); }],\n    [/ st\\.? patrick'?s( day)? | st\\.? patty'?s /, function (y) { return new Date(y, 2, 17, 12); }],\n    [/ easter /, easter],\n    [/ tax day /, function (y) { return new Date(y, 3, 15, 12); }],\n    [/ cinco de mayo /, function (y) { return new Date(y, 4, 5, 12); }],\n    [/ mother'?s day | mothers day /, function (y) { return nthWeekday(y, 4, 0, 2); }],\n    [/ memorial day /, function (y) { return nthWeekday(y, 4, 1, -1); }],\n    [/ father'?s day | fathers day /, function (y) { return nthWeekday(y, 5, 0, 3); }],\n    [/ juneteenth /, function (y) { return new Date(y, 5, 19, 12); }],\n    [/ super ?bowl /, function (y) { return nthWeekday(y, 1, 0, 2); }],\n    [/ (fourth|4th) of july | july (4th|4|fourth) | independence day /, function (y) { return new Date(y, 6, 4, 12); }],\n    [/ labor day /, function (y) { return nthWeekday(y, 8, 1, 1); }],\n    [/ halloween /, function (y) { return new Date(y, 9, 31, 12); }],\n    [/ election day /, function (y) { var d = nthWeekday(y, 10, 1, 1); d.setDate(d.getDate() + 1); return d; }],\n    [/ veterans'? day /, function (y) { return new Date(y, 10, 11, 12); }],\n    [/ thanksgiving | friendsgiving /, function (y) { return nthWeekday(y, 10, 4, 4); }],\n    [/ black friday /, function (y) { var d = nthWeekday(y, 10, 4, 4); d.setDate(d.getDate() + 1); return d; }],\n    [/ small business saturday /, function (y) { var d = nthWeekday(y, 10, 4, 4); d.setDate(d.getDate() + 2); return d; }],\n    [/ cyber monday /, function (y) { var d = nthWeekday(y, 10, 4, 4); d.setDate(d.getDate() + 4); return d; }],\n    [/ christmas eve /, function (y) { return new Date(y, 11, 24, 12); }],\n    [/ christmas /, function (y) { return new Date(y, 11, 25, 12); }]\n  ];\n  // a holiday that names a thing (\"christmas gift ideas\", \"halloween costume\", \"thanksgiving grocery list\")\n  var HOLI_THING = /^(checks?|money|cash|bonus|bonuses|tips?|market|markets|village|display|train|light show|lights show|break|playlist|cards?|gifts?|presents?|lists?|ideas?|cards?|candy|costumes?|decorations?|decor|decorating|lights|tree|trees|shopping|movies?|music|songs|playlist|pajamas|pjs|sweaters?|recipes?|menu|cookies|groceries|grocery|food|outfits?|stuff|things|crafts?|wreath|shirts?|stockings?|stocking|baking|pictures|photos?|break|budget|wrapping|wrap|plans?|theme|themed|treats|bags|buckets?|dinner menu|sides|dishes|pie|pies|bread|turkey|ham|wine|card)$/;\n  function holiday(c, today) {\n    for (var i = 0; i < HOLIDAYS.length; i++) {\n      var re = HOLIDAYS[i][0]; re.lastIndex = 0; var m = re.exec(c); if (!m) continue;\n      var d = HOLIDAYS[i][1](today.getFullYear());\n      if (d < new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0)) d = HOLIDAYS[i][1](today.getFullYear() + 1);\n      var word = m[0].trim(), after = c.slice(m.index + m[0].length).split(' ')[0] || '', before = c.slice(0, m.index).trim().split(' ').pop();\n      var thing = HOLI_THING.test(after) && !/^(dinner|party)$/.test(after) || /^(for|my|our|your|his|her|their)$/.test(before) && HOLI_THING.test(after);\n      if (/^(black friday|cyber monday|small business saturday)$/.test(word) && /^(shopping|sale|sales|deals?)$/.test(after)) thing = false;\n      if (before === 'for' || before === 'over' || before === 'during') thing = true;\n      return { date: d, word: word, thing: thing, before: /^(before|by|until)$/.test(before) };\n    }\n    return null;\n  }\n  function monthDay(today, mo, dy) {\n    var d = new Date(today.getFullYear(), mo, dy, 12);\n    if (d.getMonth() !== mo) return null;\n    if (d < new Date(today.getFullYear(), today.getMonth(), today.getDate(), 0)) d = new Date(today.getFullYear() + 1, mo, dy, 12);\n    return d;\n  }\n\n  function cap(s) { s = String(s || '').trim(); return s.charAt(0).toUpperCase() + s.slice(1); }\n  function tidy(s) { return cap(String(s || '').replace(/([^.\\s]{3,})\\.\\s*$/, '$1').replace(/\\s{2,}/g, ' ').replace(/\\s+([,.;:!?])/g, '$1').replace(/^[\\s,.;:–—\\-|]+|[\\s,;:–—\\-|]+$/g, '').replace(/^[\\s,.;:–—\\-|]+/, '')); }\n  // proper case for a name the note typed all in small letters (\"skyline chili\" -> \"Skyline Chili\")\n  function proper(s) {\n    if (/[A-Z]/.test(s)) return s;\n    return s.replace(/(^|[\\s\\-\\/(])([a-z])([a-z']*)/g, function (all, sp, a, rest, i) { var w = a + rest; return sp + (i > 0 && /^(of|the|and|in|on|at|a|an|for|to|by|de|la|du)$/.test(w) ? w : a.toUpperCase() + rest); });\n  }\n\n  // a dish to make (\"make chicken tikka masala\", \"bake banana bread\"), not \"make a dentist appointment\"\n  var DISH = /\\b(lasagna|chili|soup|stew|casserole|tacos?|curry|masala|pasta|pie|cake|cookies|brownies|bread|sourdough|enchiladas|stir fry|pizza|salad|risotto|meatloaf|meatballs|pot roast|roast|ribs|brisket|pulled pork|mac and cheese|muffins|pancakes|waffles|french toast|quiche|frittata|dumplings|ramen|pho|sushi|gumbo|jambalaya|pot pie|burgers|wings|fajitas|quesadillas|burritos|nachos|dip|jam|pickles|granola|smoothies?|cupcakes|cheesecake|fudge|candy|cinnamon rolls|biscuits|gravy|goetta|pasta|noodles|dinner|lunch|breakfast|dessert|meal|meals|recipe|recipes|chicken|beef|pork|turkey|salmon|shrimp|tofu|eggs?|cheese|cobbler|crisp|tart|scones|bagels|pretzels|tamales|empanadas|paella|bolognese|alfredo|carbonara|tikka|korma|biryani|teriyaki|bulgogi|bibimbap|pad thai|fried rice|egg rolls|wontons|chowder|bisque)\\b/;\n  function meal(head, gi) {\n    if (/\\brecipes?\\b/.test(head)) return true;\n    var obj = head.replace(/^(make|cook|bake|try making|try to make|learn to make|learn how to make|meal prep|prep|grill|smoke)\\s+/, '');\n    if (/^(a |an |the )?(appointment|appt|reservations?|payment|deposit|call|copies|copy|list|plan|budget|will|decision|choice|change|difference|time|room|space|bed|beds|sure|it|a point|friends|photo|photos|video|post|reel|website|logo)\\b/.test(obj)) return false;\n    if (DISH.test(obj)) return true;\n    var x = gi ? gi(obj) : null;\n    return !!(x && x.aisle && x.aisle !== 'Other' && x.cover >= 0.5);\n  }\n  // ---- what a note starts with ----\n\n  // words in front of the real start: \"hey remind me to\", \"i need to\", \"pls\", \"don't forget to\", \"maybe\", \"we should\"…\n  var LEAD = /^((hey|ok|okay|so|oh|um|uh|also|and|note|todo|to do|reminder|idea|thought|random thought|random idea|random|quick|please|pls|asap|urgent|important)[:\\-–,]?\\s+|(please\\s+)?(remind me|remember|don'?t forget|do not forget|dont forget|remind us|reminder)(\\s+(to|that|about|of))?\\s+|(i |we )?(really |still |also |def |definitely |probably |prob )?(need|needs|have|has|got|gotta|must|should|want|wanna|would like|'d like|'d love|would love|ought) (to )?(go |remember to |make sure to |try and |try to |start |)?|(can|could|would|will) (you|u)( please| pls| plz)? |(i |we )?(gotta|gonna|going to|will|can|could|might|may) |(let'?s|lets|maybe|possibly|someday|one day|eventually|sometime|soon|time to|make sure to|make sure|try to|try and)\\s+)+/;\n  var SAY = /^(?:[a-z]+(?: and [a-z]+)?|my (?:mom|dad|sister|brother|friend|boss|aunt|uncle|cousin|neighbor|coworker)|mom|dad)\\s+(?:said|says|recommended|recommends|suggested|suggests|mentioned|told me|told us|loves|swears by|raves about)\\s+(?:to\\s+|that\\s+|we should\\s+|i should\\s+|i'd love\\s+|you'd love\\s+)?/;\n  function startOf(R, w) {\n    // the meaning words without the date/time words, and without what's in front of the real start\n    var t = [], ti = [];\n    for (var i = 0; i < R.toks.length; i++) { if (w.usedIdx[i] || R.toks[i].hint) continue; t.push(R.toks[i].c); ti.push(i); }\n    var s = t.join(' ').replace(/[:\\-–]+(?= |$)/g, '').replace(/\\s+/g, ' ').trim();\n    var said = SAY.exec(s); if (said) s = s.slice(said[0].length);\n    var lead = LEAD.exec(s), had = '';\n    if (lead) { had = lead[0]; s = s.slice(lead[0].length); }\n    return { s: s.replace(/[.,!?;:]+$/, ''), lead: had, said: !!said };\n  }\n\n  // ---- the names the Inbox knows (inbox-words.js), as phrases of the note's own meaning words ----\n  var NAMES = null;\n  // the same meaning words read() gives, for a name in the list (quicker: no emoji, no punctuation tricks)\n  function canonPhrase(p) { return String(p).toLowerCase().split(/\\s+/).map(function (w) { var core = w.replace(/[.,!?;:]+$/, ''); return core === 'w' || core === 'sun' || core === 'res' ? core : core === 'n' ? 'and' : SHORT.hasOwnProperty(core) ? SHORT[core] : core; }).join(' ').replace(/['’.]/g, '').replace(/[^a-z0-9& +]/g, ' ').replace(/\\s+/g, ' ').trim(); }\n  function names() {\n    if (NAMES) return NAMES;\n    var W = root.dbkInboxWords || (typeof module !== 'undefined' && typeof require === 'function' ? (function () { try { return require('./inbox-words.js'); } catch (e) { return null; } })() : null);\n    var map = {}, show = {}, longest = 1;\n    if (W) ['local', 'want', 'bill', 'go', 'trip', 'place', 'rest'].forEach(function (k) {   // later kinds win a name in two lists\n      String(W[k] || '').split('|').forEach(function (p) { var key = canonPhrase(p); if (!key) return; map[key] = k; if (!show[key] || (/'/.test(p) && !/'/.test(show[key]))) show[key] = p; longest = Math.max(longest, key.split(' ').length); });\n    });\n    var out = { map: map, show: show, longest: longest };\n    if (W) NAMES = out;\n    return out;\n  }\n  // a known name as it's written (\"larosas\" -> \"LaRosa's\" is \"Larosa's\" here: the list keeps apostrophes, not capitals)\n  function displayName(key) { var N = names(); return N.show && N.show[key] ? N.show[key] : null; }\n  function plain(s) { return fold(s).toLowerCase().replace(/['’.]/g, '').replace(/[^a-z0-9& +]/g, ' ').replace(/\\s+/g, ' ').trim(); }\n  // every known name in the words: [{ k, kind, n (words), whole }]\n  function spot(s, N) {\n    var w = plain(s).split(' ').filter(Boolean), out = [], taken = {};\n    if (!w.length) return out;\n    var whole = w.join(' ');\n    if (N.map[whole]) return [{ k: whole, kind: N.map[whole], n: w.length, whole: true }];\n    for (var n = Math.min(N.longest, w.length); n >= 1; n--) {\n      for (var i = 0; i + n <= w.length; i++) {\n        var free = true; for (var j = i; j < i + n; j++) if (taken[j]) free = false;\n        if (!free) continue;\n        var k = w.slice(i, i + n).join(' ');\n        var k1 = N.map[k] ? k : /[^s]s$/.test(k) && N.map[k.slice(0, -1)] ? k.slice(0, -1) : null;\n        if (k1) { out.push({ k: k1, kind: N.map[k1], n: n, i: i, whole: n === w.length }); for (j = i; j < i + n; j++) taken[j] = 1; }\n\n      }\n    }\n    return out;\n  }\n\n  // single words people wish for that are ordinary words too (\"sweater\", \"boots\"): a weaker sign than a brand (\"owala\")\n  var GENERIC_WANT = /^(sweater|boots|purse|handbag|wallet|necklace|earrings|bracelet|perfume|cologne|robe|pajamas|slippers|mattress|couch|sectional|recliner|bike|kayak|paddleboard|telescope|binoculars|laptop|jewelry|ring|scarf|leggings|backpack|luggage|suitcase|sunglasses|tent|hammock|lego|nerf|vinyl|sneakers|smoker|alexa|headphones|treadmill|sauna|tripod|drone|crockpot|diffuser|humidifier|camera|tote bag|lululemon|nike|adidas|beats)$/;\n  // ---- the word rules (each: the place, how sure a match makes us, the words) ----\n  var RULES = [\n    // noon and midnight only as a time (\"at midnight\"); \"a better template than Midnight\" isn't one (Kasey, Oct 23)\n    ['event', 3, /\\b\\d{1,2}(:\\d\\d)?\\s?(am|pm|a\\.m\\.|p\\.m\\.)(?=\\W|$)|\\b(at|by|around|until|till|before|after|from) (noon|midnight)\\b|\\bat \\d{1,2}:\\d\\d\\b/],\n    ['event', 2, /\\b(appointment|appointments|party|meeting|wedding|shower|reunion|recital|graduation|game night|playdate|play date|reservation|rehearsal|ceremony|funeral|interview|conference|date night|girls night|guys night|movie night|double date|happy hour|bunco|book club|bible study|cookout|potluck|webinar|consult|consultation|photo shoot|photoshoot|open house|jury duty|court date|closing|surgery|watch party|trunk or treat|tree lighting|picture day|school pictures|field trip|early release|no school|meet and greet|meet & greet|discovery call|1:1|one on one|sync with|check-in call|coaching call|networking|gala|fundraiser|visitation|memorial service|baptism|christening|bar mitzvah|bat mitzvah|quinceanera|bachelorette|bachelor party|housewarming|retirement party|going away party)\\b/],\n    ['event', 2, /\\b(dinner|lunch|brunch|drinks|coffee|breakfast|happy hour|date) (with|at)\\b/],\n    // birthdays and anniversaries, however they're typed (\"bday\", \"b-day\", \"anniv\", \"turns 40\"): a day on the calendar\n    // (Kasey, Oct 23: Charlie's \"bday\" note got no suggestion at all)\n    ['event', 3, /\\b(birthdays?|birthday party|anniversary|turns \\d{1,3})\\b(?! (present|presents|gift|gifts|card|cards|cake|supplies|ideas?|candles?|balloons?|decorations?|banner|plates|napkins|hats?|goody bags|favors|wrapping paper|wrap|list|wishlist|shopping|money|stuff|things|supplies|idea|ideas)\\b)/],   // (\"birthday present for Ella\" is a thing to buy)\n    // shorthand people type: \"mtg\", \"appts\", \"dinner w/ Jess\", \"drinks @ 7\"\n    ['event', 2, /\\b(meetings|conf call|zoom call|zoom|teams call|facetime)\\b/],\n    ['reminder', 2, /\\b(prescription|payment|refill prescription)\\b/],\n    ['reminder', 2, /\\b(birthday|anniversary) (present|gift|card|cake)s?\\b/],\n    // a meal or drinks with someone on a day: the calendar (\"dinner tonite w/ Jess\")\n    ['event', 1.5, /\\b(dinner|lunch|brunch|drinks|coffee|breakfast)\\b.*\\bwith\\b/],\n    ['event', 1.5, /\\b(concert|show at|game at|flight|practice|game|lesson|class|tournament|meet|potluck|baby shower|bridal shower|open house|field trip|parent teacher|haircut|nails|massage|facial|pedicure|manicure|physical therapy|therapy|mammogram|bloodwork|blood work|labs|colonoscopy|ultrasound|dermatologist|orthodontist|chiropractor|optometrist|eye doctor|counseling|tutoring|recital|match|pickleball|golf|yoga|pilates|spin class|bootcamp|church|mass|shift|tee time|groomer|grooming|boarding|daycare|vet|vaccines|checkup|physical|dentist|doctor|ortho)\\b/],\n    ['reminder', 2, /\\b(remember to|remind me|reply to|respond to|sign up|follow up|make an? appointment|confirm|invoice|deadline|rsvp)\\b/],\n    // booking or buying something for later is a to-do (\"book flights\", \"buy tickets\"), not a book to read\n    ['reminder', 2.5, /^(book|reserve|order|buy|get|grab) (the |our |a |an |some )?([a-z']+ )?(flights?|hotel|airbnb|tickets?|rental car|car rental|campsite|table|tee time|appointment|passport|gift|present|cake|flowers|boarding|sitter|babysitter)\\b/],\n    // jobs around the house that come up again\n    ['reminder', 1.5, /^(change|replace|clean|wash|fix|water|feed|walk|mow|vacuum|sweep|mop|dust|take out|put out|empty|charge|update|back up|backup|defrost|descale|flip|rotate|check|test|winterize|service|rake|scoop|brush|bathe|clip|trim|unload|load|fold|iron)\\b/],\n    // (\"daily questions\", \"weekly planner\" name a thing, not how often)\n    ['reminder', 2, /\\b(every (day|morning|night|evening|week|weekday|weekend|month|year|other|sunday|monday|tuesday|wednesday|thursday|friday|saturday|\\d+ (days|weeks|months))|each (week|month|morning)|(weekly|monthly|daily|yearly|annually|biweekly|quarterly)(?![ -][a-z]+))\\b/],\n    ['reminder', 2, /\\b(bill|bills|due|rent|mortgage|insurance|taxes|tax return|registration|subscription|membership|dmv|bmv|prescription|flu shots?|vaccines?|booster|permission slip|license|passport|car payment|credit card|1099s?|w9|w-9|w-?2s?|estimated taxes|sales tax|property tax|tuition|daycare payment)\\b/],\n    // a prescription or a package is picked up, not bought\n    ['reminder', 2, /^(pick up|grab|get) (the |my |our |a |his |her )?(prescription|meds|medicine|package|parcel|dry cleaning|kids|dog|dogs|car|keys|mail|cake|order|refill|glasses|contacts|photos|prints|keys)\\b/],\n    ['reminder', 1.5, /\\$\\s?\\d/],\n    ['reminder', 3, /\\(?\\b\\d{3}\\)?[-. ]\\d{3}[-. ]\\d{4}\\b/],\n    ['reminder', 2, /\\b(books for|do the books|bookkeeping|mileage|receipts|invoices?|payroll|quickbooks|timesheet|expense report|quote for|estimate for|pickup order|order for pickup|curbside|vote|voting|ballot|pill|pills|meds|medicine|medication|heartworm|heartgard|flea|tick meds|nexgard|simparica|bravecto|apoquel|gabapentin|insulin|vitamins|dose|eye drops|clocks|daylight saving|daylight savings|deadline|ends|expires|expiring|renewal)\\b/],\n    ['reminder', 2, /\\b(christmas|holiday|birthday|back to school|halloween) shopping\\b/],\n    // the car's upkeep (\"oil change\", \"tire rotation\"): a to-do, never groceries (\"oil\")\n    ['reminder', 3, /\\b(oil change|change the oil|tire rotation|rotate the tires|tune-?up|car inspection|emissions test|emissions|inspection sticker|car wash|wiper blades|new tires|snow tires|alignment|smog check|state inspection|for the car|for the truck|car battery|cabin filter|brake pads|brakes checked)\\b/],\n    ['reminder', 2.5, /\\b(trash|recycling|garbage|bins|compost|yard waste) (goes|go|day|pickup|pick up|out|night)\\b|\\b(take|put|bring) (the )?(trash|recycling|garbage|bins|cans)\\b/],\n    ['grocery', 3, /\\b(groceries|grocery list|shopping list|we're out of|we are out of|out of|running low on|low on|almost out of|ran out of|add to (the )?(grocery|shopping) list|to the (grocery|shopping) list|to the list)\\b/],\n    ['grocery', 1, /^(buy|pick up|grab|get|need)\\b(?! to\\b)/, 'note'],\n    // \"need to approve…\", \"need to get us set up online\": something to do (Kasey, Oct 23: these were offered the grocery\n    // list). With no day it's for the Back Burner first, a reminder second; a day makes it a reminder (below)\n    ['hub', 2, /^(i |we )?(really )?(need|have|got) to \\w+/],\n    ['reminder', 1.5, /^(i |we )?(really )?(need|have|got) to \\w+/],\n    ['list:shows-movies', 3, /\\b(season \\d+|s\\d{1,2}|new season|next season|episode|episodes|tv show|tv series|series|documentary|docuseries|docu-series|movie|film|miniseries|mini series|on netflix|on hulu|on max|on hbo|on prime|on disney|on apple tv|on peacock|on paramount|on youtube tv|netflix|hulu|hbo max|apple tv|disney plus|disney\\+|peacock|paramount plus|prime video)\\b/],\n    ['list:shows-movies', 2, /^(watch|binge|rewatch|stream|re-watch)\\b/],\n    ['list:shows-movies', 2.5, /\\b(new show|that show|the show called|show called|sequel|prequel|trailer|part (two|three|2|3|ii|iii)|the movie|a movie|the film|limited series|sitcom|anime|k-?drama|rom-?com|horror movie|christmas movie|halloween movie|hallmark movie)\\b/],\n    ['list:restaurants', 3, /\\b(restaurant|restaurants|bistro|diner|steakhouse|trattoria|taqueria|pizzeria|brewery|brewpub|taproom|wine bar|cocktail bar|rooftop bar|speakeasy|sushi|ramen|pho|tacos?|bbq|barbecue|thai place|indian place|brunch spot|food truck|food hall|bakery|cafe|coffee shop|gastropub|oyster bar|tapas|dim sum|hibachi|hot pot|korean bbq|chili parlor|biergarten|beer garden|creamery|donut shop|ice cream shop|gelato)\\b/],\n    ['list:restaurants', 3, /\\b(brunch|lunch|dinner|breakfast|taco|pizza|sushi|burger|noodle|ramen|bbq|thai|indian|italian|mexican|chinese|korean|vietnamese|greek|mediterranean|seafood|oyster|bagel|donut|ice cream|dessert|steak|wings|wing|chicken|sandwich|deli|coffee|cocktail|wine|date night|dumpling|crepe|waffle|breakfast|vegan|vegetarian) (place|places|spot|spots|joint|truck|restaurant)\\b/],\n    ['list:restaurants', 1.5, /^(eat at|try\\b.*\\b(place|spot)|dinner at|lunch at|brunch at|breakfast at|drinks at)\\b/],\n    ['list:places', 2.5, /\\b(museum|gallery|park|hike|hikes|hiking|trail|trails|beach|zoo|aquarium|botanical|botanical gardens?|rose garden|beer garden|garden tour|farmers market|book sale|library sale|dinner cruise|riverboat|flea market|festival|fair|exhibit|planetarium|lake|waterfall|vineyard|winery|distillery|orchard|pumpkin patch|corn maze|apple picking|bookstore|escape room|mini golf|bowling|topgolf|axe throwing|trampoline park|haunted house|ice skating|light show|christmas lights|conservatory|observatory|nature center|state park|dog park|farm|amusement park|theme park|water park|arcade|go karts)\\b/],\n    ['list:places', 1, /^(go to|visit|check out|take the kids to|take the dogs to|take the dog to)\\b/],\n    ['list:reading', 3, /\\b(novel|memoir|audiobook|audio book|kindle|paperback|hardcover|the book|a book|book by|book called|book club pick|book rec|book recommendation|nonfiction|non-fiction|biography|autobiography|reading list|tbr|book about|book on)\\b/],\n    ['list:reading', 1.5, /\\bbook\\b/],\n    ['list:reading', 2.5, /^(read|reread|re-read|listen to)\\b/],\n    ['list:reading', 1.5, /\\bby [A-Z][a-z]+ [A-Z][a-z]+/],\n    // \"Book the cabin\" is a reservation to make, not a book to read (the designer, Oct 21)\n    ['list:reading', -4, /^book (a|an|the|our|my|us|it|tickets?|flights?|tables?|rooms?|seats?|hotel|airbnb|boarding|sitter|appointment|reservations?|campsite|cabin|vacation|trip|massage|hair|nails|grooming|dentist|vet|doctor|tee|haircut|flight|car|rental|tour)\\b/],\n    ['reminder', 2, /^book (a|an|the|our|my|us|it|tickets?|flights?|tables?|rooms?|seats?|hotel|airbnb|boarding|sitter|appointment|reservations?|campsite|cabin|vacation|trip|massage|hair|nails|grooming|dentist|vet|doctor|tee|haircut|flight|car|rental|tour)\\b|^book \\w+'s\\b/],\n    ['list:travel', 2.5, /\\b(cabin|airbnb|vrbo|resort|campsite|lodge|all inclusive|all-inclusive|cruise(?! on)|beach house|condo rental|road trip|ski trip|girls trip|guys trip|family trip|beach trip|staycation|weekend away)\\b/],\n    ['list:travel', 1.5, /\\b(hotel|flights?)\\b/],\n    ['list:wishlist', 2.5, /\\b(wishlist|wish list|i want|i'd love|would love|treat myself|on my list|christmas list|birthday list|xmas list|stocking stuffers?|stocking stuffer|secret santa|white elephant|gift ideas?|present ideas?|gift for|gifts for|present for|presents for|ideas for (his|her|their|my|mom|dad|charlie|kasey)|hinted at|has been wanting|been wanting|wants an? |wants (the|some|new)|wants [a-z]+ (pro|max|mini|air)\\b|splurge on)\\b/],\n    // \"I want a new Kindle\" is a thing to have, not a book to read\n    ['list:wishlist', 1.5, /^(i want|i'd love|would love|want) (a|an|the|some|new|one of those)\\b/],\n    // \"new running shoes\": a thing to get one day (Kasey, Oct 23)\n    ['list:wishlist', 1.5, /^(a )?new [a-z]+( [a-z]+)?$/],\n    // \"rewatch\", \"Gilmore Girls rewatch\": a show\n    ['list:shows-movies', 2.5, /\\b(rewatch|re-watch|binge)\\b/],\n    // \"Nashville weekend\", \"Asheville trip\": somewhere to go (a place name, then the trip)\n    ['list:travel', 2.5, /\\b[A-Z][a-z]+(?: [A-Z][a-z]+)? (weekend|trip|getaway|vacation)\\b/],\n    // tickets are bought: a to-do; a show on Broadway or a musical is somewhere to go\n    ['reminder', 1.5, /\\btickets?\\b/],\n    ['list:places', 2, /\\b(broadway|musical|off-broadway|the symphony|the ballet|the opera|the playhouse|comedy club|comedy show)\\b/],\n    ['list:travel', 1.5, /\\btrip\\b(?! to the (store|bank|post office|vet|dmv))/],\n    ['list:places', 2.5, /\\b(pickleball|climbing|bouldering|bowling|golf|trampoline|axe throwing|escape room|arcade|skating|roller skating|ice skating|go kart|laser tag|paint and sip|pottery|pottery painting|painting|ceramics|candle making|glass blowing|cooking class|dance|karaoke|mini golf|putt putt|batting cage|driving range|archery|shooting range|rage room|craft|board game|puzzle) (place|places|spot|bar|range|park|studio|gym|alley|rink|cafe)\\b/],\n    ['list:restaurants', 3, /\\b(food court|food hall|dog friendly patio|patio dining|rooftop dining)\\b/],\n    ['list:travel', 3, /\\b(trip to|vacation|getaway|weekend in|week in|honeymoon|road trip|cruise|travel to|fly to|spring break|bucket list trip|trip ideas|travel ideas|flights to|flight to|anniversary trip|babymoon|leaf peeping|ski trip|national park|national parks)\\b/],\n    ['hub', 1.5, /\\b(someday|one day|eventually|sometime|look into|research|learn|figure out|think about|idea:|maybe we should|what if|redo|remodel|declutter|organize|renovate|renovation|project|diy|bucket list)\\b/],\n    // \"someday\" says it's for later, whatever else is in the note\n    ['hub', 1.5, /\\b(someday|some day|one day|eventually|sometime|down the road|at some point|in the future|next year|next spring|next summer|this winter)\\b/],\n    ['wrcontent', 3, /\\b(portfolio|testimonial video|post(?! office)|posts|reel|reels|caption|captions|content|tiktok|tiktoks|instagram|ig story|blog|blog post|newsletter|youtube video|podcast episode|carousel|story idea|testimonial|linkedin post|facebook post|fb post|pinterest|pin for|hook|hooks|email blast|thread on|case study|portfolio post|google business profile|before and after|before\\/after|behind the scenes|meet the team|spotlight)\\b/],\n    // \"podcast episode on burnout\" is something to make, not to watch\n    ['wrcontent', 1.5, /\\b(episode|video|post|reel|blog) (on|about|idea|for)\\b|\\b(topic|hook|script|caption):/],\n    ['wrspark', 3, /\\b(business idea|side project|product idea|app idea|course idea|side hustle|new service|service idea|offer idea|pricing tier|new pricing|raise (our |my )?rates|raise prices|referral program|partner with|partnership with|expand (into|to)|subscription box|bundle|package deal|add-on|add on service|upsell|new revenue|passive income|sell (templates|printables|courses?|ebooks?|digital)|ebook|e-book|online course|merch|trademark|small business grant|booth at|vendor booth|franchise|cat sitting only|b2b)\\b/],\n    ['wrspark', 2, /\\b(offer|offering|offered|charge for|sell|launch|start offering|could do|we could|what if (we|i)|hire a|hiring a|new client type|niche|rates|pricing|price list|packages?|services?|consulting|consult for|coaching program|membership|retainer|etsy shop|shopify|storefront|business cards?|logo|rebrand|redesign|for small businesses|for local businesses|for other|add on|add-on)\\b/, 'biz'],\n    ['wrcontent', 2.5, /\\b(social media|on fb|on facebook|on instagram|on ig|on tiktok|on linkedin|on the business page|google review|5 star review|review on|short video|video:|website copy|page copy|about page|landing page copy|email list|subscribers|followers|engagement|hashtags?|grid|story poll|ig story|reels?|caption)\\b/],\n    ['wrcontent', 3, /^(share|post|announce|film|write a (post|blog|caption|newsletter)|draft (a )?(post|blog|newsletter|email)|shoot|edit the video|repost|schedule (a |the )?posts?)\\b/],\n    ['wrspark', 3, /\\b(consulting|consultancy|coaching program|productized|white label|wholesale|licensing)\\b/],\n  ];\n  var TAGS = { buy: [['grocery', 2.5], ['list:wishlist', 1]], task: [['reminder', 2]], 'look up': [['hub', 2]], idea: [['hub', 1.5], ['wrspark', 1]], 'talk about': [['hub', 1.5], ['event', 0.5]] };\n\n  // what the first word (or two) of the real start means\n  var VERBS = [\n    [/^(eat at|dinner at|lunch at|brunch at|breakfast at|drinks at|takeout from|order from)\\b/, [['list:restaurants', 2.5]]],\n    [/^(offer|start offering|launch|introduce|roll out|pilot|could add|we could add|could offer|we could offer|could start|add \\w+( \\w+){0,4} (as a service|to (our |the |my )?(services|visits|packages|menu|offerings|pet visits|walks)))\\b/, [['wrspark', 2.5]]],\n    // errands: \"go to the bank\", \"stop at the post office\", \"target run\"\n    [/^(go to|stop at|stop by|swing by|run to|head to|run by|drop by) (the )?(bank|post office|pharmacy|dmv|bmv|store|grocery store|hardware store|home depot|lowes|lowe's|target|walmart|costco|kroger|meijer|aldi|cvs|walgreens|dry cleaners|cleaners|library|goodwill|ups|fedex|ups store|usps|car wash|gas station|atm|vet|tractor supply|petsmart|petco|mall|hobby lobby|michaels|tj maxx|marshalls|bed bath|staples|office depot|best buy|apple store|tire shop|mechanic|shop|courthouse|county clerk|clerk's office|bmv office)\\b/, [['reminder', 3.5]]],\n    // to-dos with someone or something: a reminder\n    [/^(call|text|email(?! (blast|newsletter|campaign|list|sequence))|message|dm|phone|facetime|call back|reply|respond|write back|get back to|reach out to|contact)\\b/, [['reminder', 3]]],\n    [/^(pay|venmo|zelle|cash app|pay back|repay|reimburse|deposit|transfer|move money|send money|tip)\\b/, [['reminder', 3]]],\n    [/^(renew|cancel|reschedule|schedule|reserve|rsvp|confirm|return|refill|drop off|drop|mail|send|ship|fax|print|sign|submit|register|enroll|sign up|invoice|follow up|remind|dispute|vote|turn in|fill out|fill in|fill up|check in for|check in on|check on|notarize|recycle|donate|get back|pick out|order|reorder|skip|upload|scan in|review|approve|make (a |an |the )?(appointment|appt|reservation|reservations|payment|deposit|vet appointment|dentist appointment|doctor appointment|hair appointment|call)|call in|pick up|grab mail|update)\\b/, [['reminder', 3]]],\n    [/^(ask|tell|let \\w+ know|thank|apologize to|congratulate|wish \\w+ (a )?happy)\\b/, [['reminder', 2.5]]],\n    [/^(take|give|bring|pack|lock|feed|walk|let the dogs out|let the dog out|let \\w+ out|clip|bathe|brush|thaw|defrost|unplug|plug in|turn off|turn on|set(?! up)|put out|put away|bring in|take in|take out|move|charge|update|back up|backup|download|wrap|hide|grab mail|get mail|check the mail|check mail|water)\\b/, [['reminder', 2.5]]],\n    // jobs around the house: a reminder, or one day\n    [/^(clean|wash|vacuum|mow|rake|sweep|mop|dust|scrub|swap|scoop|drip|put (the |my |our )?[a-z]+( [a-z]+)? (on|in|away|back|up)|change|replace|fix|repair|winterize|cover|fold|iron|flip|rotate|test|service|blow out|descale|caulk|regrout|powerwash|power wash|pressure wash|stain|seal|reseal|patch|touch up|unclog|declog|shovel|salt(?= (the|our|my) )|weed|trim|prune|edge|fertilize|aerate|mulch|spray|empty|unload|load|do (the )?(laundry|dishes)|put up|hang|install|mount|assemble|label)\\b/, [['reminder', 2.5], ['hub', 0.8]], 'chore'],\n    // later, one day: the Back Burner\n    [/^(learn|research|look into|figure out|think about|consider|explore|look up|look for|look at|redo|remodel|renovate|declutter|organize|go through|sort through|build|paint|frame|set up|start|compare|sell|get rid of|clear out|clean out|purge|brainstorm|write|journal|practice|study|take up|get into|get better at|work on|finish|try out|figure|find|talk to|talk about|talk with|discuss|bring up|teach|train|crate train|potty train|hang|scan|digitize|have a|host a|throw a|unsubscribe|consolidate|open a|open an|create|design|make a plan|start a|plant|grow|save for|save up|invest|refinance|pay off|budget for|get quotes|get a quote|volunteer|volunteer at)\\b/, [['hub', 2.2]]],\n    [/^(plan|planning)\\b/, [['hub', 2], ['reminder', 1.8]]],\n    // the lists\n    [/^(watch|binge|stream|rewatch|re-watch|catch up on|see the movie|see the new|finish watching|start watching)\\b/, [['list:shows-movies', 3]]],\n    [/^(read|reread|re-read|finish reading|start reading)\\b/, [['list:reading', 3]]],\n    [/^(eat at|dinner at|lunch at|brunch at|breakfast at|drinks at|takeout from|order from)\\b/, [['list:restaurants', 2.5]]],\n    [/^(fly to|travel to|trip to|vacation (in|to|at)|go to .* for (a |the )?(weekend|week|trip))\\b/, [['list:travel', 3]]]\n  ];\n\n  // errands and household jobs said with a noun alone (\"gas\", \"dmv\", \"car wash\", \"haircut\")\n  var ERRAND = /^(the )?(gas|bank|post office|dmv|bmv|car wash|oil change|haircut|dry cleaning|pharmacy|cvs|walgreens|laundry|dishes|trash|recycling|taxes|tax return|passport|registration|car registration|license|car payment|water bill|electric bill|gas bill|phone bill|internet bill|cable bill|rent|mortgage|insurance|car insurance|dentist|vet|doctor|eye doctor|flu shot|flu shots|mail|lunch money|permission slip|homework|meds|vitamins|bills|budget|invoices?|payroll|timesheet|expense report|receipts|mileage|quickbooks|bookkeeping)( (due|day|run|stuff|again|today|soon|appointment|appt))?$/;\n  // things that are bought for the house rather than groceries a note reads like a to-do with (\"get gas\")\n  var NOT_GROCERY = /\\b(gas|oil change|flu shot|car wash|haircut|cash|money|stamps|tires?|wiper blades|gift|present|card|flowers|tickets?|passport|license|quote|estimate|permit|appointment|reservation|sitter)\\b/;\n  // a dish to make: the Back Burner, unless a day says it's a plan\n  var MEAL = /^(make|cook|bake|try making|try to make|learn to make|learn how to make|meal prep|prep|grill|smoke)\\b(?! sure)|\\b(recipe|recipes|to make for dinner|for dinner one night|dinner idea|meal idea)\\b|^try (that|the|this|a|an|some)? ?[a-z' ]*recipe/;\n  // something to do, not to buy (\"water the plants\", \"make lasagna\", \"mop the kitchen\")\n  var DOING = /^(label|change|replace|clean|wash|fix|water|feed|walk|mow|vacuum|sweep|mop|dust|scrub|take out|put out|empty|charge|return|call|text|email|pay|cancel|order|book|make(?! sure)|cook|bake|prep|meal prep|try|watch|read|learn|research|look into|figure out|think about|plant|repot|organize|fold|iron|hang|install|paint|move|sell|donate|ship|mail|send|wrap|decorate|plan|schedule|reschedule|ask|tell|remind|finish|start|write|print|file|sign|renew|register|apply|take|thaw|defrost|give|bring|pack|put|set|let|lock|check|go to|visit|see|turn|fill|drop|deposit|transfer|vote|clip|brush|bathe|rake|trim|unload|load)\\b/;\n\n  // well-known books, shows and films (known-titles.js)\n  function titles() { return root.dbkKnownTitles || (typeof module !== 'undefined' && typeof require === 'function' ? (function () { try { return require('./known-titles.js'); } catch (e) { return null; } })() : null); }\n  function groceryInfo() { return root.dbkGroceryInfo || (typeof module !== 'undefined' && typeof require === 'function' ? (function () { try { return require('./grocery-aisle.js').info; } catch (e) { return null; } })() : null); }\n  function groceryKnown() { var A = root.dbkGroceryAisleApi || (typeof module !== 'undefined' && typeof require === 'function' ? (function () { try { return require('./grocery-aisle.js'); } catch (e) { return null; } })() : null); return A && A.known ? A.known : null; }\n\n  // ---- the words that go along: a list item, a calendar event, a reminder ----\n  function titleFor(dest, text, w, R, kt, nameHit) {\n    if (kt && (dest === 'list:reading' || dest === 'list:shows-movies')) return kt.title;\n    R = R || read(text);\n    // the note's own words, less emoji (and, for the calendar and reminders, the date and time words)\n    var keep = [];\n    R.toks.forEach(function (t, i) { if (t.hint) return; if ((dest === 'event' || dest === 'reminder') && w.usedIdx && w.usedIdx[i]) return; keep.push(t.o); });\n    var t = keep.join(' ');\n    if (dest === 'reminder' || dest === 'event') {\n      t = t.replace(/^\\s*((hey|ok|so|oh|um|also|note|todo|to do|reminder|please|pls|plz)[:\\-–,]?\\s+)+/i, '')\n        .replace(/^\\s*(please\\s+|pls\\s+)?(remind me (to|that|about)|remember to|don'?t forget( to)?|do not forget( to)?|i need to remember to|we need to remember to|need to remember to|i need to|we need to|need to|i have to|we have to|have to|gotta|got to|i gotta|i should|we should|i must|must)\\s+/i, '')\n        .replace(/^\\s*(please|pls|plz)\\s+/i, '')\n        .replace(/\\s+(please|pls|plz|asap)?\\s*[!.]*$/i, function (x) { return /asap/i.test(x) ? ' asap' : ''; })\n        .replace(/[\\s,]*\\b(on|at|by|in|this|next|every|each|starting|from|until|between|around|for|is|are|was|will be|starts|ends|=)\\s*[:,]?\\s*$/i, function (x) { return w.used && w.used.length && !/^\\s*(ends|starts)\\s*$/i.test(x) ? '' : x; })\n        .replace(/^\\s*[:\\-–]\\s*/, '').replace(/\\s*[:\\-–]\\s*$/, '');\n      if (dest === 'reminder') t = t.replace(/^\\s*(remind me|remind us)\\s*$/i, '');\n      return tidy(t) || tidy(text);\n    }\n    if (dest === 'grocery') return tidy(t);\n    if (dest === 'hub' || dest === 'wrcontent' || dest === 'wrspark') return tidy(t.replace(/^\\s*(idea|thought|random idea|random thought|business idea|content idea|post idea|reel idea|todo|note)\\s*[:\\-–]\\s*/i, function (x) { return dest === 'wrspark' && /business/i.test(x) ? x : ''; })) || tidy(text);\n    // a list: leave out what says to do it and who said so\n    var s = t.replace(/^\\s*((hey|ok|so|oh|also|note|todo|idea|random)[:\\-–,]?\\s+)+/i, ''), s00 = s;\n    s = s.replace(/^\\s*(?:[A-Za-z]+(?: and [A-Za-z]+)?|my (?:mom|dad|sister|brother|friend|boss|aunt|uncle|cousin|neighbor|coworker))\\s+(?:said|says|recommended|recommends|suggested|suggests|mentioned|told me|told us|loves|swears by|raves about)\\s+(?:to\\s+|that\\s+|we should\\s+|i should\\s+)?/i, '');\n    s = s.replace(/^\\s*((i|we)\\s+)?((really|still|also|definitely|def|probably|prob|totally)\\s+)?((need|have|got|gotta|should|must|want|wanna|would like|'d like|would love|'d love|ought)\\s+(to\\s+)?)?((go\\s+|finally\\s+|eventually\\s+)?)/i, function (x) { return /want|love|like/i.test(x) && dest === 'list:wishlist' ? '' : x.replace(/^\\s*((i|we)\\s+)?((really|still|also|definitely|def|probably|prob|totally)\\s+)?((need|have|got|gotta|should|must|wanna|ought)\\s+(to\\s+)?)?((go\\s+|finally\\s+|eventually\\s+)?)/i, ''); });\n    var s0 = s;\n    s = s.replace(/^\\s*(let'?s|lets|maybe|someday|one day|eventually|sometime)\\s+/i, '').replace(/^\\s*to\\s+(?=go to |visit |see |try |check out |\\w)/i, function (x) { return dest === 'list:wishlist' ? x : ''; });\n    var lead = {\n      'list:shows-movies': /^\\s*(watch|binge|rewatch|re-watch|stream|start|finish|see|catch up on)\\s+((that|the new|this)\\s+)?/i,\n      'list:restaurants': /^\\s*(try|eat at|go to|check out|dinner at|lunch at|brunch at|breakfast at|drinks at|takeout from|order from|visit)\\s+((that|the|this|a|an)\\s+)?/i,\n      'list:places': /^\\s*(go to|visit|check out|take the kids to|take the dogs to|take the dog to|take \\w+ to|go see|see|go|do|try)\\s+((that|the|a|an)\\s+)?/i,\n      'list:reading': /^\\s*(read|reread|re-read|listen to|finish|start)\\s+((the book|the novel|the audiobook)\\s+)?/i,\n      'list:wishlist': /^\\s*(i want|i'd love|would love|want|get me|buy me|i really want|we want|i need|need)\\s+((a|an|the|some)\\s+)?/i,\n      'list:travel': /^\\s*(trip to|travel to|fly to|go to|visit|vacation in|vacation to|weekend in|week in|weekend trip to|road trip to|plan a trip to|take a trip to|look at flights to)\\s+/i\n    }[dest];\n    if (lead) s = s.replace(lead, '');\n    // \"the italian place on madison\", \"that pho place\": no \"the\" in front, unless it's part of the name (\"The Precinct\")\n    if (/^list:(restaurants|places|travel)$/.test(dest)) s = s.replace(/^\\s*(that|this)\\s+/i, '').replace(/^\\s*the\\s+/i, function (x) { var rest = plain(s.slice(x.length)); var N = names(); return N.map['the ' + rest] || N.map['the ' + rest.split(' ').slice(0, 2).join(' ')] ? x : ''; });\n    if (dest === 'list:restaurants') s = s.replace(/^\\s*(that|the|this)\\s+(new\\s+)/i, '$2').replace(/\\s+(sometime|soon|someday|again)\\s*$/i, '').replace(/\\s+(tonight|for dinner|for lunch)\\s*$/i, '');\n    if (dest === 'list:travel') s = s.replace(/\\s+(sometime|soon|someday|one day|eventually)\\s*$/i, '');\n    if (dest === 'list:places') s = s.replace(/\\s+(sometime|soon|someday|one day|eventually|this fall|this winter|this spring|this summer|this weekend|next summer|next weekend)\\s*$/i, '');\n    if (dest === 'list:wishlist') s = s.replace(/^\\s*(a|an|the|some)\\s+/i, function (x) { return s00 !== s ? '' : x; }).replace(/^\\s*([a-z']+\\s+){0,2}(wishlist|wish list|xmas list|christmas list|list)\\s*[:\\-–]\\s*/i, '').replace(/^\\s*(?:gift idea|gift|present|xmas idea|christmas idea|anniversary gift idea|birthday gift idea)\\s+for\\s+[a-z']+\\s*[:\\-–]\\s*/i, '').replace(/^\\s*(?:gift idea|anniversary gift idea|birthday gift idea|xmas idea|christmas idea)\\s*[:\\-–]\\s*/i, '').replace(/^\\s*(?:[A-Za-z]+)\\s+(?:wants|hinted at|has been wanting)\\s+((a|an|the|some)\\s+)?/i, '').replace(/\\s+(eventually|someday|one day)\\s*$/i, '').replace(/^\\s*(someday)\\s+/i, '');\n    s = s.replace(/[!?.]+\\s*$/, '');\n    // a name it knows, in proper case when typed in small letters\n    var out = tidy(s) || tidy(text);\n    if (nameHit && plain(out) === nameHit) out = proper(displayName(nameHit) || out);\n    else if (nameHit && dest !== 'list:wishlist') { var lo = plain(out); if (lo.indexOf(nameHit) === 0 && !/[A-Z]/.test(out)) out = proper(out.slice(0, nameHit.length)) + out.slice(nameHit.length); }\n    return cap(out);\n  }\n  // \"Oat milk, eggs, sourdough\" is three things on the grocery list; \"milk eggs bread\" too\n  // the words around groceries in a sentence (\"hey can you add …\", \"charlie said we need …\", \"… on the way home\")\n  var G_LEAD = /^\\s*((hey|ok|okay|so|um|also|oh|and|then)[,!]?\\s+|(there'?s |there is |we have )?no more|((can|could|would|will) (you|u)( please| pls| plz)?|please|pls|plz|remind me to|reminder to|don'?t forget( to)?|dont forget( to)?|remember to|(i|we) (really |still )?(need|gotta|have) to|need to|gotta|(i|we) need( more| some)?|need( more| some)?|we('re| are)? (almost |nearly |completely |all |just about )?out of|(almost |nearly )?out of|running low on|low on|ran out of|run out of|used (up )?the last of( the)?|finished the|[a-z]+ (said|says)( that)?( we need( more| some)?)?|add|buy|pick up|get|grab|get more|grab more|buy more|pick up more|grab some|get some|pick up some|more|some)\\s+)+/i;\n  var STORES = '(kroger|costco|target|walmart|meijer|aldi|trader joe\\'?s|whole foods|sam\\'?s( club)?|publix|jungle jim\\'?s|jungle jims|findlay market|cvs|walgreens|dollar general|dollar tree|the store|the grocery store|the gas station|the farmers market|fresh thyme|sprouts|lidl|wegmans|giant eagle|ikea)';\n  function groceryParts(text) {\n    var t = String(text || '').replace(EMO_RE, ' ').trim();\n    // \"<store or label> [day]: list\", \"jungle jims - mangoes, ghee\": the label isn't an item\n    t = t.replace(/^\\s*([^:,\\-–]{1,40}?)\\s*(:|\\s[-–]\\s)\\s*/, function (x, label) {\n      var rest = t.slice(x.length);\n      if (/\\b(groceries|grocery|shopping|list|run|stuff|for|need|needs|store|market|costco|kroger|target|walmart|meijer|aldi|jim'?s|jims|joe'?s|foods|night|day|week|party|prep|dinner|lunch|lunches|breakfast|brunch|board|snacks|baking|trip|game|picnic|bbq|cookout)\\b/i.test(label) || /,|\\band\\b|\\/|\\+/.test(rest) || new RegExp('^' + STORES + '\\\\b', 'i').test(label)) return '';\n      return x;\n    });\n    // asides in the middle of a sentence (\"… to the list we're also out of coffee\") become commas\n    t = t.replace(/\\s+(to|on|onto) (the |my |our )?((grocery|shopping) )?list\\b\\s*/gi, ', ')\n      .replace(/[,.]?\\s+(and )?(we('re| are)|i'm|im) (also |almost |nearly |completely |all )*(out of|low on|running low on|need)\\s+/gi, ', ')\n      .replace(/[,.]?\\s+(and )?also (need|get|grab|add)\\s+/gi, ', ')\n      .replace(/\\s+(on|from|at) (the |your |my )?way home\\b/gi, '')\n      .replace(new RegExp('\\\\s+(at|from|@) ' + STORES + '\\\\b', 'gi'), '')\n      .replace(/\\s+(again|asap|please|pls|plz|when you'?re out|while you'?re out|if you can|for the week|this week|tonight|today|tmrw|tomorrow)\\s*([!?.]*)\\s*$/i, '')\n      .replace(/[!?]+\\s*$/, '').replace(/\\.\\s*$/, '');\n    t = t.replace(G_LEAD, '');\n    // \"the dog is out of food\": dog food\n    t = t.replace(/\\b(?:the )?(dogs?|cats?|puppy|kitten)(?:'s)? (?:is |are )?(?:out of|needs|need|low on) (?:more )?(food|treats|litter)\\b/i, '$1 $2');\n    var K = groceryKnown();\n    // a flavour stays one thing (\"salt & vinegar chips\")\n    t = t.replace(/\\b([a-z]+) (&|and) ([a-z]+) ([a-z]+)\\b/gi, function (x, a, amp, b2, c) { return K && K(a.toLowerCase()) && K(b2.toLowerCase()) && HEADS.test(c.toLowerCase()) && !K((b2 + ' ' + c).toLowerCase()) && !/s$/i.test(a) ? a + '\\u2063' + (amp === '&' ? 'AMP' : 'AND') + '\\u2063' + b2 + ' ' + c : x; });\n    // one thing with \"and\" in its name (\"half and half\", \"mac and cheese\")\n    if (K && K(t.trim()) && !/,|;|\\n/.test(t)) return [tidy(t) || tidy(text)];\n    // \"a/b/c\" (not 1/2 or 10/31)\n    t = t.replace(/([a-z])\\s*\\/\\s*(?=[a-z])/gi, '$1, ');\n    var parts = [];\n    t.split(/\\s*(?:,|;|\\n|\\+|\\s&\\s|\\.\\s+|\\s\\/\\s)\\s*/i).forEach(function (seg) {\n      // split on \"and\", but keep a name that has \"and\" in it (\"half and half and eggs\", \"salt and pepper chips\")\n      var bits = seg.split(/\\s+and\\s+/i);\n      for (var b = 0; b < bits.length; b++) {\n        var cur = bits[b];\n        while (K && b + 1 < bits.length && (K(cur + ' and ' + bits[b + 1]) || K(cur + ' and ' + bits[b + 1].split(/\\s+/)[0]))) { cur = cur + ' and ' + bits[b + 1]; b++; }\n        parts.push(cur);\n      }\n    });\n    parts = parts.map(function (p) { return tidy(p.replace(G_LEAD, '')); }).filter(function (p) { return p && !/^[a-z]+ (said|says|wants|asked)( that)?$/i.test(p); });\n    // \"maybe some bananas\": the last of a list said aloud\n    parts = parts.map(function (p) { return p.replace(/^(maybe|also|and|some|a few|a couple)\\s+(some\\s+)?/i, function (x) { return ''; }) || p; }).map(cap);\n    // no commas: \"milk eggs bread\", \"limes cilantro jalapenos\" when every word is a thing the grocery list knows\n    var seg = function (one) {\n      var w = one.split(/\\s+/);\n      if (!K || /\\band\\b/i.test(one) || w.length < 2 || w.length > 10 || /\\d/.test(one)) return [one];\n      var segs = [], i = 0;\n      while (i < w.length) {\n        var got = 0;\n        for (var n = Math.min(4, w.length - i); n >= 1; n--) { if (K(w.slice(i, i + n).join(' '))) { got = n; break; } }\n        if (!got) return [one];\n        segs.push(w.slice(i, i + got).join(' ')); i += got;\n      }\n      // two things from the same part of the store are more likely one (\"tillamook cheddar\", \"graeters ice cream\")\n      var GI = groceryInfo();\n      var sameAisle = segs.length === 2 && GI && GI(segs[0]).aisle === GI(segs[1]).aisle;\n      return segs.length >= 2 && !sameAisle && !K(one) ? segs.map(cap) : [one];\n    };\n    if (parts.length > 1 && parts.every(function (p) { return p.split(/\\s+/).length <= 4; })) return [].concat.apply([], parts.map(seg));\n    var one = parts.length === 1 ? parts[0] : (tidy(t) || tidy(text));\n    if (parts.length <= 1) return seg(one);\n    return [one];\n  }\n\n  // ---- groceries found in a sentence (Oct 27, round 3): not by stripping known wrappers but by finding the things the\n  // grocery list knows by name (grocery-words.js through grocery-aisle.js `known`), longest first, with the words that\n  // belong to them (\"good bread\", \"salt & vinegar chips\", \"diapers size 5\"), and dropping everything else ----\n  var MODS = /^(good|spicy|big|small|large|organic|fresh|frozen|red|green|yellow|white|brown|whole|sliced|diced|shredded|unsalted|salted|sweet|plain|vanilla|chocolate|strawberry|diet|zero|lowfat|nonfat|extra|mild|hot|sharp|light|dark|baby|mini|jumbo|ripe|raw|smoked|grated|crushed|ground|boneless|skinless|lean|cheap|fancy|local|good|nice|fat-free|sugar-free|decaf|unsweetened|\\d+|two|three|four|five|six|dozen|gallon|half|big|huge|family-size|spiced|honey|garlic|cinnamon|maple|everything)$/;\n  var STOPEND = /^(no|none|nothing|and|&|or|the|a|an|of|for|to|this|that|these|those|some|more|any|all|my|our|your|in|on|at|with|from|is|x|morning|night|tonight|today)$/;\n  var HEADS = /^(food|treats|chips|bars|bread|cheese|cheddar|milk|yogurt|litter|pods|cereal|sauce|coffee|ice cream|pizza|pizza rolls|bacon|sausage|crackers|cookies|snacks|soap|wipes|detergent|butter|juice|water|tea|chocolate|candy|gum|dressing|seasoning|popcorn|nuts|jerky|tots|tater tots|fries|nuggets|creamer|oatmeal|granola|hummus|salsa|dip|spread|jam|jelly|syrup|pasta|noodles|rice|beans|soup|broth|kibble)$/;\n  var NOT_ITEM = /^(gas|stamps|card|cards|gift card|tickets?|ice ?cream social|party|dinner|lunch|breakfast|brunch|snacks for)$/;\n  var SENT = /\\b(sunday|monday|tuesday|wednesday|thursday|friday|saturday|sun|mon|tue|tues|wed|weds|thu|thurs|fri|sat|making|running|low|sick|is|i|we|you|u|he|she|they|someone|somebody|boys|girls|kids|need|needs|needed|get|grab|buy|pick|add|put|bring|used|finished|ate|drank|ran|out|on|to|for|at|from|with|is|are|was|were|be|did|do|does|can|could|would|should|please|pls|list|more|no|any|all|last|again|tonight|today|tomorrow|tmrw|morning|ask|tell|remind|me|stop|think|have|has|got|gotta|want|wants|likes|like|those|that|think|asked|said|before|after|while|when|if|near|run|way|home|this|these|also)\\b/i;\n  function findItems(part) {\n    var K = groceryKnown(), GI = groceryInfo();\n    if (!K) return [];\n    part = String(part).replace(/\\u2063AMP\\u2063/g, ' & ').replace(/\\u2063AND\\u2063/g, ' and ');\n    var toks = String(part).split(/\\s+/).filter(Boolean), low = toks.map(function (x) { return fold(x).toLowerCase().replace(/^[^a-z0-9&]+|[^a-z0-9&']+$/g, '').replace(/'s$/, ''); });\n    var out = [], used = {}, i = 0;\n    var store = new RegExp('^' + STORES + '$', 'i');\n    while (i < toks.length) {\n      var got = 0;\n      // a flavour: \"salt & vinegar chips\", \"salt and pepper chips\"\n      if (/^(&|and)$/.test(low[i + 1] || '') && K(low[i]) && K(low[i + 2] || '') && HEADS.test(low[i + 3] || '') && !K(low[i + 2] + ' ' + low[i + 3]) && !/s$/.test(low[i])) got = 4;\n      for (var n = Math.min(5, toks.length - i); n >= 1 && !got; n--) {\n        var ph = low.slice(i, i + n).join(' ');\n        if (!ph || STOPEND.test(low[i]) || STOPEND.test(low[i + n - 1])) continue;\n        if ((K(ph) || (n === 1 && HEADS.test(ph) && !/^(water|food|tea|coffee)$/.test(ph))) && !store.test(ph) && !NOT_ITEM.test(ph)) { got = n; break; }\n      }\n      if (!got) { i++; continue; }\n      // \"wine bar\", \"pizza place\", \"coffee shop\", \"turkey trot\", \"water bill\", \"chili recipe\": not a thing to buy\n      if (/^(bar|bars|place|places|spot|spots|shop|shops|factory|house|cafe|truck|stand|restaurant|grill|kitchen|trot|bill|bills|change|recipe|recipes|bake|bouquet|match|game|party|night|festival|fest|tasting|tour|class|station|crawl|joint|run|line|filter|lights|ornaments?|decorations?|costume|day|week|club|drive|sale|fundraiser|changed|change|fixed|checked|filled|replaced|topped|rotated|done|light|lights|bulb|filter|flavor|flavored|flavour|scented)$/.test(low[i + got] || '') || /^(lego|wiffle|nerf|playdoh)$/.test(low[i - 1] || '')) { i += got; continue; }\n      var a = i, b = i + got;\n      // the words that belong to it: \"good bread\", \"salt & vinegar chips\", \"diapers size 5\", \"13 gal\"\n      while (a > 0 && !used[a - 1] && MODS.test(low[a - 1])) a--;\n      if (a >= 3 && !used[a - 3] && /^(&|and)$/.test(low[a - 2]) && K(low[a - 1]) && K(low[a - 3])) a -= 3;\n      // \"a case of water\", \"bottle of red wine\", \"2 bags of ice\"\n      if (a >= 2 && !used[a - 2] && low[a - 1] === 'of' && /^(case|cases|bag|bags|bottle|bottles|box|boxes|pack|packs|carton|cartons|jar|jars|can|cans|gallon|gallons|loaf|loaves|bunch|bunches|dozen|pound|pounds|lb|lbs|tub|tubs|roll|rolls|block|bar|bars|head|heads)$/.test(low[a - 2])) { a -= 2; if (a > 0 && !used[a - 1] && /^(\\d+|two|three|four|a|one)$/.test(low[a - 1])) a--; }\n      while (b < toks.length && /^(size|sz|x\\d+|\\d+(oz|lb|lbs|ct|pk|gal|pack)?|oz|lb|lbs|ct|pk|gal|gallons?|pack)$/.test(low[b]) && (low[b] !== 'size' || /^\\d/.test(low[b + 1] || ''))) b++;\n      for (var u = a; u < b; u++) used[u] = 1;\n      var forWhat = a > 0 && /^(for|the)$/.test(low[a - 1]) && (low[a - 1] === 'for' || (a > 1 && low[a - 2] === 'for'));\n      out.push({ text: toks.slice(a, b).map(function (t) { return t.replace(/['’]s$/i, ''); }).join(' ').replace(/^[^A-Za-z0-9&]+|[^A-Za-z0-9&)]+$/g, ''), from: a, to: b, k: low.slice(i, i + got).join(' '), forWhat: forWhat });\n      i = b;\n    }\n    // things for something (\"for the coffee\", \"for the board\") are what it's for, unless that's all there is\n    var kept = out.filter(function (x) { return !x.forWhat || !out.some(function (y) { return y.to <= x.from && !y.forWhat; }); });\n    if (!kept.length) kept = out.slice(0, 1);\n    // a brand right before what it is stays one thing (\"blue buffalo puppy food\", \"turkey bacon\"): next to each other,\n    // the same part of the store, and the first isn't a plural (\"onions garlic\" are two)\n    var merged = [];\n    kept.forEach(function (x) {\n      var prev = merged[merged.length - 1];\n      var flav = prev && prev.to === x.from && /^(chips|coffee|tea|creamer|ice cream|yogurt|popcorn|cereal|seasoning|salsa|hummus|jam|jelly|syrup)$/.test(x.k) && !/s$/.test(prev.k) && prev.k.split(' ').length <= 2 && !HEADS.test(prev.k.split(' ').pop());\n      if (flav) { prev.text += ' ' + x.text; prev.to = x.to; prev.k += ' ' + x.k; }\n      else if (prev && prev.to === x.from && GI && GI(prev.k).aisle === GI(x.k).aisle && !/s$/.test(prev.k) && prev.k.split(' ').length === 2 && HEADS.test(x.k.split(' ').pop()) && !HEADS.test(prev.k.split(' ').pop())) { prev.text += ' ' + x.text; prev.to = x.to; prev.k += ' ' + x.k; }\n      else merged.push({ text: x.text, from: x.from, to: x.to, k: x.k });\n    });\n    return merged.map(function (x) { return cap(x.text.replace(/^(the|a|an|some)\\s+/i, '')); });\n  }\n  function groceryItems(text) {\n    var parts = groceryParts(text), K = groceryKnown(), GI = groceryInfo();\n    var out = [];\n    parts.forEach(function (p) {\n      var f = findItems(p);\n      // a plain item as typed (\"Mozz\", \"Gluten free bread\", \"Diapers size 4\") stays as typed\n      var pw = p.replace(/^(the|a|an|some)\\s+/i, '').split(/\\s+/);\n      // a plain item as typed (\"Mozz\", \"Gluten free bread\", \"Diapers size 4\", \"Oat mlik\"): no sentence around it\n      var GI2 = groceryInfo();\n      var plural = /s$/i.test(f[0] || '') && K && K(fold(f[0]).toLowerCase().replace(/e?s$/, ''));\n      var lastHead = f.length === 2 && (HEADS.test(fold(f[1]).toLowerCase()) || HEADS.test(fold(f[1]).toLowerCase().split(/\\s+/).pop()));\n      var oneThing = f.length === 1 || (f.length === 2 && GI2 && GI2(f[0]).aisle === GI2(f[1]).aisle && (lastHead || (!plural && /\\s/.test(f[0]))));\n      if (!f.length) { out.push(p); return; }\n      if (!SENT.test(p) && pw.length <= 4 && oneThing) { out.push(cap(pw.join(' '))); return; }\n      out = out.concat(f);\n    });\n    return (out.length ? out : parts).map(function (x) { return x.replace(/\\u2063AMP\\u2063/g, ' & ').replace(/\\u2063AND\\u2063/g, ' and '); });\n  }\n\n  // ---- the household's own businesses (Oct 27, round 3): their names, what they sell and the words they use, from the\n  // Work page on this phone (wr:data), passed in as opts.biz = { names, offers, words } ----\n  var BIZ_STOP = { the: 1, and: 1, for: 1, with: 1, our: 1, your: 1, from: 1, that: 1, this: 1, home: 1, people: 1, who: 1, want: 1, make: 1, more: 1, some: 1, them: 1, they: 1, their: 1, have: 1, into: 1, just: 1, little: 1, lasting: 1, things: 1, thing: 1, small: 1, local: 1, good: 1, great: 1, best: 1, new: 1, life: 1, care: 1, time: 1, help: 1, family: 1, kids: 1, day: 1, days: 1, week: 1, weeks: 1, love: 1, made: 1, plain: 1, warm: 1, funny: 1, spoken: 1, studio: 1, shop: 1, house: 1, plan: 1, service: 1, services: 1 };\n  var bizCache = { key: null, val: null };\n  function bizWords(b) {\n    if (!b) return null;\n    var key = JSON.stringify(b); if (bizCache.key === key) return bizCache.val;\n    var esc2 = function (x) { return fold(x).toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9& ]+/g, ' ').replace(/\\s+/g, ' ').trim().replace(/[.*+?^${}()|[\\]\\\\\\/]/g, '\\\\$&'); };\n    var names = (b.names || []).map(esc2).filter(function (x) { return x.length > 2; });\n    var phrases = (b.offers || []).map(esc2).concat((b.words || []).map(esc2).filter(function (x) { return x.indexOf(' ') > 0; })).filter(function (x) { return x.length > 3; });\n    var singles = {};\n    (b.words || []).map(esc2).concat(names).forEach(function (ph) { ph.split(' ').forEach(function (w) { if (w.length >= 4 && !BIZ_STOP[w] && !/^\\d+$/.test(w)) singles[w.replace(/s$/, '')] = 1; }); });\n    var mk = function (list) { return list.length ? new RegExp(' (' + list.join('|') + ')(?= )') : null; };\n    // \"Patios\" also finds \"patio\", \"Mini sessions\" \"mini session\"\n    var pl = function (ph) { return ph.split(' ').map(function (w) { return /^[a-z]{3,}$/.test(w) ? w.replace(/(es|s)$/, '') + '(?:e?s)?' : w; }).join(' '); };\n    var val = { name: mk(names.concat(names.map(function (n) { return n.split(' ')[0]; }).filter(function (w) { return w.length >= 5 && !BIZ_STOP[w]; }))), phrase: mk(phrases.map(pl)), word: mk(Object.keys(singles).map(function (w) { return w + 's?'; })) };\n    bizCache = { key: key, val: val };\n    return val;\n  }\n  // what a Work page holds (wr:data) as opts.biz: business names, offers and Home Base words\n  function bizFrom(wr) {\n    if (!wr || typeof wr !== 'object') return null;\n    if (wr.items && typeof wr.items === 'object' && !wr.businesses) wr = wr.items;\n    var names = [], offers = [], words = [];\n    (Array.isArray(wr.businesses) ? wr.businesses : []).forEach(function (bz) { if (bz && bz.name) names.push(String(bz.name)); });\n    var hb = wr.homebase || {}; Object.keys(hb).forEach(function (k) { var h = hb[k] || {}; if (h.bizName) names.push(String(h.bizName)); ['bizType', 'niche', 'tagline'].forEach(function (f) { if (h[f]) words.push(String(h[f])); }); (h.pillars || []).forEach(function (x) { if (typeof x === 'string') words.push(x); }); });\n    var of = wr.offers || {}; Object.keys(of).forEach(function (k) { (of[k] || []).forEach(function (o) { if (o && o.name && o.status !== 'retired') offers.push(String(o.name)); }); });\n    return names.length || offers.length || words.length ? { names: names, offers: offers, words: words } : null;\n  }\n  // any small business's words (a bakery, a plumber, an Etsy shop, a photographer…)\n  var GENB = / (\\d+ ?% off|percent off|bogo|buy one get one|free shipping|shipping over|delivery|deliveries|deals?|side business|side hustle|my business|our business|the business|boutique|consignment|of the month club|gluten free line|vegan line|line\\?|sessions|new scents?|new flavors?|(new|start a|start an|offer a|offer an|add a|add an|offering) [a-z -]{0,25}(service|services|line|package|class|program|plan)|mini sites?|sites? for|websites? for|clients?|customers?|llc|wholesale|retail|vendor|vendors|booth|pop-?up|pop up shop|catering|preorders?|pre-orders?|upsell|pricing|price list|price increase|raise (the )?(prices?|rates)|rates|packages?|package deal|memberships?|subscription box|subscriptions? for|loyalty|referrals?|newsletter for|launch (a|an|the|our|my)|partnership|partner with|hire (a|an)|hiring|apprentice|employee|dispatcher|editor for|second shooter|etsy|amazon handmade|shopify|storefront|inventory|product line|new line|new product|new scent|new flavor|new menu|fall menu|seasonal menu|workshop|class for|classes for|course (on|for)|craft fair|holiday market|christmas market|farmers market|market stall|small business(es)?|local businesses|marketing|seo|google business|free shipping|shipping|bundles?|gift sets?|gift certificates?|gift cards? (for|to sell)|sell gift cards?|cater|catering for|add on|add ons|discount|promo|coupon|contracts?|upsells?|add-?ons?|deal for|deals for|flat rate|service area|second van|truck|van)(?= )/;\n  var CONTENT = / (announce|podcast|episode|hook|hooks|script|post|posts|posting|reel|reels|video|tiktok|story|stories|caption|captions|blog|blog post|carousel|photo shoot|photoshoot|listing photos|product photos|sneak peek|behind the scenes|youtube|pin|pinterest|instagram|ig|facebook|fb|linkedin|google review|review reply|testimonial|share the|share a|share our|tips? (post|video)|before and after|newsletter issue|email blast)(?= )/;\n\n  // ---- the guess ----\n  function guess(text, opts) {\n    opts = opts || {};\n    var dests = opts.dests || null, ok = function (d) { return !dests || dests.indexOf(d) !== -1; };\n    var orig = String(text || ''), R = read(orig), raw = R.text.trim();\n    var low = ' ' + R.c + ' ', trimmed = R.c.trim();\n    var score = {}, add = function (d, n) { if (ok(d)) score[d] = (score[d] || 0) + n; };\n    var OWN = bizWords(opts.biz);\n    // as typed too: \"sat prep\" is an offer, not Saturday\n    var lowT = ' ' + fold(orig).toLowerCase().replace(/['’]/g, '').replace(/[^a-z0-9& ]+/g, ' ').replace(/\\s+/g, ' ').trim() + ' ';\n    var ownName = !!(OWN && OWN.name && (OWN.name.test(low) || OWN.name.test(lowT))), ownPhrase = !!(OWN && OWN.phrase && (OWN.phrase.test(low) || OWN.phrase.test(lowT))), ownWord = !!(OWN && OWN.word && (OWN.word.test(low) || OWN.word.test(lowT)));\n    var ownHit = ownName || ownPhrase || ownWord;\n    var KT = titles(), kt = KT && KT.find ? (KT.find(orig) || KT.find(raw)) : null;\n    // a title's own words aren't a day (\"Tomorrow, and Tomorrow, and Tomorrow\")\n    var w = kt && kt.whole ? { date: null, time: null, used: [], usedIdx: {}, holiday: null } : when(orig, opts.today, R);\n    var st = startOf(R, w), head = st.s, hl = ' ' + head + ' ';\n    var restLow = ' ' + head + ' ';\n    var bizCtx = ownHit || GENB.test(low) || /\\b(business|biz|clients?|customers?|llc|brand|branding|bookings?|etsy|marketing|as a service|logo|landing page|add on|add-on)\\b/.test(low);\n    RULES.forEach(function (r) { var re = r[2]; if (r[3] === 'biz' && !bizCtx) return; if (re.source.charAt(0) === '^' ? (re.test(trimmed) || (!r[3] && re.test(head))) : re.test(low) || re.test(raw)) add(r[0], r[1]); });\n    // what it starts with (\"call\", \"watch\", \"pay\", \"learn\")\n    var verb = null, labTitle = null;\n    for (var v = 0; v < VERBS.length; v++) if (VERBS[v][0].test(head)) { verb = v; VERBS[v][1].forEach(function (x) { add(x[0], x[1]); }); break; }\n    var N = names(), found = spot(head, N), kinds = {};\n    // the name alone once \"try\", \"go to\", \"someday\", \"with the kids\" are left out (\"we should go to savannah sometime\")\n    var coreName = plain(head.replace(/^(try|go to|go see|visit|check out|see|eat at|take the kids to|take the dogs? to|go|to|trip to|fly to|travel to|weekend in|weekend at)\\s+(the\\s+)?/, '')\n      .replace(/(\\s+(someday|sometime|soon|eventually|one day|again|tonight|next (summer|spring|fall|winter|year|weekend|month|time)|this (summer|spring|fall|winter|year|weekend|month)|in the (summer|spring|fall|winter)|with the (kids|family|dogs|girls|guys|fam)|with (charlie|kasey|mom|dad|friends|the dogs)|for (spring break|our anniversary|my birthday|the holidays|a weekend|the weekend|date night)))+$/, ''));\n    if (coreName && N.map[coreName] && !found.some(function (f) { return f.whole; })) found = [{ k: coreName, kind: N.map[coreName], n: coreName.split(' ').length, whole: true }];\n    found.forEach(function (f) { kinds[f.kind] = kinds[f.kind] || f; });\n    var nameHit = null;\n    // the names it knows: a place to eat, somewhere to go, a trip, a thing to wish for\n    found.forEach(function (f) {\n      var weight = f.whole ? 4 : f.n >= 2 ? 3 : 1.5;\n      if (f.kind === 'rest') { add('list:restaurants', weight); nameHit = nameHit || f.k; }\n      else if (f.kind === 'place') { add('list:places', weight); nameHit = nameHit || f.k; }\n      else if (f.kind === 'go') add('list:places', f.whole ? 3 : f.n >= 2 ? 2 : 1);\n      else if (f.kind === 'trip' && !kinds.local) { add('list:travel', f.whole ? 4 : f.n >= 2 ? 3 : 2); nameHit = nameHit || f.k; }\n      else if (f.kind === 'want') add('list:wishlist', f.whole ? 3.5 : f.n >= 2 ? 2.5 : GENERIC_WANT.test(f.k) ? 1.5 : 2.5);\n      else if (f.kind === 'bill' && !/^(should|maybe|what if|is it worth|do we need)\\b/.test(trimmed)) add('reminder', f.whole ? 3.5 : 2);\n    });\n    var verbWord = (/^([a-z]+(?: (?:up|off|out|back|in|at|to|for|on))?)/.exec(head) || [])[1] || '';\n    // try / go to / visit / check out / see + a name: that list\n    if (/^(try|go to|visit|check out|see|go see|take the kids to|take the dogs? to|take \\w+ to|eat at|go)\\b/.test(head)) {\n      if (kinds.rest || /\\b(place|spot|restaurant|bar|brewery|cafe|bakery|food truck|pizza|sushi|tacos?|ramen|bbq|diner|steakhouse)\\b/.test(head)) add('list:restaurants', 1.5);\n      else if (kinds.place || kinds.go) add('list:places', 1.5);\n      else if (kinds.trip && !kinds.local) add('list:travel', 1.5);\n    }\n    // a well-known title: the reading list for a book, the watch list for a show or film; one that's both leans on the\n    // note's own words (\"read\", \"watch\") and otherwise is offered both (Kasey, Oct 23)\n    if (kt) {\n      var screen = kt.show || kt.movie, sure = kt.weak ? 1.5 : kt.whole ? 4 : 3;\n      if (kt.book && !screen) add('list:reading', sure);\n      else if (screen && !kt.book) add('list:shows-movies', sure);\n      else if (kt.screenFirst) { add('list:shows-movies', 2.6); add('list:reading', 2.5); }\n      else { add('list:reading', 2.6); add('list:shows-movies', 2.5); }\n      if (kt.game) add('list:wishlist', sure);\n      if (kt.weak && !kt.whole) { add('list:reading', -1.5); add('list:shows-movies', -1.5); }\n    }\n    // \"read more\", \"watch less tv\": a habit to build, not a title\n    if (/^(read|watch|listen to) (more|less)( (books|tv|often|regularly|each day|every day|at night|before bed|fiction|nonfiction|news|youtube))?$/.test(head)) { add('hub', 4); ['list:reading', 'list:shows-movies'].forEach(function (d) { if (score[d]) score[d] -= 4; }); }\n    // \"every Tuesday\", \"monthly\": something that comes back is a reminder more than a calendar event\n    var repeat = !!w.freq || /\\b(every|each|weekly|monthly|daily|yearly|annually|biweekly)\\b/.test(low);\n    if (repeat && score.event) score.event -= 1;\n    // \"Thanksgiving at grandma's\" is a day on the calendar\n    if (w.holiday && !w.time) add('event', 1);\n    // \"buy a turkey before Thanksgiving\", \"by Friday\": something to get done by then\n    if ((w.date && /\\b(before|by|no later than|due|until)\\s/.test(low)) || w.deadline) add('reminder', 1.5);\n    if (w.date && /^(i |we )?(really )?(need|have|got) to \\w+/.test(trimmed) && score.hub) { score.hub -= 2; add('reminder', 1); }\n    if (w.date && w.time) add('event', 1.5);\n    else if (w.date && w.monthOnly) add('reminder', 1);\n    else if (w.date) { add('event', 1); add('reminder', 1); }\n    else if (w.time) { add('event', 0.5); add('reminder', 0.5); }\n    // a note that says to remember it (\"remind me…\", \"don't forget…\") is a reminder\n    if (/\\b(remind me|remind us|remember|forget|reminder)\\b/.test(st.lead)) add('reminder', /\\b(forget|remember)\\b/.test(st.lead) && !/^(buy|get|grab|pick up)\\b/.test(head) ? 3 : 2);\n    // \"amazon return\", \"chewy order\", \"ups package\": an errand\n    if (/\\b(returns?|refund|exchange|order|orders|delivery|package|packages|pickup|shipment|tracking)$/.test(head) && head.split(' ').length <= 3 && !w.time) add('reminder', 2.5);\n    // a hardware store run (\"home depot - mulch, paint\"): a to-do, not the grocery list\n    if (/^(home depot|lowes|lowe's|menards|hardware store|tractor supply|ace hardware|ikea|best buy|staples)\\b/.test(trimmed)) { add('reminder', 3); if (score.grocery) score.grocery -= 2; }\n    // a sitter for a night out: something to arrange\n    if (/\\b(sitter|babysitter|dog sitter|pet sitter|nanny)\\b/.test(low) && !w.time) { add('reminder', 2); if (score.event) score.event -= 1.5; }\n    // packing (\"sunscreen in the beach bag\"): a reminder\n    if (/\\b(in|into) (the |my |his |her |our )?(beach bag|diaper bag|backpack|suitcase|carry on|car|gym bag|lunchbox|lunch box|cooler|bag|purse)\\b/.test(low) && !w.date) add('reminder', 2.5);\n    // \"maybe\", \"someday\", \"eventually\": for later, the Back Burner, not a reminder\n    var later = /^(maybe|someday|one day|eventually|sometime|possibly)\\b/.test(st.lead.trim()) || /\\b(someday|eventually|down the road|at some point)\\b/.test(low);\n    if (later && !w.date) { add('hub', /^maybe\\b/.test(st.lead.trim()) ? 1.5 : 0.5); if (score.reminder) score.reminder -= 1.5; }\n    // a holiday on its own is that day (\"Halloween\", \"sat 10/31 halloween\")\n    if (w.holiday && !(verb != null && VERBS[verb][1][0][0] !== 'list:restaurants')) add('event', /^(halloween|thanksgiving|christmas|christmas eve|easter|new year's eve|new year's day|friendsgiving|valentine's day|mother's day|father's day|4th of july|fourth of july|labor day|memorial day)( (party|dinner|brunch|lunch|morning|day|eve|celebration|cookout|parade))?$/.test(head) || !head ? 3 : 0.5);\n    // a reminder verb with a date and time is still a reminder (\"call mom tomorrow at 5\"), not an event\n    if (verb != null && VERBS[verb][1][0][0] === 'reminder' && w.time && !/\\b(call|zoom|meeting|appointment) with\\b/.test(low) && !/^call with/.test(head)) add('reminder', 1.5);\n    // \"call with the client thursday 11am\", \"zoom w/ client\": a meeting on the calendar\n    if (/^((phone|video|conference|zoom|teams|facetime|intro|sales) )?(call|zoom|facetime|chat|meeting|consult|sync|1:1|one on one|coffee chat|catch up) with\\b/.test(head) || /^(discovery|intro|sales|coaching|strategy|client|team|onboarding) (call|meeting|session)\\b/.test(head)) { add('event', w.date || w.time ? 3.5 : 1.5); }\n    // health, pets and the house: with a time it's an appointment, without one it's something to book\n    var appt = /\\b(dentist|doctor|vet|groomer|grooming|haircut|hair appointment|hair|nails|massage|therapy|therapist|dermatologist|orthodontist|chiropractor|mammogram|bloodwork|physical|checkup|eye doctor|optometrist|pediatrician|ob|obgyn|surgery|plumber|electrician|furnace guy|cable guy|hvac|contractor|inspector|repairman|repair guy|handyman|exterminator|pest control|cleaners|cleaning lady|movers|delivery|installer|appraiser|realtor)\\b/.test(low);\n    if (appt && (w.time || (w.date && /\\b(appointment|coming|comes|visit|surgery|cleaning|checkup|groomer|grooming)\\b/.test(low)))) add('event', 2);\n    else if (appt && !w.date && !w.time && !verb && head.split(' ').length <= 4) add('reminder', 1.5);\n    // an errand or a bill said with a noun alone (\"gas\", \"dmv\", \"water bill\", \"car registration\")\n    if (ERRAND.test(head)) add('reminder', 3);\n    // something the grocery list knows (\"jalapeños\", \"cat litter\", \"frozen pizza\", \"2 lbs ground beef\", \"milk x2\") reads\n    // like groceries, as long as it isn't tied to a day or something to do. The words are grocery-words.js's (the same\n    // list the grocery list sorts by); how much of the note it knew (cover) decides how sure: every word = sure\n    // (\"diced jalapeños\", Kasey, Oct 25: it showed no suggestion at all), half = likely, one word of a sentence = no\n    // (\"Pepper's vet appointment\").\n    var gi = groceryInfo();\n    var doing = DOING.test(trimmed) || DOING.test(head);\n    var place = kinds.rest && (kinds.rest.whole || /^(try|eat at|go to|dinner at|lunch at|breakfast at|brunch at|takeout from|order from)\\b/.test(head) && plain(head.replace(/^(try|eat at|go to|dinner at|lunch at|breakfast at|brunch at|takeout from|order from)\\s+/, '').replace(/\\s+(tonight|for dinner|for lunch|for breakfast|takeout|delivery|again|sometime|soon)$/, '')) === kinds.rest.k);\n    var parts = groceryParts(raw), nw = raw.trim().split(/\\s+/).length;\n    var gNote = parts.length > 1 ? parts : groceryParts(head || raw);\n    var buyish = /^(buy|get|grab|pick up|need|more|we need|need more|order)\\b/.test(head) || /^(buy|get|grab|pick up|need)\\b/.test(trimmed);\n    var buyObj = buyish ? head.replace(/^(buy|get|grab|pick up|need more|need|more|we need more|we need|order)\\s+/, '') : '';\n    var infos = gi && !(kt && kt.whole) && !place && !kinds.place && !kinds.trip ? gNote.map(function (p) { return gi(p); }) : [];\n    var food = function (x) { return x && x.aisle && x.aisle !== 'Other'; };\n    var errandBuy = buyish && NOT_GROCERY.test(buyObj);\n    var dated = w.date && !w.holiday && !w.deadline || (w.date && !/\\b(for|before|by)\\b/.test(low));\n    var forHoliday = w.date && /\\b(for) (thanksgiving|christmas|halloween|easter|the party|the cookout|the potluck)\\b/.test(low);\n    // \"dog training book\", \"puppy potty training package\", \"dog friendly beach trip\": not from the pet aisle\n    var notFood = /\\b(plumber|electrician|handyman|babysitter|nanny|contractor|roofer|painter|mechanic|lawyer|attorney|accountant|cpa|realtor|tutor|dog walker|cleaning lady|house cleaner|exterminator|for the car|for the truck|prescription|prescriptions|meds|medicine|medication|package|packages|service|services|training|class|classes|sitting|sitter|walking|walker|taxi|portraits?|business|rates|clients?|trip|friendly|hikes?|hiking|book|beds|sweaters?|costumes?|daycare|boarding|insurance|license|groomer|grooming|surgery|shots|vaccines?|park|camera|photos?|bandanas|birthday party|adoption|rescue|shelter)\\b/.test(low);\n    if (notFood) { infos = []; if (score.grocery) score.grocery = Math.min(score.grocery, 0.5); }\n    infos = infos.map(function (x, i) { return x && x.aisle === 'Pets' && gNote[i].split(/\\s+/).length >= 3 && !(groceryKnown() || function () { return false; })(gNote[i]) ? { aisle: x.aisle, cover: 0.5 } : x; });\n    if (infos.length && (!w.date || forHoliday || (parts.length > 1 && !w.time)) && (!doing || buyish) && !errandBuy && (nw <= 7 || (gNote.length > 1 && gNote.every(function (p) { return p.split(/\\s+/).length <= 4; })))) {\n      var sureN = infos.filter(function (x) { return food(x) && x.cover >= 0.99; }).length;\n      var likely = infos.filter(function (x) { return food(x) && x.cover >= 0.5; }).length;\n      var some = infos.filter(food).length;\n      if (sureN === infos.length) add('grocery', 2.5);\n      else if (likely >= Math.ceil(gNote.length / 2)) add('grocery', gNote.length === 1 && nw > 3 ? 1 : 2);\n      else if (some && nw <= 3 && likely) add('grocery', 1);\n      if (sureN === infos.length && gNote.length >= 2) add('grocery', 1);\n    }\n    // a short list of things, like \"eggs, milk, bread\", reads like groceries\n    // (only when one of them is something the grocery list knows: \"challenges, daily questions & moon notes\" isn't)\n    if (!(kt && kt.whole) && !place && /,|\\band\\b/.test(low) && parts.length > 2 && !w.date && infos.some(function (x) { return food(x) && x.cover >= 0.5; })) add('grocery', 1);\n    // something to do with a food in it (\"take out chicken to thaw\", \"clean out the fridge\"): a to-do, not groceries (Oct 26\n    // audit: it went to the grocery list because \"chicken\" is a grocery word)\n    if (doing && !buyish && score.grocery) { score.grocery = Math.min(score.grocery, 0.5); add('reminder', 1.5); }\n    // the whole note is one thing the grocery list knows by name (\"contact solution\", \"half and half\", \"water\")\n    var KN = groceryKnown();\n    if (KN && !kt && !place && !w.date && !notFood && !ERRAND.test(head) && KN(gNote.length === 1 ? gNote[0] : '') ) { add('grocery', 2); if (score.reminder) score.reminder -= 2; }\n    // \"pick up eggs\": groceries; \"pick up the dry cleaning\": a to-do\n    if (buyish && score.grocery >= 2.5 && verb != null && VERBS[verb][1][0][0] === 'reminder') score.reminder -= 2.5;\n    // buying a gift, flowers, tickets, gas: a to-do\n    if (errandBuy) { add('reminder', 2); if (score.grocery) score.grocery = Math.min(score.grocery, 0.5); }\n    // food words that are also kinds of places to eat (\"ground beef for tacos\", \"sushi rice\"): groceries when the list knows it all\n    if (score.grocery >= 2 && score['list:restaurants'] && !kinds.rest && !/\\b(place|spot|restaurant|truck|joint|bar|cafe|bakery|brewery|diner|try|eat at)\\b/.test(low)) score['list:restaurants'] -= 2;\n    // a chain's own food from the store (\"Skyline chili cans\", \"graeters ice cream\"): groceries\n    if (kinds.rest && !kinds.rest.whole && score.grocery >= 2 && !/ at /.test(low) && /\\b(cans?|jars?|pints?|packs?|boxes|box|bags?|frozen|sauce|seasoning|dressing|mix|ice cream|cartons?|bottles?|pods?|k cups|coffee beans|beans|chili|salsa)\\b/.test(low.replace(new RegExp(' ' + esc(kinds.rest.k) + ' '), ' '))) { score['list:restaurants'] -= 2.5; add('grocery', 0.5); }\n    // \"make chicken tikka masala\", \"try that lasagna recipe\": a dinner to try one day, not groceries\n    if ((MEAL.test(trimmed) || MEAL.test(head)) && !w.date && meal(head, gi)) { add('hub', 2.5); if (score.grocery) score.grocery = Math.min(score.grocery, 0.5); }\n    // \"need more dog food\"\n    if (/^(need|we need|need more|more)\\b(?! to\\b)/.test(trimmed) && !w.date && score.grocery && !notFood) add('grocery', 1);\n    // gifts: \"christmas gift ideas for charlie\", \"charlie wants airpods\", \"stocking stuffers\" (the Wishlist); buying,\n    // wrapping or sending one is a to-do\n    var giftWords = /\\b(gift|gifts|present|presents|stocking stuffers?|wishlist|wish list|christmas list|xmas list|birthday list|secret santa|white elephant)\\b/.test(low);\n    if (giftWords && /^(buy|get|grab|order|pick up|wrap|ship|mail|send|give|drop off|return|deliver|bring|find)\\b/.test(head)) { add('reminder', 1.5); if (score['list:wishlist']) score['list:wishlist'] -= 2; }\n    else if (giftWords && !w.time) { add('list:wishlist', 2); if (score.event) score.event -= 2; }\n    if (kinds.want && /\\b(for (him|her|charlie|kasey|mom|dad|me|us|[a-z]+'s? (birthday|bday|stocking))|wants|would like|hinted|wishlist)\\b/.test(low)) add('list:wishlist', 1.5);\n    // \"christmas list\" without gift words, \"i want…\", \"would love…\"\n    // a thing to wish for that's bought (\"buy a new couch\"): the Wishlist, unless it's an errand\n    if (kinds.want && buyish && !errandBuy && !score.grocery) add('list:wishlist', 1);\n    // a known name inside a to-do (\"call the cincinnati zoo\", \"email the nada manager\"): the to-do wins\n    if (verb != null && VERBS[verb][1][0][0] === 'reminder' && !kt) ['list:restaurants', 'list:places', 'list:travel', 'list:wishlist'].forEach(function (d) { if (score[d]) score[d] -= 2.5; });\n    // a trip near home is an outing (\"hike in florence\" stays local)\n    if (kinds.local && score['list:travel']) score['list:travel'] -= 1.5;\n    // \"dinner at boca friday 7\": a reservation on the calendar, not a restaurant to try\n    if ((w.time || w.date) && (kinds.rest || score['list:restaurants'])) { if (w.time) add('event', 1.5); if (score['list:restaurants']) score['list:restaurants'] -= w.time ? 3 : 2; }\n    if ((w.time || (w.date && !w.monthOnly)) && (kinds.place || kinds.go) && score['list:places']) { score['list:places'] -= 1.5; add('event', 1); }\n    // a show or a book with a day and time is a plan (\"movie night fri\"), and work content with a date stays work content\n    // a business note: \"for the business page\", \"for myreliacare\", \"for 2Timelines\", clients\n    var biz = ownHit || /\\b(business|biz|clients?|customers?|llc|brand|branding|our services|my services|bookings?)\\b/.test(low);\n    if (biz && score.wrcontent) add('wrcontent', 0.5);\n    if (biz && score.wrspark) add('wrspark', 0.5);\n    if (score.wrcontent && score.wrspark && /\\b(post|reel|caption|tiktok|instagram|blog|newsletter|video|carousel|story|content|hook|testimonial|linkedin|facebook|pinterest|email blast)\\b/.test(low) && !/\\b(sell|launch|offer|start offering|business idea|side hustle|course idea|app idea)\\b/.test(low)) add('wrcontent', 1);\n    if (/^(business idea|side hustle idea|product idea|app idea|course idea|idea for (a|an) (business|service|product|app|course)|new service idea|service idea)\\b/.test(head) || /^(business idea|side hustle|product idea)/.test(trimmed)) add('wrspark', 2);\n    if (/^(idea|thought|random idea|random thought)\\b/.test(trimmed) && !score.wrspark && !score.wrcontent) add('hub', 1.5);\n    // a question or thought to come back to (\"should we switch to verizon\", \"why does the dishwasher smell\")\n    if (/^(should (we|i)|why (does|is|do|are)|how (do|does|can|much)|what (if|about|should)|is it worth|do we need|does anyone|where (do|can|should))\\b/.test(trimmed) && !w.date) add('hub', 2);\n    // \"ideas\" for the house, a dream, the backyard: the Back Burner\n    if (/\\b(ideas?|inspo|inspiration)\\b/.test(low) && !giftWords && !score.wrcontent && !score.wrspark && !score['list:travel'] && !score['list:places'] && !score['list:restaurants'] && !w.date) add('hub', 2);\n    if (/\\b(ideas?|recs?|recommendations?|suggestions?|options?)\\b/.test(low) && (score['list:travel'] || score['list:places'] || score['list:restaurants'])) { ['list:travel', 'list:places', 'list:restaurants'].forEach(function (d) { if (score[d]) add(d, 1); }); }\n    // things to do, the kids, fall: outings\n    if (/\\bthings to do\\b|\\bfun (things|stuff)\\b|\\bday trip\\b|\\bdate ideas?\\b|\\boutings?\\b/.test(low)) add('list:places', 2);\n    // \"dog friendly patio restaurants\", \"best pizza in cincy?\"\n    if (/\\b(best|good|great|favorite|fave|new|dog friendly|kid friendly|cheap|fancy) (\\w+ )?(pizza|tacos|sushi|burgers?|bbq|brunch|breakfast|coffee|thai|indian|italian|mexican|chinese|ramen|wings|steak|seafood|restaurants?|bars?|breweries)\\b/.test(low) && !w.date) add('list:restaurants', 2);\n    // \"for our anniversary\", \"for charlie's birthday\": what it's for, not the day itself\n    if (/\\bfor (our|my|his|her|their|the|your|mom'?s|dad'?s|[a-z]+'s)( \\d+(st|nd|rd|th)?| \\d+ ?(year|yr))? (birthday|anniversary|wedding|graduation|retirement|birthday dinner|anniversary dinner)\\b/.test(low) && score.event) score.event -= 3;\n    // a to-do or a project (\"call…\", \"learn…\", \"put up…\") isn't a list item, and with no day it isn't on the calendar\n    var vk = verb != null ? VERBS[verb][1][0][0] : null;\n    if ((vk === 'reminder' || vk === 'hub') && !kt) {\n      ['list:places', 'list:travel', 'list:wishlist'].concat(vk === 'hub' ? ['list:restaurants'] : []).forEach(function (d) { if (score[d] && vk === 'hub') score[d] -= 1.5; });\n      if (score.event && !w.date && !w.time) score.event -= 1.5;\n    }\n    // the house, money and life projects: the Back Burner (\"clean out the garage\", \"set up an emergency fund\")\n    var project = /\\b(closet|closets|garage|basement|attic|deck|patio|shelves|shelf|pantry|inbox|emails|photos|pictures|photo albums?|photo book|faucet|fence|backyard|garden|garden beds|raised beds|landscaping|flower beds|playroom|home office|nursery|guest room|guest bath|guest bathroom|cabinets|junk drawer|paperwork|will|wills|spreadsheet|401k|401ks|ira|roth|retirement|emergency fund|savings account|refinanc\\w*|solar|carpet|rugs|hardwood|grout|backsplash|countertops|siding|mudroom|laundry room|baseboards|light fixtures?|ceiling fans?|smart home|home gym|shed|treehouse|chicken coop|dog run|pergola|gazebo|fire pit|hot tub|pool|family tree|bucket list|chore chart|budget|routine|habit|hobby|challenge|fasting|diet|garage sale|yard sale|estate sale)\\b/.test(low);\n    var chore = verb != null && VERBS[verb][2] === 'chore';\n    if (project && !w.date && !ERRAND.test(head) && (vk !== 'reminder' || chore)) { add('hub', 2.5); if (score.reminder) score.reminder -= 1; }\n    // \"make a will\", \"make a photo book\": a project\n    if (/^make (a|an|my|our) (?!appointment|appt|reservation|payment|deposit|call|dentist|vet|doctor|hair)/.test(head) && !meal(head, gi)) add('hub', 2);\n    // a cruise on the river at dinner is an outing, not a trip\n    if (/\\b(dinner cruise|riverboat|river cruise on the ohio)\\b/.test(low) && score['list:travel']) score['list:travel'] -= 3;\n    // a day and something on it: the calendar for a thing to go to, a reminder for a thing to do\n    var onDay = w.date && !w.monthOnly && !w.deadline;\n    if (onDay && /\\b(lunch|dinner|brunch|breakfast|drinks|coffee|game|vs|visiting|visit|review|party|day at|shopping|show|concert|night|festival|haunt|lights|parade|fair|tournament|race|5k|marathon|graduation|wedding|funeral|lighting|market|tour|hike|trip|flight|leaving|leave for|arrive|arrives|arriving|lands|check in|checkout|check out|camp|retreat|conference|reunion|days|off work|pto|in shop|in the shop)\\b/.test(low) && vk !== 'reminder') add('event', 1.5);\n    if (onDay && !w.holiday && !w.time && (kinds.trip || score['list:travel'] >= 2) && vk !== 'hub') { add('event', 3); if (score['list:travel']) score['list:travel'] -= 3; }\n    if (onDay && (kinds.place || kinds.go) && score['list:places']) { score['list:places'] -= 1; add('event', 1); }\n    // one word that's only a verb (\"test\", \"start\") says too little\n    if (verb != null && head.split(' ').length === 1 && !/^(vacuum|laundry|dishes|mow|dust|mop|sweep|rake|shovel|recycle|vote|donate|meditate|journal|stretch|workout|exercise|groceries|invoice|invoices|payroll|budget)$/.test(head)) VERBS[verb][1].forEach(function (x) { if (score[x[0]]) score[x[0]] -= x[1] - 0.5; });\n    (TAGS[opts.tag] || []).forEach(function (x) { add(x[0], x[1]); });\n    // what this household did before with notes like this one: the same words, the same pairs of words, the same note\n    // (all the remembered words together count for at most 2.5: a note with four words that once went to the Back\n    // Burner used to get 10 for the Back Burner, whatever the note said; Kasey, Oct 23: \"not even close\". A note sent\n    // somewhere before counts more, never more than a clear rule)\n    var memAdd = {}, addM = function (d, n) { memAdd[d] = (memAdd[d] || 0) + n; };\n    var mem = opts.memory || {}, ms = {}, mn = 0, wl = words(raw);\n    wl.forEach(function (wd) {\n      var m = mem[wd]; if (!m) return;\n      var total = 0; for (var k in m) total += m[k];\n      if (total < 2) return;   // a word seen once says little\n      mn++; for (var d in m) ms[d] = (ms[d] || 0) + (m[d] / total) * Math.min(1, total / 4);\n    });\n    if (mn) for (var d2 in ms) addM(d2, 2.5 * ms[d2] / mn);\n    var pairs = pairsOf(raw), ps = {}, pn = 0;\n    pairs.forEach(function (p) { var m = mem[p]; if (!m) return; var total = 0; for (var k in m) total += m[k]; pn++; for (var d in m) ps[d] = (ps[d] || 0) + (m[d] / total) * Math.min(1, total / 2); });\n    if (pn) for (var d3 in ps) addM(d3, 1.5 * ps[d3] / pn);\n    var whole = mem['#' + noteKey(raw)];\n    if (whole) { var tw = 0; for (var k2 in whole) tw += whole[k2]; for (var d4 in whole) addM(d4, 2.5 * (whole[d4] / tw) * Math.min(1, tw / 2)); }\n    // all of it together counts for at most 3.5 for a place: enough to settle a weak or vague note, never a clear one\n    for (var d6 in memAdd) add(d6, Math.min(3.5, memAdd[d6]));\n    // \"need to …\" with no day is the Back Burner first, a reminder second (Kasey, Oct 23), whatever the to-do is\n    if (!w.date && /^(i |we )?(really )?(need|have|got) to \\w+/.test(trimmed) && (vk === 'reminder' || vk === 'hub' || vk == null) && score.reminder >= (score.hub || 0)) add('hub', score.reminder - (score.hub || 0) + 0.5);\n    // \"book the cabin for spring\": a trip to plan, not a booking to make today\n    if (/^(book|reserve|rent)\\b/.test(head) && /\\b(for|in|this|next) (spring|summer|fall|winter|autumn|next year|spring break)\\b/.test(low) && score['list:travel']) { add('list:travel', 3); score.reminder -= 2; }\n    // \"book: The Midnight Library\", \"movie - Elf\": a label, then the title\n    if (/^\\s*(book|novel|audiobook|kindle book)\\s*[:\\-–]/i.test(orig)) { add('list:reading', 4); if (score.reminder) score.reminder -= 2; }\n    // \"try intermittent fasting\", \"try meal prepping\", \"try to drink more water\": something to start one day\n    if (/^(try|try to|try and)\\b/.test(trimmed) && !score['list:restaurants'] && !score['list:places'] && !kt && !w.date && !(score.hub >= 2)) add('hub', 2.5);\n    // business ideas: the business's own name, selling something, a service, a gift card\n    var bizName = ownName || /\\b(the business|my business|our business|the shop|my shop)\\b/.test(low);\n    if (bizName && !score.wrcontent && score.hub && !w.date) add('wrspark', 1.5);\n    if (/\\b(expand|expanding)\\b/.test(low) && (bizName || biz)) add('wrspark', 2.5);\n    if (/^sell\\b/.test(head) && /\\b(custom|handmade|digital|printables?|templates?|courses?|products?|merch|portraits?|prints|bandanas|treats|services?|to (small )?businesses|to clients|subscriptions?|ebooks?|presets|stickers|shirts|candles|art)\\b/.test(low)) add('wrspark', 2);\n    if (biz && score['list:wishlist'] && /\\b(gift cards?|offer|offers|sell)\\b/.test(low)) { score['list:wishlist'] -= 2.5; add('wrspark', 1); }\n    if (/\\b(service|services|package|packages)\\b/.test(low) && (biz || /\\b(pet care|pet|dog|cat|house)\\b/.test(low)) && !w.date && score.event) score.event -= 2.5;\n    // \"try Bella Luna\": a name to try is most likely somewhere to eat\n    if (/^try [A-Z][a-z']+( [A-Z&][a-z']*)*\\s*$/.test(String(orig).trim().replace(/^(we should|let'?s|maybe|i want to|we need to)\\s+/i, '')) && !kt && !score['list:places'] && !score['list:travel'] && !score['list:restaurants']) { add('list:restaurants', 3); if (score.hub) score.hub -= 2; }\n    // camping, glamping: a trip\n    if (/\\b(camping|glamping|camp out|backpacking trip|rv trip)\\b/.test(low) && !w.time) add('list:travel', 2.5);\n    // \"date night ideas\": somewhere to go\n    if (/\\b(date night|date|weekend|rainy day|snow day|kid|family) ideas\\b/.test(low)) { add('list:places', 2.5); if (score.event) score.event -= 2; }\n    // habits to build (\"go to bed earlier\", \"less screen time\") and questions to come back to (\"pet insurance for moo?\")\n    if (/\\b((up|bed|sleep|leave|start|home|out) earlier|less screen time|screen time|more sleep|drink more water|walk more|exercise more|meditate|wake up earlier|go to bed|bedtime|cut back on|quit (drinking|smoking|vaping|caffeine|sugar)|stop (eating|drinking|buying|scrolling|snacking)|more often|every day|daily walks?|habit|habits|in order|estate|finances|organized|self care)\\b/.test(low) && !w.date && !w.time && vk !== 'reminder') add('hub', 2.5);\n    if (/\\?\\s*$/.test(orig) && head.split(' ').length >= 2 && !w.date && !w.time && !score['list:restaurants'] && !score['list:travel'] && !score['list:places']) { add('hub', 2); if (score.reminder) score.reminder -= 1; }\n    // \"that pasta bake from tiktok\": a dish seen online, to try one day\n    if (/\\b(from|saw on|seen on|off of|saw it on) (tiktok|instagram|insta|pinterest|youtube|facebook|reddit|ig|fb)\\b/.test(low) && !biz) { if (score.wrcontent) score.wrcontent -= 3; if (DISH.test(low)) add('hub', 2.5); }\n    // a trip for a party (\"nashville bachelorette\", \"vegas for a bachelor party\")\n    if ((kinds.trip || score['list:travel']) && /\\b(bachelorette|bachelor|girls trip|guys trip|honeymoon|babymoon|anniversary trip|birthday trip|getaway)\\b/.test(low) && !w.date) { add('list:travel', 1.5); if (score.event) score.event -= 2; }\n    // an appointment with no day is one to make (\"hair appt\", \"dentist appointment\")\n    if (/\\b(appointment|appointments)\\b/.test(low) && !w.date && !w.time && score.event) { score.event -= 1.5; add('reminder', 1.5); }\n    // a movie or show with a day and time is a plan (\"movie w charlie tonight at 8\")\n    if (w.date && w.time && !kt && score['list:shows-movies']) { score['list:shows-movies'] -= 2; add('event', 1.5); }\n    // with someone at a time (\"taxes w/ the cpa feb 25 @ 3\"): a meeting\n    if (w.date && w.time && /\\bwith (the |my |our )?[a-z]+/.test(low) && vk !== 'reminder') add('event', 1.5);\n    // business words that make a spark (\"referral discount for repeat clients\", \"monthly website care plan\")\n    if (/\\b(discount|promo|promotion|coupon|loyalty|referral|care plan|maintenance plan|monthly plan|subscription plan|course on|course about|workshop on|class on how|membership|tiers?)\\b/.test(low) && (biz || /\\b(clients?|customers?|businesses|pet owners|website|sitting)\\b/.test(low))) add('wrspark', 3);\n    if (/\\b(youtube shorts?|short form|shorts|tips video|tutorial|how to video|tip of the week|faq video)\\b/.test(low)) add('wrcontent', 2.5);\n    // \"thought: …\", \"idea: …\": the Back Burner, unless it's for the business\n    if (/^(thought|idea|random thought|random idea|note to self)\\s*[:\\-–]/i.test(orig) && !score.wrspark && !score.wrcontent) { add('hub', 2.5); if (score.event && !w.time) score.event -= 1.5; }\n    // a trip at Christmas is still a trip (\"NYC at christmas\")\n    if (kinds.trip && w.holiday && !w.time && score.event) score.event -= 2;\n    // getting something on a day that isn't groceries (\"get the christmas tree this weekend\")\n    if (buyish && w.date && !(score.grocery >= 2.5)) add('reminder', 1.5);\n    // one word that's a verb and nothing else: no rule of thumb for it either\n    if (verb != null && head.split(' ').length === 1 && !/^(vacuum|laundry|dishes|mow|dust|mop|sweep|rake|shovel|recycle|vote|donate|meditate|journal|stretch|workout|exercise|groceries|invoice|invoices|payroll|budget)$/.test(head) && score.reminder) score.reminder -= 1.5;\n    // something for later with a day and a time is on the calendar (\"volunteer at the food pantry sat 9-12\")\n    if (vk === 'hub' && w.date && w.time) { score.hub -= 2; add('event', 1.5); }\n    // an outing named with no day is somewhere to go (\"outdoor concert at riverbend\"), not a date on the calendar\n    if (!w.date && !w.time && (kinds.place || (kinds.go && kinds.go.n >= 2)) && score.event) score.event -= 1.5;\n    // \"drive in movie\", \"movie in the park\": an outing, not a film\n    if (kinds.go && kinds.go.n >= 2 && score['list:shows-movies'] && !kt) score['list:shows-movies'] -= 2;\n    // a book before its film (\"project hail mary before the movie\")\n    if (/\\bbefore (the|it|they) (movie|film|show|series|comes out|come out)\\b/.test(low) && score['list:reading']) { add('list:reading', 3); if (score['list:shows-movies']) score['list:shows-movies'] -= 3; }\n    // \"ice cream at aglamesis\", \"Skyline after the game\": the place to eat\n    var restAt = kinds.rest && (new RegExp(' at (the )?' + esc(kinds.rest.k) + ' ').test(' ' + plain(head) + ' ') || (kinds.rest.i === 0 && /^(after|before|tonight|for (lunch|dinner|breakfast|brunch)|sometime|again|soon|with|w|on|this|next|when)\\b/.test(plain(head).slice(kinds.rest.k.length).trim())));\n    if (restAt && !/^(buy|get|grab|pick up|order)\\b/.test(head) && !score.wrcontent) { if (score.grocery) score.grocery -= 3; add('list:restaurants', 1.5); }\n    // a post or a video for the business that happens to name a place (\"client testimonial video from the dog park\")\n    if (score.wrcontent >= 3) ['list:places', 'list:restaurants', 'list:travel'].forEach(function (d) { if (score[d]) score[d] -= 2.5; });\n    // a new thing to have (\"new patio furniture\")\n    if (kinds.want && /^(a )?new /.test(head) && !w.date) add('list:wishlist', 1.5);\n    // ---- round 2 (Oct 27, from the exam's weak spots, as kinds) ----\n    // a shopping list under a store or a dish (\"findlay market saturday: bread, cheese, flowers\", \"stuff for tacos: …\")\n    var gl = groceryItems(raw);\n    if (gl.length >= 2 && /^[^:,]{1,40}?\\s*(:|\\s[-–]\\s)/.test(raw.trim()) && gi && gl.filter(function (p) { var x = gi(p); return x && x.aisle !== 'Other' && x.cover >= 0.99; }).length >= 2) { add('grocery', 3); ['event', 'list:places', 'list:restaurants', 'reminder'].forEach(function (d) { if (score[d]) score[d] -= 3; }); }\n    // \"used the last of the milk\", \"can u grab tp\": groceries said in a sentence\n    if (/\\b(used (up )?the last of|ran out of|finished (off )?the|last of the)\\b/.test(low) && gl.length && gi && food(gi(gl[0]))) add('grocery', 3);\n    if (/^(can|could|would|will) (you|u)\\b/.test(trimmed) && buyish && gl.length && gi && food(gi(gl[0])) && gi(gl[0]).cover >= 0.99) add('grocery', 2);\n    // the Spark File: a service, a package, a price, a membership for a pet-care or web business\n    var bizNoun = /\\b(services?|packages?|membership|memberships|subscription|add-?ons?|bundle|retainer|workshops?|class|classes|course|surcharge|rates?|rate increase|pricing|prices|discount|referral|loyalty|audits?|plans?|products?|mini sites?|sites|e-?commerce|gift certificates?|gift cards?|flat rate|tiers?|offerings?|niche|socialization|visits|overnights|walks|walker|walkers|sitters?|assistant|va|intern|templates?|kits?|check-in calls)\\b/.test(low);\n    var bizWho = ownHit || /\\b(clients?|customers?|bookings?|small business(es)?|local (makers|businesses|shops)|the business|my business|websites?|seo|logo|branding)\\b/.test(low);\n    var idea = /^(what if|what about|how about|could (we|i)|we could|maybe (we|a|an)|idea|start|offer|launch|add|host|run|charge|sell|hire|train|partner|expand|create|build|package|a |an |new|raise|lower|bump)\\b/.test(trimmed) || /\\$\\d|\\d+ ?(visits|walks|for \\$)|per (visit|walk|month|hour)|flat rate|a month|\\/mo|annual|monthly|quarterly/.test(low);\n    var sellsThings = /^sell\\b/.test(head) && /\\b(custom|handmade|digital|printables?|templates?|courses?|products?|merch|portraits?|prints|bandanas|treats|services?|subscriptions?|ebooks?|presets|stickers|shirts|candles|art|kits)\\b/.test(low);\n    if (/^(launch|create|build|make|design) .*\\b(product|products|templates?|course|ebook|e-book|kit|kits|bundle|app|printables?|planner)\\b/.test(head)) { add('wrspark', 3); if (score.wrcontent) score.wrcontent -= 2; }\n    if (sellsThings) { add('wrspark', 2.5); ['hub', 'list:places'].forEach(function (d) { if (score[d]) score[d] -= 2.5; }); }\n    if (bizNoun && bizWho && !w.date && !w.time && !/^(call|text|email|pay|book|schedule|send|invoice|reply|respond|confirm)\\b/.test(head) && !/\\b(pin|pinterest|post|posts|reel|caption|blog|video|tiktok|instagram|newsletter|story|carousel|linkedin)\\b/.test(low.replace(/newsletter template/, ''))) { add('wrspark', idea ? 4 : 2.5); ['hub', 'reminder', 'list:places', 'list:wishlist', 'event'].forEach(function (d) { if (score[d]) score[d] -= 2; }); if (score.wrcontent && !/\\b(post|reel|caption|blog|video|tiktok|instagram|story)\\b/.test(low)) score.wrcontent -= 2; }\n    if (/^(what if|what about|how about|maybe) (we |i )?(offered|offer|started|start|did|doing|sold|selling|charged|added|launched|ran|hosted|made|created|partnered)\\b/.test(trimmed) && (bizNoun || bizWho || GENB.test(low))) { add('wrspark', 3.5); ['hub', 'list:travel', 'list:places'].forEach(function (d) { if (score[d]) score[d] -= 2.5; }); }\n    if (/^(doing|offer|offering|do|sell|selling) [a-z ]{3,30} for (local|small|other|new|busy|first)\\b/.test(head) && (bizWho || GENB.test(low))) add('wrspark', 3);\n    if (/^(charge|could charge|we could charge) (more|less|a |an |extra|for|\\$)/.test(trimmed) || /\\b(raise|increase|lower|bump) (our |my |the )?(rates?|prices?|pricing)\\b|\\brate increase\\b/.test(low)) { add('wrspark', 3); if (score.reminder) score.reminder -= 3; }\n    // the Back Burner: goals for the year, classes and courses, getting in shape, clearing out and giving away, projects with no day\n    if (/^(read \\d+ books|get back into|get back to (the gym|running|yoga|reading|working out)|get into|read more( books)?( this year| in 20\\d\\d| each (day|night|month)| every day)?$|take an? (course|class|workshop|\\w+ class|\\w+ course|\\w+ \\w+ class)|take (spanish|french|art|dance|cooking|piano|guitar|swim|tennis|golf|pottery|yoga) (lessons|classes)|get certified|run a (5k|10k|half|marathon)|get in shape|lose \\d+|do a no spend|journal every|meditate|learn|try a new hobby|get my .* license|go back to school|get a degree)/.test(head) || /\\b(this year|next year|in 20\\d\\d|someday|eventually|one day)\\b/.test(low) && /^(read|learn|take|get|run|try|do|start|finish|save|pay off)\\b/.test(head)) { if (!w.date && !bizWho) { add('hub', 3); ['reminder', 'list:reading', 'event', 'list:places'].forEach(function (d) { if (score[d]) score[d] -= 2.5; }); } }\n    if ((/^(donate|give away|purge|declutter|sell)\\b/.test(head) || /^(clean out|clear out|go through)\\b/.test(head) && project) && !w.date && !/\\b(drop off|drop|bring|take)\\b/.test(head) && !bizWho && !sellsThings) { add('hub', 2.5); if (score.reminder) score.reminder -= 1.5; if (score.wrcontent) score.wrcontent -= 3; }\n    if (/\\b(facebook marketplace|marketplace|ebay|poshmark|mercari|craigslist|garage sale)\\b/.test(low) && score.wrcontent) score.wrcontent -= 3;\n    if (/\\b(ideas?|inspo|inspiration|pinterest|makeover|mood board)\\b/.test(low) && /\\b(nursery|bedroom|kitchen|bathroom|powder room|living room|dining room|office|basement|backyard|patio|porch|yard|garden|room|house|wall|walls|stairs|entryway|mudroom|closet|landscaping|front door|curb appeal|guest room|kids room|playroom)\\b/.test(low) && !bizWho) { add('hub', 3); if (score.wrcontent) score.wrcontent -= 3; }\n    if (/^(repaint|re-paint|retile|reseal|refinish|resurface|reupholster|recarpet)\\b|^new (tile|flooring|floors|carpet|countertops|cabinets|siding|roof|windows|doors|fence|deck|patio|backsplash|light fixtures?|faucet|vanity)\\b(?! (furniture|set|chairs|table|umbrella|heater|lights|cushions|rug|decor))/.test(head) && !w.date && !w.time && !/^i (may|might)\\b/.test(trimmed)) { add('hub', 3); if (score.reminder) score.reminder -= 1; if (score['list:wishlist']) score['list:wishlist'] -= 2; }\n    if (/\\b(gallery wall|wallpaper|accent wall|board and batten|shiplap|refinish|reupholster|retile|backsplash|powder room|dent|detail the car|car detailing|touch up paint|landscap\\w*|built-?ins?)\\b/.test(low) && !w.date && !w.time) { add('hub', 2.5); if (score['list:places']) score['list:places'] -= 3; if (score.reminder && /\\b(someday|eventually|one day|myself)\\b/.test(low)) score.reminder -= 2; }\n    // to-dos that sound like projects but aren't: start the crockpot, set up autopay, get estimates, find a sitter, cash a check\n    if (/^start (the |a |my )?(crockpot|crock pot|slow cooker|dishwasher|laundry|washer|dryer|roomba|oven|instant pot|coffee|car|rice|grill|sprinklers?)\\b/.test(head)) { add('reminder', 4); if (score.hub) score.hub -= 2.2; }\n    if (/^(set up|sign up for|turn on|switch to) (the |my |our |an? )?(new )?(autopay|auto pay|auto-pay|direct deposit|paperless|new phone|phone|account|payment plan|appointment|printer|wifi|router|online account|portal|alerts|reminders?)\\b/.test(head)) { add('reminder', 4); if (score.hub) score.hub -= 2.2; }\n    if (/^get (\\d+ |a few |some |three |two )?(estimates?|quotes?|bids?)\\b/.test(head)) add('reminder', 2.5);\n    if (/^find (someone|somebody|a sitter|a babysitter|a dog sitter|a pet sitter|a dog walker|coverage|a ride|a sub|a substitute)\\b/.test(head)) { add('reminder', 3); if (score.hub) score.hub -= 1; }\n    if (/^(cash|deposit) (the |my |our |\\w+'?s )?(birthday |christmas |graduation |tax |rebate |refund |bonus )?(check|checks|money|bonus)\\b/.test(head)) { add('reminder', 3); if (score.event) score.event -= 3; }\n    if (/\\bthank you (notes|cards|card|note)\\b/.test(low) && !w.time) { add('reminder', 2.5); if (score.hub) score.hub -= 1.5; }\n    if (/^(review|check-?in|catch up|sync|1:1|one on one|performance review|annual review) (w|with)\\b/.test(head) || /\\bperformance review\\b/.test(low)) { add('event', w.date || w.time ? 4 : 1.5); }\n    // films and shows said as a group (\"halloween movies to watch\", \"scary movies for october\")\n    if (/\\b(movies?|films?|shows?|series|documentaries|docs|rom ?-?coms?|horror movies|christmas movies|tv shows?)\\b/.test(low) && /\\b(to watch|to see|to stream|for (october|halloween|christmas|the holidays|movie night|date night|the kids)|list|marathon|recs?|recommendations?)\\b|^(scary|halloween|christmas|holiday|cozy|fall|summer|kids|family|feel good|funny|sad) (movies|films|shows)\\b/.test(low)) { add('list:shows-movies', 4); ['list:wishlist', 'event', 'hub'].forEach(function (d) { if (score[d]) score[d] -= 2.5; }); }\n    // \"movie: the outrun\", \"tv: the night manager\", \"book: …\": the label says which list, the rest is the title\n    var lab = /^\\s*(movie|film|tv|tv show|show|series|doc|documentary|book|novel|audiobook|podcast)\\s*[:\\-–]\\s*(.+)$/i.exec(orig);\n    if (lab) { var isBook = /^(book|novel|audiobook)$/i.test(lab[1]); add(isBook ? 'list:reading' : 'list:shows-movies', 5); if (!kt) labTitle = proper(tidy(lab[2]).replace(/^(.)/, function (x) { return x.toLowerCase(); })); }\n    // a day and nothing else to go on: the calendar for a thing, a reminder for something to do\n\n    var top = 0; for (var d5 in score) if (score[d5] > top && d5 !== 'event' && d5 !== 'reminder') top = score[d5];\n    if (onDay && top < 2 && Math.max(score.event || 0, score.reminder || 0) < 2) { if (vk === 'reminder' || /\\b(pill|meds|due|pay|bill|renew|ends|expires|should be here|arrives?|deadline)\\b/.test(low) || /^[a-z]+ (the|my|our|a|an|his|her|their|some|all|those|these) /.test(head)) add('reminder', 1); else add('event', 1); }\n    // ---- round 3 (Oct 27): by kind, not by phrase ----\n    var habit = /^(eat|drink|do|have|spend|cook|watch|play|go) (more|less|fewer|healthier)\\b|\\b(more|less) often\\b/.test(head);\n    var giftWordsNote = /\\b(gift|gifts|present|presents|stocking stuffers?|wishlist|wish list|christmas list|xmas list|secret santa|white elephant|gift wrap)\\b/.test(low) || /\\b(flowers|bouquet|roses|tulips|balloons|a card) for (mom|dad|mum|grandma|grandpa|nana|papa|her|him|the teacher|teacher|my \\w+|aunt \\w+|uncle \\w+|\\w+'s)\\b/.test(low);\n    var gFound = findItems(raw).filter(function (x) { var y = gi && gi(x); return y && y.aisle && y.aisle !== 'Other'; });\n    // (2) business ideas and content for any small business, when Work is on: the household's own (opts.biz) and any small\n    // business's words; \"what if we/I …\" with them = an idea\n    var bs = 0;\n    if (ok('wrspark') || ok('wrcontent')) {\n      if (ownName) bs += 3; if (ownPhrase) bs += 3; else if (ownWord) bs += 1.5;\n      if (CONTENT.test(low) && ownHit) bs += 1.5;\n      if (/^hire (a|an|someone|somebody) (babysitter|sitter|nanny|plumber|electrician|cleaner|house cleaner|painter|contractor|handyman|tutor|dog walker|lawn|landscaper|mover|movers)/.test(head) && !ownHit) bs -= 3;\n      var gm = 0, gl2 = low; for (var gi2 = 0; gi2 < 3; gi2++) { var mm2 = GENB.exec(gl2); if (!mm2) break; gm++; gl2 = gl2.slice(mm2.index + mm2[0].length); }\n      bs += gm ? 2 + 1.5 * (gm - 1) : 0;\n      if (gm && / for( [a-z-]+){0,2} [a-z-]+(s|ers|ors|ies|ents)( |$)/.test(low)) bs += 1;\n      if (bs > 0 && /^(what if|what about|how about|maybe|could|we could|i could|should we|should i|idea)\\b/.test(trimmed)) bs += 1.5;\n      if (bs > 0 && /^(offer|offering|start offering|launch|sell|selling|hire|raise|lower|charge|partner|add|expand|introduce|open|apply for|book a booth|create|start|new|wholesale|catering|custom)\\b/.test(head)) bs += 1;\n      if (bs > 0 && /\\?\\s*$/.test(orig)) bs += 0.5;\n      if (/^(pay|call|text|email|sign|send|book|schedule|cancel|renew|return|venmo|confirm|update|drop off|drop|pick up|deposit|invoice|reply|respond|follow up|remind|compare|check|fix|wash|clean|mail|ship|buy|order)\\b/.test(head) || /^(update|compare|check|fix|mail|buy|order|call|text|email|pay)\\b/.test(trimmed) || /\\b(call|text|email) (back|them|her|him)\\b|\\d{3}[-. ]\\d{3}[-. ]\\d{4}/.test(low)) { if (!/^(email|text) (blast|newsletter|campaign)/.test(trimmed)) { bs = Math.min(bs - 2.5, /^(what if|idea|maybe|could)\\b/.test(trimmed) ? 9 : 2); var bizTodo = true; } }\n      // a thing to buy for it (\"ipad for the business\") or a course to take yourself is not an idea for it\n      if (/^(a |an |new |nice )?[a-z-]+( [a-z-]+)? for (the|my|our) (business|shop|studio|truck|salon)\\b/.test(head) && !GENB.test(' ' + head.split(' for ')[0] + ' ')) bs -= 2;\n      if (/^(get certified|take (a|an) (online )?(course|class)|learn)\\b/.test(head) && !/\\b(for|to) (clients|customers|students)\\b/.test(low)) bs -= 2;\n      if (w.date && w.time) bs -= 2; else if (w.date && !w.monthOnly) bs -= 1.5;\n      if (bs >= 3) {\n        var isContent = CONTENT.test(low) && !/^(start|launch|hire) /.test(head) && (/^(announce|post|share|promote) /.test(head) || !/ for (clients|customers)\\b| (plan|package|service|membership|retainer) /.test(low));\n        add(isContent ? 'wrcontent' : 'wrspark', bs + 1.5);\n        ['hub', 'reminder', 'event', 'grocery', 'list:places', 'list:restaurants', 'list:wishlist', 'list:travel', 'list:shows-movies', 'list:reading'].forEach(function (d) { if (score[d]) score[d] -= 2.5; });\n        if (isContent && score.wrspark) score.wrspark -= 2; else if (!isContent && score.wrcontent) score.wrcontent -= 2.5;\n      } else if (bs >= 2 && !bizTodo) add(CONTENT.test(low) ? 'wrcontent' : 'wrspark', bs);\n      else if (bizTodo) ['wrspark', 'wrcontent'].forEach(function (d) { if (score[d]) score[d] -= 3; });\n      if (score.wrcontent >= 3 && CONTENT.test(low) && !w.date && score.event) score.event -= 2;\n    }\n    // a habit with a food in it (\"drink more water\", \"eat less sugar\") is a goal, not shopping\n    if (habit && !w.date && score.grocery) { score.grocery -= 4; add('hub', 1.5); }\n    // (1) groceries found in a sentence about needing, getting or running out of them, even with a day or a \"remind me\"\n    var storeLed = gFound.length >= 1 && new RegExp('^\\\\s*' + STORES + '(\\\\s+(trip|run|haul|list|order|pickup|for))?\\\\b').test(trimmed);\n    // \"snacks for the road trip: trail mix, jerky\": the trip is what they're for\n    var shopFor = gFound.length >= 2 && /^(snacks|stuff|things|food|groceries|supplies|ingredients|drinks)( to (get|buy|grab))? for [^:]{1,40}:/i.test(raw.trim());\n    var needs = /\\b((we|we're|we are|i'?m|is|are|almost|nearly|all|completely|totally|ran|run|running|be) out of|the last of|last of the|no more|need|needs|needed|grab|pick up|picked up|get|got to get|add|put|on the list|to the list|on our list|buy|low on|running low|run out|ran out|used up|drank all|ate all|finished|stop for|stuff for|snacks for)\\b/.test(low) || /^\\s*out of /.test(low) || (gFound.length >= 2 && /^[^:,]{1,40}?\\s*(:|\\s[-–]\\s)/.test(raw.trim())) || storeLed;\n    var lastNeed = !/^(i |we )?(really )?(need|have|got) to \\w+/.test(trimmed) || !w.date;   // Kasey's rule: \"need to buy jalapeños friday\" is a to-do\n    // how much of what the note is about the things are (\"get certified in pet first aid\" isn't about first aid)\n    var gw = 0; gFound.forEach(function (x) { gw += words(x).length || 1; });\n    var NOTC = /^(need|needs|needed|grab|get|pick|picked|add|list|buy|low|last|more|out|used|finished|remind|please|pls|tomorrow|tonight|today|morning|night|way|home|again|also|some|can|could|you|someone|somebody|said|says|wants|asked|tell|stop|run|running|ran|drank|ate|think|there|almost|still|kroger|costco|target|walmart|aldi|meijer|trader|joes|jims|jungle|store|sunday|monday|tuesday|wednesday|thursday|friday|saturday|week|weekend|before|after|charlie|kasey|mom|dad|boys|girls|kids|stuff|things|bring|put|our|got|gotta|ingredients|snacks|lunches|grocery|groceries|run)$/;\n    var rawCore = raw.replace(/\\s+for\\s+(the |a |an |my |our )?[^,:]+$/i, function (x, y) { return /[a-z]/i.test(raw.slice(0, raw.length - x.length)) ? '' : x; });\n    var cw = words(rawCore).filter(function (x) { return !NOTC.test(x); });\n    var cutFor = cw.length; var lr = ' ' + words(raw).join(' ') + ' ', fp = lr.indexOf(' for ');\n    var share = cw.length ? gw / cw.length : 1;\n    var todoHead = /^(order|register|confirm|update|take|venmo|zelle|pay|call|text|email|book|schedule|cancel|return|renew|drop|mail|send|sign|set up|start|make|cook|bake|thaw|defrost|clean|wash|try|fill|refill|change|replace|fix|wrap|print|ship|deliver|bring|plant|water|feed|walk|get certified|register)\\b/.test(head);\n    if (gFound.length && needs && lastNeed && share >= 0.5 && !todoHead && (shopFor || storeLed || !notFood) && !giftWordsNote && !w.time && !w.deadline && (shopFor || (!kt && !kinds.trip && !kinds.rest && !kinds.place)) && !(bs >= 3) && !habit) {\n      add('grocery', gFound.length >= 2 ? 4.5 : 3.5);\n      ['reminder', 'event', 'hub', 'list:places', 'list:restaurants', 'list:wishlist'].forEach(function (d) { if (score[d]) score[d] -= (d === 'reminder' ? 4 : 2.5); });\n      if (storeLed || shopFor || (gFound.length >= 2 && /^[^:,]{1,40}?\\s*(:|\\s[-–]\\s)/.test(raw.trim()))) ['list:travel', 'event', 'list:places'].forEach(function (d) { if (score[d]) score[d] -= 4; });\n    } else if (gFound.length >= 2 && share >= 0.6 && !todoHead && !notFood && !giftWordsNote && !kt && !w.time && !kinds.trip && !kinds.rest && !kinds.place) add('grocery', 2);   // \"cheese crackers grapes salami\"\n    // (3) the shape of a to-do: a someday goal or habit with no day = the Back Burner; a one-off errand with a thing = a reminder\n    var errand = /^(make (a |an |the )?(reservations?|appointment|dinner reservations?)|set up (a |the )?(call|meeting|appointment|time|vet appointment)|book|renew|return|reschedule|schedule|cancel|order|sign (up|the)|send|email|text|call|mail|print|wrap|sharpen|shred|fix the|replace the|hang the|reset|refill|test the|change the|clean the|find the|pick up|drop (off|the)|pay|buy|get the|get a new|deposit|file|submit|update the|install the|return the)\\b/.test(head) && head.split(' ').length >= 2;\n    var laterW = /\\b(this year|next year|in 20\\d\\d|in a year|someday|one day|eventually|more often|less often)\\b|\\b(more|less)$/.test(low.trim());\n    var goal = (!errand || laterW) && /\\b(more|less|fewer|better|(up|bed|sleep|leave|start|home|out) earlier|healthier|this year|next year|in 20\\d\\d|in a year|every day|each day|daily|a day|once a (week|month)|someday|one day|eventually)\\b/.test(low) && (!gFound.length || habit) && !kinds.trip && !kinds.want && !kinds.rest && !kinds.place\n      || /^(save|save up|learn|start a|start an|start composting|start saving|start journaling|start running|get back into|get into|get better at|be (more|less|better)|stop (buying|eating|drinking|spending|scrolling)|spend (more|less)|eat (more|less|healthier)|drink (more|less)|walk \\d|read the|memorize|organize|record|scan|label|digitize|make a (family|baby|photo)|write down|put together a|figure out|teach the kids|try to)\\b/.test(head)\n      || /\\b(family (recipes|stories|history|photos|tree|cookbook)|photo albums?|baby book|old photos|grandma'?s stories|grandpa telling|kids'? artwork)\\b/.test(low);\n    if (goal && !w.date && !w.time && (!kt || laterW) && !(score.wrspark >= 3) && !(score.wrcontent >= 3) && !(score.grocery >= 3)) { add('hub', 3); if (score.reminder > 0) score.reminder = Math.max(/^(i |we )?(really )?need to /.test(trimmed) ? 0.5 : -1, score.reminder - 2.5); ['list:reading', 'list:places', 'list:shows-movies', 'event'].forEach(function (d) { if (score[d] && score[d] < 5) score[d] -= 1.5; }); }\n    else if (errand && !goal && !(project && laterW) && !(score.grocery >= 3) && !(score.wrspark >= 3) && !(score.wrcontent >= 3) && !kt) { add('reminder', 2.5); if (score.hub && !project) score.hub -= 2; }\n    // a trip on given days is on the calendar (\"camping trip fri-sun\")\n    if (onDay && !w.time && !w.holiday && score['list:travel'] > (score.event || 0) && vk !== 'hub' && !/\\b(ideas?|someday|maybe)\\b/.test(low)) { var dt = score['list:travel'] - (score.event || 0) + 0.5; add('event', dt); }\n    if (labTitle) kt = { title: labTitle.charAt(0).toUpperCase() + labTitle.slice(1), book: true, show: true, movie: true, whole: true };\n    var ranked = Object.keys(score).filter(function (d) { return score[d] > 0; }).sort(function (a, b) { return score[b] - score[a] || ORDER.indexOf(a) - ORDER.indexOf(b); });\n    var best = ranked.length && score[ranked[0]] >= 1.5 ? ranked[0] : null;\n    // a note that's only a day (\"tomorrow\", \"friday\") says nothing about what\n    if (best && !head && !kt && !(w.holiday)) best = null;\n    // a lone word nothing knows says too little (\"charlie\", \"stuff\")\n    if (best && score[best] < 2 && nw <= 1 && !kt) best = null;\n    // (4) nothing scored: the strongest weak sign, unless it's a lone word nothing knows or \"???\"\n    if (!best && /[a-z]{2}/i.test(raw) && !(nw <= 1 && !gFound.length)) {\n      if (/^(what if|what about|how about|maybe (we|i)|idea|someday)\\b/.test(trimmed) && ok('hub')) { best = 'hub'; score.hub = Math.max(score.hub || 0, 1.5); }\n      else if (gFound.length && ok('grocery') && !/^(make|cook|bake)\\b/.test(head)) { best = 'grocery'; score.grocery = Math.max(score.grocery || 0, 1.5); }\n      else if (/^[a-z]+ (the|a|an|my|our|his|her|some|new|old|\\w+'s) \\w+/.test(head) && ok('reminder') && !/^(the|a|an|my|our|this|that|so|ok|ugh|lol|what|why|how|is|was|it)\\b/.test(head) && !/\\b(may|might|maybe|want to|wanna|thinking|should we|someday)\\b/.test(low)) { best = 'reminder'; score.reminder = Math.max(score.reminder || 0, 1.5); }\n      if (best && ranked.indexOf(best) === -1) ranked.unshift(best);\n    }\n    return {\n      best: best, ranked: ranked, score: score, date: w.date, time: w.time, repeat: repeat, freq: w.freq, dow: w.dow,\n      title: best ? titleFor(best, orig, w, R, kt, nameHit) : tidy(R.text),\n      titleFor: function (d) { return titleFor(d, orig, w, R, kt, nameHit); },\n      known: kt,\n      items: groceryItems(orig)\n    };\n  }\n  var ORDER = ['reminder', 'event', 'grocery', 'hub', 'list:shows-movies', 'list:reading', 'list:restaurants', 'list:places', 'list:travel', 'list:wishlist', 'wrcontent', 'wrspark'];\n  function noteKey(text) { return words(text).join(' ').slice(0, 60); }\n  function pairsOf(text) { var w = words(text), out = []; for (var i = 0; i + 1 < w.length; i++) out.push(w[i] + ' ' + w[i + 1]); return out; }\n\n  // remember that a note with these words went to this place (kept small: the most used words only); its pairs of words\n  // and the whole note too, so \"costco run\" or \"grimsby hollow\" can be offered the same place next time\n  function learn(memory, text, dest) {\n    var mem = {}; for (var k in (memory || {})) mem[k] = Object.assign({}, memory[k]);\n    var keys0 = words(text).concat(pairsOf(text));\n    var nk = noteKey(text); if (nk) keys0.push('#' + nk);\n    keys0.forEach(function (wd) { mem[wd] = mem[wd] || {}; mem[wd][dest] = (mem[wd][dest] || 0) + 1; });\n    var keys = Object.keys(mem);\n    if (keys.length > 400) {\n      var sum = function (k) { var s = 0; for (var d in mem[k]) s += mem[k][d]; return s; };\n      // single words are kept first (they say most), then pairs, then whole notes\n      var rank = function (k) { return sum(k) * (k.charAt(0) === '#' ? 0.6 : k.indexOf(' ') !== -1 ? 0.8 : 1); };\n      keys.sort(function (a, b) { return rank(b) - rank(a); }).slice(400).forEach(function (k) { delete mem[k]; });\n    }\n    return mem;\n  }\n\n  // the first guess builds the word lists and the rules (a few tenths of a second on a slower phone): do it while the\n  // phone is idle after Today opens, so the Inbox opens without that wait\n  if (typeof window !== 'undefined' && window.document) {\n    var warm = function () { try { guess('warm up the inbox', { today: new Date() }); } catch (e) {} };\n    if (window.requestIdleCallback) window.requestIdleCallback(warm, { timeout: 4000 }); else setTimeout(warm, 1500);\n  }\n  var api = { groceryParts: groceryParts, findItems: findItems, guess: guess, learn: learn, when: function (text, today) { return when(text, today); }, groceryItems: groceryItems, words: words, read: read, bizFrom: bizFrom };\n  if (typeof module !== 'undefined' && module.exports) module.exports = api;\n  root.dbkInboxGuess = api;\n})(typeof window !== 'undefined' ? window : globalThis);\n","dashboard.js":"let calendarView='twoday';let calendarDate=new Date();let calendarEvents=[];let groceries=[];let selectedDates=[];let selectedDateEntries=[];function localDateStr(d){return d.getFullYear()+'-'+String(d.getMonth()+1).padStart(2,'0')+'-'+String(d.getDate()).padStart(2,'0');}\nlet lifeReminders=[];let currentReminderIndex=0;async function loadLifeReminders(){const firebaseData=await loadFromFirebase('lifeReminders');if(firebaseData&&firebaseData.length>0){lifeReminders=firebaseData;}else{const localData=localStorage.getItem('lifeReminders');if(localData){try{lifeReminders=JSON.parse(localData);}catch(e){lifeReminders=[];}}else{lifeReminders=[];}}\n/* one-time reminders saved before they kept a year: give each the year of its next date (a date more than 30 days back means next year) */\nlet _addedYear=false;lifeReminders.forEach(r=>{if(r&&r.frequency==='once'&&r.notifyDate&&typeof r.notifyDate==='object'&&r.notifyDate.month&&r.notifyDate.day){r.notifyDate=localDateStr(getNextNotifyDate(Object.assign({},r,{snoozedUntil:null})));_addedYear=true;}});if(_addedYear)await saveLifeReminders();\nupdateReminderDisplay();}\nasync function saveLifeReminders(){localStorage.setItem('lifeReminders',JSON.stringify(lifeReminders));try{await syncToFirebase('lifeReminders',lifeReminders);}catch(err){showToast('Error saving reminders: '+err.message);}}\n/* the date as a reminder keeps it: a one-time reminder keeps the whole date (\"2027-01-05\"); the repeating ones keep month and day */\nfunction dbkRemDate(date,frequency){if(frequency==='once')return date;const p=date.split('-');return{month:parseInt(p[1],10),day:parseInt(p[2],10)};}\nfunction getNextNotifyDate(reminder){const today=new Date();today.setHours(0,0,0,0);const currentYear=today.getFullYear();if(reminder.snoozedUntil){const snoozed=new Date(reminder.snoozedUntil);snoozed.setHours(0,0,0,0);if(snoozed>today)return snoozed;}\nif(reminder.frequency==='weekly'){const targetDay=reminder.dayOfWeek!==undefined?reminder.dayOfWeek:6;const todayDay=today.getDay();let daysAhead=targetDay-todayDay;if(daysAhead<0)daysAhead+=7;if(daysAhead===0&&reminder.lastDone){const lastDoneDate=new Date(reminder.lastDone);lastDoneDate.setHours(0,0,0,0);const daysSinceLastDone=Math.floor((today-lastDoneDate)/(1000*60*60*24));if(daysSinceLastDone<1)daysAhead=7;}\nconst nextDate=new Date(today);nextDate.setDate(nextDate.getDate()+daysAhead);const _df=dbkDoneFor(reminder);while(_df&&nextDate<=_df)nextDate.setDate(nextDate.getDate()+7);return nextDate;}\nlet nd=reminder.notifyDate,ndYear=null;if(typeof nd==='string'){const parts=nd.split('-');ndYear=parseInt(parts[0],10)||null;nd={month:parseInt(parts[1],10),day:parseInt(parts[2],10)};}\nif(!nd||!nd.month||!nd.day)return new Date();let notifyDate=new Date(currentYear,nd.month-1,nd.day);notifyDate.setHours(0,0,0,0);if(reminder.frequency==='once'){if(ndYear)return new Date(ndYear,nd.month-1,nd.day);if(today-notifyDate>30*86400000)notifyDate=new Date(currentYear+1,nd.month-1,nd.day);return notifyDate;}else if(reminder.frequency==='quarterly'||reminder.frequency==='twice'){return dbkEveryMonths(reminder,nd,today,reminder.frequency==='quarterly'?3:6);}else if(reminder.frequency==='monthly'){const occ=(y,m)=>{const d=new Date(y,m,Math.min(nd.day,new Date(y,m+1,0).getDate()));d.setHours(0,0,0,0);return d;};let from=null;if(reminder.lastDoneFor){from=new Date(reminder.lastDoneFor+'T00:00:00');from.setDate(from.getDate()+1);}else if(reminder.lastDone){const ld=new Date(reminder.lastDone);from=new Date(ld.getFullYear(),ld.getMonth()+1,1);}else if(/^\\d{12,14}$/.test(String(reminder.id))){from=new Date(+reminder.id);from.setHours(0,0,0,0);}if(!from||isNaN(from)){let n=occ(currentYear,today.getMonth());if(n<today)n=occ(currentYear,today.getMonth()+1);return n;}let next=occ(from.getFullYear(),from.getMonth());if(next<from)next=occ(from.getFullYear(),from.getMonth()+1);if(next<today){let last=occ(currentYear,today.getMonth());if(last>today)last=occ(currentYear,today.getMonth()-1);if(last>next)next=last;}return next;}else if(reminder.frequency==='yearly'){if(reminder.lastDone){const lastDoneDate=new Date(reminder.lastDone);const lastDoneYear=lastDoneDate.getFullYear();if(lastDoneYear===currentYear){notifyDate=new Date(currentYear+1,nd.month-1,nd.day);}}else{if(notifyDate<today){notifyDate=new Date(currentYear+1,nd.month-1,nd.day);}}const _df=dbkDoneFor(reminder);while(_df&&notifyDate<=_df)notifyDate=new Date(notifyDate.getFullYear()+1,nd.month-1,nd.day);}\nreturn notifyDate;}\n/* the date a repeating reminder was last marked done FOR (Oct 24): ticked ahead of its day (a weekly one the day before,\n   a yearly January one in December) it moves on past that date; with only lastDone it stayed where it was */\nfunction dbkDoneFor(r){if(!r||!r.lastDoneFor||!/^\\d{4}-\\d{2}-\\d{2}$/.test(r.lastDoneFor))return null;const f=new Date(r.lastDoneFor+'T00:00:00');return isNaN(f)?null:f;}\nfunction getDaysUntilNotify(reminder){const notifyDate=getNextNotifyDate(reminder);const today=new Date();today.setHours(0,0,0,0);const diffTime=notifyDate-today;return Math.round(diffTime/(1000*60*60*24));}\nfunction formatDueText(daysUntil){if(daysUntil<0){var _o=Math.abs(daysUntil);return _o+(_o===1?' day overdue':' days overdue');}else if(daysUntil===0){return'Due today';}else if(daysUntil===1){return'Due tomorrow';}else if(daysUntil<=14){return`In ${daysUntil} days`;}else{const notifyDate=new Date();notifyDate.setDate(notifyDate.getDate()+daysUntil);return notifyDate.toLocaleDateString('en-US',{month:'short',day:'numeric'});}}\nfunction getUpcomingReminders(withinDays=90){const now=new Date();now.setHours(0,0,0,0);return lifeReminders.map(r=>{const daysUntil=getDaysUntilNotify(r);return{...r,daysUntil};}).filter(r=>{if(r.daysUntil<0){return r.daysUntil>=-30;}\nif(r.daysUntil>withinDays)return false;if(r.snoozedUntil){const snoozedDate=new Date(r.snoozedUntil);snoozedDate.setHours(0,0,0,0);if(snoozedDate>now)return false;}\nreturn true;}).sort((a,b)=>a.daysUntil-b.daysUntil);}\nfunction reminderReachHtml(r,small){var acts=[],esc=function(t){return String(t==null?'':t).replace(/[&<>\"']/g,function(c){return{'&':'&amp;','<':'&lt;','>':'&gt;','\"':'&quot;',\"'\":'&#39;'}[c];});};var digits=String(r.phone||'').replace(/[^0-9+]/g,'');if(digits){acts.push('<a href=\"tel:'+digits+'\">Call</a>');acts.push('<a href=\"sms:'+digits+'\">Text</a>');}\nif(r.email)acts.push('<a href=\"mailto:'+esc(r.email)+'\">Email</a>');if(r.link){var u=/^https?:\\/\\//i.test(r.link)?r.link:'https://'+r.link;acts.push('<a href=\"'+esc(u)+'\" target=\"_blank\" rel=\"noopener\">Book online</a>');}\nif(!acts.length)return '';return '<div class=\"dbk-rem-contact'+(small?' dbk-rem-contact-sm':'')+'\"><div class=\"dbk-rc-acts\">'+acts.join('<span class=\"dbk-rc-sep\" aria-hidden=\"true\">·</span>')+'</div></div>';}\nfunction updateReminderDisplay(){const upcoming=getUpcomingReminders(90);const container=document.getElementById('currentReminder');container.classList.toggle('is-empty',upcoming.length===0);if(upcoming.length===0){container.classList.add('visible');document.getElementById('reminderTitle').textContent='yay! no reminders';document.getElementById('reminderDue').textContent='';document.getElementById('reminderLinks').innerHTML='';const badge=document.querySelector('.reminder-badge');if(badge)badge.style.display='none';return;}\ncontainer.classList.add('visible');const badge=document.querySelector('.reminder-badge');if(badge)badge.style.display='';if(currentReminderIndex>=upcoming.length){currentReminderIndex=0;}\nconst reminder=upcoming[currentReminderIndex];document.getElementById('reminderTitle').textContent=reminder.title;document.getElementById('reminderDue').textContent=formatDueText(reminder.daysUntil);const descEl=document.getElementById('reminderDescription');if(descEl)descEl.textContent=reminder.description||'';const linkBtn=document.getElementById('reminderLinkBtn');if(linkBtn)linkBtn.style.display='none';\nconst linksContainer=document.getElementById('reminderLinks');linksContainer.innerHTML=reminderReachHtml(reminder,false);\nconst countEl=document.getElementById('reminderCount');if(countEl){if(upcoming.length>1){countEl.textContent=(currentReminderIndex+1)+' of '+upcoming.length;countEl.style.display='';}else{countEl.style.display='none';}}}\nasync function markCurrentReminderDone(){const upcoming=getUpcomingReminders(90);if(upcoming.length===0){return;}\nconst reminder=upcoming[currentReminderIndex];const index=lifeReminders.findIndex(r=>r.id===reminder.id);if(index===-1)return;const before=JSON.parse(JSON.stringify(lifeReminders[index]));if(reminder.frequency==='once'){lifeReminders.splice(index,1);if(window.dbkRemoved)dbkRemoved.track('Done reminder','lifeReminders',[before],lifeReminders);}else{lifeReminders[index].lastDoneFor=localDateStr(getNextNotifyDate(reminder));lifeReminders[index].lastDone=new Date().toISOString();lifeReminders[index].snoozedUntil=null;}\nawait saveLifeReminders();currentReminderIndex=0;updateReminderDisplay();showToast('Reminder done',{duration:8000,undoCallback:async()=>{const i=lifeReminders.findIndex(r=>String(r.id)===String(before.id));if(i===-1)lifeReminders.splice(Math.min(index,lifeReminders.length),0,before);else lifeReminders[i]=before;await saveLifeReminders();updateReminderDisplay();}});}\nfunction openAddReminderPopup(){document.getElementById('addReminderTitle').value='';document.getElementById('addReminderDate').value='';document.getElementById('addReminderFrequency').value='once';document.getElementById('addReminderDesc').value='';document.getElementById('addReminderLink').value='';document.getElementById('addReminderPhone').value='';document.getElementById('addReminderEmail').value='';document.getElementById('addReminderDayOfWeek').value='6';document.getElementById('addWeeklyDayRow').style.display='none';document.getElementById('addReminderDateGroup').style.display='';document.getElementById('addReminderOverlay').classList.add('visible');setTimeout(()=>document.getElementById('addReminderTitle').focus(),100);}\nfunction closeAddReminderPopup(e){if(e&&e.target!==e.currentTarget)return;window.dbkFormThen=null;document.getElementById('addReminderOverlay').classList.remove('visible');if(_pendingRouteThoughtId){_pendingRouteThoughtId=null;setTimeout(openInbox,150);}}\n/* the location picker (search, current location, saving) lives in dbk-places.js */\nfunction toggleAddReminderWeeklyDay(){const freq=document.getElementById('addReminderFrequency').value;document.getElementById('addWeeklyDayRow').style.display=freq==='weekly'?'':'none';document.getElementById('addReminderDateGroup').style.display=freq==='weekly'?'none':'';}\nasync function saveAddReminderPopup(){const title=document.getElementById('addReminderTitle').value.trim();const date=document.getElementById('addReminderDate').value;const frequency=document.getElementById('addReminderFrequency').value;const description=document.getElementById('addReminderDesc').value.trim();const link=document.getElementById('addReminderLink').value.trim();const phone=document.getElementById('addReminderPhone').value.trim();const email=document.getElementById('addReminderEmail').value.trim();if(!title){showToast('Please enter a reminder title');return;}\nif(frequency!=='weekly'&&!date){showToast('Please select a notify date');return;}\nconst newReminder={id:Date.now().toString(),title:title,frequency:frequency,description:description||null,link:link||null,phone:phone||null,email:email||null,lastDone:null,snoozedUntil:null};if(date){newReminder.notifyDate=dbkRemDate(date,frequency);}\nif(frequency==='weekly'){newReminder.dayOfWeek=parseInt(document.getElementById('addReminderDayOfWeek').value,10);}\nlifeReminders.push(newReminder);await saveLifeReminders();if(_pendingRouteThoughtId){removeThoughtById(_pendingRouteThoughtId);_pendingRouteThoughtId=null;}\n/* opened from the Back Burner (window.dbkFormThen): told it was saved, with a way to take the reminder off again (its Undo) */\nif(window.dbkFormThen){var _then=window.dbkFormThen,_rid=newReminder.id;window.dbkFormThen=null;setTimeout(function(){_then('reminder',async function(){lifeReminders=lifeReminders.filter(function(r){return r.id!==_rid;});await saveLifeReminders();updateReminderDisplay();});},0);}\ncloseAddReminderPopup();updateReminderDisplay();showToast('Reminder added');}\nfunction openReminderModal(){var s=document.getElementById('reminderSearch');if(s)s.value='';dbkRemKindPick='all';renderReminderList();document.getElementById('reminderModalOverlay').classList.add('visible');}\nfunction closeReminderModal(event){if(event&&event.target!==event.currentTarget)return;document.getElementById('reminderModalOverlay').classList.remove('visible');}\nfunction renderReminderList(){const container=document.getElementById('reminderModalList');const query=(document.getElementById('reminderSearch')?document.getElementById('reminderSearch').value:'').toLowerCase().trim();if(lifeReminders.length===0){container.innerHTML='<div class=\"reminder-empty\">No reminders yet. Add one above.</div>';const cntEl=document.getElementById('reminderModalCount');if(cntEl)cntEl.textContent='';return;}\nlet sorted=[...lifeReminders].sort((a,b)=>{const dateA=new Date(getNextNotifyDate(a));const dateB=new Date(getNextNotifyDate(b));return dateA-dateB;});if(query){sorted=sorted.filter(r=>(r.title||'').toLowerCase().includes(query)||(r.description||'').toLowerCase().includes(query)||(r.link||'').toLowerCase().includes(query)||(r.phone||'').toLowerCase().includes(query)||(r.email||'').toLowerCase().includes(query));}\n/* With a lot of reminders, a switch to show only Personal, Work or Bills (Kasey, Oct 23). Bills are the ones Money makes\n   (bills and subscriptions); Work is marked Work; Personal is the rest. Shown with 8 or more and at least two kinds. */\nsorted=dbkRemKindFilter(sorted);\nconst cntEl=document.getElementById('reminderModalCount');if(cntEl)cntEl.textContent=sorted.length+' of '+lifeReminders.length;if(sorted.length===0){container.innerHTML='<div class=\"reminder-empty\" style=\"padding:16px 0;text-align:center;color:rgba(var(--lh-text-rgb),0.3);font-style:italic;font-size:0.85rem;\">No matches</div>';return;}\ncontainer.innerHTML=sorted.map(reminder=>{const nextDate=new Date(getNextNotifyDate(reminder));const daysUntil=getDaysUntilNotify(reminder);const isOverdue=daysUntil<0;const dueText=formatDueText(daysUntil);const frequencyText=reminder.frequency==='quarterly'?'Every 3 months':reminder.frequency==='twice'?'Every 6 months':reminder.frequency==='yearly'?'Yearly':reminder.frequency==='monthly'?'Monthly':reminder.frequency==='weekly'?'Every '+['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'][reminder.dayOfWeek||0]:'One-time';let linkHtml=reminderReachHtml(reminder,true);\nconst acctLine=(reminder.fromFinance||reminder.fromSubs)&&reminder.description?((String(reminder.description).match(/Usually comes out of [^.\\n]+/)||[])[0]||''):'';const descRest=acctLine?String(reminder.description).replace(acctLine,'').replace(/^\\.\\s*/,'').trim():(reminder.description||'');const descHtml=descRest?`<div style=\"color:rgba(var(--lh-text-rgb),0.4);font-size:0.78rem;font-style:italic;margin-bottom:4px;\">${escHtml(descRest)}</div>`:'';return`<div class=\"reminder-list-item${isOverdue ? ' overdue' : ''}\"id=\"rli-${escHtml(reminder.id)}\"><div class=\"reminder-list-row\" data-id=\"${escHtml(reminder.id)}\" onclick=\"toggleReminderRow(this.dataset.id)\"><span class=\"reminder-list-chevron\">&#9658;</span><span class=\"reminder-list-title\">${escHtml(reminder.title)}${acctLine?`<span class=\"dbk-rem-acct\">${escHtml(acctLine)}</span>`:''}</span><span class=\"reminder-list-due\">${dueText}</span></div><div class=\"reminder-list-details\"><div class=\"reminder-list-meta\"><span>${frequencyText}</span><span>${nextDate.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'})}</span></div>${descHtml}\n${linkHtml}<div class=\"reminder-list-actions\"><button class=\"reminder-edit-btn\" data-id=\"${escHtml(reminder.id)}\" onclick=\"editReminder(this.dataset.id)\">Edit</button><button class=\"reminder-delete-btn\" data-id=\"${escHtml(reminder.id)}\" onclick=\"deleteReminder(this.dataset.id)\">Delete</button></div></div></div>`;}).join('');}\nfunction toggleReminderRow(id){const item=document.getElementById('rli-'+id);if(!item)return;item.classList.toggle('open');}\nfunction filterReminderList(){renderReminderList();}\nfunction dbkRemKind(r){if(r&&(r.fromFinance||r.fromSubs||/^(bill|sub)-/.test(String(r.id))))return 'bills';return r&&r.space==='work'?'work':'personal';}\nvar dbkRemKindPick='all';\nfunction dbkRemKindFilter(list){var box=document.getElementById('dbkRemKinds');var have={};lifeReminders.forEach(function(r){have[dbkRemKind(r)]=1;});var kinds=[['all','All'],['personal','Personal'],['work','Work'],['bills','Bills']].filter(function(k){return k[0]==='all'||have[k[0]];});var show=lifeReminders.length>=8&&kinds.length>2;if(!show||!have[dbkRemKindPick])dbkRemKindPick='all';if(box){box.hidden=!show;var h=show?kinds.map(function(k){return '<button type=\"button\" data-remkind=\"'+k[0]+'\" class=\"'+(dbkRemKindPick===k[0]?'on':'')+'\" aria-pressed=\"'+(dbkRemKindPick===k[0])+'\">'+k[1]+'</button>';}).join(''):'';if(box._h!==h){box.innerHTML=h;box._h=h;}if(!box._wired){box._wired=1;box.addEventListener('click',function(e){var b=e.target.closest('[data-remkind]');if(!b)return;dbkRemKindPick=b.getAttribute('data-remkind');renderReminderList();var l=document.getElementById('reminderModalList');if(l&&l.closest('.reminder-modal'))l.closest('.reminder-modal').scrollTop=0;});}}\nreturn dbkRemKindPick==='all'?list:list.filter(function(r){return dbkRemKind(r)===dbkRemKindPick;});}\nvar _editRemWas=null;function editReminder(id){const reminder=lifeReminders.find(r=>String(r.id)===String(id));if(!reminder)return;document.getElementById('editReminderTitle').value=reminder.title;document.getElementById('editReminderDesc').value=reminder.description||'';document.getElementById('editReminderLink').value=reminder.link||'';document.getElementById('editReminderPhone').value=reminder.phone||'';document.getElementById('editReminderEmail').value=reminder.email||'';document.getElementById('editReminderId').value=id;document.getElementById('editReminderFrequency').value=reminder.frequency||'once';const nd=reminder.notifyDate;/* a repeating reminder shows its next date (a monthly one saved as January showed \"Jan 27, 2026\" in October; overnight audit, Oct 24); saving with the date untouched keeps the date as it was saved */let _rd='';if(nd&&typeof nd==='object'&&nd.month&&nd.day){_rd=localDateStr(getNextNotifyDate(Object.assign({},reminder,{snoozedUntil:null})));}else if(typeof nd==='string'){_rd=nd;}document.getElementById('editReminderDate').value=_rd;_editRemWas={date:_rd,frequency:reminder.frequency||'once'};\nif(reminder.dayOfWeek!==undefined){document.getElementById('editReminderDayOfWeek').value=reminder.dayOfWeek;}\ntoggleEditWeeklyDay();document.getElementById('editReminderOverlay').classList.add('visible');}\nfunction toggleEditWeeklyDay(){const freq=document.getElementById('editReminderFrequency').value;const dayRow=document.getElementById('editWeeklyDayRow');const dateGroup=document.getElementById('editReminderDateGroup');if(freq==='weekly'){dayRow.style.display='';dateGroup.style.display='none';}else{dayRow.style.display='none';dateGroup.style.display='';}}\nfunction closeEditReminderModal(e){if(e&&e.target!==e.currentTarget)return;document.getElementById('editReminderOverlay').classList.remove('visible');}\nasync function saveEditedReminder(){const id=document.getElementById('editReminderId').value;const title=document.getElementById('editReminderTitle').value.trim();const date=document.getElementById('editReminderDate').value;const frequency=document.getElementById('editReminderFrequency').value;const description=document.getElementById('editReminderDesc').value.trim();const link=document.getElementById('editReminderLink').value.trim();const phone=document.getElementById('editReminderPhone').value.trim();const email=document.getElementById('editReminderEmail').value.trim();if(!title){showToast('Please enter a reminder title');return;}\nif(frequency!=='weekly'&&!date){showToast('Please select a notify date');return;}\nconst index=lifeReminders.findIndex(r=>String(r.id)===String(id));if(index===-1)return;lifeReminders[index].title=title;lifeReminders[index].frequency=frequency;lifeReminders[index].description=description||null;lifeReminders[index].link=link||null;lifeReminders[index].phone=phone||null;lifeReminders[index].email=email||null;if(date&&!(_editRemWas&&_editRemWas.date===date&&_editRemWas.frequency===frequency&&lifeReminders[index].notifyDate)){lifeReminders[index].notifyDate=dbkRemDate(date,frequency);}\nif(frequency==='weekly'){lifeReminders[index].dayOfWeek=parseInt(document.getElementById('editReminderDayOfWeek').value,10);}else{delete lifeReminders[index].dayOfWeek;}\nawait saveLifeReminders();closeEditReminderModal();renderReminderList();updateReminderDisplay();}\n/* A reminder Money made (Kasey, Oct 24: deleting a bill's reminder brought it back on the next Money visit; \"yes send it to\n   recently deleted\"). Deleting it turns off what made it, in Money's own lists (finance_bills / finance_subs, saved item by\n   item like every shared list), so neither phone makes it again and the bill's or subscription's form shows it off:\n   bill-<id> = the bill's \"Remind me the day before it's due\" (remind: false); its 30-days-before heads-up\n   (bill-<id>-early) only exists while that is on, so it goes with it; bill-<id>-early alone = \"Remind me 30 days before\"\n   (early: false); sub-<hash> = Plan to cancel's \"Remind me on\" (remind: ''); subday-<hash> = \"Remind me the day before\n   it's charged\" (dayRemind off). Undo, and Put back in Settings > Recently removed, bring the reminder back and turn it\n   on again (dbkMoneyRem.on). Ticking one Done changes nothing here. With no signal and no copy of Money's lists on this\n   phone, the change waits in dbkMoneyRemQ and is made once the cloud answers. */\nvar dbkMoneyRem=(function(){\nvar QK='dbkMoneyRemQ';\nfunction hash(s){var h=2166136261;for(var i=0;i<s.length;i++){h^=s.charCodeAt(i);h=Math.imul(h,16777619);}return(h>>>0).toString(36);}   /* finance.js hashStr */\nfunction what(r){if(!r||typeof r.id!=='string')return null;var m;\nif(r.fromFinance&&(m=/^bill-([a-z0-9]+)(-early)?$/i.exec(r.id)))return{col:'finance_bills',k:m[1],kind:m[2]?'early':'bill'};\n/* a tracked loan's \"Remind me the day before it's due\" (Oct 26, finance.js syncLoanReminder) */\nif(r.fromFinance&&(m=/^loan-([a-z0-9]+)$/i.exec(r.id)))return{col:'finance_loans',k:m[1],kind:'loan'};\nif(r.fromSubs&&(m=/^subday-([a-z0-9]+)$/.exec(r.id)))return{col:'finance_subs',k:m[1],kind:'day'};\nif(r.fromSubs&&(m=/^sub-([a-z0-9]+)$/.exec(r.id)))return{col:'finance_subs',k:m[1],kind:'cancel',val:typeof r.notifyDate==='string'?r.notifyDate:''};\nreturn null;}\nfunction hit(x,op){return!!x&&x.id!=null&&(op.col==='finance_bills'||op.col==='finance_loans'?String(x.id).replace(/[^a-z0-9]/gi,'')===op.k:hash(String(x.id))===op.k);}\nfunction change(x,op){var y=JSON.parse(JSON.stringify(x));\nif(op.kind==='bill'||op.kind==='loan'){if(!!y.remind===op.on)return x;y.remind=op.on;}\nelse if(op.kind==='early'){if((y.early!==false)===op.on)return x;if(op.on)delete y.early;else y.early=false;}\nelse if(op.kind==='day'){if(!!y.dayRemind===op.on)return x;if(op.on)y.dayRemind=true;else delete y.dayRemind;}\nelse if(op.kind==='cancel'){var v=op.on?(op.val||''):'';if((y.remind||'')===v||(op.on&&y.state!=='cancel'))return x;y.remind=v;}\nelse return x;\nif(op.col==='finance_subs')y.at=new Date().toISOString();return y;}\nfunction qGet(){try{return JSON.parse(localStorage.getItem(QK)||'[]')||[];}catch(e){return[];}}\nfunction qPut(q){try{if(q.length)localStorage.setItem(QK,JSON.stringify(q));else localStorage.removeItem(QK);}catch(e){}}\nfunction cloud(){return!!(window.firestoreImports&&window.db&&window.firebaseReady&&!window.firebaseConfigEmpty);}\n/* the newest copy of one of Money's lists: the cloud's, else (no signal) this phone's own copy of it */\nfunction read(col){var fi=window.firestoreImports,ref=fi.doc(window.db,col,'data');var snapIt=function(){try{var v=window.dbkSnapItems&&window.dbkSnapItems(col);return Array.isArray(v)?v:null;}catch(e){return null;}};\nreturn new Promise(function(res){var t=setTimeout(function(){res(snapIt());},5000);Promise.resolve(fi.getDoc(ref)).then(function(sn){clearTimeout(t);var d=sn&&sn.exists&&sn.exists()?sn.data():null;res(d&&Array.isArray(d.items)?d.items:(sn&&sn.exists&&!sn.exists()?[]:snapIt()));},function(){clearTimeout(t);res(snapIt());});});}\nfunction run(ops){if(!ops.length)return Promise.resolve(true);if(!cloud())return Promise.resolve(false);var fi=window.firestoreImports,cols={};ops.forEach(function(o){(cols[o.col]=cols[o.col]||[]).push(o);});\nreturn Promise.all(Object.keys(cols).map(function(col){return read(col).then(function(items){if(!items)return false;var ch=false;var next=items.map(function(x){var y=x;cols[col].forEach(function(o){if(hit(y,o))y=change(y,o);});if(y!==x)ch=true;return y;});if(!ch)return true;\n/* (what this page last had of that list, so the save sends only the item changed: daybook-theme.js) */\ntry{if(window.__dbkSync)window.__dbkSync.base[col+'/data']=JSON.parse(JSON.stringify(items));}catch(e){}\nreturn Promise.resolve(fi.setDoc(fi.doc(window.db,col,'data'),{items:next,updatedAt:new Date().toISOString()})).then(function(){return true;},function(){return true;});});})).then(function(r){return r.every(Boolean);});}\nfunction send(ops){if(window.firebaseConfigEmpty||window.firebaseNotConfigured)return Promise.resolve(true);/* (a copy with no cloud: Money makes no reminders there) */var q=qGet().concat(ops);qPut([]);return run(q).then(function(ok){if(!ok)qPut(qGet().concat(q));return ok;},function(){qPut(qGet().concat(q));return false;});}\nfunction flush(){if(qGet().length&&cloud())send([]);}\nwindow.addEventListener('firebaseReady',function(){setTimeout(flush,1500);});window.addEventListener('online',function(){setTimeout(flush,800);});setTimeout(flush,6000);\nfunction ops(rems,on){return(rems||[]).map(function(r){var w=what(r);if(!w)return null;w.on=on;return w;}).filter(Boolean);}\nreturn{\n/* the reminders going with this one: a bill's main reminder takes its 30-days-before heads-up along */\nalong:function(r,list){var w=what(r);if(!w||w.kind!=='bill')return[];return(list||[]).filter(function(x){return x&&x.id===r.id+'-early'&&x.fromFinance;});},\nis:function(r){return!!what(r);},\noff:function(rems){var o=ops(rems,false);return o.length?send(o):Promise.resolve(true);},\non:function(rems){var o=ops(rems,true);return o.length?send(o):Promise.resolve(true);}\n};})();\nwindow.dbkMoneyRem=dbkMoneyRem;\n/* delete a reminder (and any that go with it), with Undo that puts back only those and turns Money's back on */\nasync function dbkRemDelete(id,after){var r0=lifeReminders.filter(function(r){return String(r.id)===String(id);})[0];if(!r0)return;var gid={};[r0].concat(dbkMoneyRem.along(r0,lifeReminders)).forEach(function(r){gid[String(r.id)]=1;});var before=JSON.parse(JSON.stringify(lifeReminders));var gone=before.filter(function(r){return r&&gid[String(r.id)];});lifeReminders=lifeReminders.filter(function(r){return!(r&&gid[String(r.id)]);});if(window.dbkRemoved)dbkRemoved.track('Reminder','lifeReminders',before,lifeReminders);await saveLifeReminders();var money=dbkMoneyRem.is(r0);if(money)dbkMoneyRem.off(gone);if(after)after();renderReminderList();updateReminderDisplay();try{if(window.dbkHmWeek)window.dbkHmWeek();}catch(e){}\n(window.dbkUndo||function(){})(money?'Reminder deleted and turned off in Money':'Reminder deleted',async function(){dbkPutBackOwn(lifeReminders,before,gone);await saveLifeReminders();if(money)dbkMoneyRem.on(gone);renderReminderList();updateReminderDisplay();try{if(window.dbkHmWeek)window.dbkHmWeek();}catch(e){}});}\nasync function deleteReminder(id){return dbkRemDelete(id);}\nasync function calendarLoadEvents(){const firebaseData=await loadFromFirebase('calendarEvents');if(firebaseData){calendarEvents=firebaseData;}else{const saved=localStorage.getItem('calendarEvents');if(saved){calendarEvents=JSON.parse(saved);if(window.dbkCloudMissing&&await window.dbkCloudMissing('calendarEvents'))await syncToFirebase('calendarEvents',calendarEvents);}}}\n/* Oct 20 (Charlie): the calendar is saved on the phone at once and the cloud catches up on its own; the page never waits for it.\n   Waiting on the cloud left Save's pop-up open, and a deleted event showing, for as long as a slow connection took. */\nasync function calendarSaveEvents(){localStorage.setItem('calendarEvents',JSON.stringify(calendarEvents));Promise.resolve(syncToFirebase('calendarEvents',calendarEvents)).catch(function(){});}\nfunction calendarGetEventsForDate(date){const dateStr=date.toDateString();const events=calendarEvents.filter(event=>{try{const[year,month,day]=event.date.split('-').map(Number);const eventDate=new Date(year,month-1,day);return eventDate.toDateString()===dateStr;}catch(e){return false;}});events.sort((a,b)=>{if(!a.time&&!b.time)return 0;if(!a.time)return 1;if(!b.time)return-1;return a.time.localeCompare(b.time);});return events;}\nfunction formatTime12Hour(time24){if(!time24)return'';const[hours,minutes]=time24.split(':');let hour=parseInt(hours);const ampm=hour>=12?'PM':'AM';hour=hour%12;hour=hour?hour:12;return`${hour}:${minutes}${ampm}`;}\nfunction calendarPrevious(){if(calendarView==='twoday'){calendarDate.setDate(calendarDate.getDate()-2);}else if(calendarView==='week'){calendarDate.setDate(calendarDate.getDate()-7);}else{calendarDate.setMonth(calendarDate.getMonth()-1);}\ncalendarRender();}\nfunction calendarNext(){if(calendarView==='twoday'){calendarDate.setDate(calendarDate.getDate()+2);}else if(calendarView==='week'){calendarDate.setDate(calendarDate.getDate()+7);}else{calendarDate.setMonth(calendarDate.getMonth()+1);}\ncalendarRender();}\nfunction calendarChangeView(view){calendarView=view;document.querySelectorAll('.view-toggle-btn').forEach(btn=>{btn.classList.remove('active');if(btn.getAttribute('data-view')===view){btn.classList.add('active');}});calendarRender();}\nfunction renderEventHTML(event,eventIndex,dateStr){var timeStr=event.allDay?'All day':(event.time?formatTime12Hour(event.time):'');var endTimeStr=(!event.allDay&&event.endTime)?' – '+formatTime12Hour(event.endTime):'';var heartTag='';var eventId=event.id||eventIndex;var isDone=isEventDone(eventId,dateStr);var colorAttr=event.color?' data-color=\"'+escHtml(event.color)+'\"':'';var itemClass='event-item'+(isDone?' done':'');var checkClass='event-check'+(isDone?' checked':'');var timeHTML=timeStr?'<div class=\"event-note\" style=\"font-style:normal;color:rgba(var(--lh-text-rgb),0.5);\">'+timeStr+endTimeStr+'</div>':'';var locHTML=event.location?'<div class=\"event-location\">'+escHtml(event.location)+'</div>':'';var noteHTML=event.note?'<div class=\"event-note\">'+escHtml(event.note)+'</div>':'';var urlHTML=dbkSafeUrl(event.url)?'<a href=\"'+escHtml(dbkSafeUrl(event.url))+'\" target=\"_blank\" rel=\"noopener\" class=\"reminder-link\" style=\"margin-top:4px;display:inline-block;font-size:0.7rem;\">Open link</a>':'';return'<div class=\"'+itemClass+'\"'+colorAttr+'>'+\n'<button class=\"'+checkClass+'\" data-eid=\"'+escHtml(eventId)+'\" data-ds=\"'+dateStr+'\" onclick=\"toggleEventDone(this.dataset.eid,this.dataset.ds)\" aria-label=\"Mark done\"></button>'+\n'<div style=\"flex:1;min-width:0;\">'+\n'<div class=\"event-title\">'+escHtml(event.title)+heartTag+'</div>'+\ntimeHTML+locHTML+noteHTML+urlHTML+\n'</div>'+\n'<div class=\"event-actions\">'+\n'<button class=\"event-edit-btn\" onclick=\"calendarEditEvent('+eventIndex+')\">Edit</button>'+\n'<button class=\"event-delete-btn\" onclick=\"calendarDeleteEvent('+eventIndex+')\">Delete</button>'+\n'</div></div>';}\nfunction getEventCompletions(){try{return JSON.parse(localStorage.getItem('eventCompletions')||'{}');}catch{return{};}}\n/* kept for anything that still calls it: ticks are history, so nothing is deleted any more (the designer: never delete history) */\nfunction isEventDone(eventId,dateStr){if(window.dbkEvDone)return window.dbkEvDone.is(eventId,dateStr);const completions=getEventCompletions();const key=eventId+':'+dateStr;return!!completions[key];}\n/* one tick per day an event is on: window.dbkEvDone (daybook-theme.js) saves just that tick, with Undo, and never prunes old ones */\nasync function toggleEventDone(eventId,dateStr){if(window.dbkEvDone){window.dbkEvDone.toggle(eventId,dateStr);return;}const completions=getEventCompletions();const key=eventId+':'+dateStr;if(completions[key]){delete completions[key];}else{completions[key]=true;}\nlocalStorage.setItem('eventCompletions',JSON.stringify(completions));await syncToFirebase('eventCompletions',completions);calendarRender();}\nasync function loadEventCompletions(){const firebaseData=await loadFromFirebase('eventCompletions');if(firebaseData){localStorage.setItem('eventCompletions',JSON.stringify(firebaseData));}}\nfunction calendarRenderTwoDay(){const container=document.getElementById('calendarContainer');container.innerHTML='';const firstDay=new Date(calendarDate);const secondDay=new Date(calendarDate);secondDay.setDate(firstDay.getDate()+1);document.getElementById('calendarTitle').textContent=`${firstDay.toLocaleDateString('en-US',{month:'short',day:'numeric'})}-${secondDay.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'})}`;const today=new Date();const todayStr=today.toDateString();for(let i=0;i<2;i++){const date=i===0?new Date(firstDay):new Date(secondDay);const dayDiv=document.createElement('div');dayDiv.className='week-day';if(date.toDateString()===todayStr){dayDiv.classList.add('today');}\nconst dayEvents=calendarGetEventsForDate(date);const dateStr=localDateStr(date);let eventsHTML='';if(dayEvents.length>0){dayEvents.forEach((event)=>{const eventIndex=calendarEvents.indexOf(event);eventsHTML+=renderEventHTML(event,eventIndex,dateStr);});}else{eventsHTML='<div class=\"empty-state\">No events</div>';}\nconst tomorrow=new Date(today);tomorrow.setDate(today.getDate()+1);let relLabel='';if(date.toDateString()===todayStr)relLabel='Today';else if(date.toDateString()===tomorrow.toDateString())relLabel='Tomorrow';dayDiv.innerHTML=`<div class=\"week-day-header\"><div style=\"display:flex;flex-direction:column;gap:1px;\">${relLabel?`<span class=\"week-day-rel\">${relLabel}</span>`:''}<span class=\"week-day-name\">${date.toLocaleDateString('en-US',{weekday:'long'})}</span></div><span class=\"week-day-date\">${date.toLocaleDateString('en-US',{month:'short',day:'numeric'})}</span></div><div>${eventsHTML}</div>`;container.appendChild(dayDiv);}}\nfunction calendarRenderWeek(){const container=document.getElementById('calendarContainer');container.innerHTML='';const startOfWeek=new Date(calendarDate);startOfWeek.setDate(calendarDate.getDate()-calendarDate.getDay());const endOfWeek=new Date(startOfWeek);endOfWeek.setDate(startOfWeek.getDate()+6);document.getElementById('calendarTitle').textContent=`${startOfWeek.toLocaleDateString('en-US',{month:'short',day:'numeric'})}-${endOfWeek.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'})}`;for(let i=0;i<7;i++){const date=new Date(startOfWeek);date.setDate(startOfWeek.getDate()+i);const dayDiv=document.createElement('div');dayDiv.className='week-day';const today=new Date();if(date.toDateString()===today.toDateString()){dayDiv.classList.add('today');}\nconst dayEvents=calendarGetEventsForDate(date);const dateStr=localDateStr(date);let eventsHTML='';if(dayEvents.length>0){dayEvents.forEach((event)=>{const eventIndex=calendarEvents.indexOf(event);eventsHTML+=renderEventHTML(event,eventIndex,dateStr);});}else{eventsHTML='<div class=\"empty-state\">No events</div>';}\ndayDiv.innerHTML=`<div class=\"week-day-header\"><span class=\"week-day-name\">${date.toLocaleDateString('en-US',{weekday:'long'})}</span><span class=\"week-day-date\">${date.toLocaleDateString('en-US',{month:'short',day:'numeric'})}</span></div><div>${eventsHTML}</div>`;container.appendChild(dayDiv);}}\nfunction calendarRenderMonth(){const container=document.getElementById('calendarContainer');container.innerHTML='';const year=calendarDate.getFullYear();const month=calendarDate.getMonth();document.getElementById('calendarTitle').textContent=calendarDate.toLocaleDateString('en-US',{month:'long',year:'numeric'});const grid=document.createElement('div');grid.className='calendar-grid';const dayNames=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];dayNames.forEach(day=>{const header=document.createElement('div');header.className='calendar-day-header';header.textContent=day;grid.appendChild(header);});const firstDay=new Date(year,month,1);const lastDay=new Date(year,month+1,0);const daysInMonth=lastDay.getDate();const startingDayOfWeek=firstDay.getDay();const prevMonthLastDay=new Date(year,month,0).getDate();for(let i=startingDayOfWeek-1;i>=0;i--){const day=prevMonthLastDay-i;const date=new Date(year,month-1,day);grid.appendChild(calendarCreateMonthDay(date,true));}\nfor(let day=1;day<=daysInMonth;day++){const date=new Date(year,month,day);grid.appendChild(calendarCreateMonthDay(date,false));}\nconst totalCells=startingDayOfWeek+daysInMonth;const remainingCells=totalCells%7===0?0:7-(totalCells%7);for(let day=1;day<=remainingCells;day++){const date=new Date(year,month+1,day);grid.appendChild(calendarCreateMonthDay(date,true));}\ncontainer.appendChild(grid);}\nfunction calendarCreateMonthDay(date,otherMonth){const dayDiv=document.createElement('div');dayDiv.className='calendar-month-day';if(otherMonth){dayDiv.classList.add('other-month');}\nconst today=new Date();if(date.toDateString()===today.toDateString()){dayDiv.classList.add('today');}\nconst dayEvents=calendarGetEventsForDate(date);const eventCount=dayEvents.length;let countHtml='';if(eventCount>0){countHtml=`<div class=\"day-count\"><span class=\"day-dot\"></span>${eventCount}</div>`;}\ndayDiv.innerHTML=`<div class=\"day-number\">${date.getDate()}</div>${countHtml}`;dayDiv.onclick=()=>{openDayModal(date);};return dayDiv;}\n/* a web link from an event or reminder: http(s) only (a bare \"example.com\" gets https://) */\nfunction dbkSafeUrl(u){u=String(u||'').trim();if(!u)return'';if(!/^https?:\\/\\//i.test(u)){if(/^[a-z][a-z0-9+.-]*:/i.test(u))return'';u='https://'+u;}return u;}\nlet selectedModalDate=null;function openDayModal(date){selectedModalDate=new Date(date);const overlay=document.getElementById('dayModalOverlay');const title=document.getElementById('dayModalTitle');title.textContent=date.toLocaleDateString('en-US',{weekday:'long',month:'long',day:'numeric',year:'numeric'});renderDayModalEvents();hideDayModalForm();overlay.classList.add('visible');}\nfunction closeDayModal(event){if(event&&event.target!==event.currentTarget)return;document.getElementById('dayModalOverlay').classList.remove('visible');selectedModalDate=null;}\nfunction renderDayModalEvents(){const container=document.getElementById('dayModalEvents');const events=calendarGetEventsForDate(selectedModalDate);if(events.length===0){container.innerHTML='<div class=\"day-modal-empty\">No events scheduled</div>';return;}\ncontainer.innerHTML=events.map(event=>{const id=escHtml(event.id);const colorAttr=event.color?` data-color=\"${escHtml(event.color)}\"`:'';let timeStr='';if(event.allDay){timeStr='All day';}else if(event.time){timeStr=formatTime12Hour(event.time);if(event.endTime)timeStr+=' – '+formatTime12Hour(event.endTime);}\nconst timeHtml=timeStr?`<div class=\"day-modal-event-meta\">${escHtml(timeStr)}</div>`:'';const locHtml=event.location?`<div class=\"day-modal-event-location\">${escHtml(event.location)}</div>`:'';const noteHtml=event.note?`<div class=\"day-modal-event-note\">${escHtml(event.note)}</div>`:'';let urlHtml='';const safeUrl=dbkSafeUrl(event.url);if(safeUrl){let label=safeUrl;try{label=new URL(safeUrl).hostname.replace('www.','');}catch(e){}\nurlHtml=`<a href=\"${escHtml(safeUrl)}\" target=\"_blank\" rel=\"noopener\" class=\"day-modal-event-url\">${escHtml(label)}</a>`;}\nconst _ds=localDateStr(selectedModalDate),_has=event.id!=null&&event.id!=='',_dn=_has&&isEventDone(event.id,_ds);const tick=_has?`<button type=\"button\" class=\"hc-ev-ck${_dn?' is-ticked':''}\" data-dbk-icon=\"tick\" data-id=\"${id}\" data-ds=\"${_ds}\" aria-pressed=\"${_dn}\" aria-label=\"Done: ${escHtml(event.title)}\" onclick=\"toggleEventDone(this.dataset.id,this.dataset.ds)\">Done</button>`:'';\nreturn`<div class=\"day-modal-event${_dn?' is-done':''}\"${colorAttr}><div class=\"day-modal-event-header\"><div class=\"day-modal-event-title\">${escHtml(event.title)}</div>${tick}<div class=\"day-modal-event-actions\"><button class=\"day-modal-edit\" data-id=\"${id}\" onclick=\"editDayModalEvent(this.dataset.id)\">Edit</button><button class=\"day-modal-delete\" data-id=\"${id}\" onclick=\"deleteDayModalEvent(this.dataset.id)\">&times;</button></div></div>${timeHtml}${locHtml}${noteHtml}${urlHtml}</div>`;}).join('');}\nfunction showDayModalForm(){document.getElementById('dayModalForm').classList.add('visible');['dayModalEventTitle','dayModalEventTime','dayModalEventEndTime','dayModalEventLocation','dayModalEventUrl','dayModalEventNote','dayModalEditId'].forEach(function(id){var el=document.getElementById(id);if(el)el.value='';});document.getElementById('dayModalEventTitle').focus();}\nfunction hideDayModalForm(){document.getElementById('dayModalForm').classList.remove('visible');}\nfunction editDayModalEvent(eventId){var event=calendarEvents.find(function(e){return e.id===eventId;});if(!event)return;var index=calendarEvents.indexOf(event);document.getElementById('dayModalEventTitle').value=event.title||'';document.getElementById('dayModalEventTime').value=event.time||'';if(document.getElementById('dayModalEventEndTime'))document.getElementById('dayModalEventEndTime').value=event.endTime||'';if(document.getElementById('dayModalEventLocation'))document.getElementById('dayModalEventLocation').value=event.location||'';if(document.getElementById('dayModalEventUrl'))document.getElementById('dayModalEventUrl').value=event.url||'';document.getElementById('dayModalEventNote').value=event.note||'';document.getElementById('dayModalEditId').value=index;document.getElementById('dayModalForm').classList.add('visible');document.getElementById('dayModalEventTitle').focus();}\nasync function deleteDayModalEvent(eventId){const event=calendarEvents.find(e=>e.id===eventId);const _evBefore=JSON.parse(JSON.stringify(calendarEvents)),_compBefore=localStorage.getItem('eventCompletions');\ncalendarEvents=calendarEvents.filter(e=>e.id!==eventId);try{const completions=getEventCompletions();Object.keys(completions).forEach(k=>{if(k.startsWith(eventId+':'))delete completions[k];});localStorage.setItem('eventCompletions',JSON.stringify(completions));}catch(e){}\nrenderDayModalEvents();calendarRender();await calendarSaveEvents();if(window.dbkRemoved)dbkRemoved.track('Event','calendarEvents',_evBefore,calendarEvents);var _gone=_evBefore.filter(function(e){return e.id===eventId;});(window.dbkUndo||function(){})('Event deleted',async function(){dbkPutBackOwn(calendarEvents,_evBefore,_gone);try{if(_compBefore!==null)localStorage.setItem('eventCompletions',_compBefore);}catch(e){}await calendarSaveEvents();try{renderDayModalEvents();}catch(e){}calendarRender();});}\nasync function saveDayModalEvent(){var title=document.getElementById('dayModalEventTitle').value.trim();if(!title){showToast('Please enter an event title');return;}\nvar time=document.getElementById('dayModalEventTime').value;var endTime=document.getElementById('dayModalEventEndTime')?document.getElementById('dayModalEventEndTime').value:'';var location=document.getElementById('dayModalEventLocation')?document.getElementById('dayModalEventLocation').value.trim():'';var url=document.getElementById('dayModalEventUrl')?document.getElementById('dayModalEventUrl').value.trim():'';var note=document.getElementById('dayModalEventNote').value.trim();var editRef=document.getElementById('dayModalEditId').value;var dateStr=localDateStr(selectedModalDate);if(editRef!==''){var index=-1;if(editRef.startsWith('id:')){var eid=editRef.slice(3);index=calendarEvents.findIndex(function(e){return e.id===eid;});}else{index=parseInt(editRef);}\nif(index>=0&&index<calendarEvents.length){calendarEvents[index].title=title;calendarEvents[index].time=time||null;if(time)calendarEvents[index].allDay=false;calendarEvents[index].endTime=endTime||null;calendarEvents[index].location=location||null;calendarEvents[index].url=url||null;calendarEvents[index].note=note||null;calendarEvents[index].date=dateStr;}}else{var ev=buildCalEvent({title:title,date:dateStr,time:time||null,endTime:endTime||null,location:location||null,url:url||null,note:note||null});calendarEvents.push(ev);}\ncalendarSaveEvents();calendarRender();var _mo=document.getElementById('dayModalOverlay');if(_mo&&_mo.classList.contains('hc-editing')){closeDayModal();try{if(window.dbkHmShow)window.dbkHmShow(dateStr);}catch(e){}}else{hideDayModalForm();renderDayModalEvents();}}\nfunction calendarRender(){if(calendarView==='twoday'){calendarRenderTwoDay();}else if(calendarView==='week'){calendarRenderWeek();}else{calendarRenderMonth();}\nupdateCalendarSummary();}\nfunction calendarShowAddForm(){const overlay=document.getElementById('addEventModalOverlay');overlay.classList.add('visible');toggleRepeatOptions();}\nfunction toggleRepeatOptions(){var repeatMode=document.getElementById('calendarRepeatMode').value;var modes={single:'singleDateMode',multiple:'multipleDateMode',range:'rangeMode',recurring:'recurringMode'};Object.values(modes).forEach(function(id){var el=document.getElementById(id);if(el)el.style.display='none';});var show=modes[repeatMode];if(show)document.getElementById(show).style.display='block';}\nfunction addSelectedDate(){var dateInput=document.getElementById('multipleDateInput');var date=dateInput.value;if(!date){showToast('Please select a date first');return;}\nif(selectedDateEntries.find(function(e){return e.date===date;})){showToast('Already added');return;}\nselectedDateEntries.push({date:date,time:'',endTime:''});selectedDateEntries.sort(function(a,b){return a.date.localeCompare(b.date);});renderSelectedDates();dateInput.value='';var lbl=dateInput.closest('.hh-datepicker').querySelector('.hh-dp-label');if(lbl){lbl.textContent='Pick a date to add';lbl.classList.add('placeholder');}}\nfunction removeSelectedDate(date){selectedDateEntries=selectedDateEntries.filter(function(e){return e.date!==date;});renderSelectedDates();}\nfunction updateEntryTime(date,field,val){var entry=selectedDateEntries.find(function(e){return e.date===date;});if(entry)entry[field]=val;}\nfunction renderSelectedDates(){var container=document.getElementById('selectedDatesList');if(!container)return;if(selectedDateEntries.length===0){container.innerHTML='<div style=\"color:rgba(var(--lh-text-rgb),0.25);font-size:0.8rem;font-style:italic;padding:4px 0;\">No dates added yet</div>';return;}\nvar html='';selectedDateEntries.forEach(function(entry){var dateObj=new Date(entry.date+'T00:00:00');var formatted=dateObj.toLocaleDateString('en-US',{weekday:'short',month:'short',day:'numeric'});html+='<div class=\"multi-date-entry\">'\n+'<div class=\"multi-date-entry-header\">'\n+'<span class=\"multi-date-label\">'+formatted+'</span>'\n+'<button type=\"button\" class=\"multi-date-remove\" data-d=\"'+entry.date+'\" onclick=\"removeSelectedDate(this.dataset.d)\">&times;</button>'\n+'</div>'\n+'<div class=\"multi-date-times\">'\n+'<div><label>Start time</label>'\n+'<input type=\"time\" data-d=\"'+entry.date+'\" data-f=\"time\" value=\"'+(entry.time||'')+'\" onchange=\"updateEntryTime(this.dataset.d,this.dataset.f,this.value)\">'\n+'</div>'\n+'<div><label>End time</label>'\n+'<input type=\"time\" data-d=\"'+entry.date+'\" data-f=\"endTime\" value=\"'+(entry.endTime||'')+'\" onchange=\"updateEntryTime(this.dataset.d,this.dataset.f,this.value)\">'\n+'</div>'\n+'</div></div>';});container.innerHTML=html;}\nfunction calendarHideAddForm(){window.dbkFormThen=null;var overlay=document.getElementById('addEventModalOverlay');overlay.classList.remove('visible');var fields=['calendarEventTitle','calendarEventDate','calendarRangeStartDate','calendarEventEndDate','calendarEventTime','calendarEventEndTime','calendarEventNote','calendarEventLocation','calendarEventUrl','calendarEventColor','multipleDateInput','calendarRangeStartTime','calendarRangeEndTime','calendarRecurStart','calendarRecurEnd','calendarRecurTime','calendarRecurEndTime'];fields.forEach(function(id){var el=document.getElementById(id);if(el)el.value='';});document.getElementById('calendarRepeatMode').value='single';var at=document.getElementById('allDayToggle');if(at)at.classList.remove('on');var rt=document.getElementById('recurAllDayToggle');if(rt)rt.classList.remove('on');var stf=document.getElementById('singleTimeFields');if(stf)stf.style.display='block';var rtf=document.getElementById('recurTimeFields');if(rtf)rtf.style.display='block';selectEventColor(null);selectedDateEntries=[];renderSelectedDates();toggleRepeatOptions();if(_pendingRouteThoughtId){_pendingRouteThoughtId=null;setTimeout(openInbox,150);}}\nfunction closeAddEventModal(event){if(event&&event.target!==event.currentTarget)return;calendarHideAddForm();}\nasync function calendarAddEvent(e){e.preventDefault();var title=document.getElementById('calendarEventTitle').value.trim();var repeatMode=document.getElementById('calendarRepeatMode').value;var note=document.getElementById('calendarEventNote').value.trim();var location=document.getElementById('calendarEventLocation').value.trim();var url=document.getElementById('calendarEventUrl').value.trim();var color=document.getElementById('calendarEventColor').value||null;if(!title){showToast('Please enter an event title');return;}\nvar newEvents=[];if(repeatMode==='single'){var date=document.getElementById('calendarEventDate').value;if(!date){var t=document.getElementById('calendarEventDate').closest('.hh-datepicker').querySelector('.hh-dp-trigger');if(t){t.style.borderColor='rgba(201,122,122,0.6)';setTimeout(function(){t.style.borderColor='';},2500);}\nreturn;}\nvar allDay=document.getElementById('allDayToggle').classList.contains('on');var time=allDay?null:(document.getElementById('calendarEventTime').value||null);var endTime=allDay?null:(document.getElementById('calendarEventEndTime').value||null);newEvents.push(buildCalEvent({title:title,date:date,time:time,endTime:endTime,allDay:allDay,note:note,location:location,url:url,color:color}));}else if(repeatMode==='multiple'){if(selectedDateEntries.length===0){showToast('Please add at least one date');return;}\nvar grp=selectedDateEntries.length>1?Date.now().toString():null;selectedDateEntries.forEach(function(entry){newEvents.push(buildCalEvent({title:title,date:entry.date,time:entry.time||null,endTime:entry.endTime||null,allDay:false,note:note,location:location,url:url,color:color,isMultiDay:selectedDateEntries.length>1,eventGroup:grp,repeatMode:repeatMode}));});}else if(repeatMode==='range'){var startDate=document.getElementById('calendarRangeStartDate').value;var endDate=document.getElementById('calendarEventEndDate').value;if(!startDate||!endDate){showToast('Please select start and end dates');return;}\nif(endDate<startDate){showToast('End date must be after start date');return;}\nvar time=document.getElementById('calendarRangeStartTime').value||null;var endTime=document.getElementById('calendarRangeEndTime').value||null;var grp=Date.now().toString();var cur=new Date(startDate+'T00:00:00');var fin=new Date(endDate+'T00:00:00');while(cur<=fin){var ds=localDateStr(cur);newEvents.push(buildCalEvent({title:title,date:ds,time:time,endTime:endTime,allDay:false,note:note,location:location,url:url,color:color,isMultiDay:true,eventGroup:grp,repeatMode:repeatMode}));cur.setDate(cur.getDate()+1);}}else if(repeatMode==='recurring'){var startDate=document.getElementById('calendarRecurStart').value;if(!startDate){showToast('Please select a start date');return;}\nvar freq=document.getElementById('calendarRecurFreq').value;var recurEnd=document.getElementById('calendarRecurEnd').value;var allDay=document.getElementById('recurAllDayToggle').classList.contains('on');var time=allDay?null:(document.getElementById('calendarRecurTime').value||null);var endTime=allDay?null:(document.getElementById('calendarRecurEndTime').value||null);var grp=Date.now().toString();var fin=recurEnd?new Date(recurEnd+'T00:00:00'):null;var limit=365;if(!fin){fin=new Date(startDate+'T00:00:00');fin.setFullYear(fin.getFullYear()+(freq==='yearly'?24:2));}var count=0;var cur=new Date(startDate+'T00:00:00');while((!fin||cur<=fin)&&count<limit){var ds=localDateStr(cur);newEvents.push(buildCalEvent({title:title,date:ds,time:time,endTime:endTime,allDay:allDay,note:note,location:location,url:url,color:color,isMultiDay:true,eventGroup:grp,repeatMode:repeatMode,recurring:{freq:freq,endDate:recurEnd||null}}));if(freq==='daily')cur.setDate(cur.getDate()+1);else if(freq==='weekly')cur.setDate(cur.getDate()+7);else if(freq==='biweekly')cur.setDate(cur.getDate()+14);else if(freq==='monthly'||freq==='yearly'){/* from the first date each time, on that day or the month's last day (an event on the 31st is on Nov 30 and Feb 28, and stays on the 31st after; it drifted to the 1st or 3rd, Oct 24) */var _s=new Date(startDate+'T00:00:00'),_m=_s.getMonth()+(count+1)*(freq==='monthly'?1:12);cur=new Date(_s.getFullYear(),_m,Math.min(_s.getDate(),new Date(_s.getFullYear(),_m+1,0).getDate()));}count++;}\nif(count===0){showToast('No occurrences generated');return;}}\nnewEvents.forEach(function(ev){calendarEvents.push(ev);});calendarSaveEvents();if(_pendingRouteThoughtId){removeThoughtById(_pendingRouteThoughtId);_pendingRouteThoughtId=null;}\nif(window.dbkFormThen){var _then=window.dbkFormThen,_eids=newEvents.map(function(ev){return ev.id;});window.dbkFormThen=null;setTimeout(function(){_then('event',function(){calendarEvents=calendarEvents.filter(function(ev){return _eids.indexOf(ev.id)===-1;});calendarSaveEvents();calendarRender();});},0);}\n/* the pop-up closes and Today's calendar shows the event's day at once (Charlie, Oct 20: it saved but he couldn't see it) */\ncalendarHideAddForm();calendarRender();try{if(window.dbkHmShow)window.dbkHmShow(newEvents[0].date);}catch(e){}var _lastEv=newEvents[newEvents.length-1];var _dayW=function(k){return new Date(k+'T00:00:00').toLocaleDateString('en-US',{weekday:'short',month:'short',day:'numeric'});};showToast(newEvents.length===1?'Event added for '+_dayW(newEvents[0].date)+'.':repeatMode==='recurring'?'Saved on '+newEvents.length+' dates, through '+new Date(_lastEv.date+'T00:00:00').toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'})+'.':newEvents.length+' events saved.',{duration:repeatMode==='recurring'?6000:3500});}\n/* every event a unique id, also the dates of one series made in the same millisecond (Nov 1 review: 'the same id twice: the first one counts' in the item-by-item save, so a repeating series could lose dates) */var _calIdN=0;function buildCalEvent(opts){var id='lh_'+Date.now().toString()+'_'+(++_calIdN)+'_'+Math.floor(Math.random()*10000);return{id:id,title:opts.title||'',date:opts.date,time:opts.time||null,endTime:opts.endTime||null,allDay:opts.allDay||false,note:opts.note||null,location:opts.location||null,url:opts.url||null,color:opts.color||null,isMultiDay:opts.isMultiDay||false,eventGroup:opts.eventGroup||null,repeatMode:opts.repeatMode||'single',recurring:opts.recurring||null};}\nfunction selectEventColor(color){document.getElementById('calendarEventColor').value=color||'';document.querySelectorAll('#addEventModalOverlay .color-dot-btn').forEach(function(btn){btn.classList.toggle('selected',btn.dataset.color===color);});var nb=document.getElementById('colorNone');if(nb)nb.classList.toggle('selected',!color);}\nfunction toggleAllDay(){var btn=document.getElementById('allDayToggle');var fields=document.getElementById('singleTimeFields');btn.classList.toggle('on');if(fields)fields.style.display=btn.classList.contains('on')?'none':'';}\nfunction toggleRecurAllDay(){var btn=document.getElementById('recurAllDayToggle');var fields=document.getElementById('recurTimeFields');btn.classList.toggle('on');if(fields)fields.style.display=btn.classList.contains('on')?'none':'';}\n/* Deleting an event: no \"are you sure\", the standard Undo message instead (as for reminders; Kasey's rule). An event on several\n   dates (one group) goes from all of them, and Undo puts them all back; which==='one' (Edit event > Delete > This date,\n   Kasey, Oct 24) takes off only that date. Recently removed names the date then. */\nasync function calendarDeleteEvent(index,which){if(index<0||index>=calendarEvents.length)return;const event=calendarEvents[index];const _b=JSON.parse(JSON.stringify(calendarEvents));const _all=!!(event.isMultiDay&&event.eventGroup)&&which!=='one';let n=1;if(_all){n=calendarEvents.filter(e=>e.eventGroup===event.eventGroup).length;calendarEvents=calendarEvents.filter(e=>e.eventGroup!==event.eventGroup);}else{calendarEvents.splice(index,1);}calendarRender();await calendarSaveEvents();const _day=which==='one'&&event.date?new Date(event.date+'T12:00:00').toLocaleDateString('en-US',{weekday:'short',month:'short',day:'numeric'}):'';if(window.dbkRemoved)dbkRemoved.track('Event','calendarEvents',_b,calendarEvents,_day?{label:(event.title||'Event')+' ('+_day+')'}:undefined);const _gone=_b.filter(function(e,i){return _all?e.eventGroup===event.eventGroup:i===index;});(window.dbkUndo||function(){})(n>1?'Event deleted from '+n+' dates':_day?'Event deleted from '+_day:'Event deleted',async function(){dbkPutBackOwn(calendarEvents,_b,_gone);calendarRender();await calendarSaveEvents();});}\n/* Undo after a delete puts back only what that delete took off, where it was (overnight audit, Oct 24): putting back a\n   copy of the whole list took off an event the other phone added in those seconds. Missing ones only (by id). */\nfunction dbkPutBackOwn(list,before,gone){var have={};list.forEach(function(x){if(x&&x.id!=null)have[String(x.id)]=1;});gone.forEach(function(g){if(!g||(g.id!=null&&have[String(g.id)]))return;var i=before.indexOf(g);list.splice(Math.min(i<0?list.length:i,list.length),0,g);});return list;}\nfunction calendarEditEvent(index){if(index<0||index>=calendarEvents.length)return;const event=calendarEvents[index];const eventId=event.id||String(index);selectedModalDate=new Date(event.date+'T00:00:00');document.getElementById('dayModalEventTitle').value=event.title;document.getElementById('dayModalEventTime').value=event.time||'';document.getElementById('dayModalEventEndTime').value=event.endTime||'';document.getElementById('dayModalEventLocation').value=event.location||'';document.getElementById('dayModalEventUrl').value=event.url||'';document.getElementById('dayModalEventNote').value=event.note||'';document.getElementById('dayModalEditId').value='id:'+eventId;const overlay=document.getElementById('dayModalOverlay');const title=document.getElementById('dayModalTitle');title.textContent='Edit Event - '+selectedModalDate.toLocaleDateString('en-US',{weekday:'long',month:'long',day:'numeric',year:'numeric'});document.getElementById('dayModalForm').classList.add('visible');overlay.classList.add('visible');if(!(window.matchMedia&&window.matchMedia('(pointer: coarse)').matches))document.getElementById('dayModalEventTitle').focus();}\nasync function calendarInit(){await calendarLoadEvents();calendarDate=new Date();calendarView='twoday';calendarRender();setupFirebaseListener('calendarEvents',(data)=>{if(isWriting('calendarEvents'))return;calendarEvents=data;calendarRender();});}\n/* the phone's saved grocery list is always the newest copy here (Meals adds to it, the cloud copy is kept in it),\n   so Today reads it again before any change instead of saving over items added elsewhere */\nlet _grocBusy=0;function freshGroceries(){try{const l=JSON.parse(localStorage.getItem('groceries')||'null');if(Array.isArray(l))groceries=l;}catch(e){}}\nfunction groceriesRefresh(){if(_grocBusy||!document.getElementById('groceryList'))return;const was=JSON.stringify(groceries);freshGroceries();if(JSON.stringify(groceries)!==was)renderGroceries();}\nwindow.addEventListener('storage',function(e){if(e.key==='groceries')groceriesRefresh();});window.addEventListener('dbk-show',groceriesRefresh);window.addEventListener('focus',groceriesRefresh);document.addEventListener('visibilitychange',function(){if(!document.hidden)groceriesRefresh();});\nasync function loadGroceries(){const firebaseData=await loadFromFirebase('groceries');if(firebaseData){groceries=firebaseData;try{localStorage.setItem('groceries',JSON.stringify(groceries));}catch(e){}}else{const saved=localStorage.getItem('groceries');if(saved){groceries=JSON.parse(saved);if(window.dbkCloudMissing&&await window.dbkCloudMissing('groceries'))await syncToFirebase('groceries',groceries);}}\nlet needsSave=false;if(groceries.some(g=>/^\\u2500\\u2500/.test((g&&g.text)||''))){groceries=groceries.filter(g=>!/^\\u2500\\u2500/.test((g&&g.text)||''));needsSave=true;}groceries.forEach((item,i)=>{if(!item.id){item.id=Date.now()+i;needsSave=true;}});if(needsSave)await saveGroceries();renderGroceries();}\nasync function saveGroceries(){localStorage.setItem('groceries',JSON.stringify(groceries));await syncToFirebase('groceries',groceries);}\nasync function addGrocery(){const input=document.getElementById('groceryInput');const text=input.value.trim();if(text){freshGroceries();groceries.push({id:Date.now(),text,completed:false});await saveGroceries();renderGroceries();input.value='';input.focus();}}\nfunction _grocCartOn(){var m=window.dbkModule;try{return !!(m&&m.forPerson('meals',m.me())&&!m.archived('page:meals'));}catch(e){return false;}}\n// (a tick is kept in _grocTicking until it's saved: kept on the item itself, a copy from the other phone arriving in\n// that moment replaced the list and the tick was lost, Oct 26 audit)\nconst _grocTicking=new Set();\nasync function toggleGrocery(id){if(_grocCartOn())return toCartGrocery(id);if(_grocTicking.has(id))return;freshGroceries();const idx=groceries.findIndex(g=>g.id===id);if(idx===-1)return;const removedItem={...groceries[idx]};_grocTicking.add(id);_grocBusy++;renderGroceries();setTimeout(()=>{const el=document.querySelector(`.grocery-item[data-id=\"${id}\"]`);if(el)el.classList.add('fading');},300);setTimeout(async()=>{_grocBusy=Math.max(0,_grocBusy-1);if(_grocTicking.has(id)){_grocTicking.delete(id);freshGroceries();groceries=groceries.filter(g=>g.id!==id);await saveGroceries();renderGroceries();showToast('\"'+removedItem.text+'\" removed',{duration:8000,undoCallback:async()=>{freshGroceries();removedItem.completed=false;groceries.push(removedItem);groceries.sort((a,b)=>(a.id||0)-(b.id||0));await saveGroceries();renderGroceries();}});}},600);}\n// with Meals on, a ticked thing goes to \"In the cart\" on the Meals grocery list (same list), and says so, with Undo\nasync function toCartGrocery(id){freshGroceries();const it=groceries.find(g=>g.id===id);if(!it)return;if(it.completed){it.completed=false;await saveGroceries();renderGroceries();return;}const el=document.querySelector(`.grocery-item[data-id=\"${id}\"]`);if(el){const cb=el.querySelector('input');if(cb)cb.checked=true;el.classList.add('fading');}_grocBusy++;setTimeout(async()=>{_grocBusy=Math.max(0,_grocBusy-1);freshGroceries();const x=groceries.find(g=>g.id===id);if(!x)return;x.completed=true;await saveGroceries();renderGroceries();showToast('\"'+x.text+'\" moved to In the cart',{duration:8000,undoCallback:async()=>{freshGroceries();const y=groceries.find(g=>g.id===id);if(y){y.completed=false;await saveGroceries();renderGroceries();}}});},450);}\n// Change a thing on the list (Kasey, Oct 26: \"i want to be able to edit grocery items somehow\"): the pencil turns its\n// words into a box in place; return or tapping away saves, Escape keeps it as it was. Saved like a tick (the shared\n// list, item by item and field by field: a tick on the other phone at the same moment stays), with Undo. Meals' section\n// is guessed again from the new words unless someone picked one (catSet).\nfunction editGrocery(id,row){const sp=row&&row.querySelector('span');if(!sp||row.querySelector('input.dbk-groc-in'))return;freshGroceries();const it=groceries.find(g=>g.id===id);if(!it)return;const was={text:it.text,cat:it.cat};const inp=document.createElement('input');inp.type='text';inp.className='dbk-groc-in';inp.maxLength=100;inp.value=it.text;inp.setAttribute('aria-label','Change '+it.text);inp.addEventListener('click',e=>e.stopPropagation());sp.replaceWith(inp);_grocBusy++;let done=false;\nconst finish=async(keep)=>{if(done)return;done=true;_grocBusy=Math.max(0,_grocBusy-1);const t=inp.value.trim().slice(0,100);freshGroceries();const x=groceries.find(g=>g.id===id);if(!keep||!t||!x||t===x.text){renderGroceries();return;}x.text=t;if(!x.catSet)delete x.cat;await saveGroceries();renderGroceries();(window.dbkUndo||function(){})('Saved '+t,async function(){freshGroceries();const y=groceries.find(g=>g.id===id);if(!y||y.text!==t)return;y.text=was.text;if(was.cat!==undefined)y.cat=was.cat;await saveGroceries();renderGroceries();});};\ninp.addEventListener('keydown',e=>{if(e.key==='Enter'){e.preventDefault();finish(true);}else if(e.key==='Escape'){e.preventDefault();finish(false);}});inp.addEventListener('focus',()=>{if(!inp._dbkOn){inp._dbkOn=1;inp.addEventListener('blur',()=>finish(true));}});inp.focus();setTimeout(()=>{if(!done&&document.activeElement!==inp)inp.focus();},0);}\nasync function deleteGrocery(id){freshGroceries();const idx=groceries.findIndex(g=>g.id===id);if(idx!==-1){const _b=JSON.parse(JSON.stringify(groceries));groceries.splice(idx,1);await saveGroceries();if(window.dbkRemoved)dbkRemoved.track('Grocery item','groceries',_b,groceries,{title:'text'});renderGroceries();const _gone=_b.slice(idx,idx+1);(window.dbkUndo||function(){})('Grocery item removed',async function(){freshGroceries();dbkPutBackOwn(groceries,_b,_gone);await saveGroceries();renderGroceries();});}}\nfunction renderGroceries(){const list=document.getElementById('groceryList');if(!list)return;const _cart=_grocCartOn()?groceries.filter(g=>g&&g.completed).length:0;const _cartRow=_cart?'<a class=\"grocery-cart-link\" href=\"meal-plan.html#grocery\">In the cart · '+_cart+' ›</a>':'';\nif(groceries.length===0||(_grocCartOn()&&!groceries.some(g=>g&&!g.completed))){list.innerHTML='<div class=\"empty-state\" style=\"color: rgba(var(--lh-text-rgb),0.35); font-size: 0.9rem; padding: 20px; text-align: center; font-style: italic;\">No items yet</div>'+_cartRow;return;}\nlist.innerHTML='';let fixedIds=false;groceries.forEach((item,i)=>{if(item.id==null||item.id===''){item.id=Date.now()+i;fixedIds=true;}if(item.completed===undefined&&item.checked!==undefined){item.completed=false;delete item.checked;fixedIds=true;}});if(fixedIds)saveGroceries();groceries.forEach((item)=>{if(_cart&&item.completed)return;const id=item.id;const itemDiv=document.createElement('div');const _done=item.completed||_grocTicking.has(id);itemDiv.className='grocery-item'+(_done?' done':'');itemDiv.setAttribute('data-id',id);itemDiv.style.cursor='pointer';itemDiv.onclick=function(){toggleGrocery(id);};itemDiv.innerHTML=`<input type=\"checkbox\"${_done?' checked':''}><span>${escHtml(item.text)}</span>`+(_done?'':'<button type=\"button\" class=\"dbk-groc-ed\" aria-label=\"Change '+escHtml(item.text)+'\"><svg viewBox=\"0 0 24 24\" width=\"15\" height=\"15\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.7\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><path d=\"M4 20h4L19 9a2.1 2.1 0 0 0-3-3L5 17v3Z\"/><path d=\"m14 7 3 3\"/></svg></button>');itemDiv.querySelector('input').addEventListener('click',function(e){e.stopPropagation();e.preventDefault();toggleGrocery(id);});const _ed=itemDiv.querySelector('.dbk-groc-ed');if(_ed){_ed.addEventListener('mousedown',function(e){e.preventDefault();});_ed.addEventListener('click',function(e){e.stopPropagation();e.preventDefault();window.dbkTapFocus=Date.now();editGrocery(id,itemDiv);});}list.appendChild(itemDiv);});if(_cartRow)list.insertAdjacentHTML('beforeend',_cartRow);}\n\n\n\n\n\n\n\n\n\n\n/* tells shared.js this notice can carry Undo */try{showToast.dbkUndo=true;}catch(e){}\nfunction showToast(message,options={}){/* every notice goes to the one message spot (shared.js) */if(window.dbkNotice){return window.dbkNotice(message==null?'':String(message),{undo:options.undoCallback||null,duration:options.duration});}return null;}\nfunction setupAllListeners(){setupFirebaseListener('groceries',(data)=>{if(isWriting('groceries'))return;groceries=Array.isArray(data)?data:[];try{localStorage.setItem('groceries',JSON.stringify(groceries));}catch(e){}renderGroceries();});setupFirebaseListener('lifeReminders',(data)=>{if(isWriting('lifeReminders'))return;lifeReminders=data;updateReminderDisplay();});setupFirebaseListener('eventCompletions',(data)=>{if(isWriting('eventCompletions'))return;localStorage.setItem('eventCompletions',JSON.stringify(data));calendarRender();});setupFirebaseListener(threeThingsKey(),(data)=>{if(isWriting(threeThingsKey()))return;var today=new Date().toDateString();if(data&&data.date===today){_threeThings=data.items;threeThingsRender();}});setupFirebaseListener(inboxKey(),(data)=>{if(isWriting(inboxKey()))return;if(Array.isArray(data)){_capturedThoughts=window.dbkInboxAdopt?window.dbkInboxAdopt(data):data;updateInboxBadge();if(document.getElementById('inboxOverlay')?.classList.contains('visible')&&!document.querySelector('.inbox-edit-area')){renderInbox();}}});}\ndocument.addEventListener('DOMContentLoaded',async function(){try{const now=new Date();function dbkGreet(now){const hour=now.getHours();let greeting='Good evening,';if(hour<12)greeting='Good morning,';else if(hour<17)greeting='Good afternoon,';const greetingEl=document.getElementById('homeGreeting');if(greetingEl&&greetingEl.textContent!==greeting)greetingEl.textContent=greeting;}dbkGreet(now);const namesEl=document.getElementById('homeNames');if(namesEl){const s=window.HH;if(s&&s.names){const n1=s.names.name1||'Person 1';const n2=s.names.name2||'Person 2';var _r=null;try{_r=localStorage.getItem('myPersonRole');if(_r!=='person1'&&_r!=='person2'&&window.dbkLookCarry)_r=window.dbkLookCarry.who();}catch(e){}namesEl.textContent=_r==='person2'?n2:n1;}}\nconst dateEl=document.getElementById('homeDate');const dateText=now.toLocaleDateString('en-US',{weekday:'long',month:'long',day:'numeric'});if(dateEl)dateEl.textContent=dateText;function updateClock(){const t=new Date();let h=t.getHours(),m=t.getMinutes();const ampm=h>=12?'pm':'am';h=h%12||12;const timeText=h+':'+String(m).padStart(2,'0')+' '+ampm;const timeEl=document.getElementById('homeTime');if(timeEl)timeEl.textContent=timeText;}\nupdateClock();setInterval(updateClock,60000);function dbkQuestion(now){const intentionEl=document.getElementById('homeIntention');if(intentionEl){const intentions=['What actually matters today? If everything can\\'t get done, what must?','What would your future self thank you for doing today?','What is one thing that would make today feel like progress?','Where is your energy best spent today?','What needs finishing more than starting today?','What would the steadier version of you choose today?','What is within your control today? Stay there.','What deserves your full attention today?','What are you choosing to let be imperfect today?','Where can you move with intention instead of urgency?','What would it look like to follow through today?','If you trusted yourself fully, what would you do today?','What would make today feel intentional instead of reactive?','What\\'s one steady thing you can do today?','What\\'s one thing you\\'d regret skipping today?','What are you building today?','What small choice today supports the bigger picture?','What\\'s one thing you can stay consistent with today?','What\\'s something that\\'s been working that you can keep doing?','Who are you choosing to be today?','How do you want to feel when you go to bed tonight?','What are you letting go of today?','If you trusted where you\\'re headed, what would you focus on today?','What would make you feel proud of yourself tonight?','What\\'s one promise you can keep to yourself today?','What would today look like if you didn\\'t second-guess yourself?','What\\'s one thing you keep putting off that future-you needs you to start?','What do you actually have the capacity for today? Start there.','What would it look like to not abandon yourself today?','What are you showing up for today?','What would future-you be relieved you handled today?'];const dayOfYear=Math.floor((now-new Date(now.getFullYear(),0,0))/86400000);intentionEl.textContent='What would your future self thank you for doing today?';}}dbkQuestion(now);\n/* Today left open past midnight (a phone left on this page overnight): the new day's date, question, Today's Three, reminders and calendar */\nlet _dayShown=now.toDateString();function dbkDayCheck(){const t=new Date();dbkGreet(t);if(t.toDateString()===_dayShown)return;_dayShown=t.toDateString();if(dateEl)dateEl.textContent=t.toLocaleDateString('en-US',{weekday:'long',month:'long',day:'numeric'});dbkQuestion(t);try{threeThingsLoad();}catch(e){}try{currentReminderIndex=0;updateReminderDisplay();}catch(e){}try{updateCalendarSummary();}catch(e){}}\nsetInterval(dbkDayCheck,30000);document.addEventListener('visibilitychange',function(){if(!document.hidden)dbkDayCheck();});window.addEventListener('dbk-show',dbkDayCheck);window.addEventListener('focus',dbkDayCheck);\n\n/* the moon: one accurate answer for the whole app (dbk-moon.js); the older sums below only if it didn't load */window._moonCalc=function(d){if(window.dbkMoon){var mm=window.dbkMoon(d);return{name:mm.name,illum:mm.illum,frac:mm.cycle,phase:mm.age};}var knownNew=new Date(2000,0,6,18,14);var synodic=29.53059;var diff=(d-knownNew)/86400000;var phase=window.dbkMoonAge?window.dbkMoonAge(d):((diff%synodic)+synodic)%synodic;var frac=phase/synodic;var name;if(phase<1.85)name='New Moon';else if(phase<5.53)name='Waxing Crescent';else if(phase<9.22)name='First Quarter';else if(phase<12.91)name='Waxing Gibbous';else if(phase<16.61)name='Full Moon';else if(phase<20.30)name='Waning Gibbous';else if(phase<23.99)name='Last Quarter';else if(phase<27.68)name='Waning Crescent';else name='New Moon';var illum=Math.round((1-Math.cos(2*Math.PI*frac))/2*100);return{name:name,illum:illum,frac:frac,phase:phase};};\nwindow._moonSign=function(d){if(window.dbkMoon){var mm=window.dbkMoon(d);return{sign:mm.sign,degrees:mm.degrees,longitude:mm.longitude};}var jd=d.getTime()/86400000+2440587.5;var T=(jd-2451545.0)/36525.0;var L=218.3165+481267.8813*T;var M=134.9634+477198.8676*T;var D=297.8502+445267.1115*T;var Ms=357.5291+35999.0503*T;var F=93.2720+483202.0175*T;var r=Math.PI/180;var lng=L+6.289*Math.sin(M*r)+1.274*Math.sin((2*D-M)*r)+0.658*Math.sin(2*D*r)+0.214*Math.sin(2*M*r)-0.186*Math.sin(Ms*r)-0.114*Math.sin(2*F*r);lng=((lng%360)+360)%360;var signs=['Aries','Taurus','Gemini','Cancer','Leo','Virgo','Libra','Scorpio','Sagittarius','Capricorn','Aquarius','Pisces'];var idx=Math.floor(lng/30);return{sign:signs[idx],degrees:Math.floor(lng%30),longitude:lng};};\nwindow._moonMiniSvg=function(frac,size){var s=size||12;var r=s/2-1;var cx=s/2;var cy=s/2;var illum=Math.round((1-Math.cos(2*Math.PI*frac))/2*100);var dk='rgba(var(--lh-secondary-rgb),0.1)';var lt='rgba(var(--lh-secondary-rgb),0.5)';if(illum<=2)return'<svg width=\"'+s+'\" height=\"'+s+'\" viewBox=\"0 0 '+s+' '+s+'\"><circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+dk+'\" stroke=\"rgba(var(--lh-secondary-rgb),0.15)\" stroke-width=\"0.3\"/></svg>';if(illum>=98)return'<svg width=\"'+s+'\" height=\"'+s+'\" viewBox=\"0 0 '+s+' '+s+'\"><circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+lt+'\"/></svg>';var isWax=frac<0.5;var f=illum/100;var ty=cy-r;var by=cy+r;var tx=Math.max(0.1,r*Math.abs(2*f-1));var path;if(isWax){var sw=f<=0.5?0:1;path='M '+cx+' '+ty+' A '+r+' '+r+' 0 0 1 '+cx+' '+by+' A '+tx+' '+r+' 0 0 '+sw+' '+cx+' '+ty+' Z';}else{var sw=f<=0.5?1:0;path='M '+cx+' '+ty+' A '+r+' '+r+' 0 0 0 '+cx+' '+by+' A '+tx+' '+r+' 0 0 '+sw+' '+cx+' '+ty+' Z';}return'<svg width=\"'+s+'\" height=\"'+s+'\" viewBox=\"0 0 '+s+' '+s+'\"><circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+dk+'\"/><path d=\"'+path+'\" fill=\"'+lt+'\"/></svg>';};\nwindow.showMoonDetail=function(){if(window.dbkMoonPop)return window.dbkMoonPop();\nvar w=window._moonDetail;if(!w)return;\nvar meanings={'New Moon':'Set intentions. Plant seeds. Begin.','Waxing Crescent':'Build momentum. Take first steps. Trust the process.','First Quarter':'Push through resistance. Make decisions. Act.','Waxing Gibbous':'Refine. Adjust. Keep building.','Full Moon':'Release what no longer serves you. Celebrate. Feel fully.','Waning Gibbous':'Gratitude. Share what you have learned. Give back.','Last Quarter':'Let go. Forgive. Clear space.','Waning Crescent':'Rest. Reflect. Surrender. Be still.'};\nvar overlay=document.createElement('div');overlay.className='dbk-infopop';\noverlay.style.cssText='position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;';\noverlay.onclick=function(e){if(e.target===overlay)overlay.remove();};\nvar card=document.createElement('div');card.className='dbk-infocard';\ncard.style.cssText='background:var(--card-bg, var(--lh-bg-darker));border:1px solid rgba(var(--lh-secondary-rgb),0.15);border-radius:16px;padding:24px;max-width:340px;width:100%;font-family:var(--lh-font);color:var(--lh-text);max-height:85vh;overflow-y:auto;';\nvar h='';\nh+='<div style=\"text-align:center;margin-bottom:16px;\">';\nh+='<div style=\"margin-bottom:8px;\">'+window._moonMiniSvg(w.frac,48)+'</div>';\nh+='<div style=\"font-size:1.1rem;font-weight:600;\">'+w.name+'</div>';\nh+='<div style=\"font-size:0.78rem;opacity:0.5;margin-top:2px;\">'+w.illum+'% illuminated</div>';\nh+='</div>';\nh+='<div style=\"text-align:center;padding:12px 16px;background:rgba(var(--lh-secondary-rgb),0.06);border-radius:10px;margin-bottom:14px;font-size:0.82rem;line-height:1.5;font-style:italic;opacity:0.7;\">'+(meanings[w.name]||'')+'</div>';\nh+='<div style=\"display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;font-size:0.78rem;margin-bottom:18px;\">';\nh+='<div style=\"opacity:0.5;\">Moon in</div><div style=\"text-align:right;\">'+w.sign.sign+'</div>';\nh+='<div style=\"opacity:0.5;\">Position</div><div style=\"text-align:right;\">'+w.sign.degrees+'\\u00b0 '+w.sign.sign+'</div>';\nh+='</div>';\nh+='<div style=\"margin-bottom:6px;font-size:0.72rem;text-transform:uppercase;letter-spacing:0.1em;opacity:0.4;text-align:center;\">'+w.monthName+'</div>';\nh+='<div style=\"display:grid;grid-template-columns:repeat(7,1fr);gap:2px;text-align:center;\">';\nh+='<div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">S</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">M</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">T</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">W</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">T</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">F</div><div style=\"font-size:0.55rem;opacity:0.3;padding:2px 0;\">S</div>';\nvar d1=new Date(w.year,w.month,1);var startDow=d1.getDay();var daysInMonth=new Date(w.year,w.month+1,0).getDate();\nfor(var e=0;e<startDow;e++)h+='<div></div>';\nfor(var day=1;day<=daysInMonth;day++){var dd=new Date(w.year,w.month,day,12);var mc=window._moonCalc(dd);var isToday=(day===w.today);var border=isToday?'border:1px solid var(--lh-secondary);border-radius:4px;':'';var bg=isToday?'background:rgba(var(--lh-secondary-rgb),0.08);':'';h+='<div style=\"padding:3px 0;display:flex;flex-direction:column;align-items:center;gap:1px;'+border+bg+'\" title=\"'+mc.name+' '+mc.illum+'%\">'+window._moonMiniSvg(mc.frac,10)+'<span style=\"font-size:0.5rem;opacity:0.3;\">'+day+'</span></div>';}\nh+='</div>';\ncard.innerHTML=h;\noverlay.appendChild(card);\ndocument.body.appendChild(overlay);\n};\n(function setMoonPhase(){var mc=window._moonCalc(now);var ms=window._moonSign(now);var name=mc.name;var illum=mc.illum;var phaseFraction=mc.frac;var monthNames=['January','February','March','April','May','June','July','August','September','October','November','December'];window._moonDetail={name:name,illum:illum,frac:mc.frac,sign:ms,year:now.getFullYear(),month:now.getMonth(),monthName:monthNames[now.getMonth()]+' '+now.getFullYear(),today:now.getDate()};const r=10,cx=12,cy=12;const darkFill='rgba(var(--lh-secondary-rgb),0.12)';const litFill='rgba(var(--lh-secondary-rgb),0.55)';const strokeC='rgba(var(--lh-secondary-rgb),0.2)';let svg;if(illum<=2){svg='<svg viewBox=\"0 0 24 24\"><circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+darkFill+'\" stroke=\"'+strokeC+'\" stroke-width=\"0.5\"/></svg>';}else if(illum>=98){svg='<svg viewBox=\"0 0 24 24\"><circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+litFill+'\" stroke=\"'+strokeC+'\" stroke-width=\"0.5\"/></svg>';}else{const isWaxing=phaseFraction<0.5;const f=illum/100;const topY=cy-r;const botY=cy+r;const tx=Math.max(0.1,r*Math.abs(2*f-1));let litPath;if(isWaxing){const tSweep=f<=0.5?0:1;litPath='M '+cx+' '+topY+' A '+r+' '+r+' 0 0 1 '+cx+' '+botY+' A '+tx+' '+r+' 0 0 '+tSweep+' '+cx+' '+topY+' Z';}else{const tSweep=f<=0.5?1:0;litPath='M '+cx+' '+topY+' A '+r+' '+r+' 0 0 0 '+cx+' '+botY+' A '+tx+' '+r+' 0 0 '+tSweep+' '+cx+' '+topY+' Z';}\nsvg='<svg viewBox=\"0 0 24 24\">'+\n'<circle cx=\"'+cx+'\" cy=\"'+cy+'\" r=\"'+r+'\" fill=\"'+darkFill+'\" stroke=\"'+strokeC+'\" stroke-width=\"0.5\"/>'+\n'<path d=\"'+litPath+'\" fill=\"'+litFill+'\"/>'+\n'</svg>';}\nconst moonIconEl=document.getElementById('moonIcon');const moonPhaseEl=document.getElementById('moonPhase');const moonIllumEl=document.getElementById('moonIllum');if(moonIconEl)moonIconEl.innerHTML=svg;if(moonPhaseEl)moonPhaseEl.textContent=name;if(moonIllumEl)moonIllumEl.textContent='in '+ms.sign;var moonEl=document.getElementById('moonWidget');if(moonEl){moonEl.style.cursor='pointer';moonEl.title='Tap for details';moonEl.onclick=function(){window.showMoonDetail();};}})();/* the location is a household setting (kept in step by dbkSettings); this older cloud copy only fills a phone that has none, never overwrites a newer choice */try{if(!localStorage.getItem('userLocation')){const fbLoc=await loadFromFirebase('userLocation');if(fbLoc&&fbLoc.lat&&!localStorage.getItem('userLocation')){localStorage.setItem('userLocation',JSON.stringify(fbLoc));}}}catch(e){}\nwindow.showWeatherDetail=function(){if(window.dbkWeatherPop)return window.dbkWeatherPop();\nvar w=window._weatherDetail;if(!w)return;\nvar uvLabel='';if(w.uvMax!==null){if(w.uvMax<=2)uvLabel='Low';else if(w.uvMax<=5)uvLabel='Moderate';else if(w.uvMax<=7)uvLabel='High';else if(w.uvMax<=10)uvLabel='Very high';else uvLabel='Extreme';}\nvar overlay=document.createElement('div');overlay.className='dbk-infopop';\noverlay.style.cssText='position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.5);z-index:99999;display:flex;align-items:center;justify-content:center;padding:20px;';\noverlay.onclick=function(e){if(e.target===overlay)overlay.remove();};\nvar card=document.createElement('div');card.className='dbk-infocard';\ncard.style.cssText='background:var(--card-bg, var(--lh-bg-darker));border:1px solid rgba(var(--lh-accent-rgb),0.15);border-radius:16px;padding:24px;max-width:320px;width:100%;font-family:var(--lh-font);color:var(--lh-text);';\nvar h='';\nh+='<div style=\"text-align:center;margin-bottom:16px;\">';\nh+='<div style=\"font-size:2.2rem;font-weight:700;letter-spacing:-0.02em;\">'+escHtml(w.temp)+'°</div>';\nh+='<div style=\"font-size:0.82rem;opacity:0.6;margin-top:2px;\">'+escHtml(w.desc)+'</div>';\nif(w.locName)h+='<div style=\"font-size:0.68rem;opacity:0.35;margin-top:4px;\">'+escHtml(w.locName)+'</div>';\nh+='</div>';\nh+='<div style=\"display:grid;grid-template-columns:1fr 1fr;gap:10px 16px;font-size:0.78rem;\">';\nh+='<div style=\"opacity:0.5;\">Feels like</div><div style=\"text-align:right;\">'+escHtml(w.feelsLike)+'°</div>';\nh+='<div style=\"opacity:0.5;\">High / Low</div><div style=\"text-align:right;\">'+escHtml(w.hi)+'° / '+escHtml(w.lo)+'°</div>';\nh+='<div style=\"opacity:0.5;\">Humidity</div><div style=\"text-align:right;\">'+escHtml(w.humidity)+'%</div>';\nh+='<div style=\"opacity:0.5;\">Wind</div><div style=\"text-align:right;\">'+escHtml(w.wind)+' mph</div>';\nif(w.uvMax!==null)h+='<div style=\"opacity:0.5;\">UV Index</div><div style=\"text-align:right;\">'+escHtml(w.uvMax)+' <span style=\"opacity:0.5;font-size:0.7rem;\">'+uvLabel+'</span></div>';\nif(w.precipChance!==null)h+='<div style=\"opacity:0.5;\">Rain chance</div><div style=\"text-align:right;\">'+escHtml(w.precipChance)+'%</div>';\nif(w.sunrise&&w.sunset){h+='<div style=\"opacity:0.5;\">Sunrise</div><div style=\"text-align:right;\">'+escHtml(w.sunrise)+'</div>';h+='<div style=\"opacity:0.5;\">Sunset</div><div style=\"text-align:right;\">'+escHtml(w.sunset)+'</div>';}\nh+='</div>';\nh+='<div style=\"text-align:center;margin-top:18px;\"><button onclick=\"this.closest(\\'div[style*=fixed]\\').remove();openLocationSetup();\" style=\"background:none;border:none;color:var(--lh-accent);font-family:var(--lh-font);font-size:0.72rem;cursor:pointer;opacity:0.5;\">Change location</button></div>';\ncard.innerHTML=h;\noverlay.appendChild(card);\ndocument.body.appendChild(overlay);\n};\nconst _dbkWeather=async function fetchWeather(){function weatherSVG(code){const sage='rgba(var(--lh-accent-rgb),0.65)';const sageLt='rgba(var(--lh-accent-rgb),0.4)';const rose='rgba(var(--lh-secondary-rgb),0.6)';if(code===0){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><circle cx=\"12\" cy=\"12\" r=\"4.5\" fill=\"'+sage+'\"/><g stroke=\"'+sage+'\" stroke-width=\"1.2\" stroke-linecap=\"round\"><line x1=\"12\" y1=\"2.5\" x2=\"12\" y2=\"5\"/><line x1=\"12\" y1=\"19\" x2=\"12\" y2=\"21.5\"/><line x1=\"2.5\" y1=\"12\" x2=\"5\" y2=\"12\"/><line x1=\"19\" y1=\"12\" x2=\"21.5\" y2=\"12\"/><line x1=\"5.3\" y1=\"5.3\" x2=\"7\" y2=\"7\"/><line x1=\"17\" y1=\"17\" x2=\"18.7\" y2=\"18.7\"/><line x1=\"5.3\" y1=\"18.7\" x2=\"7\" y2=\"17\"/><line x1=\"17\" y1=\"7\" x2=\"18.7\" y2=\"5.3\"/></g></svg>';}\nif(code>=1&&code<=3){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><circle cx=\"9\" cy=\"9\" r=\"3.5\" fill=\"'+sage+'\" opacity=\"0.5\"/><g stroke=\"'+sage+'\" stroke-width=\"1\" stroke-linecap=\"round\" opacity=\"0.4\"><line x1=\"9\" y1=\"3\" x2=\"9\" y2=\"4.5\"/><line x1=\"4\" y1=\"9\" x2=\"5.5\" y2=\"9\"/><line x1=\"5\" y1=\"5\" x2=\"6.1\" y2=\"6.1\"/></g><path d=\"M8 16.5 C8 14 10 12.5 12.5 12.5 C13.5 10.5 16 10 17.5 11.5 C19.5 11.5 21 13 20.5 15 C21 16 20.5 17.5 19 17.5 L9.5 17.5 C8 17.5 7 16.5 8 16.5Z\" fill=\"'+sage+'\" opacity=\"0.45\"/></svg>';}\nif(code>=45&&code<=48){return'<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"'+sageLt+'\" stroke-width=\"1.3\" stroke-linecap=\"round\"><line x1=\"4\" y1=\"8\" x2=\"20\" y2=\"8\"/><line x1=\"6\" y1=\"12\" x2=\"18\" y2=\"12\"/><line x1=\"4\" y1=\"16\" x2=\"20\" y2=\"16\"/></svg>';}\nif(code>=51&&code<=67){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 13 C6 10.5 8 9 10.5 9 C11.5 7 14 6.5 15.5 8 C17.5 8 19 9.5 18.5 11.5 C19 12.5 18.5 14 17 14 L7.5 14 C6 14 5 13 6 13Z\" fill=\"'+sage+'\" opacity=\"0.4\"/><g stroke=\"'+sage+'\" stroke-width=\"1\" stroke-linecap=\"round\" opacity=\"0.55\"><line x1=\"9\" y1=\"16\" x2=\"8\" y2=\"19\"/><line x1=\"13\" y1=\"16\" x2=\"12\" y2=\"19\"/><line x1=\"17\" y1=\"16\" x2=\"16\" y2=\"19\"/></g></svg>';}\nif(code>=71&&code<=77){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 13 C6 10.5 8 9 10.5 9 C11.5 7 14 6.5 15.5 8 C17.5 8 19 9.5 18.5 11.5 C19 12.5 18.5 14 17 14 L7.5 14 C6 14 5 13 6 13Z\" fill=\"'+sage+'\" opacity=\"0.4\"/><g fill=\"'+sage+'\" opacity=\"0.6\"><circle cx=\"9\" cy=\"17\" r=\"1\"/><circle cx=\"13\" cy=\"16.5\" r=\"1\"/><circle cx=\"17\" cy=\"17.5\" r=\"1\"/><circle cx=\"11\" cy=\"20\" r=\"0.8\"/><circle cx=\"15\" cy=\"20\" r=\"0.8\"/></g></svg>';}\nif(code>=80&&code<=82){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 12 C6 9.5 8 8 10.5 8 C11.5 6 14 5.5 15.5 7 C17.5 7 19 8.5 18.5 10.5 C19 11.5 18.5 13 17 13 L7.5 13 C6 13 5 12 6 12Z\" fill=\"'+sage+'\" opacity=\"0.4\"/><g stroke=\"'+sage+'\" stroke-width=\"1.2\" stroke-linecap=\"round\" opacity=\"0.6\"><line x1=\"8\" y1=\"15\" x2=\"7\" y2=\"18.5\"/><line x1=\"11\" y1=\"15\" x2=\"10\" y2=\"18.5\"/><line x1=\"14\" y1=\"15\" x2=\"13\" y2=\"18.5\"/><line x1=\"17\" y1=\"15\" x2=\"16\" y2=\"18.5\"/></g></svg>';}\nif(code>=95){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 11 C6 8.5 8 7 10.5 7 C11.5 5 14 4.5 15.5 6 C17.5 6 19 7.5 18.5 9.5 C19 10.5 18.5 12 17 12 L7.5 12 C6 12 5 11 6 11Z\" fill=\"'+sage+'\" opacity=\"0.4\"/><path d=\"M13 13 L11 17 L14 17 L11.5 21\" stroke=\"'+rose+'\" stroke-width=\"1.3\" stroke-linecap=\"round\" stroke-linejoin=\"round\" fill=\"none\"/></svg>';}\nreturn'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 15 C6 12.5 8 11 10.5 11 C11.5 9 14 8.5 15.5 10 C17.5 10 19 11.5 18.5 13.5 C19 14.5 18.5 16 17 16 L7.5 16 C6 16 5 15 6 15Z\" fill=\"'+sage+'\" opacity=\"0.4\"/></svg>';}\nfunction pinSVG(){return'<svg viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7z\" fill=\"rgba(var(--lh-accent-rgb),0.5)\" stroke=\"rgba(var(--lh-accent-rgb),0.3)\" stroke-width=\"0.5\"/><circle cx=\"12\" cy=\"9\" r=\"2.5\" fill=\"rgba(var(--lh-bg-rgb),0.6)\"/></svg>';}\ntry{let loc=null;try{loc=JSON.parse(localStorage.getItem('userLocation'));}catch(e){}\nif(!loc||!loc.lat||!loc.lon){const weatherEl=document.getElementById('weatherWidget');if(weatherEl){weatherEl.style.cursor='pointer';weatherEl.title='Tap to set your location';document.getElementById('weatherIcon').innerHTML=pinSVG();document.getElementById('weatherTemp').textContent='set location';document.getElementById('weatherRange').textContent='';weatherEl.onclick=function(){openLocationSetup();};}\nreturn;}\nconst data=await window.dbkNWS.load(loc);if(data.outside)return;const n=data.now;const code=n.code;const temp=n.temp;const hi=data.hi;const lo=data.lo;var _hours=[];[3,6,9].forEach(function(o){var h=data.hourly[o];if(h)_hours.push({t:h.t,temp:h.temp,code:h.code,day:h.day});});window._weatherDetail={hours:_hours,isDay:n.isDay,temp:temp,hi:hi,lo:lo,feelsLike:n.feels,humidity:n.humidity,wind:n.wind,uvMax:null,precipChance:data.pop,sunrise:data.sunrise,sunset:data.sunset,desc:n.desc,code:code,locName:(window.dbkLocName?window.dbkLocName(loc.name):loc.name)||''};const weatherEl=document.getElementById('weatherWidget');if(weatherEl){document.getElementById('weatherIcon').innerHTML=weatherSVG(code);document.getElementById('weatherTemp').textContent=temp+'°';document.getElementById('weatherRange').textContent=hi+'°/'+lo+'°';weatherEl.style.cursor='pointer';weatherEl.title='Tap for details';weatherEl.onclick=function(){window.showWeatherDetail();};}}catch(e){const weatherEl=document.getElementById('weatherWidget');if(weatherEl&&window.dbkWxState&&window.dbkWxState()==='on'){document.getElementById('weatherTemp').textContent='weather unavailable';document.getElementById('weatherRange').textContent='';weatherEl.style.cursor='pointer';weatherEl.title='Weather couldn\\'t load. Tap to change location';weatherEl.onclick=function(){openLocationSetup();};}const retry=function(){window.removeEventListener('online',retry);window.removeEventListener('dbk-show',retry);fetchWeather();};window.addEventListener('online',retry);window.addEventListener('dbk-show',retry);}};_dbkWeather();/* a new location picked in Settings (or by the other person) shows here without a reload */window.addEventListener('storage',function(e){if(e.key==='userLocation'&&e.newValue!==e.oldValue)_dbkWeather();});await Promise.all([calendarInit(),loadLifeReminders(),loadGroceries(),loadCapturedThoughts(),loadEventCompletions(),loadHeaderPhoto()]);updateCalendarSummary();document.getElementById('photoUpload').addEventListener('change',handlePhotoUpload);setupPhotoDrag();setTimeout(setupAllListeners,1000);}catch(error){document.body.style.opacity='1';}});let photoPosition={x:0,y:0};let photoScale=1;let isDragging=false;let startPos={x:0,y:0};let photoEditMode=false;async function loadHeaderPhoto(){if(_photoSaving)return;const localRaw=localStorage.getItem('headerPhoto');const localPhoto=localRaw?JSON.parse(localRaw):null;const firebasePhoto=await loadFromFirebase('headerPhoto');let photo=null;if(firebasePhoto&&firebasePhoto.removed){localStorage.removeItem('headerPhoto');return;}\nif(firebasePhoto&&firebasePhoto.data&&localPhoto&&localPhoto.data){const fbTime=new Date(firebasePhoto.uploaded||0).getTime();const localTime=new Date(localPhoto.uploaded||0).getTime();photo=localTime>=fbTime?localPhoto:firebasePhoto;if(localTime>fbTime){syncToFirebase('headerPhoto',localPhoto);}else if(fbTime>localTime){localStorage.setItem('headerPhoto',JSON.stringify(firebasePhoto));}}else{photo=(firebasePhoto&&firebasePhoto.data)?firebasePhoto:localPhoto;}\nif(photo&&photo.data){displayPhoto(photo.data,photo.position,photo.scale);}}\nfunction displayPhoto(dataUrl,position={x:0,y:0},scale=1.5){const img=document.getElementById('headerPhoto');const draggable=document.getElementById('photoDraggable');const placeholder=document.getElementById('photoPlaceholder');const uploadBtn=document.getElementById('uploadBtn');img.src=dataUrl;img.onload=function(){photoPosition=position;photoScale=scale;updatePhotoTransform();draggable.style.display='block';placeholder.style.display='none';if(uploadBtn)uploadBtn.classList.remove('no-photo');};}\nfunction updatePhotoTransform(){const draggable=document.getElementById('photoDraggable');const img=document.getElementById('headerPhoto');const container=document.getElementById('photoContainer');if(!draggable||!img||!container)return;const containerSize=container.offsetWidth||78;if(containerSize<10)return;const imgAspect=img.naturalWidth/img.naturalHeight;if(!imgAspect||!isFinite(imgAspect))return;const repoRefSize=140;const posScale=containerSize/repoRefSize;let width,height;if(imgAspect>1){height=containerSize*photoScale;width=height*imgAspect;}else{width=containerSize*photoScale;height=width/imgAspect;}\nimg.style.width=width+'px';img.style.height=height+'px';draggable.style.left=(photoPosition.x*posScale)+'px';draggable.style.top=(photoPosition.y*posScale)+'px';}\nwindow.addEventListener('resize',function(){if(typeof updatePhotoTransform==='function')updatePhotoTransform();});async function handlePhotoUpload(e){const file=e.target.files[0];if(!file)return;if(!file.type.startsWith('image/')){showToast('Please select an image file');return;}\nconst compressed=await compressImage(file,600,0.7);photoPosition={x:0,y:0};photoScale=1.5;displayPhoto(compressed,photoPosition,photoScale);await savePhotoData(compressed);}\nfunction compressImage(file,maxSize,quality){return new Promise((resolve)=>{const reader=new FileReader();reader.onload=function(e){const img=new Image();img.onload=function(){const canvas=document.createElement('canvas');let w=img.width,h=img.height;if(w>h&&w>maxSize){h=h*maxSize/w;w=maxSize;}\nelse if(h>maxSize){w=w*maxSize/h;h=maxSize;}\ncanvas.width=w;canvas.height=h;canvas.getContext('2d').drawImage(img,0,0,w,h);resolve(canvas.toDataURL('image/jpeg',quality));};img.src=e.target.result;};reader.readAsDataURL(file);});}\nlet _photoSaving=false;async function savePhotoData(dataUrl=null){_photoSaving=true;const img=document.getElementById('headerPhoto');const photoData={data:dataUrl||img.src,position:photoPosition,scale:photoScale,uploaded:new Date().toISOString()};localStorage.setItem('headerPhoto',JSON.stringify(photoData));await syncToFirebase('headerPhoto',photoData);_photoSaving=false;}\nfunction setupPhotoDrag(){const container=document.getElementById('photoContainer');const draggable=document.getElementById('photoDraggable');draggable.addEventListener('mousedown',startDrag);draggable.addEventListener('touchstart',startDrag,{passive:false});document.addEventListener('mousemove',drag);document.addEventListener('touchmove',drag,{passive:false});document.addEventListener('mouseup',endDrag);document.addEventListener('touchend',endDrag);}\nfunction startDrag(e){isDragging=true;_dragMoved=false;const draggable=document.getElementById('photoDraggable');draggable.classList.add('dragging');const clientX=e.touches?e.touches[0].clientX:e.clientX;const clientY=e.touches?e.touches[0].clientY:e.clientY;const container=document.getElementById('photoContainer');const containerSize=container?container.offsetWidth:78;const posScale=containerSize/140;startPos={x:clientX-(photoPosition.x*posScale),y:clientY-(photoPosition.y*posScale)};e.preventDefault();}\nfunction drag(e){if(!isDragging)return;const clientX=e.touches?e.touches[0].clientX:e.clientX;const clientY=e.touches?e.touches[0].clientY:e.clientY;_dragMoved=true;const container=document.getElementById('photoContainer');const containerSize=container?container.offsetWidth:78;const toRef=140/containerSize;photoPosition={x:(clientX-startPos.x)*toRef,y:(clientY-startPos.y)*toRef};updatePhotoTransform();e.preventDefault();}\nfunction endDrag(){if(isDragging){isDragging=false;const draggable=document.getElementById('photoDraggable');draggable.classList.remove('dragging');savePhotoData();}}\nlet _dragMoved=false;function handlePhotoContainerClick(e){if(_dragMoved)return;document.getElementById('photoUpload').click();}\nconst _origStartDrag=startDrag;var PSD_MODULES=[{key:'intention',label:'Daily question'},{key:'weather',label:'Weather'},{key:'moon',label:'Moon Phase'},{key:'three',label:'Today\\'s Three & Back Burner'},{key:'routine',label:'Routine'},{key:'reminders',label:'Reminder'},{key:'calendar',label:'Calendar'},{key:'grocery',label:'Grocery list'}];if(document.documentElement.classList.contains('dbk-no-wx'))PSD_MODULES=PSD_MODULES.filter(function(m){return m.key!=='weather';});var PSD_DEFAULTS={intention:true,weather:true,moon:true,three:true,routine:true,reminders:true,calendar:true,grocery:true};var PSD_TARGETS={intention:['#homeIntention','#intentionWidget','.home-intention','[data-module=\"intention\"]'],weather:['#weatherWidget','#weatherStrip','[data-module=\"weather\"]'],moon:['#moonWidget','#moonStrip','[data-module=\"moon\"]'],three:['[data-sortkey=\"three\"]'],routine:['[data-sortkey=\"routine\"]','#hmRoutine'],reminders:['[data-sortkey=\"reminders\"]','[data-module=\"reminders\"]'],calendar:['[data-sortkey=\"calendar\"]','[data-module=\"calendar\"]'],grocery:['[data-sortkey=\"grocery\"]','[data-module=\"grocery\"]']};var PSD_DEFAULT_ORDER=['three','routine','reminders','calendar','grocery'];function psdGetOrder(){try{var saved=JSON.parse(localStorage.getItem('dashboardOrder')||'null');if(Array.isArray(saved)){saved=saved.filter(function(k){return PSD_DEFAULT_ORDER.indexOf(k)!==-1;});PSD_DEFAULT_ORDER.forEach(function(k){if(saved.indexOf(k)===-1)saved.push(k);});return saved;}}catch(e){}\nreturn PSD_DEFAULT_ORDER.slice();}\nfunction psdGetFeatures(){try{return Object.assign({},PSD_DEFAULTS,JSON.parse(localStorage.getItem('dashboardFeatures')||'{}'));}\ncatch(e){return Object.assign({},PSD_DEFAULTS);}}\n\n\n\n\n\n\n\nwindow.addEventListener('dbk-wx',function(){try{psdApplyAll();}catch(e){}});function psdApplyAll(){var features=psdGetFeatures();PSD_MODULES.forEach(function(mod){var on=features[mod.key]!==false;var targets=PSD_TARGETS[mod.key];targets.forEach(function(sel){document.querySelectorAll(sel).forEach(function(el){if(on)el.style.removeProperty('display');else el.style.setProperty('display','none','important');});});});var weatherPill=document.getElementById('weatherWidget');var moonPill=document.getElementById('moonWidget');var stripWidgets=document.querySelector('.strip-widgets');if(stripWidgets){var wOn=features.weather!==false&&!/\\bdbk-(no-wx|wx-wait)\\b/.test(document.documentElement.className);var mOn=features.moon!==false;if(weatherPill)weatherPill.style.display=wOn?'':'none';if(moonPill)moonPill.style.display=mOn?'':'none';stripWidgets.style.display=(wOn||mOn)?'':'none';}}\n// Today's sections in the chosen order. Moves nothing when they are already in that order (this runs every time\n// the page gets focus, and moving a section takes the cursor out of any box being typed in, e.g. a Back Burner\n// item being changed). If the order did change while someone is typing, it waits until they leave the box.\nfunction psdApplyOrder(){var order=psdGetOrder();var container=document.querySelector('.container');if(!container)return;var blocks={};PSD_DEFAULT_ORDER.forEach(function(key){var el=container.querySelector('[data-sortkey=\"'+key+'\"]');if(el)blocks[key]=el;});var anchor=container.querySelector('#sections-end-anchor');if(!anchor)return;\nvar want=order.filter(function(key){return !!blocks[key];});var parent=anchor.parentNode;var now=[].slice.call(parent.children).filter(function(el){return el.hasAttribute&&el.hasAttribute('data-sortkey')&&blocks[el.getAttribute('data-sortkey')]===el;}).map(function(el){return el.getAttribute('data-sortkey');});\nif(want.every(function(key){return blocks[key].parentNode===parent;})&&now.join('|')===want.join('|'))return;\nvar ae=document.activeElement;if(ae&&ae!==document.body&&container.contains(ae)&&(/^(INPUT|TEXTAREA|SELECT)$/.test(ae.tagName)||ae.isContentEditable)){if(!psdApplyOrder._wait){psdApplyOrder._wait=1;document.addEventListener('focusout',function again(){setTimeout(function(){var a=document.activeElement;if(a&&a!==document.body&&container.contains(a)&&/^(INPUT|TEXTAREA|SELECT)$/.test(a.tagName))return;document.removeEventListener('focusout',again);psdApplyOrder._wait=0;psdApplyOrder();},0);});}return;}\nwant.forEach(function(key){parent.insertBefore(blocks[key],anchor);});}\n\n\n\n\ndocument.addEventListener('DOMContentLoaded',function(){psdApplyOrder();psdApplyAll();});\n\n\n\n\n\n\nvar _threeThings=[{text:'',done:false},{text:'',done:false},{text:'',done:false}];var _threeLoadedFor=null;\n/* the list on screen belongs to the day it was loaded for; past midnight it is loaded fresh before anything changes */\nfunction threeStale(){if(_threeLoadedFor&&_threeLoadedFor!==new Date().toDateString()){threeThingsLoad();return true;}return false;}\nfunction threeThingsKey(){var r='person1';try{r=localStorage.getItem('myPersonRole')==='person2'?'person2':'person1';}catch(e){}return'threeThings_'+r;}\n/* Each of the three lines keeps its own time (overnight audit, Oct 23): the same person's phone and computer both save\n   this list, and with one time for the whole list a change from the other device that came in a few seconds after this\n   one's save was ignored, then written over. Now a cloud copy and this device's copy are joined line by line (dbkMerge\n   lineMerge: the newer line wins, an emptied line only empties what it saw), saves read the cloud first (dbkMergeSave),\n   and the listener is the list's own (the shared one skips anything that arrives in the 3s after a save). */\nvar _threeBase=null,_threeSentAt=0;\n/* A new day (Kasey, Oct 25: \"3 things yesterday on today's three that i never checked off and they're gone\", twice): the\n   unfinished lines are carried over on screen but only saved once something changes, and a phone that carried from an\n   older copy (the cloud hadn't answered yet, or only its own copy from days ago) then saved today's list without them.\n   Now: the list isn't saved while it loads (a save waits until it has loaded, _threeReady); a cloud copy from an earlier\n   day that comes in late is carried again while nothing has been saved today (threeTakeCloud); and today's first save,\n   which reads the cloud in its transaction, keeps the cloud's unfinished lines this phone never showed (threeFold), in\n   empty lines, the rest to Recently removed. A line this phone showed and the person took off stays off (_threeSeen). */\nvar _threeReady=false,_threeFrom=null,_threeSeen={},_threeWait=null,_threeFiled={};\nfunction threeSeenAdd(l){(l||[]).forEach(function(x){if(x&&x.text)_threeSeen[x.text]=1;});}\nfunction threeTodayHere(K){try{var v=JSON.parse(localStorage.getItem(K)||'null');return!!(v&&v.date===new Date().toDateString());}catch(e){return false;}}\nfunction threeOlder(d){return!!(d&&d.date&&Array.isArray(d.items)&&new Date(d.date)<new Date(new Date().toDateString()));}\nfunction threeCarryShow(src){_threeFrom=src?threeDoc(src):null;var c=threeCarry(_threeFrom);_threeThings=threeClone(c);_threeBase=window.dbkMerge&&window.dbkMerge.lineNorm?window.dbkMerge.lineNorm(c,0):null;threeSeenAdd(c);}\nfunction threeFold(K,mine,cloud){var c=threeDoc(cloud),m=threeDoc(mine);if(!c||!m)return mine;var have={};m.items.forEach(function(x){if(x.text)have[x.text]=1;});var now=Date.now(),left=[];\nc.items.forEach(function(x){if(!x||!x.text||x.done||have[x.text]||_threeSeen[x.text])return;have[x.text]=1;var i=-1;for(var j=0;j<m.items.length;j++){if(!m.items[j].text){i=j;break;}}if(i<0){left.push({text:x.text});return;}m.items[i]={text:x.text,done:false,t:now};});\nleft=left.filter(function(x){if(_threeFiled[x.text])return false;_threeFiled[x.text]=1;return true;});\nif(left.length&&window.dbkRemoved)setTimeout(function(){try{window.dbkRemoved.track('Today\\u2019s Three',K,left,[],{id:'text',title:'text'});}catch(e){}},0);\nreturn{date:m.date,items:m.items,at:Math.max(m.at||0,now)};}\nfunction threeReadyNow(){_threeReady=true;var w=_threeWait;_threeWait=null;if(!w)return;var have={},ch=false;_threeThings.forEach(function(x){if(x&&x.text)have[x.text]=1;});\nw.forEach(function(x){if(!x||!x.text||x.done||have[x.text])return;for(var i=0;i<3;i++){if(!_threeThings[i]||!_threeThings[i].text){_threeThings[i]={text:x.text,done:false};have[x.text]=1;ch=true;return;}}});\nif(ch){threeThingsRender();threeThingsSave();}}\nfunction threeClone(x){try{return JSON.parse(JSON.stringify(x));}catch(e){return x;}}\nfunction threeDoc(d){if(!d||!Array.isArray(d.items)||!d.date)return null;var M=window.dbkMerge;return{date:d.date,items:M&&M.lineNorm?M.lineNorm(d.items,d.at):threeClone(d.items),at:+d.at||0};}\nfunction threeJoin(a,b){a=threeDoc(a);b=threeDoc(b);if(!a)return b;if(!b)return a;if(a.date!==b.date)return new Date(a.date)>new Date(b.date)?a:b;var M=window.dbkMerge;if(!M||!M.lineMerge)return a.at>b.at?a:b;return{date:a.date,items:M.lineMerge(a.items,b.items),at:Math.max(a.at,b.at)};}\nfunction threeTD(l){return JSON.stringify((l||[]).map(function(x){return[(x&&x.text)||'',!!(x&&x.done)];}));}\nfunction threeShow(K,d){if(threeTD(d.items)!==threeTD(_threeThings)){threeLost(K,_threeThings,d.items);_threeThings=threeClone(d.items);threeThingsRender();}_threeBase=threeClone(d.items);try{localStorage.setItem(K,JSON.stringify(d));}catch(e){}}\nfunction threeSend(K,mine){_threeSentAt=Date.now();if(typeof window.dbkMergeSave!=='function'){try{syncToFirebase(K,mine);}catch(e){}return;}\nwindow.dbkMergeSave(K,function(cloud){if(cloud&&threeOlder(cloud)&&mine&&mine.date===new Date().toDateString())return threeFold(K,mine,cloud);return cloud?threeJoin(mine,cloud):mine;}).then(function(out){if(!out||out.date!==new Date().toDateString()||K!==threeThingsKey()||document.querySelector('.thing-edit-input'))return;var loc=null;try{loc=JSON.parse(localStorage.getItem(K)||'null');}catch(e){}var m=threeJoin(loc,out);if(m&&m.date===out.date)threeShow(K,m);},function(){});}\nfunction threeTakeCloud(K,d){if(d&&threeOlder(d)){if(!_threeReady||threeTodayHere(K)||document.querySelector('.thing-edit-input'))return;var src=threeJoin(_threeFrom,d);if(!src||JSON.stringify(src)===JSON.stringify(_threeFrom))return;var was=threeTD(_threeThings);threeCarryShow(src);if(threeTD(_threeThings)!==was)threeThingsRender();return;}\nif(!d||d.date!==new Date().toDateString()||!Array.isArray(d.items))return;if(document.querySelector('.thing-edit-input'))return;\n/* the cloud's copy can be older than this phone's: a change made here that hadn't reached it yet (slow, offline, mid-reload). Then this phone's lines go up again instead of being replaced (Kasey, Oct 21: two unfinished ones were just gone) */\nvar mine=null;try{mine=JSON.parse(localStorage.getItem(K)||'null');}catch(e){}var m=threeJoin(mine,d);if(!m||m.date!==d.date)return;threeShow(K,m);\nif(JSON.stringify(m.items)!==JSON.stringify(threeDoc(d).items)&&Date.now()-_threeSentAt>4000)threeSend(K,m);}\n/* anything unfinished that leaves Today's Three without being ticked off goes to Settings > Recently removed */\nfunction threeLost(K,before,after){try{if(!window.dbkRemoved)return;var have={};(after||[]).forEach(function(t){if(t&&t.text)have[t.text]=1;});var gone=(before||[]).filter(function(t){return t&&t.text&&!t.done&&!have[t.text];}).map(function(t){return{text:t.text};});if(gone.length)window.dbkRemoved.track('Today\\u2019s Three',K,gone,[],{id:'text',title:'text'});}catch(e){}}\n/* a new day: what was ticked off yesterday is gone, what wasn't stays (in order) for the person to keep or remove */function threeCarry(prev){var out=[];try{(prev&&prev.items||[]).forEach(function(it){if(it&&it.text&&!it.done&&out.length<3)out.push({text:it.text,done:false});});}catch(e){}while(out.length<3)out.push({text:'',done:false});return out;}\nfunction threeThingsLoad(){var today=new Date().toDateString();_threeLoadedFor=today;var K=threeThingsKey();_threeReady=false;_threeFrom=null;_threeSeen={};\n/* the phone's copy shows first, then the cloud itself is checked (the phone's copy can be from yesterday), and the other phone's changes arrive live */\nvar check=function(){if(typeof window.loadFromFirebaseLive==='function'){window.loadFromFirebaseLive(K).then(function(d){threeTakeCloud(K,d);},function(){});}if(!window._threeListenOn&&!window.firebaseConfigEmpty){window._threeListenOn=K;var go=function(){var fi=window.firestoreImports;if(!window.firebaseReady||!window.db||!fi||typeof fi.onSnapshot!=='function')return false;try{fi.onSnapshot(fi.doc(window.db,K,'data'),function(s){try{if(s&&s.exists()&&!(s.metadata&&s.metadata.hasPendingWrites))threeTakeCloud(K,s.data().items);}catch(e){}},function(){});}catch(e){}return true;};if(!go())window.addEventListener('firebaseReady',go,{once:true});}};\n(async function(){var prev=null;try{var fbData=await loadFromFirebase(K);if(!fbData&&K==='threeThings_person1'){fbData=await loadFromFirebase('threeThings');}var mine0=null;try{mine0=JSON.parse(localStorage.getItem(K)||'null');}catch(e){}\nvar c0=fbData&&fbData.date===today&&Array.isArray(fbData.items)?fbData:null,m0=mine0&&mine0.date===today&&Array.isArray(mine0.items)?mine0:null;\nif(c0||m0){var m=threeJoin(m0,c0);_threeThings=threeClone(m.items);_threeBase=threeClone(m.items);try{localStorage.setItem(K,JSON.stringify(m));}catch(e){}threeSeenAdd(m.items);threeThingsRender();threeReadyNow();if(m0&&!(c0&&JSON.stringify(threeDoc(c0).items)===JSON.stringify(m.items))){try{threeSend(K,m);}catch(e){}}check();return;}\nif(fbData&&Array.isArray(fbData.items))prev=fbData;}catch(e){}\ntry{var saved=JSON.parse(localStorage.getItem(K)||(K==='threeThings_person1'?localStorage.getItem('threeThings'):null)||'null');if(saved&&saved.date===today){var sd=threeDoc(saved);_threeThings=threeClone(sd.items);_threeBase=threeClone(sd.items);threeSeenAdd(sd.items);}else{if(saved&&Array.isArray(saved.items)&&saved.date)prev=prev?threeJoin(prev,saved):saved;threeCarryShow(prev);/* not saved: it goes to the cloud only once something is changed, so a phone holding an older copy never replaces today's list */}}catch(e){}\nthreeThingsRender();threeReadyNow();check();})();}\nfunction threeThingsSave(){if(!_threeReady){_threeWait=threeClone(_threeThings);return;}var today=new Date().toDateString();if(_threeLoadedFor&&_threeLoadedFor!==today){threeThingsLoad();return;}var now=Date.now(),M=window.dbkMerge;var items=M&&M.lineStamp?M.lineStamp(_threeBase||[],_threeThings,now):threeClone(_threeThings);_threeBase=threeClone(items);var payload={date:today,items:items,at:now};var K=threeThingsKey();localStorage.setItem(K,JSON.stringify(payload));threeSend(K,payload);}\nfunction threeThingsRender(){var allDone=true;var anyFilled=false;for(var i=0;i<3;i++){var slot=document.getElementById('thing-'+i);var textEl=document.getElementById('thing-text-'+i);if(!slot||!textEl)continue;var item=_threeThings[i];slot.classList.toggle('done',item.done);if(item.text){textEl.textContent=item.text;textEl.classList.remove('empty');anyFilled=true;if(!item.done)allDone=false;}else{textEl.textContent='';textEl.classList.add('empty');allDone=false;}}\nvar celebEl=document.getElementById('threeThingsCeleb');if(celebEl){if(allDone&&anyFilled){celebEl.style.display='block';}else{celebEl.style.display='none';}}}\nfunction thingSlotClick(i,ev){if(threeStale())return;if(document.getElementById('thing-edit-'+i))return;var item=_threeThings[i];var t=ev&&ev.target;var onWords=!!(t&&t.closest&&t.closest('.thing-text'));if(item.text&&!onWords){item.done=!item.done;threeThingsSave();threeThingsRender();if(item.done)showToast('One down.');}else{window.dbkTapFocus=Date.now();thingStartEdit(i);}}\nfunction thingStartEdit(i){if(document.getElementById('thing-edit-'+i))return;if(threeStale())return;\n/* only one line is edited at a time: finish any other open one first (on a phone the keyboard may not have come up, so it never lost focus) */\nfor(var k=0;k<3;k++){if(k!==i&&document.getElementById('thing-edit-'+k))thingFinishEdit(k);}\nvar textEl=document.getElementById('thing-text-'+i);if(!textEl)return;\n/* a box that wraps like the text it replaces, instead of a one-line field that cuts long items off */\nvar input=document.createElement('textarea');input.rows=1;input.className='thing-edit-input';input.id='thing-edit-'+i;input.value=_threeThings[i].text;input.setAttribute('maxlength','200');input.setAttribute('enterkeyhint','done');input.setAttribute('aria-label','Edit this one');\nvar grow=function(){input.style.height='auto';input.style.height=input.scrollHeight+'px';};input.addEventListener('input',function(){input.value=input.value.replace(/\\n/g,' ');grow();});\ntextEl.replaceWith(input);grow();input.focus();try{var n=input.value.length;input.setSelectionRange(n,n);}catch(x){}\n/* tapping anywhere else finishes the edit, even if the box never had focus */\nvar away=function(e){if(!document.getElementById('thing-edit-'+i)){document.removeEventListener('pointerdown',away,true);return;}if(e.target===input)return;document.removeEventListener('pointerdown',away,true);thingFinishEdit(i);};setTimeout(function(){document.addEventListener('pointerdown',away,true);},0);input.addEventListener('blur',function(){thingFinishEdit(i);});input.addEventListener('keydown',function(e){if(e.key==='Enter'){e.preventDefault();input.blur();}\nif(e.key==='Escape'){e.preventDefault();e.stopPropagation();input.value=_threeThings[i].text;input.blur();}});var slot=document.getElementById('thing-'+i);if(slot)slot.onclick=null;}\nfunction thingFinishEdit(i){var input=document.getElementById('thing-edit-'+i);if(!input||input._finishing)return;input._finishing=true;var val=input.value.trim();var was=_threeThings[i].text;var span=document.createElement('span');span.id='thing-text-'+i;span.className='thing-text';input.replaceWith(span);var slot=document.getElementById('thing-'+i);if(slot)slot.onclick=function(e){thingSlotClick(i,e);};\nif(!val&&was){threeThingsRender();thingAskRemove(i);return;}\nif(val!==was){_threeThings[i].text=val;if(!val)_threeThings[i].done=false;threeThingsSave();}threeThingsRender();}\nfunction thingAskRemove(i){var it=_threeThings[i];if(!it||!it.text)return Promise.resolve(false);var name=it.text;/* no \"are you sure?\": Undo and Recently removed (Kasey, Oct 22) */var ask=Promise.resolve(true);return ask.then(function(ok){if(!ok)return false;if(threeStale())return false;var cur=_threeThings[i];if(cur&&cur.text===name){var _wasDone=!!cur.done;if(!_wasDone)threeLost(threeThingsKey(),[{text:name,done:false}],[]);cur.text='';cur.done=false;threeThingsSave();threeThingsRender();(window.dbkUndo||function(){})('Removed from Today\\u2019s Three',function(){var c=_threeThings[i];if(c&&!c.text){c.text=name;c.done=_wasDone;threeThingsSave();threeThingsRender();}});}return true;});}\n(function setupThingLongPress(){document.addEventListener('DOMContentLoaded',function(){for(var i=0;i<3;i++){(function(idx){var slot=document.getElementById('thing-'+idx);if(!slot)return;var pressTimer;slot.addEventListener('mousedown',function(){pressTimer=setTimeout(function(){thingStartEdit(idx);},500);});slot.addEventListener('touchstart',function(){pressTimer=setTimeout(function(){thingStartEdit(idx);},500);},{passive:true});slot.addEventListener('mouseup',function(){clearTimeout(pressTimer);});slot.addEventListener('touchend',function(){clearTimeout(pressTimer);});})(i);}\nthreeThingsLoad();\n/* Settings > Recently removed > Put back: into the first empty slot (or slots) of today's list */\nif(window.dbkRemoved)window.dbkRemoved.on(function(k){return /^threeThings_person[12]$/.test(k);},function(k,items){if(k!==threeThingsKey()||!_threeReady)return false;if(threeStale())return false;var have={};_threeThings.forEach(function(t){if(t&&t.text)have[t.text]=1;});var n=0;items.forEach(function(x){if(!x||!x.text||have[x.text])return;for(var i=0;i<3;i++){if(!_threeThings[i].text){_threeThings[i]={text:x.text,done:false};n++;return;}}});if(n){threeThingsSave();threeThingsRender();}return true;});\n});})();function threeThingsClear(){if(threeStale())return;if(!_threeThings.some(function(t){return t&&t.text;}))return;var ask=Promise.resolve(true);ask.then(function(ok){if(!ok||threeStale())return;var _b=JSON.parse(JSON.stringify(_threeThings));threeLost(threeThingsKey(),_b,[]);_threeThings=[{text:'',done:false},{text:'',done:false},{text:'',done:false}];threeThingsSave();threeThingsRender();(window.dbkUndo||function(){})('Today\\u2019s Three cleared',function(){threeUndoClear(_b);});});}\n/* Undo of \"Clear the list\" (overnight audit, Oct 23): the list is one document for both of this person's devices, so it\n   first reads the cloud's newest copy (what the computer added meanwhile), then puts the cleared ones back into the empty\n   lines only, never over something there now. Putting back the old copy whole took the other device's line off. */\nfunction threeUndoClear(b){var K=threeThingsKey(),done=false;var put=function(){if(done)return;done=true;var cur=_threeThings,have={},free=[];for(var i=0;i<3;i++){if(!cur[i])cur[i]={text:'',done:false};if(cur[i].text)have[cur[i].text]=1;else free.push(i);}\n(b||[]).forEach(function(t,i){if(!t||!t.text||have[t.text]||!free.length)return;var at=free.indexOf(i)!==-1?i:free[0];free.splice(free.indexOf(at),1);cur[at]={text:t.text,done:!!t.done};have[t.text]=1;});threeThingsSave();threeThingsRender();};\ntry{if(typeof window.loadFromFirebaseLive==='function'&&!window.firebaseConfigEmpty&&window.db){setTimeout(put,2500);window.loadFromFirebaseLive(K).then(function(d){if(!done)threeTakeCloud(K,d);put();},put);return;}}catch(e){}put();}\nvar _capturedThoughts=[];var _inboxSearch='';var _inboxTagFilter=null;var _pendingRouteThoughtId=null;var INBOX_TAGS=['task','idea','buy','look up','talk about'];function captureThought(fromInbox){var inputId=fromInbox?'inboxCaptureInput':'captureInput';var input=document.getElementById(inputId);if(!input)return;var text=input.value.trim();if(!text)return;var item={id:Date.now(),text:text,tag:null,createdAt:new Date().toISOString()};_capturedThoughts.push(item);saveCapturedThoughts();updateInboxBadge();input.value='';if(fromInbox){renderInbox();setTimeout(function(){input.focus();},50);}else{showToast('Captured.');}}\n/* each of us has our own inbox; the old shared one is copied into each person's inbox the first time */\nfunction inboxKey(){var r='person1';try{r=localStorage.getItem('myPersonRole')==='person2'?'person2':'person1';}catch(e){}return'capturedThoughts_'+r;}\nasync function loadCapturedThoughts(){var K=inboxKey();var fbData=await loadFromFirebase(K);if(fbData&&Array.isArray(fbData)){_capturedThoughts=window.dbkInboxAdopt?window.dbkInboxAdopt(fbData):fbData;}else{var mine=null;try{mine=JSON.parse(localStorage.getItem(K)||'null');}catch(e){}\nif(Array.isArray(mine)){_capturedThoughts=mine;}else{var old=await loadFromFirebase('capturedThoughts');if(!Array.isArray(old)){try{old=JSON.parse(localStorage.getItem('capturedThoughts')||'[]');}catch(e){old=[];}}\n_capturedThoughts=Array.isArray(old)?old.slice():[];}\nif(_capturedThoughts.length||Array.isArray(mine)){try{localStorage.setItem(K,JSON.stringify(_capturedThoughts));}catch(e){}if(window.dbkCloudMissing&&await window.dbkCloudMissing(K))await syncToFirebase(K,_capturedThoughts);}}\nupdateInboxBadge();}\nasync function saveCapturedThoughts(){var K=inboxKey();localStorage.setItem(K,JSON.stringify(_capturedThoughts));await syncToFirebase(K,_capturedThoughts);}\nfunction updateInboxBadge(){var badge=document.getElementById('inboxBadge');if(!badge)return;var count=_capturedThoughts.length;badge.textContent=count>0?count:'';}\nfunction openInbox(){_inboxSearch='';_inboxTagFilter=null;window._inboxMenu={};window._inboxOpenId=null;var si=document.getElementById('inboxSearchInput');if(si)si.value='';try{inboxPullMemory();}catch(e){}renderInbox();document.getElementById('inboxOverlay').classList.add('visible');var bar=document.querySelector('.capture-sticky-bar');if(bar)bar.classList.add('hidden');}\nfunction closeInbox(){inboxDropPorted();window._inboxMenu={};document.getElementById('inboxOverlay').classList.remove('visible','dbk-now');var bar=document.querySelector('.capture-sticky-bar');if(bar)bar.classList.remove('hidden');}\nfunction getFilteredThoughts(){var _snd=window._ibxSending||{};var items=_capturedThoughts.filter(function(t){return !_snd[t.id];});if(_inboxSearch){var q=_inboxSearch.toLowerCase();items=items.filter(function(t){return t.text.toLowerCase().indexOf(q)!==-1;});}\nif(_inboxTagFilter){if(_inboxTagFilter==='_untagged'){items=items.filter(function(t){return!t.tag;});}else{items=items.filter(function(t){return t.tag===_inboxTagFilter;});}}\nitems.sort(function(a,b){return b.id-a.id;});return items;}\nfunction getUsedTags(){var tags={};_capturedThoughts.forEach(function(t){if(t.tag)tags[t.tag]=(tags[t.tag]||0)+1;});var untagged=_capturedThoughts.filter(function(t){return!t.tag;}).length;return{tags:tags,untagged:untagged};}\nvar INBOX_TAG_LABELS={'task':'Task','idea':'Idea','buy':'To buy','look up':'Look up','talk about':'Talk about'};\n/* every place a note can go, in the order Send to lists them; the Lists ones say which list they add to */\nvar INBOX_DESTS=[['event','Calendar'],['reminder','Reminder'],['grocery','Grocery list'],['hub','Back Burner'],['wrcontent','Work idea'],['wrspark','Spark File'],\n['list:shows-movies','TV and movies'],['list:restaurants','Restaurants'],['list:places','Places to go'],['list:reading','Reading list'],['list:wishlist','Wishlist'],['list:travel','Travel']];\nvar INBOX_LIST_CAT={'list:shows-movies':'shows-movies','list:restaurants':'restaurants','list:places':'places','list:reading':'reading','list:travel':'travel'};\n/* a place is offered only when it's in this build for this person and not put away in Settings */\nfunction inboxDestOk(dest){var M=window.dbkModule;var away=function(k){return!!(M&&M.archived&&M.archived(k));};\nif(dest==='wrcontent'||dest==='wrspark'){if(!M||typeof M.forPerson!=='function')return false;var p='p1';if(M.me){p=M.me();}else{try{p=localStorage.getItem('myPersonRole')==='person2'?'p2':'p1';}catch(e){}}if(!M.forPerson('work',p))return false;return!away('page:work')&&!away(dest==='wrspark'?'work:sparkfile':'work:content');}\nif(dest==='grocery')return!M||(M.on('meals')&&!away('page:meals')&&!away('meals:grocery'));\nif(dest==='list:travel')return!!M&&M.on('travel')&&!away('page:us')&&!away('us:travel');\nif(dest.indexOf('list:')===0){if(!M||!M.on('us')||away('page:us'))return false;return!away('us:'+(dest==='list:wishlist'?'wishlists':dest.slice(5)));}\nreturn true;}\nfunction inboxDests(){return INBOX_DESTS.filter(function(d){return inboxDestOk(d[0]);});}\nfunction inboxDestName(dest){var d=INBOX_DESTS.filter(function(x){return x[0]===dest;})[0];return d?d[1]:'';}\n/* what this person sent where before, so the same words are offered the same place next time (kept on this phone and in their cloud copy) */\nfunction inboxLearnKey(){var r='person1';try{r=localStorage.getItem('myPersonRole')==='person2'?'person2':'person1';}catch(e){}return'inboxLearn_'+r;}\nfunction inboxMemory(){try{var m=JSON.parse(localStorage.getItem(inboxLearnKey())||'null');return m&&typeof m==='object'&&!Array.isArray(m)?m:{};}catch(e){return{};}}\nvar _inboxLearnPulled=false;\nfunction inboxPullMemory(){if(_inboxLearnPulled||typeof loadFromFirebase!=='function')return;_inboxLearnPulled=true;var K=inboxLearnKey();Promise.resolve(loadFromFirebase(K)).then(function(cloud){if(!cloud||typeof cloud!=='object'||Array.isArray(cloud))return;var mine=inboxMemory(),changed=false;Object.keys(cloud).forEach(function(w){var c=cloud[w];if(!c||typeof c!=='object')return;mine[w]=mine[w]||{};Object.keys(c).forEach(function(d){if((+c[d]||0)>(mine[w][d]||0)){mine[w][d]=+c[d];changed=true;}});});if(changed){try{localStorage.setItem(K,JSON.stringify(mine));}catch(e){}}}).catch(function(){});}\nfunction inboxRemember(text,dest){if(!window.dbkInboxGuess)return;var K=inboxLearnKey(),m=window.dbkInboxGuess.learn(inboxMemory(),text,dest);try{localStorage.setItem(K,JSON.stringify(m));}catch(e){}try{if(typeof syncToFirebase==='function')syncToFirebase(K,m);}catch(e){}}\n/* the best guess for a note, among the places that are on */\n/* the household's own businesses (names, offers, words from Home Base), read from this phone's copy of the Work page, only while Work is on */\nvar _inboxBizRaw=null,_inboxBiz=null;\nfunction inboxBiz(dests){if(dests.indexOf('wrspark')===-1&&dests.indexOf('wrcontent')===-1)return null;var raw=null;try{raw=localStorage.getItem('wr:data');}catch(e){}if(raw!==_inboxBizRaw){_inboxBizRaw=raw;_inboxBiz=null;try{if(raw&&window.dbkInboxGuess.bizFrom)_inboxBiz=window.dbkInboxGuess.bizFrom(JSON.parse(raw));}catch(e){_inboxBiz=null;}}return _inboxBiz;}\nfunction inboxGuess(item){if(!window.dbkInboxGuess)return{best:null,ranked:[],title:item.text,items:[item.text],titleFor:function(){return item.text;}};var ds=inboxDests().map(function(d){return d[0];});return window.dbkInboxGuess.guess(item.text,{dests:ds,tag:item.tag,memory:inboxMemory(),today:new Date(),biz:inboxBiz(ds)});}\nvar IBX_CARET='<svg class=\"ibx-caret\" width=\"10\" height=\"7\" viewBox=\"0 0 12 8\" aria-hidden=\"true\"><path d=\"M1 1.5l5 5 5-5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\"/></svg>';\nvar IBX_ARROW='<svg class=\"ibx-arrow\" width=\"13\" height=\"10\" viewBox=\"0 0 14 10\" aria-hidden=\"true\"><path d=\"M1 5h11M8 1l4 4-4 4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>';\nvar IBX_PEN='<svg width=\"15\" height=\"15\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M11 2.5l2.5 2.5L6 12.5H3.5V10z\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linejoin=\"round\"/></svg>';\nvar IBX_BIN='<svg width=\"15\" height=\"15\" viewBox=\"0 0 16 16\" aria-hidden=\"true\"><path d=\"M3 4.5h10M6.5 4.5V3h3v1.5M4.5 4.5l.7 8.5h5.6l.7-8.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linejoin=\"round\" stroke-linecap=\"round\"/></svg>';\nfunction renderInbox(){var body=document.getElementById('inboxBody');if(!body)return;inboxDropPorted();var _snd=window._ibxSending||{};var n=_capturedThoughts.filter(function(t){return !_snd[t.id];}).length;var countEl=document.getElementById('inboxCount');if(countEl)countEl.textContent=n?n+' note'+(n===1?'':'s'):'';var clearBtn=document.getElementById('inboxClearBtn');if(clearBtn)clearBtn.style.display=n>1?'':'none';\n/* search only once there's enough to search through */\nvar sr=document.querySelector('#inboxModal .inbox-search-row');if(sr){var showSearch=n>=6||!!_inboxSearch;sr.style.display=showSearch?'':'none';}\nvar tagInfo=getUsedTags();var tagKeys=INBOX_TAGS.filter(function(k){return tagInfo.tags[k];});if(_inboxTagFilter&&_inboxTagFilter!=='_untagged'&&!tagInfo.tags[_inboxTagFilter])_inboxTagFilter=null;\nvar tagBarHtml='';if(tagKeys.length>0&&n>1){tagBarHtml='<div class=\"inbox-tagbar ibx-tagbar\" role=\"group\" aria-label=\"Show\">';tagBarHtml+='<button type=\"button\" class=\"ibx-chip\" aria-pressed=\"'+(!_inboxTagFilter)+'\" onclick=\"setInboxTagFilter(null)\">All</button>';tagKeys.forEach(function(tag){tagBarHtml+='<button type=\"button\" class=\"ibx-chip\" aria-pressed=\"'+(_inboxTagFilter===tag)+'\" onclick=\"setInboxTagFilter(\\''+dbkJsStr(tag)+'\\')\">'+escHtml(INBOX_TAG_LABELS[tag]||tag)+' <span class=\"ibx-chip-n\">'+tagInfo.tags[tag]+'</span></button>';});tagBarHtml+='</div>';}\nif(n===0){body.innerHTML='<div class=\"inbox-empty\">Nothing here yet. Jot anything down, then send it where it belongs when you have a minute.</div>';return;}\nvar filtered=getFilteredThoughts();if(filtered.length===0){body.innerHTML=tagBarHtml+'<div class=\"inbox-empty\">No notes match.</div>';return;}\nvar M=window._inboxMenu||{};var dests=inboxDests();\nbody.innerHTML=tagBarHtml+filtered.map(function(item){var open=window._inboxOpenId===item.id;var menu=open&&M.id===item.id?M.kind:null;var tagLbl=item.tag?(INBOX_TAG_LABELS[item.tag]||item.tag):'';var g=inboxGuess(item);var sug=g.best;\nvar sendMenu='',tagMenu='';\nif(menu==='send'){var order=dests.slice();if(sug)order.sort(function(x,y){return(x[0]===sug?-1:0)-(y[0]===sug?-1:0);});var main=order.filter(function(d){return d[0].indexOf('list:')!==0||d[0]===sug;}),lists=order.filter(function(d){return d[0].indexOf('list:')===0&&d[0]!==sug;});\nvar mi=function(d){return'<button type=\"button\" role=\"menuitem\" class=\"ibx-mi'+(d[0]===sug?' sug':'')+'\" onclick=\"inboxSend('+dbkJsArg(item.id)+',\\''+dbkJsStr(d[0])+'\\')\"><span>'+escHtml(d[1])+'</span>'+(d[0]===sug?'<span class=\"ibx-mi-note\">Suggested</span>':'')+'</button>';};\nsendMenu='<div class=\"ibx-menu\" role=\"menu\" aria-label=\"Send to\">'+main.map(mi).join('')+(lists.length?'<div class=\"ibx-menu-h\" role=\"presentation\">Lists</div>'+lists.map(mi).join(''):'')+'</div>';}\nif(menu==='tag'){tagMenu='<div class=\"ibx-menu ibx-tagmenu\" role=\"menu\" aria-label=\"Tag\">'+INBOX_TAGS.map(function(k){var on=item.tag===k;return'<button type=\"button\" role=\"menuitemradio\" aria-checked=\"'+on+'\" class=\"ibx-mi'+(on?' on':'')+'\" onclick=\"setThoughtTag('+dbkJsArg(item.id)+',\\''+k+'\\')\"><span>'+INBOX_TAG_LABELS[k]+'</span>'+(on?'<span class=\"ibx-mi-note\">Tagged</span>':'')+'</button>';}).join('')+(item.tag?'<button type=\"button\" role=\"menuitem\" class=\"ibx-mi ibx-untag\" onclick=\"setThoughtTag('+dbkJsArg(item.id)+',null)\"><span>Remove tag</span></button>':'')+'</div>';}\nreturn'<div class=\"inbox-item ibx-item'+(open?' open':'')+(menu?' menu-open':'')+'\" id=\"thought-'+escHtml(item.id)+'\">'+\n'<div class=\"inbox-item-row1\" onclick=\"toggleThought('+dbkJsArg(item.id)+',event)\" onkeydown=\"if(event.target===this&&(event.key===\\'Enter\\'||event.key===\\' \\')){event.preventDefault();toggleThought('+dbkJsArg(item.id)+',event);}\" role=\"button\" tabindex=\"0\" aria-expanded=\"'+(open?'true':'false')+'\">'+\n'<div class=\"inbox-item-text\">'+escHtml(item.text)+'</div>'+\n'<span class=\"inbox-item-meta\">'+formatTimeAgo(item.createdAt)+(tagLbl?'<span class=\"inbox-item-tag\">'+escHtml(tagLbl)+'</span>':'')+'</span>'+\n'</div>'+\n(sug&&!open?'<button type=\"button\" class=\"ibx-quick\" onclick=\"inboxSend('+dbkJsArg(item.id)+',\\''+dbkJsStr(sug)+'\\')\" aria-label=\"Send to '+escHtml(inboxDestName(sug))+'\">'+IBX_ARROW+'<span>'+escHtml(inboxDestName(sug))+'</span></button>':'')+\n'<div class=\"inbox-item-row2\"><div class=\"ibx-acts\">'+\n'<div class=\"ibx-dd\"><button type=\"button\" class=\"ibx-btn\" data-ibx=\"tag\" aria-haspopup=\"menu\" aria-expanded=\"'+(menu==='tag')+'\" onclick=\"dbkInboxMenu('+dbkJsArg(item.id)+',\\'tag\\',event)\">Tag'+IBX_CARET+'</button>'+tagMenu+'</div>'+\n'<div class=\"ibx-dd\"><button type=\"button\" class=\"ibx-btn\" data-ibx=\"send\" aria-haspopup=\"menu\" aria-expanded=\"'+(menu==='send')+'\" onclick=\"dbkInboxMenu('+dbkJsArg(item.id)+',\\'send\\',event)\">Send to'+IBX_CARET+'</button>'+sendMenu+'</div>'+\n'<button type=\"button\" class=\"ibx-icon\" onclick=\"startEditThought('+dbkJsArg(item.id)+')\" aria-label=\"Edit\" title=\"Edit\">'+IBX_PEN+'</button>'+\n'<button type=\"button\" class=\"ibx-icon del\" onclick=\"deleteThought('+dbkJsArg(item.id)+')\" aria-label=\"Delete\" title=\"Delete\">'+IBX_BIN+'</button>'+\n'</div></div>'+\n'</div>';}).join('');\ninboxPlaceMenu();}\n/* a menu always opens downward just under its button, above everything else. It is lifted out of the notes list onto the\n   page itself (above even the Undo message), so nothing in the pop-up (the list's scrolling, its edges) can clip or cover it on a phone;\n   a tall one scrolls inside itself, and it never scrolls the list behind it */\nfunction inboxDropPorted(){[].forEach.call(document.querySelectorAll('body > .ibx-menu.is-port'),function(m){m.remove();});}\nfunction inboxPlaceMenu(){inboxDropPorted();var menu=document.querySelector('#inboxBody .ibx-menu');if(!menu)return;var btn=menu.parentNode.querySelector('.ibx-btn');if(!btn)return;\nmenu.classList.remove('up','is-fixed');menu.classList.add('is-port');menu.style.maxHeight='';document.body.appendChild(menu);\nvar r=btn.getBoundingClientRect(),w=menu.offsetWidth,vw=document.documentElement.clientWidth;\nvar vb=window.dbkViewBottom?window.dbkViewBottom():(window.visualViewport?window.visualViewport.height:window.innerHeight);   /* the bottom of what can be seen (above the keyboard) */\nvar need=Math.min(menu.offsetHeight,180),room=vb-r.bottom-6-10;\n/* a button near the bottom edge: the notes move up just enough for the menu to have room (no animation) */\nif(room<need){var body=document.getElementById('inboxBody');if(body){var can=body.scrollHeight-body.clientHeight-body.scrollTop,by=Math.min(can,Math.ceil(need-room));if(by>0){var was=body.scrollTop;body.scrollTop+=by;if(body.scrollTop!==was)window._ibxNoShut=true;r=btn.getBoundingClientRect();room=vb-r.bottom-6-10;}}}\nvar top=Math.round(r.bottom+6),left=Math.round(Math.max(10,Math.min(r.left,vw-10-w)));   /* lines up with the button's left edge; slides left only if it would run off the right */\nmenu.style.top=top+'px';menu.style.left=left+'px';\nif(menu.offsetHeight>room)menu.style.maxHeight=Math.max(120,Math.floor(room))+'px';\nif(window._ibxKeyOpen){window._ibxKeyOpen=false;var first=menu.querySelector('.ibx-mi');if(first)first.focus({preventScroll:true});}}\n/* the menu is pinned under its button, so scrolling the notes or resizing closes it rather than leaving it behind */\n(function(){var shut=function(){var M=window._inboxMenu||{};if(M.id)inboxCloseMenu(false);};document.addEventListener('scroll',function(e){var b=document.getElementById('inboxBody');if(b&&e.target===b){if(window._ibxNoShut){window._ibxNoShut=false;return;}shut();}},true);window.addEventListener('resize',function(){var M=window._inboxMenu||{};if(M.id&&!document.querySelector('.inbox-edit-area'))renderInbox();});})();\nfunction dbkInboxMenu(id,kind,ev){var M=window._inboxMenu||{};var closing=M.id===id&&M.kind===kind;window._inboxMenu=closing?{}:{id:id,kind:kind};window._inboxOpenId=id;window._ibxKeyOpen=!closing&&!!(ev&&ev.detail===0);renderInbox();if(closing){var b=document.querySelector('#thought-'+id+' [data-ibx=\"'+kind+'\"]');if(b)b.focus({preventScroll:true});}}\nfunction inboxCloseMenu(refocus){var M=window._inboxMenu||{};if(!M.id)return false;window._inboxMenu={};renderInbox();if(refocus){var b=document.querySelector('#thought-'+M.id+' [data-ibx=\"'+M.kind+'\"]');if(b)b.focus();}return true;}\n/* tap anywhere outside an open menu to close it; Escape closes the menu first, then the inbox; arrow keys move through it */\ndocument.addEventListener('click',function(e){var M=window._inboxMenu||{};if(!M.id)return;if(e.target&&e.target.closest&&e.target.closest('.ibx-dd, .ibx-menu.is-port'))return;inboxCloseMenu(false);},true);\nwindow.addEventListener('keydown',function(e){var M=window._inboxMenu||{};if(!M.id)return;var o=document.getElementById('inboxOverlay');if(!o||!o.classList.contains('visible'))return;\nif(e.key==='Escape'){e.preventDefault();e.stopImmediatePropagation();inboxCloseMenu(true);return;}\nif(e.key==='ArrowDown'||e.key==='ArrowUp'||e.key==='Home'||e.key==='End'){var items=[].slice.call(document.querySelectorAll('.ibx-menu.is-port .ibx-mi'));if(!items.length)return;e.preventDefault();var i=items.indexOf(document.activeElement);if(e.key==='Home')i=0;else if(e.key==='End')i=items.length-1;else if(i<0)i=e.key==='ArrowDown'?0:items.length-1;else i=(i+(e.key==='ArrowDown'?1:-1)+items.length)%items.length;items[i].focus();}\nif(e.key==='Tab'){inboxCloseMenu(false);}},true);\nasync function setThoughtTag(id,tag){var idx=_capturedThoughts.findIndex(function(t){return t.id===id;});if(idx===-1)return;_capturedThoughts[idx].tag=tag||null;window._inboxMenu={};await saveCapturedThoughts();renderInbox();var b=document.querySelector('#thought-'+id+' [data-ibx=\"send\"]');if(b&&document.activeElement===document.body)b.focus({preventScroll:true});}\n/* a note shows just its words until you tap it; then what you can do with it appears */\nfunction toggleThought(id,ev){if(ev&&ev.target&&ev.target.closest&&ev.target.closest('textarea, .inbox-edit-area, .inbox-edit-actions, button, select, .ibx-menu'))return;if(document.getElementById('editArea-'+id))return;window._inboxOpenId=window._inboxOpenId===id?null:id;window._inboxMenu={};renderInbox();var r=document.querySelector('#thought-'+id+' .inbox-item-row1');if(r&&ev&&ev.type==='keydown')r.focus();}\nfunction setInboxTagFilter(tag){_inboxTagFilter=tag;renderInbox();}\nfunction onInboxSearch(val){_inboxSearch=(val||'').trim();renderInbox();}\nfunction startEditThought(id){var idx=_capturedThoughts.findIndex(function(t){return t.id===id;});if(idx===-1)return;var thought=_capturedThoughts[idx];window._inboxMenu={};var el=document.getElementById('thought-'+id);if(!el)return;var textEl=el.querySelector('.inbox-item-text');if(!textEl)return;var origText=thought.text;textEl.innerHTML='<textarea class=\"inbox-edit-area\" id=\"editArea-'+escHtml(id)+'\" rows=\"2\" aria-label=\"Edit note\">'+escHtml(origText)+'</textarea>'+\n'<div class=\"inbox-edit-actions\">'+\n'<button type=\"button\" class=\"inbox-edit-save\" onclick=\"saveEditThought('+dbkJsArg(id)+')\">Save</button>'+\n'<button type=\"button\" class=\"inbox-edit-cancel\" onclick=\"cancelEditThought('+dbkJsArg(id)+')\">Cancel</button>'+\n'</div>';var area=document.getElementById('editArea-'+id);if(area){window.dbkTapFocus=Date.now();area.focus();area.selectionStart=area.value.length;area.addEventListener('keydown',function(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();saveEditThought(id);}\nif(e.key==='Escape'){e.stopPropagation();cancelEditThought(id);}});}\nvar row2=el.querySelector('.inbox-item-row2');if(row2)row2.style.display='none';var q=el.querySelector('.ibx-quick');if(q)q.style.display='none';}\nasync function saveEditThought(id){var area=document.getElementById('editArea-'+id);if(!area)return;var newText=area.value.trim();if(!newText)return;var idx=_capturedThoughts.findIndex(function(t){return t.id===id;});if(idx===-1)return;_capturedThoughts[idx].text=newText;await saveCapturedThoughts();renderInbox();showToast('Updated.');}\nfunction cancelEditThought(id){renderInbox();}\nfunction formatTimeAgo(isoStr){if(!isoStr)return'';var diff=Date.now()-new Date(isoStr).getTime();var mins=Math.floor(diff/60000);if(mins<1)return'just now';if(mins<60)return mins+'m ago';var hrs=Math.floor(mins/60);if(hrs<24)return hrs+'h ago';var days=Math.floor(hrs/24);if(days===1)return'yesterday';if(days<7)return days+'d ago';return new Date(isoStr).toLocaleDateString('en-US',{month:'short',day:'numeric'});}\n/* one tap on a place: remember the choice for next time, then send it */\n/* Send to the Back Burner or Work: one tap, the note leaves the Inbox at once with Undo (the designer, Oct 21: \"should\n   just have to tap for it to send\"). It really goes once the 5 seconds for Undo are up, so Undo just puts it back; if the\n   app closes first, the note simply stays in the Inbox. Grocery and the lists have their own Undo; Reminder and Calendar\n   open their form, since they need a date. */\nvar IBX_LATER={hub:'the Back Burner',wrcontent:'your Work ideas',wrspark:'the Spark File'};\nfunction inboxSend(id,dest){var t=_capturedThoughts.filter(function(x){return x.id===id;})[0];if(!t)return;window._inboxMenu={};try{inboxRemember(t.text,dest);}catch(e){}\nif(IBX_LATER[dest]){var S=window._ibxSending=window._ibxSending||{};if(S[id])return;S[id]=dest;if(window._inboxOpenId===id)window._inboxOpenId=null;renderInbox();\nvar tm=setTimeout(function(){if(S[id]!==dest)return;\n  // its own \"Added to…\" message isn't shown again (one already went up); a failure still is, and the note comes back\n  var st=window.showToast;window.showToast=function(m,o){if(/^Couldn/.test(String(m)))return st(m,o);};\n  var back=function(){if(window.showToast!==st)window.showToast=st;};\n  var p;try{p=Promise.resolve(window.routeThought(id,dest));}catch(e){p=Promise.resolve();}\n  Promise.race([p,new Promise(function(r){setTimeout(r,3000);})]).then(back,back);\n  p.then(function(){delete S[id];renderInbox();},function(){delete S[id];renderInbox();});\n},5000);\nshowToast('Sent to '+IBX_LATER[dest]+'.',{duration:5000,undoCallback:function(){clearTimeout(tm);delete S[id];renderInbox();}});return;}\n/* grocery and the lists: the note leaves the Inbox at the tap, not once the list's save has gone through (on a slow\n   connection it sat there a second or two, looked like it hadn't gone, and a second tap said \"Already on the list\") */\nif(dest==='grocery'||String(dest).indexOf('list:')===0){var H=window._ibxSending=window._ibxSending||{};if(H[id])return;H[id]=dest;if(window._inboxOpenId===id)window._inboxOpenId=null;renderInbox();\n  var un=function(){if(H[id]===dest)delete H[id];renderInbox();};var q;try{q=Promise.resolve(window.routeThought(id,dest));}catch(e){q=Promise.resolve();}q.then(un,un);return q;}\nreturn window.routeThought(id,dest);}\n/* another page that's kept loaded in the background is reloaded, so it shows what the inbox just added */\nfunction inboxRefreshPage(file){try{var fr=window.parent&&window.parent!==window?window.parent.document.querySelectorAll('iframe'):[];[].forEach.call(fr,function(f){try{if(f.contentWindow!==window&&f.contentWindow.location.pathname.split('/').pop()===file&&!f.classList.contains('on'))f.contentWindow.location.reload();}catch(e){}});}catch(e){}}\n/* a note put back after Undo goes back where it was */\nfunction inboxPutBack(item){try{if(window.dbkInboxFresh)window.dbkInboxFresh();}catch(e){}if(!_capturedThoughts.some(function(t){return t.id===item.id;}))_capturedThoughts.push(item);saveCapturedThoughts();updateInboxBadge();renderInbox();}\n/* add a note to one of the Lists (same shape the Lists page saves), on this phone and in the cloud */\nasync function inboxAddToList(dest,title){var cat=INBOX_LIST_CAT[dest];if(dest==='list:wishlist'){var two=!window.dbkModule||(window.dbkModule.people||1)>1;var me='person1';try{me=localStorage.getItem('myPersonRole')==='person2'?'person2':'person1';}catch(e){}cat=two?me+'-wishlist':'person1-wishlist';}\nif(!cat)return null;var now=Date.now();/* fromInbox: sent over as a bare name, so the list marks it to fill in later (cleared when it's edited there); nothing else is guessed, e.g. no price */\nvar item={id:now,firebaseId:'item_'+now,title:title,details:'',priority:'',achieved:false,dateAdded:new Date().toISOString(),image:null,fromInbox:true};/* whose it is (Settings > Sharing: a list the partner later keeps just theirs still shows it here) */try{if(window.dbkSharing&&window.dbkSharing.people()>1&&window.dbkSharing.familyOf(cat))item.by=window.dbkSharing.me();}catch(e){}\n/* a list this person keeps just for themselves (Settings > Sharing) lives in dreams/<list>_person1 or _person2 */\nif(window.dbkSharing)cat=window.dbkSharing.doc(cat);\nvar list=[];try{list=JSON.parse(localStorage.getItem('dreams_'+cat)||'[]');}catch(e){}if(!Array.isArray(list))list=[];list.push(item);localStorage.setItem('dreams_'+cat,JSON.stringify(list));\ntry{if(window.db&&window.firestoreImports&&window.firestoreImports.setDoc){var fi=window.firestoreImports,data={byId:{}};data.byId[item.firebaseId]=item;fi.setDoc(fi.doc(window.db,'dreams',cat),data,{mergeFields:['byId.'+item.firebaseId]}).catch(function(){});}}catch(e){}\ninboxRefreshPage('our-dreams.html');return{cat:cat,item:item};}\nasync function inboxRemoveFromList(added){if(!added)return;var list=[];try{list=JSON.parse(localStorage.getItem('dreams_'+added.cat)||'[]');}catch(e){}if(!Array.isArray(list))list=[];localStorage.setItem('dreams_'+added.cat,JSON.stringify(list.filter(function(d){return d&&d.firebaseId!==added.item.firebaseId;})));\ntry{if(window.db&&window.firestoreImports&&window.firestoreImports.deleteField){var fi=window.firestoreImports,data={byId:{}};data.byId[added.item.firebaseId]=fi.deleteField();fi.setDoc(fi.doc(window.db,'dreams',added.cat),data,{mergeFields:['byId.'+added.item.firebaseId]}).catch(function(){});}}catch(e){}inboxRefreshPage('our-dreams.html');}\nasync function routeThought(id,destination){var idx=_capturedThoughts.findIndex(function(t){return t.id===id;});if(idx===-1)return;var thought=_capturedThoughts[idx];if(!inboxDestOk(destination))return;var g=inboxGuess(thought);\nif(destination==='wrcontent'||destination==='wrspark'){if(!window.dbkSendToWorkroom)return;try{await window.dbkSendToWorkroom(thought.text,destination==='wrspark'?'spark':'content');removeThoughtById(id);showToast(destination==='wrspark'?'Saved to the Spark File.':'Sent to your Work ideas.');}catch(e){showToast('Couldn\\'t send that. Try again.');}return;}\nif(destination==='reminder'){window._dbkInboxStay=true;try{closeInbox();}finally{window._dbkInboxStay=false;}_pendingRouteThoughtId=id;setTimeout(function(){var v=function(i,x){var el=document.getElementById(i);if(el)el.value=x;};v('addReminderTitle',g.titleFor?g.titleFor('reminder'):thought.text);v('addReminderDate',g.date||'');v('addReminderFrequency',g.freq||'once');v('addReminderDesc','');v('addReminderLink','');v('addReminderPhone','');v('addReminderEmail','');v('addReminderDayOfWeek',g.dow!=null?String(g.dow):'6');var wr=document.getElementById('addWeeklyDayRow');if(wr)wr.style.display=g.freq==='weekly'?'':'none';var dg=document.getElementById('addReminderDateGroup');if(dg)dg.style.display=g.freq==='weekly'?'none':'';document.getElementById('addReminderOverlay').classList.add('visible');},150);return;}\nif(destination==='event'){window._dbkInboxStay=true;try{closeInbox();}finally{window._dbkInboxStay=false;}_pendingRouteThoughtId=id;setTimeout(function(){var rm=document.getElementById('calendarRepeatMode');if(rm)rm.value='single';calendarShowAddForm();var ti=document.getElementById('calendarEventTitle');if(ti)ti.value=g.titleFor('event');var de=document.getElementById('calendarEventDate');if(de)de.value=g.date||'';var tm=document.getElementById('calendarEventTime');if(tm)tm.value=g.time||'';},150);return;}\nif(destination==='grocery'){freshGroceries();var things=g.items&&g.items.length?g.items:[thought.text];\n/* things already on the list (not yet bought) aren't added a second time */\nvar _gk=function(x){return String(x||'').trim().toLowerCase().replace(/\\s+/g,' ');};var _have={};groceries.forEach(function(x){if(x&&!x.completed)_have[_gk(x.text||x.name)]=1;});var _was=things.length;things=things.filter(function(x){var k=_gk(x);if(_have[k])return false;_have[k]=1;return true;});var _skip=_was-things.length;\nvar base=Date.now();var added=things.map(function(x,i){return{id:base+i,text:x,completed:false};});added.forEach(function(a){groceries.push(a);});await saveGroceries();renderGroceries();await removeThoughtById(id);inboxRefreshPage('meal-plan.html');\nshowToast(!things.length?(_was>1?'All of those are already on the grocery list.':'Already on the grocery list.'):(things.length>1?'Added '+things.length+' things to the grocery list':'Added to the grocery list')+(_skip?' ('+_skip+' already there).':'.'),{duration:8000,undoCallback:async function(){freshGroceries();var ids=added.map(function(a){return a.id;});groceries=groceries.filter(function(x){return ids.indexOf(x.id)===-1;});await saveGroceries();renderGroceries();inboxRefreshPage('meal-plan.html');inboxPutBack(thought);}});return;}\nif(destination.indexOf('list:')===0){var title=g.titleFor(destination);var done=await inboxAddToList(destination,title);if(!done){showToast('Couldn\\'t add that. Try again.');return;}await removeThoughtById(id);\nshowToast('Added to '+inboxDestName(destination)+'.',{duration:8000,undoCallback:async function(){await inboxRemoveFromList(done);inboxPutBack(thought);}});return;}\nif(destination==='hub'){var partner='';try{partner=localStorage.getItem('myPersonRole')||'';}catch(e){}var hubKey=(partner==='person2')?'futureTodos_person2':'futureTodos_person1';try{var existing=await loadFromFirebase(hubKey)||[];if(!Array.isArray(existing))existing=[];existing.unshift({id:Date.now(),text:thought.text,completed:false,createdAt:thought.createdAt||new Date().toISOString()});await syncToFirebase(hubKey,existing);removeThoughtById(id);showToast('Added to the Back Burner.');}catch(e){removeThoughtById(id);showToast('Sent to the Back Burner.');}return;}}\nasync function removeThoughtById(id){_capturedThoughts=_capturedThoughts.filter(function(t){return t.id!==id;});await saveCapturedThoughts();updateInboxBadge();renderInbox();}\nasync function deleteThought(id){var idx=_capturedThoughts.findIndex(function(t){return t.id===id;});if(idx===-1)return;var item=_capturedThoughts[idx];await removeThoughtById(id);if(window.dbkRemoved)dbkRemoved.track('Inbox note',inboxKey(),[item],_capturedThoughts,{title:'text'});showToast('Note deleted',{duration:8000,undoCallback:function(){try{if(window.dbkInboxFresh)window.dbkInboxFresh();}catch(e){}if(!_capturedThoughts.some(function(t){return t.id===item.id;})){_capturedThoughts.splice(Math.min(idx,_capturedThoughts.length),0,item);}saveCapturedThoughts();updateInboxBadge();renderInbox();}});}\n/* Clear all acts at once with Undo and Recently removed, no \"are you sure?\" (Kasey, Oct 22/24) */async function clearAllThoughts(){if(_capturedThoughts.length===0)return;var count=_capturedThoughts.length,_b=_capturedThoughts.slice();_capturedThoughts=[];await saveCapturedThoughts();if(window.dbkRemoved)dbkRemoved.track('Inbox note',inboxKey(),_b,[],{title:'text'});updateInboxBadge();renderInbox();(window.dbkUndo||function(){})(count+' note'+(count===1?'':'s')+' cleared',async function(){try{if(window.dbkInboxFresh)window.dbkInboxFresh();}catch(e){}dbkPutBackOwn(_capturedThoughts,_b,_b);await saveCapturedThoughts();updateInboxBadge();renderInbox();});}\ndocument.addEventListener('keydown',function(e){if(e.key==='Escape'&&!(e.target&&e.target.classList&&e.target.classList.contains('inbox-edit-area'))){var overlay=document.getElementById('inboxOverlay');if(overlay&&overlay.classList.contains('visible')){closeInbox();}}});(function(){var _dp={popover:null,activeInput:null,activeTrigger:null,viewYear:0,viewMonth:0,mode:'days',};var MONTHS=['January','February','March','April','May','June','July','August','September','October','November','December'];var DAYS=['Su','Mo','Tu','We','Th','Fr','Sa'];function pad(n){return String(n).padStart(2,'0');}\nfunction valToDisplay(val){if(!val)return null;var parts=val.split('-');if(parts.length!==3)return null;var d=new Date(parseInt(parts[0]),parseInt(parts[1])-1,parseInt(parts[2]));return d.toLocaleDateString('en-US',{month:'short',day:'numeric',year:'numeric'});}\nfunction syncTrigger(trigger,val){var lbl=trigger.querySelector('.hh-dp-label');if(!lbl)return;if(val){var disp=valToDisplay(val);lbl.textContent=disp||val;lbl.classList.remove('placeholder');}else{lbl.textContent='Select date';lbl.classList.add('placeholder');}}\nfunction createPopover(){var el=document.createElement('div');el.className='hh-dp-popover';el.id='hhDpPopover';el.onclick=function(e){e.stopPropagation();};document.body.appendChild(el);return el;}\nfunction positionPopover(trigger){var pop=_dp.popover;var rect=trigger.getBoundingClientRect();var spaceBelow=window.innerHeight-rect.bottom;var spaceAbove=rect.top;var vw=document.documentElement.clientWidth||window.innerWidth;var w=Math.max(260,Math.min(320,vw-32));pop.style.width=w+'px';var cx=rect.left+rect.width/2;pop.style.left=Math.max(16,Math.min(vw-w-16,Math.round(cx-w/2)))+'px';if(spaceBelow>=300||spaceBelow>=spaceAbove){pop.style.top=(rect.bottom+4)+'px';pop.style.bottom='auto';}else{pop.style.bottom=(window.innerHeight-rect.top+4)+'px';pop.style.top='auto';}}\nfunction renderDays(){var pop=_dp.popover;var input=_dp.activeInput;var selectedVal=input?input.value:'';var today=new Date();var todayStr=today.getFullYear()+'-'+pad(today.getMonth()+1)+'-'+pad(today.getDate());var firstDay=new Date(_dp.viewYear,_dp.viewMonth,1).getDay();var daysInMonth=new Date(_dp.viewYear,_dp.viewMonth+1,0).getDate();var daysInPrev=new Date(_dp.viewYear,_dp.viewMonth,0).getDate();var html='<div class=\"hh-dp-nav\">'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpPrev()\">&#8249;</button>'+\n'<span class=\"hh-dp-month-label\" onclick=\"hhDpShowMonths()\">'+MONTHS[_dp.viewMonth]+' '+_dp.viewYear+'</span>'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpNext()\">&#8250;</button>'+\n'</div>';html+='<div class=\"hh-dp-weekdays\">';DAYS.forEach(function(d){html+='<div class=\"hh-dp-wd\">'+d+'</div>';});html+='</div><div class=\"hh-dp-days\">';for(var i=firstDay-1;i>=0;i--){var d=daysInPrev-i;html+='<div class=\"hh-dp-day other-month\" data-dbk-keep onclick=\"hhDpPickPrev('+d+')\">'+d+'</div>';}\nfor(var d=1;d<=daysInMonth;d++){var ds=_dp.viewYear+'-'+pad(_dp.viewMonth+1)+'-'+pad(d);var cls='hh-dp-day';if(ds===todayStr)cls+=' today';if(ds===selectedVal)cls+=' selected';html+='<div class=\"'+cls+'\" onclick=\"hhDpPick(&quot;'+ds+'&quot;)\">'+d+'</div>';}\nvar total=firstDay+daysInMonth;var remaining=total%7===0?0:7-(total%7);for(var d=1;d<=remaining;d++){html+='<div class=\"hh-dp-day other-month\" data-dbk-keep onclick=\"hhDpPickNext('+d+')\">'+d+'</div>';}\nhtml+='</div>';html+='<button type=\"button\" class=\"hh-dp-clear\" onclick=\"hhDpClear()\">clear</button>';pop.innerHTML=html;}\nfunction renderMonths(){var pop=_dp.popover;var html='<div class=\"hh-dp-nav\">'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpYearStep(-1)\">&#8249;</button>'+\n'<span class=\"hh-dp-month-label\" onclick=\"hhDpShowYears()\">'+_dp.viewYear+'</span>'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpYearStep(1)\">&#8250;</button>'+\n'</div><div class=\"hh-dp-ym-grid\">';MONTHS.forEach(function(m,i){var cls='hh-dp-ym-btn'+(i===_dp.viewMonth?' current':'');html+='<button type=\"button\" class=\"'+cls+'\" onclick=\"hhDpPickMonth('+i+')\">'+m.slice(0,3)+'</button>';});html+='</div>';pop.innerHTML=html;}\nfunction renderYears(){var pop=_dp.popover;var base=Math.floor(_dp.viewYear/12)*12;var html='<div class=\"hh-dp-nav\">'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpYearRangeStep(-12)\">&#8249;</button>'+\n'<span class=\"hh-dp-month-label\">'+base+'–'+(base+11)+'</span>'+\n'<button type=\"button\" class=\"hh-dp-nav-btn\" onclick=\"hhDpYearRangeStep(12)\">&#8250;</button>'+\n'</div><div class=\"hh-dp-ym-grid\">';for(var y=base;y<base+12;y++){var cls='hh-dp-ym-btn'+(y===_dp.viewYear?' current':'');html+='<button type=\"button\" class=\"'+cls+'\" onclick=\"hhDpPickYear('+y+')\">'+y+'</button>';}\nhtml+='</div>';pop.innerHTML=html;}\nfunction render(){if(_dp.mode==='months')renderMonths();else if(_dp.mode==='years')renderYears();else renderDays();}\nwindow.hhDpOpen=function(trigger){if(!_dp.popover)_dp.popover=createPopover();var wrapper=trigger.closest('.hh-datepicker');var input=wrapper?wrapper.querySelector('input[type=\"hidden\"]'):null;if(!input)return;if(_dp.activeTrigger===trigger&&_dp.popover.classList.contains('open')){hhDpClose();return;}\nif(_dp.activeTrigger)_dp.activeTrigger.classList.remove('open');_dp.activeInput=input;_dp.activeTrigger=trigger;trigger.classList.add('open');var val=input.value;if(val){var parts=val.split('-');_dp.viewYear=parseInt(parts[0]);_dp.viewMonth=parseInt(parts[1])-1;}else{var now=new Date();_dp.viewYear=now.getFullYear();_dp.viewMonth=now.getMonth();}\n_dp.mode='days';render();positionPopover(trigger);_dp.popover.classList.add('open');};window.hhDpClose=function(){if(_dp.popover)_dp.popover.classList.remove('open');if(_dp.activeTrigger)_dp.activeTrigger.classList.remove('open');_dp.activeTrigger=null;_dp.activeInput=null;};window.hhDpPick=function(dateStr){if(!_dp.activeInput)return;_dp.activeInput.value=dateStr;if(_dp.activeTrigger)syncTrigger(_dp.activeTrigger,dateStr);_dp.activeInput.dispatchEvent(new Event('change',{bubbles:true}));hhDpClose();};window.hhDpPickPrev=function(d){_dp.viewMonth--;if(_dp.viewMonth<0){_dp.viewMonth=11;_dp.viewYear--;}\nhhDpPick(_dp.viewYear+'-'+pad(_dp.viewMonth+1)+'-'+pad(d));};window.hhDpPickNext=function(d){_dp.viewMonth++;if(_dp.viewMonth>11){_dp.viewMonth=0;_dp.viewYear++;}\nhhDpPick(_dp.viewYear+'-'+pad(_dp.viewMonth+1)+'-'+pad(d));};window.hhDpPrev=function(){if(_dp.mode==='days'){_dp.viewMonth--;if(_dp.viewMonth<0){_dp.viewMonth=11;_dp.viewYear--;}}render();};window.hhDpNext=function(){if(_dp.mode==='days'){_dp.viewMonth++;if(_dp.viewMonth>11){_dp.viewMonth=0;_dp.viewYear++;}}render();};window.hhDpShowMonths=function(){_dp.mode='months';render();};window.hhDpShowYears=function(){_dp.mode='years';render();};window.hhDpPickMonth=function(m){_dp.viewMonth=m;_dp.mode='days';render();};window.hhDpPickYear=function(y){_dp.viewYear=y;_dp.mode='months';render();};window.hhDpYearStep=function(n){_dp.viewYear+=n;render();};window.hhDpYearRangeStep=function(n){_dp.viewYear+=n;render();};window.hhDpClear=function(){if(!_dp.activeInput)return;_dp.activeInput.value='';if(_dp.activeTrigger)syncTrigger(_dp.activeTrigger,'');_dp.activeInput.dispatchEvent(new Event('change',{bubbles:true}));hhDpClose();};function patchDpInputs(){document.querySelectorAll('.hh-datepicker').forEach(function(wrapper){var input=wrapper.querySelector('input[type=\"hidden\"]');var trigger=wrapper.querySelector('.hh-dp-trigger');if(!input||!trigger)return;var proto=Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,'value');Object.defineProperty(input,'value',{get:function(){return proto.get.call(this);},set:function(v){proto.set.call(this,v);syncTrigger(trigger,v);},configurable:true});syncTrigger(trigger,input.value);});}\ndocument.addEventListener('click',function(e){if(!_dp.popover||!_dp.popover.classList.contains('open'))return;if(_dp.activeTrigger&&_dp.activeTrigger.contains(e.target))return;hhDpClose();});document.addEventListener('DOMContentLoaded',function(){patchDpInputs();window.addEventListener('hhDpReinit',patchDpInputs);});window.hhDpReinit=function(){patchDpInputs();};})();\nvar _calExpanded=false;function toggleCalendarExpand(forceOpen){_calExpanded=forceOpen!==undefined?forceOpen:!_calExpanded;var full=document.getElementById('calendarFullView');var btn=document.getElementById('calendarExpandBtn');if(full)full.classList.toggle('expanded',_calExpanded);if(btn)btn.innerHTML=_calExpanded?'Hide &#x25B4;':'View &#x25BE;';if(_calExpanded){calendarRender();}}\nfunction updateCalendarSummary(){var el=document.getElementById('calendarSummaryText');if(!el)return;var today=new Date();var todayStr=localDateStr(today);var todayEvents=(calendarEvents||[]).filter(function(e){return calendarEventMatchesDate(e,today);});if(todayEvents.length===0){el.textContent='Nothing scheduled today';el.classList.add('empty');}else if(todayEvents.length===1){var e=todayEvents[0];var t=e.time?formatTime12Hour(e.time)+' · ':'';el.textContent=t+e.title;el.classList.remove('empty');}else{var first=todayEvents[0];var t=first.time?formatTime12Hour(first.time)+' · ':'';el.textContent=t+first.title+' +'+(todayEvents.length-1)+' more';el.classList.remove('empty');}}\nfunction calendarEventMatchesDate(event,date){var ds=localDateStr(date);if(event.dates&&Array.isArray(event.dates)){return event.dates.indexOf(ds)!==-1;}\nif(event.startDate&&event.endDate){return ds>=event.startDate&&ds<=event.endDate;}\nreturn event.date===ds;}\n/* reminders that repeat every few months (every 3 or every 6), counted from the month you picked.\n   Like monthly ones, each shows its next date; marking it done moves it to the one after. */\nfunction dbkEveryMonths(reminder,nd,today,step){var DAY=86400000;var occ=function(k){var y0=today.getFullYear()-1,m0=(nd.month-1)%step+k*step;var d=new Date(y0,m0,Math.min(nd.day,new Date(y0,m0+1,0).getDate()));d.setHours(0,0,0,0);return d;};\nvar k=0;while(k<80&&occ(k)<today)k++;var cand=occ(k);\nvar done=reminder.lastDone?new Date(reminder.lastDone):null;if(done)done.setHours(0,0,0,0);\nwhile(done&&done>=new Date(cand.getTime()-30*DAY)){k++;cand=occ(k);}\nvar df=dbkDoneFor(reminder);while(df&&cand<=df&&k<200){k++;cand=occ(k);}\nreturn cand;}\n\n/* All reminders: tap one to edit it. The edit pop-up has the delete. */\nwindow.toggleReminderRow=function(id){editReminder(id);};\n/* All reminders: a round tick on each row marks that one done (one tap, with a moment to undo) */\nwindow.dbkReminderDone=async function(id){var index=lifeReminders.findIndex(function(r){return String(r.id)===String(id);});if(index===-1)return;var reminder=lifeReminders[index];var before=JSON.parse(JSON.stringify(reminder));\nif(reminder.frequency==='once'){lifeReminders.splice(index,1);if(window.dbkRemoved)dbkRemoved.track('Done reminder','lifeReminders',[before],lifeReminders);}else{lifeReminders[index].lastDoneFor=localDateStr(getNextNotifyDate(reminder));lifeReminders[index].lastDone=new Date().toISOString();lifeReminders[index].snoozedUntil=null;}\nawait saveLifeReminders();currentReminderIndex=0;updateReminderDisplay();renderReminderList();\nshowToast('Reminder done',{duration:8000,undoCallback:async function(){var i=lifeReminders.findIndex(function(r){return String(r.id)===String(before.id);});if(i===-1)lifeReminders.push(before);else lifeReminders[i]=before;await saveLifeReminders();updateReminderDisplay();renderReminderList();}});};\n/* All reminders (Kasey, Oct 31: \"i don't think the o things need to be there. Just make them editable and deletable\"): no\n   done tick; tapping a row opens Edit reminder, and the × at its end deletes it at once (Undo, Recently removed; a reminder\n   Money made is turned off in Money too, `dbkRemDelete`). Done stays on Today's line and in Edit reminder. */\n(function(){var _rrl=renderReminderList;renderReminderList=function(){_rrl.apply(this,arguments);var c=document.getElementById('reminderModalList');if(!c)return;c.querySelectorAll('.reminder-list-row[data-id]').forEach(function(row){if(row.querySelector('[data-remdel-id]'))return;var b=document.createElement('button');b.type='button';b.className='dbk-rl-del';b.setAttribute('data-remdel-id',row.getAttribute('data-id'));b.textContent='Delete';b.setAttribute('aria-label','Delete: '+((row.querySelector('.reminder-list-title')||{}).textContent||''));b.addEventListener('click',function(e){e.stopPropagation();dbkRemDelete(row.getAttribute('data-id'));});row.appendChild(b);});};window.renderReminderList=renderReminderList;})();\nwindow.dbkDeleteEditedReminder=async function(){var id=document.getElementById('editReminderId').value;if(!id)return;return dbkRemDelete(id,function(){closeEditReminderModal();});};\n\n/* clear just one of Today's Three (the × at the end of a filled line), with a moment to undo */\nwindow.thingClearOne=function(i){var it=_threeThings[i];if(!it||!it.text)return;var ed=document.getElementById('thing-edit-'+i);if(ed){ed.value=it.text;ed.blur();}thingAskRemove(i);};\n/* Inbox on a phone: swipe a note to the left and a trash button slides in at its right; tap it to delete (with Undo, and\n   the note goes to Recently removed like any delete). The note itself stays where it is, fully readable; only the trash\n   button moves, following the finger (the designer, Oct 21: the whole note sliding away looked shaky and hid it).\n   Swiping back, or touching anything else, puts the trash away. A tap is never taken for a swipe. The trash icon among\n   a note's buttons is only kept for computers, where there's no swipe. */\n(function(){\n  var W=64,open=null,st=null,noClick=0,raf=0;\n  var touch=false;try{touch=matchMedia('(pointer: coarse)').matches;}catch(e){}\n  if(!touch)return;\n  document.documentElement.classList.add('dbk-ibx-swipe');\n  function body(){return document.getElementById('inboxBody');}\n  // how far the trash has come in: 0 put away, 1 all the way\n  function set(item,f,anim){\n    var b=bin(item);b.style.transition=anim?'transform .2s ease, opacity .2s ease':'none';\n    b.style.transform='translate3d('+Math.round((1-f)*W)+'px,-50%,0)';b.style.opacity=String(Math.min(1,f*1.4));\n    b.style.pointerEvents=f>0.9?'auto':'none';item.classList.toggle('ibx-swiping',f>0.05);\n  }\n  function close(anim){if(open&&open.isConnected)set(open,0,anim!==false);open=null;}\n  function bin(item){\n    var b=item.querySelector(':scope > .ibx-swipe-del');if(b)return b;\n    var id=+String(item.id).replace('thought-','');\n    b=document.createElement('button');b.type='button';b.className='ibx-swipe-del';b.setAttribute('aria-label','Delete');b.innerHTML=IBX_BIN;\n    b.style.transform='translate3d('+W+'px,-50%,0)';b.style.opacity='0';b.style.pointerEvents='none';\n    b.addEventListener('click',function(e){e.stopPropagation();open=null;deleteThought(id);});\n    item.appendChild(b);return b;\n  }\n  document.addEventListener('touchstart',function(e){\n    var b=body();if(!b||!b.contains(e.target)){if(open&&!(e.target.closest&&e.target.closest('.ibx-swipe-del')))close();return;}\n    var item=e.target.closest('.ibx-item');\n    if(open&&open!==item)close();\n    // a note being edited, or a menu being used, never swipes\n    if(!item||item.querySelector('.inbox-edit-area')||e.target.closest('textarea, input, .ibx-menu, .ibx-swipe-del'))return;\n    var t=e.touches[0];st={item:item,x:t.clientX,y:t.clientY,base:item===open?1:0,dir:null,f:item===open?1:0};\n  },{passive:true,capture:true});\n  document.addEventListener('touchmove',function(e){\n    if(!st)return;var t=e.touches[0],dx=t.clientX-st.x,dy=t.clientY-st.y;\n    if(!st.dir){if(Math.abs(dx)<14&&Math.abs(dy)<10)return;st.dir=Math.abs(dx)>=14&&Math.abs(dx)>Math.abs(dy)*1.3?'x':'y';}\n    if(st.dir!=='x')return;\n    if(e.cancelable)e.preventDefault();   // the list holds still while the trash comes in\n    st.f=Math.max(0,Math.min(1,st.base-(dx+(st.base?0:14))/W));\n    if(!raf)raf=requestAnimationFrame(function(){raf=0;if(st)set(st.item,st.f,false);});\n  },{passive:false,capture:true});\n  document.addEventListener('touchend',function(){\n    if(!st)return;var s=st;st=null;if(raf){cancelAnimationFrame(raf);raf=0;}if(s.dir!=='x')return;\n    noClick=Date.now();\n    if(s.f>0.4){set(s.item,1,true);open=s.item;}else{set(s.item,0,true);if(open===s.item)open=null;}\n  },{passive:true,capture:true});\n  document.addEventListener('touchcancel',function(){if(st&&st.dir==='x')set(st.item,st.base,true);st=null;},{passive:true,capture:true});\n  // the tap a swipe ends with doesn't open the note; a tap on a note with its trash out puts the trash away instead\n  document.addEventListener('click',function(e){\n    var b=body();if(!b||!b.contains(e.target)||(e.target.closest&&e.target.closest('.ibx-swipe-del')))return;\n    if(Date.now()-noClick<400||(open&&e.target.closest('.ibx-item')===open)){e.stopPropagation();e.preventDefault();if(Date.now()-noClick>=400)close();}\n  },true);\n})();\n","dbk-places.js":"/* Location picker: search US cities, towns and ZIP codes, or use the phone's position.\n   Nothing is looked up online. The places list (us-places.json, from US Census Bureau public data, rebuilt with\n   tools/make-us-places.mjs) is fetched from this same site the first time the picker opens.\n   The saved location keeps the same shape as before: localStorage 'userLocation' = { lat, lon, name }.\n   Used on Today (index.html) and in Settings. */\n(function () {\n  var DATA = null, LOADING = null;\n\n  function load() {\n    if (DATA) return Promise.resolve(DATA);\n    if (!LOADING) {\n      LOADING = fetch('daybook-sample/us-places-4c3e36077b.json').then(function (r) { if (!r.ok) throw new Error(r.status); return r.json(); })\n        .then(function (j) { DATA = parse(j); return DATA; })\n        .catch(function (e) { LOADING = null; throw e; });\n    }\n    return LOADING;\n  }\n  function norm(s) {\n    return String(s || '').toLowerCase().normalize('NFD').replace(/[̀-ͯ]/g, '')\n      .replace(/[^a-z0-9]+/g, ' ').trim();\n  }\n  function parse(j) {\n    var pl = j.places.split(';'), n = pl.length;\n    var d = { name: new Array(n), st: new Array(n), key: new Array(n), alt: new Array(n), lat: new Float64Array(n), lon: new Float64Array(n), r: new Float64Array(n) };\n    for (var i = 0; i < n; i++) {\n      var f = pl[i].split('|');\n      d.name[i] = f[0]; d.st[i] = f[1]; d.key[i] = norm(f[0]);\n      var m = /\\(([^)]+)\\)/.exec(f[0]); if (m) d.alt[i] = norm(m[1]); // \"San Buenaventura (Ventura)\" is also \"ventura\"\n      d.lat[i] = f[2] / 1000; d.lon[i] = -f[3] / 1000; d.r[i] = f[4] / 10;\n    }\n    var zs = j.zips.split(';'), zn = zs.length, prev = 0;\n    d.zip = new Array(zn); d.zlat = new Float64Array(zn); d.zlon = new Float64Array(zn);\n    for (var k = 0; k < zn; k++) {\n      var g = zs[k].split('|');\n      prev = k ? prev + (+g[0]) : +g[0];\n      d.zip[k] = ('0000' + prev).slice(-5); d.zlat[k] = g[1] / 1000; d.zlon[k] = -g[2] / 1000;\n    }\n    return d;\n  }\n\n  var STATES = { AL: 'alabama', AK: 'alaska', AZ: 'arizona', AR: 'arkansas', CA: 'california', CO: 'colorado', CT: 'connecticut',\n    DE: 'delaware', DC: 'district of columbia', FL: 'florida', GA: 'georgia', HI: 'hawaii', ID: 'idaho', IL: 'illinois', IN: 'indiana',\n    IA: 'iowa', KS: 'kansas', KY: 'kentucky', LA: 'louisiana', ME: 'maine', MD: 'maryland', MA: 'massachusetts', MI: 'michigan',\n    MN: 'minnesota', MS: 'mississippi', MO: 'missouri', MT: 'montana', NE: 'nebraska', NV: 'nevada', NH: 'new hampshire',\n    NJ: 'new jersey', NM: 'new mexico', NY: 'new york', NC: 'north carolina', ND: 'north dakota', OH: 'ohio', OK: 'oklahoma',\n    OR: 'oregon', PA: 'pennsylvania', RI: 'rhode island', SC: 'south carolina', SD: 'south dakota', TN: 'tennessee', TX: 'texas',\n    UT: 'utah', VT: 'vermont', VA: 'virginia', WA: 'washington', WV: 'west virginia', WI: 'wisconsin', WY: 'wyoming', PR: 'puerto rico' };\n  var STATE_BY_NAME = {}; Object.keys(STATES).forEach(function (k) { STATE_BY_NAME[STATES[k]] = k; });\n\n  // \"louisville ky\", \"Burlington, KY\", \"lexington kentucky\" -> { q: 'louisville', st: 'KY' }\n  function splitState(raw) {\n    var q = norm(raw), words = q.split(' ');\n    for (var take = Math.min(3, words.length - 1); take >= 1; take--) {\n      var tail = words.slice(-take).join(' '), st = null;\n      if (take === 1 && tail.length === 2 && STATES[tail.toUpperCase()]) st = tail.toUpperCase();\n      else if (STATE_BY_NAME[tail]) st = STATE_BY_NAME[tail];\n      if (st) return { q: words.slice(0, -take).join(' '), st: st };\n    }\n    return { q: q, st: null };\n  }\n  var NICK = { nyc: 'new york ny', 'new york city': 'new york ny', 'nyc ny': 'new york ny', sf: 'san francisco ca', 'san fran': 'san francisco ca', dc: 'washington dc', 'washington d c': 'washington dc',\n    philly: 'philadelphia pa', vegas: 'las vegas nv', nola: 'new orleans la', okc: 'oklahoma city ok', slc: 'salt lake city ut', kc: 'kansas city mo', atl: 'atlanta ga' };\n  // \"saint louis\" finds \"St. Louis\", \"mt pleasant\" finds \"Mount Pleasant\"\n  var SAME = [['saint', 'st'], ['sainte', 'ste'], ['mount', 'mt'], ['fort', 'ft']];\n  function variants(q) {\n    var out = [q];\n    SAME.forEach(function (p) {\n      [[p[0], p[1]], [p[1], p[0]]].forEach(function (ab) {\n        out.slice().forEach(function (v) {\n          var w = (' ' + v + ' ').replace(' ' + ab[0] + ' ', ' ' + ab[1] + ' ').trim();\n          if (out.indexOf(w) < 0) out.push(w);\n        });\n      });\n    });\n    return out;\n  }\n  function km(lat1, lon1, lat2, lon2) {\n    var x = (lon2 - lon1) * Math.cos((lat1 + lat2) * Math.PI / 360) * 111.32, y = (lat2 - lat1) * 110.57;\n    return Math.sqrt(x * x + y * y);\n  }\n  // the place a point is in (or nearest to): being inside a place's rough circle counts as distance 0\n  function nearest(d, lat, lon) {\n    var best = -1, bs = Infinity;\n    for (var i = 0; i < d.name.length; i++) {\n      if (Math.abs(d.lat[i] - lat) > 1.2) continue;\n      var dist = km(lat, lon, d.lat[i], d.lon[i]);\n      if (dist > 80) continue;\n      var s = Math.max(0, dist - d.r[i]) + 0.1 * dist;\n      if (s < bs) { bs = s; best = i; }\n    }\n    return best;\n  }\n  function search(d, raw, max) {\n    max = max || 8;\n    var digits = String(raw).replace(/\\s/g, '');\n    if (/^\\d{3,5}$/.test(digits)) {\n      var zout = [];\n      for (var z = 0; z < d.zip.length && zout.length < max; z++) {\n        if (d.zip[z].indexOf(digits) !== 0) continue;\n        var p = nearest(d, d.zlat[z], d.zlon[z]);\n        if (p < 0) continue;\n        zout.push({ name: d.name[p] + ', ' + d.st[p], zip: d.zip[z], lat: d.zlat[z], lon: d.zlon[z] });\n      }\n      return zout;\n    }\n    // what people call a few big cities (\"NYC\", \"Philly\")\n    var nick = NICK[norm(raw)]; if (nick) raw = nick;\n    var parts = splitState(raw);\n    var res = find(d, parts.q, parts.st, max);\n    if (!res.length && parts.st) res = find(d, norm(raw), null, max); // \"new york\" style names that end in a state word\n    return res;\n  }\n  function find(d, q, st, max) {\n    if (q.length < 2) return [];\n    var qs = variants(q), hits = [[], [], []], seen = {};\n    for (var i = 0; i < d.key.length; i++) {\n      if (st && d.st[i] !== st) continue;\n      var k = d.key[i], score = -1;\n      for (var v = 0; v < qs.length; v++) {\n        var s = qs[v];\n        var a = d.alt[i];\n        if (k === s || a === s) { score = 0; break; }\n        if (a && a.indexOf(s) === 0) score = score < 0 ? 1 : Math.min(score, 1);\n        if (k.indexOf(s) === 0) score = score < 0 ? 1 : Math.min(score, 1);\n        else if (score < 0 && k.indexOf(' ' + s) > -1) score = 2;\n      }\n      if (score < 0) continue;\n      var id = d.name[i] + '|' + d.st[i];\n      if (seen[id]) continue; // two places with the same name in one state: keep the bigger one\n      seen[id] = 1; hits[score].push(i);\n      if (score === 0 && hits[0].length >= max) break;\n    }\n    return hits[0].concat(hits[1], hits[2]).slice(0, max).map(function (i) {\n      return { name: d.name[i] + ', ' + d.st[i], lat: d.lat[i], lon: d.lon[i] };\n    });\n  }\n  window.dbkPlaces = {\n    load: load,\n    search: function (q, max) { return load().then(function (d) { return search(d, q, max); }); },\n    nearest: function (lat, lon) { return load().then(function (d) { var i = nearest(d, lat, lon); return i < 0 ? null : { name: d.name[i] + ', ' + d.st[i], lat: d.lat[i], lon: d.lon[i] }; }); }\n  };\n\n  /* ---------- the pop-up ---------- */\n  var PIN = '<svg width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\"><circle cx=\"12\" cy=\"12\" r=\"3\"/><line x1=\"12\" y1=\"2\" x2=\"12\" y2=\"6\"/><line x1=\"12\" y1=\"18\" x2=\"12\" y2=\"22\"/><line x1=\"2\" y1=\"12\" x2=\"6\" y2=\"12\"/><line x1=\"18\" y1=\"12\" x2=\"22\" y2=\"12\"/></svg>';\n  var CSS = '' +\n    // the pop-up frame (Today's page has the same rules for all its pop-ups; Settings doesn't)\n    '#locationSetupOverlay{position:fixed;top:0;left:0;right:0;bottom:0;background:rgba(0,0,0,0.8);z-index:3000;display:none;align-items:center;justify-content:center;padding:64px 12px 12px;}' +\n    '#locationSetupOverlay.visible{display:flex;}' +\n    '#locationSetupOverlay .edit-reminder-modal{background:var(--lh-bg);border:1px solid var(--lh-accent-border);width:100%;max-width:440px;max-height:calc(80 * var(--dbk-vh, 1vh));overflow-y:auto;overflow-x:hidden;border-radius:4px;box-sizing:border-box;}' +\n    '#locationSetupOverlay .modal-header{display:flex;justify-content:space-between;align-items:center;padding:14px 18px;border-bottom:1px solid var(--lh-accent-muted);}' +\n    '#locationSetupOverlay .modal-title{font-size:1.05rem;color:var(--lh-text);font-weight:600;}' +\n    '#locationSetupOverlay .modal-close{background:transparent;border:none;color:var(--lh-secondary);font-size:1.5rem;cursor:pointer;padding:0;line-height:1;}' +\n    '#locationSetupOverlay .modal-body{padding:16px 18px;}' +\n    '#locationSetupOverlay .dbk-loc-field input{width:100%;background:var(--lh-bg-darker);border:1px solid var(--lh-accent-muted);color:var(--lh-text);padding:10px 14px;font-family:inherit;border-radius:4px;}' +\n    // anchored near the top, so it grows downward as results appear instead of shifting up and down\n    'html:not(#z):not(#y):not(#x):not(#w):not(#v) #locationSetupOverlay{justify-content:flex-start !important;padding-top:max(var(--dbk-pop-top, 64px), calc(12 * var(--dbk-vh, 1vh))) !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w):not(#v) #locationSetupOverlay::before{flex:0 0 0 !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w):not(#v) #locationSetupOverlay::after{flex:1 1 0 !important;}' +\n    // its contents\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-now{margin:0 0 12px !important;text-wrap:balance;text-align:center !important;font-size:0.85rem !important;opacity:0.75;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-field{margin:0 !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locSearchInput{display:block !important;width:100% !important;max-width:none !important;margin:0 !important;box-sizing:border-box !important;font-size:16px !important;text-align:left !important;text-align-last:left !important;outline:none !important;box-shadow:none !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locSearchInput::placeholder{text-align:left !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locResults{margin:6px 0 0 !important;padding:0 !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locResults:empty{display:none !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-row{all:unset;box-sizing:border-box;display:flex !important;justify-content:space-between;align-items:baseline;gap:12px;width:100%;padding:11px 4px !important;cursor:pointer;color:inherit !important;font-family:inherit !important;font-variant:normal !important;font-variant-caps:normal !important;text-transform:none !important;letter-spacing:normal !important;font-weight:400 !important;font-size:1rem !important;line-height:1.3 !important;text-align:left !important;border-bottom:1px solid color-mix(in srgb, currentColor 14%, transparent) !important;background:none !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-row:last-child{border-bottom:0 !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-row small{font-size:0.8rem;opacity:0.65;flex:none;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locStatus{margin:10px 0 0 !important;min-height:1.2em;text-wrap:balance;text-align:center !important;font-size:0.85rem !important;opacity:0.75;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locStatus:empty{display:none !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay .dbk-loc-acts{display:flex !important;justify-content:center !important;margin:16px 0 2px !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locGpsBtn{all:unset;box-sizing:border-box;display:inline-flex !important;align-items:center;gap:8px;width:auto !important;padding:9px 16px !important;border-radius:6px;cursor:pointer;color:inherit !important;font:inherit;font-size:0.9rem !important;border:1px solid color-mix(in srgb, currentColor 45%, transparent) !important;background:none !important;}' +\n    'html:not(#z):not(#y):not(#x):not(#w) #locationSetupOverlay #locGpsBtn[disabled]{opacity:0.6;cursor:default;}';\n\n  function el() {\n    var o = document.getElementById('locationSetupOverlay');\n    if (o) return o;\n    var st = document.createElement('style'); st.id = 'dbkPlacesCss'; st.textContent = CSS; document.head.appendChild(st);\n    o = document.createElement('div');\n    o.className = 'edit-reminder-overlay'; o.id = 'locationSetupOverlay';\n    o.innerHTML = '<div class=\"edit-reminder-modal\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"locTitle\">' +\n      '<div class=\"modal-header\"><div class=\"modal-title\" id=\"locTitle\">Location</div><button type=\"button\" class=\"modal-close\" aria-label=\"Close\">&times;</button></div>' +\n      '<div class=\"modal-body\">' +\n      '<p class=\"dbk-loc-now\" id=\"locationCurrent\"></p>' +\n      '<div class=\"form-group dbk-loc-field\"><input type=\"text\" id=\"locSearchInput\" placeholder=\"City or ZIP code\" autocomplete=\"off\" autocapitalize=\"words\" spellcheck=\"false\" enterkeyhint=\"search\" aria-label=\"City or ZIP code\"></div>' +\n      '<div id=\"locResults\" role=\"listbox\"></div>' +\n      '<p id=\"locStatus\" aria-live=\"polite\"></p>' +\n      '<div class=\"dbk-loc-acts\"><button type=\"button\" id=\"locGpsBtn\">' + PIN + '<span>Use my current location</span></button></div>' +\n      '</div></div>';\n    o.addEventListener('click', function (e) { if (e.target === o || e.target.closest('.modal-close')) close(); });\n    document.body.appendChild(o);\n    var inp = o.querySelector('#locSearchInput');\n    inp.addEventListener('input', run);\n    inp.addEventListener('keydown', function (e) {\n      if (e.key === 'Enter') { e.preventDefault(); var first = o.querySelector('.dbk-loc-row'); if (first) first.click(); }\n      if (e.key === 'Escape') close();\n    });\n    o.querySelector('#locResults').addEventListener('click', function (e) {\n      var b = e.target.closest('.dbk-loc-row'); if (!b) return;\n      var r = SHOWN[+b.dataset.i]; if (r) pick(r.lat, r.lon, r.name);\n    });\n    o.querySelector('#locGpsBtn').addEventListener('click', useGPS);\n    return o;\n  }\n  var SHOWN = [], RUN = 0, AFTER = null, KEY = 'userLocation';   // KEY: which place is being set (the weather's second place is 'userLocation2')\n  function esc(s) { return String(s).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n  function status(t) { var s = document.getElementById('locStatus'); if (s) s.textContent = t || ''; }\n  function run() {\n    var q = document.getElementById('locSearchInput').value.trim(), my = ++RUN, box = document.getElementById('locResults');\n    if (q.replace(/\\s/g, '').length < 2 || (/^\\d+$/.test(q) && q.length < 3)) { SHOWN = []; box.innerHTML = ''; status(''); return; }\n    var slow = setTimeout(function () { if (my === RUN) status('Loading places…'); }, 400);\n    load().then(function (d) {\n      clearTimeout(slow);\n      if (my !== RUN) return;\n      SHOWN = search(d, q, 8);\n      box.innerHTML = SHOWN.map(function (r, i) {\n        return '<button type=\"button\" class=\"dbk-loc-row\" role=\"option\" data-i=\"' + i + '\"><span>' + esc(r.name) + '</span>' + (r.zip ? '<small>' + r.zip + '</small>' : '') + '</button>';\n      }).join('');\n      status(SHOWN.length ? '' : (/^\\d+$/.test(q) ? 'No US ZIP code starts with ' + q : 'No US city or town matches that'));\n    }).catch(function () { clearTimeout(slow); if (my === RUN) status('The places list didn’t load. Check your connection and try again.'); });\n  }\n  function gpsLabel(t) { var b = document.getElementById('locGpsBtn'); if (b) b.querySelector('span').textContent = t; }\n  function useGPS() {\n    var btn = document.getElementById('locGpsBtn');\n    if (!navigator.geolocation) { status('This device can’t share its location. Search instead.'); return; }\n    btn.disabled = true; gpsLabel('Finding you…'); status('');\n    load().catch(function () { return null; });\n    var done = false;\n    var finish = function (msg) { if (done) return false; done = true; clearTimeout(guard); btn.disabled = false; gpsLabel('Use my current location'); if (msg) status(msg); return true; };\n    // a permission question left unanswered never calls back; don't leave the button waiting forever\n    var guard = setTimeout(function () { finish('Couldn’t find your location. Search instead.'); }, 20000);\n    navigator.geolocation.getCurrentPosition(function (pos) {\n      if (done) return;\n      var lat = pos.coords.latitude, lon = pos.coords.longitude;\n      load().then(function (d) {\n        var i = nearest(d, lat, lon);\n        return i < 0 ? '' : d.name[i] + ', ' + d.st[i];\n      }).catch(function () { return null; }).then(function (name) {\n        if (name === null) { finish('The places list didn’t load. Check your connection and try again.'); return; }\n        if (!name) { finish('That’s outside the US. Only US places can be picked.'); return; }\n        if (finish('')) pick(lat, lon, name);\n      });\n    }, function (err) {\n      finish(err && err.code === 1 ? 'Location is turned off for this app. Search instead.' : 'Couldn’t find your location. Search instead.');\n    }, { timeout: 15000, maximumAge: 60000 });\n  }\n  function nm(n) { return window.dbkLocName ? window.dbkLocName(n) : String(n || ''); }\n  function current() { try { var l = JSON.parse(localStorage.getItem(KEY) || 'null'); return l && nm(l.name) ? l : null; } catch (e) { return null; } }\n  function open(opts) {\n    var o = el();\n    AFTER = opts && opts.after || null;\n    KEY = opts && opts.key === 'userLocation2' ? 'userLocation2' : 'userLocation';\n    var t = document.getElementById('locTitle'); if (t) t.textContent = KEY === 'userLocation2' ? 'Second place' : 'Location';\n    var cur = current(), now = document.getElementById('locationCurrent');\n    now.textContent = cur ? 'Now set to ' + nm(cur.name) : ''; now.style.display = cur ? '' : 'none';\n    var inp = document.getElementById('locSearchInput'); inp.value = '';\n    document.getElementById('locResults').innerHTML = ''; SHOWN = []; status('');\n    var btn = document.getElementById('locGpsBtn'); btn.disabled = false; gpsLabel('Use my current location');\n    o.classList.add('visible');\n    load().catch(function () {}); // start fetching the list while the person types\n    try { inp.focus({ preventScroll: true }); } catch (e) { inp.focus(); }\n  }\n  function close() { var o = document.getElementById('locationSetupOverlay'); if (o) o.classList.remove('visible'); }\n  function notice(msg) {\n    if (typeof window.showToast === 'function') { try { window.showToast(msg); return; } catch (e) {} }\n    if (typeof window.dbkNotice === 'function') { try { window.dbkNotice(msg); } catch (e) {} }\n  }\n  async function pick(lat, lon, name) {\n    var loc = { lat: lat, lon: lon, name: name };\n    if (KEY === 'userLocation2') {\n      // the weather's second place: a household setting too (both phones see it), nothing else changes\n      var was2 = localStorage.getItem('userLocation2');\n      localStorage.setItem('userLocation2', JSON.stringify(loc));\n      try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['userLocation2']); } catch (e) {}\n      close(); KEY = 'userLocation';\n      notice('Second place set to ' + name);\n      try { window.dispatchEvent(new StorageEvent('storage', { key: 'userLocation2', oldValue: was2, newValue: JSON.stringify(loc) })); } catch (e) {}\n      var after2 = AFTER; AFTER = null;\n      if (after2) { try { after2(loc); } catch (e) {} }\n      return;\n    }\n    var was = localStorage.getItem('userLocation');\n    localStorage.setItem('userLocation', JSON.stringify(loc));\n    // a household setting: saved as this phone's newest change straight away, so no older copy can win over it\n    try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['userLocation']); } catch (e) {}\n    try { window.dbkWxMark && window.dbkWxMark(); } catch (e) {}\n    try { if (window.dbkNWS) await Promise.race([window.dbkNWS.point(loc), new Promise(function (r) { setTimeout(r, 4000); })]); } catch (e) {}\n    try { if (typeof window.syncToFirebase === 'function') await window.syncToFirebase('userLocation', loc); } catch (e) {}\n    close();\n    notice('Location set to ' + name);\n    // the page's own weather (and Settings' row) listen for this; other open pages get it from the browser\n    try { window.dispatchEvent(new StorageEvent('storage', { key: 'userLocation', oldValue: was, newValue: JSON.stringify(loc) })); } catch (e) {}\n    var after = AFTER; AFTER = null;\n    if (after) { try { after(loc); } catch (e) {} }\n  }\n  // the names the rest of the app already calls\n  window.openLocationSetup = function (opts) { open(opts && (opts.after || opts.key) ? opts : null); };\n  window.dbkPlaces.open = function (opts) { open(opts || null); };\n  window.closeLocationSetup = function (e) { if (e && e.target !== e.currentTarget) return; close(); };\n  window.selectLocation = pick;\n  window.locUseGPS = useGPS;\n})();\n","work-spaces.js":"/* Personal or Work, on Today's event and reminder forms (only in copies with the Work page, for the person\n   it's for). Events and reminders marked Work carry space: 'work' and show on the Work overview; everything\n   still shows on Today's calendar, where work ones get a small \"Work\" tag. Nothing marked = personal.\n   The forms themselves live in dashboard.js; this adds the switch and stores the choice. */\n(function () {\n  function on() { try { return !!(window.dbkModule && window.dbkModule.workOn && window.dbkModule.workOn()); } catch (e) { return false; } }\n  var NOTE = { personal: '', work: '' };\n\n  // ---- the switch ----\n  function make(id) {\n    var w = document.createElement('div'); w.className = 'dbk-space'; w.id = id;\n    w.innerHTML = '<div class=\"dbk-space-sw\" role=\"radiogroup\" aria-label=\"Personal or Work\">' +\n      '<button type=\"button\" role=\"radio\" data-space=\"personal\">Personal</button><button type=\"button\" role=\"radio\" data-space=\"work\">Work</button></div>' +\n      '<p class=\"dbk-space-note\"></p>';\n    w.addEventListener('click', function (e) { var b = e.target.closest('[data-space]'); if (b) set(w, b.getAttribute('data-space')); });\n    // tapping the switch keeps the box being typed in (and its keyboard): the keyboard closing moved the whole pop-up (the designer, Oct 20)\n    w.addEventListener('mousedown', function (e) { if (e.target.closest('[data-space]')) e.preventDefault(); });\n    w.addEventListener('keydown', function (e) {\n      if (e.key !== 'ArrowLeft' && e.key !== 'ArrowRight') return;\n      e.preventDefault(); set(w, get(w) === 'work' ? 'personal' : 'work'); var b = w.querySelector('[aria-checked=\"true\"]'); if (b) b.focus();\n    });\n    set(w, 'personal');\n    return w;\n  }\n  function set(w, v) {\n    if (!w) return; v = v === 'work' ? 'work' : 'personal'; w.setAttribute('data-v', v);\n    w.querySelectorAll('[data-space]').forEach(function (b) { var is = b.getAttribute('data-space') === v; b.setAttribute('aria-checked', is ? 'true' : 'false'); b.tabIndex = is ? 0 : -1; b.classList.toggle('on', is); });\n    var n = w.querySelector('.dbk-space-note'); n.textContent = NOTE[v]; n.hidden = !NOTE[v];\n  }\n  function get(w) { return w && w.getAttribute('data-v') === 'work' ? 'work' : 'personal'; }\n  function sw(id) { var w = document.getElementById(id); return w && on() ? w : null; }\n  function place(id, beforeSel, inSel) {\n    if (document.getElementById(id)) return;\n    var box = document.querySelector(inSel); if (!box) return;\n    var before = box.querySelector(beforeSel);\n    var w = make(id);\n    if (before) before.parentNode.insertBefore(w, before); else box.appendChild(w);\n  }\n  function showAll() { document.querySelectorAll('.dbk-space').forEach(function (w) { w.hidden = !on(); }); }\n  function setup() {\n    place('dbkSpaceAdd', '.form-actions', '#addEventModalOverlay form');\n    place('dbkSpaceDay', '.day-modal-form-actions', '#dayModalForm');\n    place('dbkSpaceRemAdd', '.form-actions', '#addReminderOverlay .modal-body');\n    place('dbkSpaceRemEdit', '.form-actions', '#editReminderOverlay .modal-body');\n    showAll();\n  }\n\n  // ---- storing the choice ----\n  function wrap(name, fn) { var orig = window[name]; if (typeof orig !== 'function' || orig._dbkSpace) return; var w = fn(orig); w._dbkSpace = 1; window[name] = w; }\n  function visible(id) { var o = document.getElementById(id); return !!o && o.classList.contains('visible'); }\n  // spaceBy: whose Work it is, so its notification goes only to that person's phones (functions/notify-core.js)\n  function me() { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) { return 'person1'; } }\n  function mark(item, v) { if (!item) return; if (v === 'work') { item.space = 'work'; if (!item.spaceBy) item.spaceBy = me(); } else { delete item.space; delete item.spaceBy; } }\n  function hook() {\n    // a new event: the open form's switch decides\n    wrap('buildCalEvent', function (orig) {\n      return function (opts) {\n        var ev = orig.apply(this, arguments);\n        var w = visible('addEventModalOverlay') ? sw('dbkSpaceAdd') : visible('dayModalOverlay') ? sw('dbkSpaceDay') : null;\n        if (w) mark(ev, get(w));\n        return ev;\n      };\n    });\n    // the add form opens on Personal, unless it was opened from Work\n    wrap('calendarShowAddForm', function (orig) {\n      return function () { var r = orig.apply(this, arguments); set(document.getElementById('dbkSpaceAdd'), takePreset()); return r; };\n    });\n    // editing an event: the switch shows what it is now, and saving keeps the choice\n    var showFor = function (ev) { set(document.getElementById('dbkSpaceDay'), ev && ev.space === 'work' ? 'work' : 'personal'); };\n    wrap('calendarEditEvent', function (orig) { return function (index) { var r = orig.apply(this, arguments); try { showFor(calendarEvents[index]); } catch (e) {} return r; }; });\n    wrap('editDayModalEvent', function (orig) { return function (id) { var r = orig.apply(this, arguments); try { showFor(calendarEvents.filter(function (e) { return e.id === id; })[0]); } catch (e) {} return r; }; });\n    wrap('saveDayModalEvent', function (orig) {\n      return async function () {\n        var w = sw('dbkSpaceDay'), v = get(w), ref = (document.getElementById('dayModalEditId') || {}).value || '', target = null;\n        try {\n          if (ref.indexOf('id:') === 0) { var id = ref.slice(3); target = calendarEvents.filter(function (e) { return String(e.id) === id; })[0]; }\n          else if (ref !== '') target = calendarEvents[parseInt(ref, 10)];\n        } catch (e) { target = null; }\n        var r = await orig.apply(this, arguments);\n        if (w && target && calendarEvents.indexOf(target) !== -1 && (target.space === 'work') !== (v === 'work')) {\n          mark(target, v); try { await calendarSaveEvents(); if (typeof calendarRender === 'function') calendarRender(); } catch (e) {}\n        }\n        if (!w || v === 'personal') set(document.getElementById('dbkSpaceDay'), 'personal');\n        return r;\n      };\n    });\n    // reminders\n    wrap('openAddReminderPopup', function (orig) { return function () { var r = orig.apply(this, arguments); set(document.getElementById('dbkSpaceRemAdd'), takePreset()); return r; }; });\n    wrap('saveAddReminderPopup', function (orig) {\n      return async function () {\n        var w = sw('dbkSpaceRemAdd'), v = get(w), had = {};\n        try { lifeReminders.forEach(function (x) { had[String(x.id)] = 1; }); } catch (e) {}\n        // a new Work reminder is marked before its first save, so it's never saved (or shown on Work) without the mark\n        if (w && v === 'work') addMark = function () { try { lifeReminders.forEach(function (x) { if (x && !had[String(x.id)]) mark(x, v); }); } catch (e) {} };\n        var r; try { r = await orig.apply(this, arguments); } finally { addMark = null; }\n        if (w && v === 'work') {\n          var fresh = []; try { fresh = lifeReminders.filter(function (x) { return !had[String(x.id)] && !(x.space === 'work' && x.spaceBy); }); } catch (e) {}\n          if (fresh.length) { fresh.forEach(function (x) { mark(x, v); }); try { await saveLifeReminders(); updateReminderDisplay(); } catch (e) {} }\n        }\n        return r;\n      };\n    });\n    // once, at the first save (the new reminder was just added; a later save could hold one from another phone)\n    wrap('saveLifeReminders', function (orig) { return function () { var m = addMark; addMark = null; if (m) m(); return orig.apply(this, arguments); }; });\n    wrap('editReminder', function (orig) {\n      return function (id) { var r = orig.apply(this, arguments); try { var x = lifeReminders.filter(function (q) { return String(q.id) === String(id); })[0]; set(document.getElementById('dbkSpaceRemEdit'), x && x.space === 'work' ? 'work' : 'personal'); } catch (e) {} return r; };\n    });\n    wrap('saveEditedReminder', function (orig) {\n      return async function () {\n        var w = sw('dbkSpaceRemEdit'), v = get(w), id = (document.getElementById('editReminderId') || {}).value;\n        var r = await orig.apply(this, arguments);\n        if (w) {\n          var x = null; try { x = lifeReminders.filter(function (q) { return String(q.id) === String(id); })[0]; } catch (e) {}\n          if (x && (x.space === 'work') !== (v === 'work')) { mark(x, v); try { await saveLifeReminders(); updateReminderDisplay(); } catch (e) {} }\n        }\n        return r;\n      };\n    });\n  }\n  var addMark = null;\n  // Work's own \"+ Work event\" opens this page's form with Work picked (one time only)\n  function takePreset() { var v = 'personal'; try { v = sessionStorage.getItem('dbkAddSpace') === 'work' ? 'work' : 'personal'; sessionStorage.removeItem('dbkAddSpace'); } catch (e) {} return on() ? v : 'personal'; }\n\n  // ---- added on the Work page (another page in the app): take it in here too, so a save here can't drop it ----\n  window.addEventListener('storage', function (e) {\n    try {\n      if (e.key === 'calendarEvents' && e.newValue) { var a = JSON.parse(e.newValue); if (Array.isArray(a)) { calendarEvents = a; if (typeof calendarRender === 'function') calendarRender(); } }\n      if (e.key === 'lifeReminders' && e.newValue) { var b = JSON.parse(e.newValue); if (Array.isArray(b)) { lifeReminders = b; if (typeof updateReminderDisplay === 'function') updateReminderDisplay(); } }\n      if (e.key === 'archived') showAll();\n    } catch (x) {}\n  });\n\n  // ---- the Work page uses these same forms (Kasey, Oct 22: \"Work events & work reminders need the same treatment as\n  // personal\") ----\n  // Work's \"+ Work event\" and \"+ Reminder\" open the add forms here with Work picked, and tapping a work event or\n  // reminder on Work opens its edit form here. Inside the app, Work asks app.html to lay this page over itself\n  // showing only the pop-up (dbkShell.overlay); its messages (Saved, Undo) show on Work, and once the pop-up closes\n  // Work is simply there again. Opened on its own (index.html#wkform=...&from=work), closing goes back to Work.\n  var FORMS = { 'event-add': 'addEventModalOverlay', 'event-edit': 'addEventModalOverlay', 'reminder-add': 'addReminderOverlay', 'reminder-edit': 'editReminderOverlay' };\n  var wk = null;\n  function openForm(kind, id) {\n    if (!on() || !FORMS[kind]) return null;\n    var ov = document.getElementById(FORMS[kind]); if (!ov) return null;\n    try {\n      if (kind === 'event-add') { sessionStorage.setItem('dbkAddSpace', 'work'); window.dbkAddEvent(); }\n      else if (kind === 'reminder-add') { sessionStorage.setItem('dbkAddSpace', 'work'); openAddReminderPopup(); }\n      else if (kind === 'event-edit') { var ev = calendarEvents.filter(function (e) { return e && String(e.id) === String(id); })[0]; if (!ev || !window.dbkEditEvent(ev)) return null; }\n      else { if (!lifeReminders.some(function (r) { return r && String(r.id) === String(id); })) return null; editReminder(id); }\n    } catch (e) { try { sessionStorage.removeItem('dbkAddSpace'); } catch (x) {} return null; }\n    try { sessionStorage.removeItem('dbkAddSpace'); } catch (e) {}\n    return ov.classList.contains('visible') ? ov : null;\n  }\n  // watch the pop-up until it closes (Save, Delete, Cancel, ×, tapping outside, Back all close it)\n  function watch(ov, closed) {\n    var mo = new MutationObserver(function () { if (ov.classList.contains('visible')) return; mo.disconnect(); closed(); });\n    mo.observe(ov, { attributes: true, attributeFilter: ['class'] });\n  }\n  function todayBack() { try { var t = new Date(), k = t.getFullYear() + '-' + ('0' + (t.getMonth() + 1)).slice(-2) + '-' + ('0' + t.getDate()).slice(-2); if (window.dbkHmShow) window.dbkHmShow(k); } catch (e) {} }\n  window.dbkWorkForm = function (kind, id, under) {\n    if (wk) return false;\n    var root = document.documentElement;\n    root.classList.add('dbk-wkover');\n    // messages go to the page on screen while the pop-up is up, and for a moment after (Undo comes once it has closed)\n    // (while it's open they show here, over it, as on Today)\n    var me = wk = { under: under, until: 0, ov: null };\n    window.dbkNoticeTo = function () { return me.ov && !me.ov.classList.contains('visible') && (wk === me || Date.now() < me.until) ? me.under : null; };\n    var ov = me.ov = openForm(kind, id);\n    if (!ov) { wk = null; root.classList.remove('dbk-wkover'); return false; }\n    ov.classList.add('dbk-wkform');\n    try { ov.scrollTop = 0; } catch (e) {}\n    watch(ov, function () {\n      me.until = Date.now() + 2000; wk = null;\n      ov.classList.remove('dbk-wkform'); root.classList.remove('dbk-wkover');\n      todayBack();\n      try { var sh = window.parent && window.parent.dbkShell; if (sh && sh.overlayDone) sh.overlayDone(window); } catch (e) {}\n    });\n    return true;\n  };\n  // opened on its own (no app frame): index.html#wkform=<kind>[:<id>]&from=work\n  function fromHash() {\n    var m = /#wkform=([a-z-]+)(?::([^&]*))?/.exec(location.hash || ''); if (!m) return;\n    var back = /[#&]from=work\\b/.test(location.hash);\n    try { history.replaceState(null, '', 'index.html#today'); } catch (e) {}\n    var ov = openForm(m[1], m[2] ? decodeURIComponent(m[2]) : ''); if (!ov) return;\n    watch(ov, function () { todayBack(); if (back) (window.dbkGo || function (u) { location.href = u; })('workroom.html#today'); });\n  }\n  window.addEventListener('hashchange', fromHash);\n  window.addEventListener('dbk-show', function () { setTimeout(fromHash, 0); });\n\n  function go() { setup(); hook(); setTimeout(fromHash, 0); }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', go); else go();\n})();\n","meal-notes.js":"/* Dinner reminders (Kasey, Oct 23: \"add tonight's dinner as a personal reminder that shows up on the homepage, so you\n   remember to put the meat in the fridge, start the crockpot, stop at the store\"). A person adds one from a dinner on\n   Meals (the top card or a night's pop-up, \"+ Reminder\"); it shows on Today on its day, at the top of the calendar\n   like the cooking heads-ups, with Done. Each person's are their own: kept in the synced setting\n   dbkMealNotes_<person> as [{ id, day: 'YYYY-MM-DD', text, dish, time: 'HH:MM' | '', done }], so they show on every\n   phone and computer of that person. Ones more than a week old are dropped when the list is saved. */\n(function () {\n  'use strict';\n  if (window.dbkMealNotes) return;\n  var CHOICES = ['Take the meat out to thaw', 'Start the slow cooker', 'Stop at the store'];\n  var DAYN = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n  var MON = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n  function esc(s) { return String(s == null ? '' : s).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n  function pad(n) { return (n < 10 ? '0' : '') + n; }\n  function key(d) { return d.getFullYear() + '-' + pad(d.getMonth() + 1) + '-' + pad(d.getDate()); }\n  function parse(k) { var p = String(k).split('-'); return new Date(+p[0], +p[1] - 1, +p[2]); }\n  function role() { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) { return 'person1'; } }\n  function lsKey() { return 'dbkMealNotes_' + role(); }\n  // every entry, including ones taken off ({ id, gone: <time> }, kept 14 days so another device's older copy can't bring\n  // them back); each kept one has `at`, when it last changed. The household settings join two devices' lists item by\n  // item (joinNotes in shared.js), so both of one person's devices adding at once keep both (overnight audit, Oct 23).\n  function raw() { try { var v = JSON.parse(localStorage.getItem(lsKey()) || '[]'); return Array.isArray(v) ? v.filter(function (n) { return n && n.id; }) : []; } catch (e) { return []; } }\n  function all() { return raw().filter(function (n) { return !n.gone && n.day && n.text; }); }\n  function put(list) {\n    var cut = key(new Date(Date.now() - 7 * 864e5)), gcut = Date.now() - 14 * 864e5, k = lsKey();\n    list = list.filter(function (n) { return n.gone ? n.gone > gcut : n.day >= cut; });\n    var v = JSON.stringify(list);\n    try { if (typeof window.dbkJoinNotes === 'function') v = window.dbkJoinNotes(v, '[]'); } catch (e) {}\n    try { localStorage.setItem(k, v); } catch (e) {}\n    // a setting changed by hand names itself, so another phone's older copy can't put it back\n    try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save([k]); } catch (e) {}\n  }\n  function change(id, fn) { var now = Date.now(); put(raw().map(function (n) { return n.id === id ? fn(n, now) : n; })); }\n  function fmtTime(t) { if (!t) return ''; var p = t.split(':'), h = +p[0]; return (h % 12 || 12) + ':' + p[1] + (h < 12 ? ' am' : ' pm'); }\n  function dayWord(dk) { var t = key(new Date()), tm = new Date(); tm.setDate(tm.getDate() + 1); return dk === t ? 'Today' : dk === key(tm) ? 'Tomorrow' : DAYN[parse(dk).getDay()]; }\n\n  var api = {\n    choices: CHOICES,\n    all: all,\n    add: function (n) { var l = raw(); n.id = 'mn' + Date.now().toString(36) + Math.random().toString(36).slice(2, 5); n.at = Date.now(); l.push(n); put(l); return n; },\n    // taken off: kept as a mark (see raw); returns what it was, for Undo\n    remove: function (id) { var was = null; raw().forEach(function (n) { if (n.id === id && !n.gone) was = n; }); change(id, function (n, now) { return { id: id, gone: now }; }); return was; },\n    // Undo of remove: back as it was (newer than the mark)\n    restore: function (n) { if (!n || !n.id) return; var o = Object.assign({}, n); delete o.gone; o.at = Date.now(); put(raw().filter(function (x) { return x.id !== n.id; }).concat([o])); },\n    done: function (id, on) { change(id, function (n, now) { return n.gone ? n : Object.assign({}, n, { done: !!on, at: now }); }); },\n    // today's, earliest time first, in the same shape as the cooking heads-ups (meal-cookplan.js draws them on Today)\n    today: function () {\n      var t = key(new Date());\n      return all().filter(function (n) { return n.day === t; }).sort(function (a, b) { return (a.time || '99') < (b.time || '99') ? -1 : 1; })\n        .map(function (n) { return { id: 'mn:' + n.id, when: n.time ? fmtTime(n.time) : 'Dinner', text: n.text, sub: n.dish ? 'For ' + n.dish : '', done: !!n.done, today: true, note: true }; });\n    },\n    // the pop-up on Meals: what to remember, which day (the dinner's own day, or the day before for a later night),\n    // and an optional time\n    open: function (dk, dish) {\n      var old = document.getElementById('mnPop'); if (old) old.remove();\n      var t = key(new Date()), dayBefore = new Date(parse(dk)); dayBefore.setDate(dayBefore.getDate() - 1);\n      var days = [dk]; if (key(dayBefore) >= t) days.unshift(key(dayBefore));\n      var st = { text: '', day: dk, time: '' };\n      var o = document.createElement('div'); o.id = 'mnPop'; o.className = 'mprj-scrim';\n      var times = ['', '07:00', '08:00', '09:00', '10:00', '11:00', '12:00', '13:00', '14:00', '15:00', '16:00', '17:00', '18:00', '19:00', '20:00', '21:00'];\n      o.innerHTML = '<div class=\"mprj-pop mn-pop\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"mnT\">' +\n        '<button type=\"button\" class=\"mprj-x\" data-mn=\"close\" aria-label=\"Close\">×</button>' +\n        '<h3 id=\"mnT\">' + esc(dish || 'Dinner') + '</h3>' +\n        '<div class=\"mn-lab\">Remind me to</div>' +\n        '<div class=\"mn-chips mn-what\" role=\"group\" aria-label=\"Remind me to\">' + CHOICES.map(function (c) { return '<button type=\"button\" class=\"mn-chip\" data-mnc=\"' + esc(c) + '\" aria-pressed=\"false\">' + esc(c) + '</button>'; }).join('') + '</div>' +\n        '<input id=\"mnText\" class=\"mn-text\" type=\"text\" placeholder=\"Or type your own\" autocomplete=\"off\">' +\n        (days.length > 1 ? '<div class=\"mn-lab\">When</div><div class=\"mn-chips\" role=\"group\" aria-label=\"When\">' + days.map(function (d) { return '<button type=\"button\" class=\"mn-chip\" data-mnd=\"' + d + '\" aria-pressed=\"' + (d === st.day ? 'true' : 'false') + '\">' + esc(dayWord(d)) + '</button>'; }).join('') + '</div>' : '') +\n        '<div class=\"mn-lab\">At</div><select id=\"mnTime\" class=\"mn-time\" aria-label=\"Time\">' + times.map(function (x) { return '<option value=\"' + x + '\">' + (x ? fmtTime(x) : 'Any time') + '</option>'; }).join('') + '</select>' +\n        '<div class=\"mn-btns\"><button type=\"button\" class=\"mn-save\" data-mn=\"save\">Save</button></div></div>';\n      var txt = o.querySelector('#mnText');\n      function close() { o.remove(); document.removeEventListener('keydown', onKey); }\n      function onKey(e) { if (e.key === 'Escape') close(); }\n      o.addEventListener('click', function (e) {\n        if (e.target === o) { close(); return; }\n        var c = e.target.closest('[data-mnc]');\n        if (c) { var v = c.getAttribute('data-mnc'); var on = c.getAttribute('aria-pressed') !== 'true'; [].forEach.call(o.querySelectorAll('[data-mnc]'), function (b) { b.setAttribute('aria-pressed', on && b === c ? 'true' : 'false'); }); st.text = c.getAttribute('aria-pressed') === 'true' ? v : ''; if (st.text) txt.value = ''; return; }\n        var d = e.target.closest('[data-mnd]');\n        if (d) { st.day = d.getAttribute('data-mnd'); [].forEach.call(o.querySelectorAll('[data-mnd]'), function (b) { b.setAttribute('aria-pressed', b === d ? 'true' : 'false'); }); return; }\n        var b = e.target.closest('[data-mn]'); if (!b) return;\n        if (b.getAttribute('data-mn') === 'close') { close(); return; }\n        var text = txt.value.trim() || st.text;   // a choice picked, or what was typed (typing lets go of the choice)\n        if (!text) { txt.focus(); return; }\n        var n = api.add({ day: st.day, text: text, dish: dish || '', time: o.querySelector('#mnTime').value, done: false });\n        close();\n        if (window.dbkMealToast) window.dbkMealToast('Reminder added for ' + dayWord(n.day).toLowerCase().replace(/^(mon|tue|wed|thu|fri|sat|sun)/, function (m) { return m.charAt(0).toUpperCase() + m.slice(1); }) + (n.time ? ' at ' + fmtTime(n.time) : ''), function () { api.remove(n.id); });\n      });\n      txt.addEventListener('input', function () { if (!txt.value.trim()) return; [].forEach.call(o.querySelectorAll('[data-mnc]'), function (b) { b.setAttribute('aria-pressed', 'false'); }); st.text = ''; });\n      document.body.appendChild(o); document.addEventListener('keydown', onKey);\n      try { var x = o.querySelector('.mprj-x'); if (window.dbkQuietFocus) window.dbkQuietFocus(x); else x.focus({ preventScroll: true }); } catch (e) {}\n    }\n  };\n  window.dbkMealNotes = api;\n})();\n","meal-cookplan.js":"/* Meals cooking help, worked out with plain rules (no AI anywhere). It reads each planned meal's own ingredients\n   and steps and gives two things:\n     - Tonight's plan (Meals > Plan): when to start so dinner is ready at your dinner time, then every step in\n       order. Waits (it bakes, it simmers) are marked, and a second dish's hands-on steps fit inside them.\n     - Heads-ups on Today: the one or two things that have to happen before you'd start cooking, e.g. take the\n       chicken out of the freezer tonight for tomorrow, or start the slow cooker at 11:45. Quick dinners give none.\n   Dinner time is Meals settings > \"We eat dinner around\" (mealplan_settings.dinnerTime, synced with the other\n   meal settings); 6:00 pm until it's set. Recipes imported from a link carry the times the site publishes.\n   The pure parts are exposed as window.dbkCookRules so they can be tested on their own. */\n(function () {\n  'use strict';\n\n  /* ============================== RULES ==============================\n     Edit these lists to teach the planner. Each pattern is checked against the recipe's name first, then\n     its ingredients and steps. Days are how long the cooked dish keeps in the fridge. */\n  var RULES = {\n    // dishes that keep in the fridge (days) and whether they freeze well\n    keeps: [\n      { re: /\\b(soup|chowder|bisque|pho|ramen broth)\\b/, what: 'soup', days: 4, freezes: true },\n      { re: /\\bchili\\b/, what: 'chili', days: 4, freezes: true },\n      { re: /\\b(stew|curry|tagine|goulash|dal|dhal)\\b/, what: 'stew', days: 4, freezes: true },\n      { re: /\\b(casserole|lasagna|enchiladas?|baked ziti|shepherd'?s pie|pot pie|bake)\\b/, what: 'casserole', days: 4, freezes: true },\n      { re: /\\b(sauce|ragu|bolognese|marinara|pesto)\\b/, what: 'sauce', days: 4, freezes: true },\n      { re: /\\b(meatballs?|meatloaf|burgers? patties)\\b/, what: 'meatballs', days: 4, freezes: true },\n      { re: /\\b(crock.?pot|slow.?cook(er)?|instant.?pot|pressure.?cook|pulled|shredded|braised?)\\b/, what: 'slow-cooked', days: 4, freezes: true },\n      { re: /\\b(marinated?|teriyaki|honey garlic|bbq|barbecue|tikka)\\b/, what: 'marinated', days: 4, freezes: true },\n      { re: /\\b(fried rice|burrito bowl|grain bowl|rice bowl|power bowl|bowls?)\\b/, what: 'bowl', days: 4, freezes: false },\n      { re: /\\b(roasted|sheet.?pan|traybake)\\b/, what: 'roasted', days: 4, freezes: false },\n      { re: /\\b(overnight oats|chia pudding|egg (muffins|bites|cups)|frittata|breakfast burritos?|energy (bites|balls)|bites|muffins?|granola|cookies|bars?)\\b/, what: 'make-ahead', days: 4, freezes: true },\n      { re: /\\b(pasta salad|chicken salad|egg salad|tuna salad|grain salad|quinoa salad)\\b/, what: 'salad that keeps', days: 3, freezes: false }\n    ],\n    // dishes that are best cooked the day you eat them, with the reason shown\n    // (strong ones win even over a \"keeps\" match, e.g. a salmon rice bowl; the others lose to it, e.g. taco bowls)\n    fresh: [\n      { re: /\\b(salmon|cod|tilapia|halibut|trout|tuna steak|mahi|snapper|sea bass|shrimp|prawns?|scallops?|crab|lobster|fish|seafood)\\b/, why: 'fish: best cooked fresh', strong: true },\n      { re: /\\b(crispy|crunchy|fried|tempura|schnitzel|katsu|air.?fr(y|ied|yer)|nuggets?|tenders?)\\b/, why: 'crispy: goes soft in the fridge', strong: true },\n      { re: /\\b(avocado|guacamole)\\b/, why: 'avocado browns once cut', strong: true },\n      { re: /\\b(smoothie|shake|toast(?!ed)|omelet(te)?|scrambl\\w*|fried egg|sunny.?side|pancakes?|waffles?|french toast|quesadillas?|grilled cheese|tacos?(?! bowls?))\\b/, why: 'best made fresh' },\n      { re: /\\b(stir.?fry|stir.?fried)\\b/, why: 'stir-fry: best straight from the pan' }\n    ],\n    // tossed pasta (not baked) and dressed salads are fresh, unless a keeps rule above says otherwise\n    pasta: /\\b(pasta|spaghetti|linguine|fettuccine|penne|rigatoni|noodles?|gnocchi|orzo|mac and cheese|carbonara|alfredo)\\b/,\n    salad: /\\bsalad\\b/,\n    // food-safety limits for cooked food in the fridge, in days (the shortest that matches wins)\n    limits: [\n      { re: /\\b(salmon|cod|tilapia|halibut|trout|tuna|mahi|shrimp|prawns?|scallops?|crab|fish|seafood)\\b/, days: 2, what: 'fish' },\n      { re: /\\b(cut fruit|berries|melon|mango|pineapple)\\b/, days: 3, what: 'cut fruit' },\n      { re: /\\b(chicken|turkey)\\b/, days: 4, what: 'cooked chicken' },\n      { re: /\\b(beef|steak|pork|lamb|sausage)\\b/, days: 4, what: 'cooked meat' },\n      { re: /\\b(rice)\\b/, days: 4, what: 'cooked rice' }\n    ],\n    // how long a reheat takes, by kind of dish (minutes)\n    reheat: [\n      { re: /\\b(casserole|lasagna|enchiladas?|baked ziti|pot pie|bake)\\b/, min: 20, how: 'reheat 20 min in the oven' },\n      { re: /\\b(soup|chili|stew|curry|sauce|dal)\\b/, min: 8, how: 'reheat 8 min' },\n      { re: /\\b(overnight oats|chia pudding|salad)\\b/, min: 0, how: 'ready to eat' }\n    ],\n    // ingredients that are chopped or cut, even when the recipe doesn't say so\n    chopAlways: /\\b(onions?|shallots?|garlic|bell peppers?|peppers?|jalape(n|ñ)os?|carrots?|celery|zucchini|broccoli|cauliflower|mushrooms?|cabbage|kale|leeks?|scallions?|green onions?|ginger|cilantro|parsley|basil|potato(es)?|sweet potato(es)?|squash|cucumbers?|tomato(es)?|eggplant)\\b/,\n    chopWords: /\\b(diced|dice|sliced|slice|minced|mince|chopped|chop|julienned|halved|quartered|trimmed|shredded|grated|peeled|cubed|cut into|thinly|roughly|finely|spiralized)\\b/,\n    // grains cooked ahead and shared, with stovetop minutes\n    grains: [\n      { re: /\\bbrown rice\\b/, key: 'brown rice', min: 45 }, { re: /\\bwild rice\\b/, key: 'wild rice', min: 50 },\n      { re: /\\b(jasmine|basmati|white)?\\s*rice\\b/, key: 'rice', min: 20 }, { re: /\\bquinoa\\b/, key: 'quinoa', min: 20 },\n      { re: /\\bfarro\\b/, key: 'farro', min: 30 }, { re: /\\b(lentils?)\\b/, key: 'lentils', min: 25 }, { re: /\\bcouscous\\b/, key: 'couscous', min: 10 },\n      { re: /\\b(dried|dry) (black |pinto |kidney )?beans\\b/, key: 'dried beans', min: 90 }\n    ],\n    // proteins cooked ahead and shared\n    proteins: [\n      { re: /\\bground (turkey|beef|chicken|pork)\\b/, key: function (m) { return 'ground ' + m[1]; } },\n      { re: /\\bchicken (breasts?|thighs?|tenderloins?)\\b|\\bchicken\\b/, key: function () { return 'chicken'; } },\n      { re: /\\b(pork (loin|tenderloin|chops?|shoulder))\\b/, key: function () { return 'pork'; } },\n      { re: /\\b(steak|beef (chuck|roast|stew meat))\\b/, key: function () { return 'beef'; } },\n      { re: /\\btofu\\b/, key: function () { return 'tofu'; } }\n    ],\n    // lines that are never prep tasks (seasonings, water, oil...)\n    skip: /^(salt|pepper|black pepper|salt and pepper|salt, pepper|water|ice|cooking spray|oil|olive oil|avocado oil|vegetable oil|to taste|pinch|dash)\\b|\\b(to taste|for serving|optional|garnish)\\b|^-{2,}|^(topping|toppings|for the|sauce:|dressing:)/i\n  };\n  /* ==================================================================== */\n\n  var FRAC = { '½': 0.5, '¼': 0.25, '¾': 0.75, '⅓': 1 / 3, '⅔': 2 / 3, '⅛': 0.125 };\n  var UNITS = [\n    ['cup', /^(cups?|c\\.?)$/], ['tbsp', /^(tbsps?|tablespoons?|tbs\\.?|tbl)$/], ['tsp', /^(tsps?|teaspoons?)$/], ['oz', /^(oz|ounces?)$/],\n    ['lb', /^(lbs?|pounds?)$/], ['g', /^(g|grams?)$/], ['kg', /^(kgs?|kilograms?)$/], ['ml', /^(ml|millilit(er|re)s?)$/],\n    ['clove', /^cloves?$/], ['can', /^cans?$/], ['slice', /^slices?$/], ['piece', /^pieces?$/], ['head', /^heads?$/], ['bunch', /^bunch(es)?$/],\n    ['stalk', /^stalks?$/], ['sprig', /^sprigs?$/], ['handful', /^handfuls?$/], ['package', /^(packages?|pkgs?)$/], ['pinch', /^pinch(es)?$/], ['dash', /^dash(es)?$/]\n  ];\n  function num(s) {\n    s = String(s).trim();\n    if (FRAC[s] != null) return FRAC[s];\n    var m = /^(\\d+)\\s+(\\d+)\\/(\\d+)$/.exec(s); if (m) return +m[1] + m[2] / m[3];\n    m = /^(\\d+)([½¼¾⅓⅔⅛])$/.exec(s); if (m) return +m[1] + FRAC[m[2]];\n    m = /^(\\d+)\\/(\\d+)$/.exec(s); if (m) return m[1] / m[2];\n    var n = parseFloat(s); return isNaN(n) ? null : n;\n  }\n  function singular(w) { return w.replace(/(tomato|potato)es\\b/g, '$1').replace(/([^s])s\\b/g, '$1'); }\n\n  // \"1 1/2 cups diced yellow onion, divided\" -> { qty: 1.5, unit: 'cup', name: 'yellow onion', key: 'onion', prep: 'diced' }\n  function parseIngredient(line) {\n    var raw = String(line == null ? '' : line).replace(/<[^>]*>/g, '').trim();\n    var s = raw.replace(/^[-•*·▢☐]\\s*/, '').replace(/\\([^)]*\\)/g, ' ').replace(/\\s+/g, ' ').trim();\n    var low = s.toLowerCase();\n    if (!low || RULES.skip.test(low)) return null;\n    var qty = null, unit = null, rest = low;\n    var q = /^((\\d+\\s+\\d+\\/\\d+)|(\\d+[½¼¾⅓⅔⅛])|(\\d+\\/\\d+)|(\\d*\\.\\d+)|(\\d+)|([½¼¾⅓⅔⅛]))(\\s*(-|–|to)\\s*((\\d+\\/\\d+)|(\\d*\\.?\\d+)))?\\s*/.exec(rest);\n    if (q) {\n      qty = num(q[1]); if (q[10] != null && num(q[10]) != null) qty = (qty + num(q[10])) / 2;\n      rest = rest.slice(q[0].length);\n    } else if (/^(a|an|one)\\s/.test(rest)) { qty = 1; rest = rest.replace(/^(a|an|one)\\s/, ''); }\n    var first = (rest.split(/\\s+/)[0] || '').replace(/[.,]$/, '');\n    for (var i = 0; i < UNITS.length; i++) if (UNITS[i][1].test(first)) { unit = UNITS[i][0]; rest = rest.slice(rest.indexOf(first) + first.length).trim(); break; }\n    if (unit === 'pinch' || unit === 'dash') return null;\n    rest = rest.replace(/^of\\s+/, '');\n    var parts = rest.split(','), name = parts[0].trim(), prep = parts.slice(1).join(',').trim();\n    var words = [];\n    name = name.replace(new RegExp(RULES.chopWords.source, 'g'), function (w) { words.push(w); return ' '; }).replace(/\\b(fresh|large|medium|small|boneless|skinless|organic|frozen|canned|raw|cooked|lean|extra.virgin|about|roughly|finely|thinly)\\b/g, ' ').replace(/\\s+/g, ' ').trim();\n    if (words.length) prep = (words.join(' ') + (prep ? ', ' + prep : '')).trim();\n    if (!name) return null;\n    return { raw: raw, qty: qty, unit: unit, name: name, key: keyOf(name), prep: prep };\n  }\n  // one name for the same thing (\"yellow onion\", \"onions\" -> \"onion\")\n  function keyOf(name) {\n    var n = singular(String(name).toLowerCase().replace(/[^a-z\\s]/g, ' ').replace(/\\s+/g, ' ').trim());\n    var m;\n    if ((m = /\\b(green onion|scallion)\\b/.exec(n))) return 'green onion';\n    if ((m = /\\b(red|yellow|white|sweet)?\\s*onion\\b/.exec(n))) return m[1] === 'red' ? 'red onion' : 'onion';\n    if (/\\bgarlic\\b/.test(n)) return 'garlic';\n    if ((m = /\\b(red|green|yellow|orange)?\\s*bell pepper\\b/.exec(n))) return 'bell pepper';\n    if ((m = /\\bground (turkey|beef|chicken|pork)\\b/.exec(n))) return 'ground ' + m[1];\n    if (/\\bchicken\\b/.test(n) && !/broth|stock|bouillon/.test(n)) return 'chicken';\n    if (/\\bsweet potato\\b/.test(n)) return 'sweet potato';\n    if (/\\bpotato\\b/.test(n)) return 'potato';\n    if (/\\bcarrot\\b/.test(n)) return 'carrot';\n    if (/\\bcelery\\b/.test(n)) return 'celery';\n    if (/\\bbroccoli\\b/.test(n)) return 'broccoli';\n    if (/\\bmushroom\\b/.test(n)) return 'mushroom';\n    if (/\\bcilantro\\b/.test(n)) return 'cilantro';\n    if (/\\bginger\\b/.test(n)) return 'ginger';\n    if (/\\bzucchini\\b/.test(n)) return 'zucchini';\n    if (/\\bspinach\\b/.test(n)) return 'spinach';\n    if (/\\bbrown rice\\b/.test(n)) return 'brown rice';\n    if (/\\brice\\b/.test(n) && !/vinegar|noodle|paper/.test(n)) return 'rice';\n    if (/\\bquinoa\\b/.test(n)) return 'quinoa';\n    return n;\n  }\n\n  // minutes a recipe takes, from what the site published, its portion tags (\"4-5 hrs crock\") or its steps\n  /* times written the way recipes and texts write them (Oct 26 audit: \"simmer for about 1 1/2 hours\" read as 2 hours,\n     \"1½ hours\" and \"simmer an hour or so\" as nothing, so Mom's chili was a 5-minute dinner): \"1 1/2\", \"1-1/2\", \"1½\",\n     \"1/2 hour\", \"an hour\", \"half an hour\", \"an hour and a half\", \"two hours\" become numbers first */\n  var FRAC = { '½': 0.5, '¼': 0.25, '¾': 0.75, '⅓': 1 / 3, '⅔': 2 / 3 };\n  var WORDN = { one: 1, two: 2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9, ten: 10, eleven: 11, twelve: 12, fifteen: 15, twenty: 20, thirty: 30, forty: 40, 'forty-five': 45, 'forty five': 45, sixty: 60, ninety: 90 };\n  function timeWords(t) {\n    return t.replace(/\\b(\\d+)\\s*(?:-|\\s)\\s*(\\d)\\/(\\d)\\b/g, function (m0, a, b, c) { return String(+a + b / c); })\n      .replace(/(\\d+)\\s*([½¼¾⅓⅔])/g, function (m0, a, f) { return String(+a + FRAC[f]); })\n      .replace(/([½¼¾⅓⅔])/g, function (m0, f) { return String(FRAC[f]); })\n      .replace(/\\b(\\d)\\/(\\d)\\s*(?=(hours?|hrs?)\\b)/g, function (m0, a, b) { return String(a / b) + ' '; })\n      .replace(/\\b(?:(?:an?|one) )?hour and a half\\b/g, '1.5 hours')\n      .replace(/\\b(?:half an hour|a half hour|half-hour|half hour)\\b/g, '30 minutes')\n      .replace(/\\b(an?) (hour|minute)\\b/g, '1 $2')\n      .replace(/\\b(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve|fifteen|twenty|thirty|forty[- ]five|forty|sixty|ninety)(?=\\s+(?:to\\s+\\w+\\s+)?(hours?|hrs?|minutes?|mins?)\\b)/g, function (m0) { return String(WORDN[m0]); })\n      .replace(/\\b(one|two|three|four|five|six|eight|ten|twelve|fifteen|twenty|thirty|forty[- ]five|forty)(?=\\s+to\\s+\\d)/g, function (m0) { return String(WORDN[m0]); })\n      // \"1 hour 20 minutes\", \"1 hr and 15 min\": one time\n      .replace(/\\b(\\d+(?:\\.\\d+)?)\\s*(?:hours?|hrs?|h)\\b,?\\s*(?:and\\s+)?(\\d+)\\s*(?=(minutes?|mins?|min)\\b)/g, function (m0, a, b) { return String(Math.round(+a * 60 + +b)) + ' '; });\n  }\n  function minutesIn(text) {\n    var t = timeWords(String(text || '').toLowerCase()), total = 0, m, re;\n    re = /(\\d+(?:\\.\\d+)?)(?:\\s*(?:-|–|to)\\s*(\\d+(?:\\.\\d+)?))?\\s*(hours?|hrs?|h)\\b/g;\n    while ((m = re.exec(t))) total = Math.max(total, (m[2] ? (+m[1] + +m[2]) / 2 : +m[1]) * 60);\n    if (total) return Math.round(total);\n    var sum = 0; re = /(\\d+)(?:\\s*(?:-|–|to)\\s*(\\d+))?\\s*(minutes?|mins?|min)\\b/g;\n    while ((m = re.exec(t))) sum += m[2] ? (+m[1] + +m[2]) / 2 : +m[1];\n    return Math.round(sum);\n  }\n  function recipeText(r) { return ((r.name || '') + ' \\n ' + (r.ingredients || []).join(' \\n ') + ' \\n ' + (r.steps || []).join(' \\n ') + ' \\n ' + (r.portions || []).join(' ') + ' \\n ' + (r.category || '') + ' ' + (r.keywords || '')).toLowerCase(); }\n  // how it's cooked and roughly how long: slow cooker / oven / stove / no-cook\n  function methodOf(r) {\n    var steps = ((r.steps || []).join(' ') + ' ' + (r.portions || []).join(' ') + ' ' + (r.name || '')).toLowerCase();\n    var mins = r.cookMinutes || 0;\n    if (/crock.?pot|slow.?cook|\\bcrock\\b/.test(steps)) {\n      var low = /low[^.]*?(\\d+(?:\\s*(?:-|–|to)\\s*\\d+)?\\s*(?:hours?|hrs?))/.exec(steps);\n      return { kind: 'slow', label: 'slow cooker', min: minutesIn(low ? low[1] : steps) || 240, handsOff: true };\n    }\n    if (/instant.?pot|pressure.?cook/.test(steps)) return { kind: 'pressure', label: 'pressure cooker', min: mins || minutesIn(steps) || 30, handsOff: true };\n    var oven = /(preheat|bake|roast|broil|oven)[^.]*/.exec(steps);\n    if (oven || /\\b(baked?|roast(ed)?|sheet.?pan|casserole|lasagna|enchiladas?)\\b/.test((r.name || '').toLowerCase())) {\n      var temp = /(\\d{3})\\s*°?\\s*f?\\b/.exec(oven ? oven[0] : '') || /(\\d{3})\\s*°/.exec(steps);\n      var om = /(bake|roast)[^.]*?(\\d+(?:\\s*(?:-|–|to)\\s*\\d+)?\\s*(?:minutes?|mins?|min|hours?|hrs?))/.exec(steps);\n      return { kind: 'oven', label: 'oven', temp: temp ? temp[1] : '400', min: mins || (om ? minutesIn(om[2]) : 0) || 30, handsOff: true };\n    }\n    if (/(saut[eé]|simmer|boil|brown|sear|skillet|pan|stovetop|stir)/.test(steps)) return { kind: 'stove', label: 'stove', min: mins || minutesIn(steps) || 25, handsOff: false };\n    return { kind: 'none', label: 'no cooking', min: 0, handsOff: false };\n  }\n  function mainProtein(r) {\n    var t = recipeText(r), m;\n    if (RULES.limits[0].re.test(t)) return 'fish';\n    if ((m = /\\bground (turkey|beef|chicken|pork)\\b/.exec(t))) return m[1];\n    var order = ['chicken', 'turkey', 'beef', 'steak', 'pork', 'sausage', 'lamb', 'tofu', 'tempeh', 'lentil', 'chickpea', 'black bean', 'egg'];\n    for (var i = 0; i < order.length; i++) if (new RegExp('\\\\b' + order[i] + 's?\\\\b').test(t)) return order[i] === 'steak' ? 'beef' : order[i];\n    return '';\n  }\n  // can it be made ahead, for how many days, does it freeze, and why\n  function classify(r) {\n    var name = String((r && r.name) || '').toLowerCase(), t = recipeText(r || {}), out = { fresh: false, unknown: false, days: 0, freezes: false, why: '', what: '' };\n    var limit = 99, limitWhat = '';\n    RULES.limits.forEach(function (l) { if (l.re.test(t) && l.days < limit) { limit = l.days; limitWhat = l.what; } });\n    if (r && r.makeAhead === true) { out.days = Math.min(4, limit); out.freezes = true; out.why = 'you said it keeps'; out.what = 'yours'; return out; }\n    if (r && r.makeAhead === false) { out.fresh = true; out.why = 'you said to cook it fresh'; return out; }\n    var keep = null, i;\n    for (i = 0; i < RULES.keeps.length && !keep; i++) if (RULES.keeps[i].re.test(name)) keep = RULES.keeps[i];\n    var fresh = null;\n    for (i = 0; i < RULES.fresh.length && !fresh; i++) if (RULES.fresh[i].re.test(name)) fresh = RULES.fresh[i];\n    // a fish main makes it fresh even when the name doesn't say so (\"Lemon herb sheet pan\" with salmon)\n    if (!fresh && limitWhat === 'fish' && !/\\b(soup|chowder|stew|curry|cakes?|salad)\\b/.test(name)) fresh = RULES.fresh[0];\n    if (fresh && (!keep || (fresh.strong && !/soup|chili|stew|casserole/.test(keep.what)))) { out.fresh = true; out.why = fresh.why; return out; }\n    if (!keep && RULES.pasta.test(name) && !/\\b(bake|baked|casserole|lasagna|salad)\\b/.test(name)) { out.fresh = true; out.why = 'pasta: best tossed fresh (the sauce can be made ahead)'; return out; }\n    if (!keep && RULES.salad.test(name)) { out.fresh = true; out.why = 'salad: dress it fresh'; return out; }\n    if (!keep) for (i = 0; i < RULES.keeps.length && !keep; i++) if (RULES.keeps[i].re.test(t)) keep = RULES.keeps[i];\n    if (!keep && r && /dinner|lunch/i.test(String(r.category || '')) && r.cookMinutes >= 60) keep = { what: 'long-cooked', days: 4, freezes: true };\n    if (!keep) { out.unknown = true; return out; }\n    out.days = Math.min(keep.days, limit); out.freezes = keep.freezes; out.what = keep.what;\n    out.why = keep.what + ' keeps ' + out.days + ' day' + (out.days === 1 ? '' : 's') + (limit < keep.days ? ' (' + limitWhat + ')' : '') + (keep.freezes ? ', freezes well' : '');\n    return out;\n  }\n  function reheatOf(r) {\n    var n = String((r && r.name) || '').toLowerCase();\n    for (var i = 0; i < RULES.reheat.length; i++) if (RULES.reheat[i].re.test(n)) return RULES.reheat[i];\n    return { min: 5, how: 'reheat 5 min' };\n  }\n\n  /* ===================== Tonight's plan and today's heads-ups =====================\n     Both read a recipe's own steps. Each step is either hands-on (you're busy) or a wait (it bakes, simmers,\n     sits in the slow cooker...). A wait lets you do another dish's hands-on steps at the same time.\n     Steps that need hours or a night (marinating, soaking beans, chilling overnight) are left out of\n     tonight's timeline and become a heads-up earlier in the day or the night before. */\n  var WAITS = [\n    { re: /\\b(slow.?cook\\w*|crock.?pot|crock|cook (?:it )?(?:on )?(?:low|high))\\b/, verb: 'cooks', slow: true },\n    { re: /\\b(pressure.?cook\\w*|instant.?pot|seal the lid)\\b/, verb: 'cooks' },\n    { re: /\\broast\\w*/, verb: 'roasts' },\n    { re: /\\b(bake|baking|broil\\w*)\\b/, verb: 'bakes' },\n    { re: /\\bsimmer\\w*/, verb: 'simmers' },\n    { re: /\\bmarinat\\w*/, verb: 'marinates', marinate: true },\n    { re: /\\b(rest|let (?:it |them )?(?:sit|stand|cool))\\b/, verb: 'rests' },\n    { re: /\\b(chill|refrigerate)\\w*/, verb: 'chills' },\n    { re: /\\b(rise|proof)\\b/, verb: 'rises' },\n    { re: /\\bsoak\\w*/, verb: 'soaks', soak: true },\n    { re: /\\b(boil|cook)\\b[^.]*\\b(rice|quinoa|pasta|noodles|potatoes|farro|lentils|beans)\\b|\\b(rice|quinoa|pasta|noodles|potatoes|farro|lentils)\\b[^.]*\\b(boil|cook|simmer)\\b/, verb: 'cooks' }\n  ];\n  // turning the oven on, however it's written (\"Preheat the oven\", \"Heat oven to 450\", \"Set the oven to 400\"; Oct 26\n  // audit: NYT's \"Heat oven to 450 degrees.\" got a second, added \"Preheat the oven to 450°F\" above it)\n  var PREHEAT = /\\bpre-?heat\\b|\\b(heat|set|turn on|turn)\\s+(the\\s+|your\\s+|an\\s+)?oven\\b|\\boven\\s+(on\\s+)?to\\s+\\d{3}/;\n  var OVERNIGHT = /\\b(overnight|the night before|at least (8|10|12|24) hours|(8|10|12|24) hours or overnight)\\b/;\n  var FROZEN_MEAT = /\\bfrozen\\b[^,]*?\\b(ground (?:beef|turkey|chicken|pork)|chicken|beef|steak|pork|turkey|lamb|sausages?|shrimp|prawns|salmon|cod|tilapia|fish|roast)\\b/;\n  var COOKS_FROM_FROZEN = /\\b(meatballs|nuggets|tenders|fries|tots|pot ?stickers|dumplings|pizza|veg\\w*|peas|corn|berries|fruit|spinach|broccoli)\\b/;\n  function pad2(n) { return ('0' + n).slice(-2); }\n  // \"18:00\", \"6:00 pm\", \"6pm\" -> minutes after midnight (6:00 pm when it can't tell)\n  function toMin(t) {\n    if (typeof t === 'number' && isFinite(t)) return t;\n    var m = /^\\s*(\\d{1,2})(?::(\\d{2}))?\\s*(am|pm|a|p)?\\s*$/i.exec(String(t || ''));\n    if (!m) return 18 * 60;\n    var h = +m[1] % 24, mm = +(m[2] || 0), ap = (m[3] || '').toLowerCase();\n    if (ap[0] === 'p' && h < 12) h += 12; if (ap[0] === 'a' && h === 12) h = 0;\n    return h * 60 + mm;\n  }\n  // 1035 -> \"5:15\"; mornings say \"am\" (\"9:30 am\") so a slow-cooker start isn't mistaken for the evening\n  function fmtTime(m) { m = ((Math.round(m) % 1440) + 1440) % 1440; var h = Math.floor(m / 60), mm = m % 60; return (h % 12 || 12) + ':' + pad2(mm) + (h < 12 ? ' am' : ''); }\n  function fmtLen(m) { if (m < 60) return m + ' min'; var h = Math.round(m / 30) / 2; return (h === Math.floor(h) ? h : h.toFixed(1)) + (h === 1 ? ' hr' : ' hrs'); }\n  function protWord(t) {\n    var m = /\\bground (beef|turkey|chicken|pork)\\b/.exec(t); if (m) return 'ground ' + m[1];\n    var order = ['chicken', 'turkey', 'steak', 'beef', 'pork', 'lamb', 'sausage', 'shrimp', 'salmon', 'cod', 'tilapia', 'fish', 'roast', 'tofu'];\n    for (var i = 0; i < order.length; i++) if (new RegExp('\\\\b' + order[i] + 's?\\\\b').test(t)) return order[i];\n    return '';\n  }\n  // one recipe as a chain of steps for tonight, plus what has to happen earlier\n  function chainOf(r) {\n    var name = String((r && r.name) || '').trim(), steps = [], ahead = [];\n    // notes written as steps (\"BATCH TIP: …\", \"NOTE: …\", \"FREEZE: …\") aren't things to do tonight\n    var list = ((r && r.steps) || []).map(function (s) { return String(s == null ? '' : s).replace(/<[^>]*>/g, '').trim(); }).filter(function (s) { return s && !/^(batch tip|tip|note|freeze|storage|store|make.ahead)\\s*:/i.test(s); });\n    var md = methodOf(r || {});\n    list.forEach(function (text) {\n      var low = text.toLowerCase(), w = null, i;\n      for (i = 0; i < WAITS.length && !w; i++) if (WAITS[i].re.test(low)) w = WAITS[i];\n      var min = minutesIn(low.replace(/\\(or [^)]*\\)/g, ' '));   // \"Roast 20 min (or air fry 10 min)\" is 20\n      var night = OVERNIGHT.test(low);\n      if (w && w.marinate) {\n        // a long or untimed marinade is a heads-up; a short one stays in tonight's steps\n        if (night || min >= 480) { ahead.push({ kind: 'marinate', night: true, text: text }); return; }\n        if (!min || min >= 240) { ahead.push({ kind: 'marinate', night: false, min: min, text: text }); return; }\n      }\n      if (w && w.soak && (night || min >= 240 || /\\bbeans?\\b/.test(low))) { ahead.push({ kind: 'soak', night: true, text: text }); return; }\n      if (night) { ahead.push({ kind: 'overnight', night: true, text: text }); return; }\n      if (PREHEAT.test(low) && !(w && min)) { steps.push({ text: text, min: 0, wait: false, preheat: true }); return; }\n      // \"put it all in the slow cooker\" is hands-on; \"cook on low\" is the wait\n      if (w && w.slow && !min) { if (/\\b(cook|low|high)\\b/.test(low)) min = md.kind === 'slow' ? md.min : 240; else w = null; }\n      if (w && min >= 8) steps.push({ text: text, min: min, wait: true, verb: w.verb, slow: !!w.slow, oven: /bakes|roasts/.test(w.verb) });\n      else steps.push({ text: text, min: min || 5, wait: false });\n    });\n    if (!steps.length && name) {\n      // no steps written down: one line from the recipe's times\n      if (md.kind === 'slow') { steps.push({ text: 'Put everything in the slow cooker', min: 15, wait: false }); steps.push({ text: 'Let it cook on low', min: md.min, wait: true, verb: 'cooks', slow: true }); }\n      else steps.push({ text: 'Make ' + name, min: (r && r.totalMinutes) || md.min || 20, wait: false });\n    }\n    // dried beans need soaking even when the steps don't say so\n    var ing = ((r && r.ingredients) || []).join(' \\n ').toLowerCase();\n    if (/\\b(dried|dry) (black |pinto |kidney |white |navy |cannellini )?beans\\b/.test(ing) && !ahead.some(function (a) { return a.kind === 'soak'; })) ahead.push({ kind: 'soak', night: true, text: '' });\n    var frozen = (r && r.frozen === true) || ((r && r.ingredients) || []).some(function (l) { var s = String(l).toLowerCase(); return FROZEN_MEAT.test(s) && !COOKS_FROM_FROZEN.test(s); }) || /\\b(thaw\\w*|defrost\\w*)\\b/.test(list.join(' ').toLowerCase());\n    if (frozen) ahead.push({ kind: 'thaw', night: true, text: '' });\n    var sides = list.length ? fillGaps(r, list, steps, md) : [];\n    return { name: name, steps: steps, ahead: ahead, sides: sides, protein: protWord(ing + ' ' + name.toLowerCase()) };\n  }\n\n  /* What the recipe's own steps leave out (Kasey, Oct 25: \"mentions rice when putting the bowl together but never said\n     when to make it\"). Many recipes list \"1/2 cup cooked brown rice\", \"steamed broccoli\", \"dark chocolate, melted\" or a\n     sauce under its own heading (--- TZATZIKI ---) and then only use it (\"rice on the bottom\", \"a drizzle of\n     tzatziki\"). Each of those gets a step of its own, timed to be ready by the step that first uses it:\n       - rice, quinoa, farro, couscous, lentils, pasta, potatoes: cooked (typical stovetop minutes, hands-off)\n       - \"steamed X\": steam it; \"X, melted\": melt it\n       - a sauce or spice mix listed under its own heading: mix it\n       - a step that says \"serve over rice\" with no rice in the recipe: \"If you're serving it over rice, cook the rice\"\n     Bought ready (microwave or instant rice, a pouch, leftover or store-bought) needs no step. A grain step with no\n     time (\"Cook pasta per package\") gets the typical time instead of 5 minutes. Something baked with no \"preheat\"\n     step gets one. The extra steps run beside the recipe's own (a dish of their own in the timeline), so the\n     chicken is cooked while the rice simmers. Plain rules, no AI. */\n  var SIDES = [\n    { key: 'brown rice', re: /\\bbrown rice\\b/, min: 45, g: 'rice' },\n    { key: 'wild rice', re: /\\bwild rice\\b/, min: 50, g: 'rice' },\n    { key: 'rice', re: /\\brice\\b(?!\\s+(vinegar|noodles?|paper|wine|cakes?|flour|krispies))/, min: 20, g: 'rice' },\n    { key: 'quinoa', re: /\\bquinoa\\b/, min: 20, g: 'quinoa' },\n    { key: 'farro', re: /\\bfarro\\b/, min: 30, g: 'farro' },\n    { key: 'couscous', re: /\\bcouscous\\b/, min: 10, g: 'couscous' },\n    { key: 'lentils', re: /\\blentils?\\b/, min: 25, g: 'lentils' },\n    { key: 'pasta', re: /\\b(pasta|spaghetti|linguine|fettuccine|penne|rigatoni|ziti|macaroni|noodles|orzo|gnocchi|rotini|farfalle|shells)\\b/, min: 20, g: 'pasta' },\n    { key: 'sweet potatoes', re: /\\bsweet potato(e?s)?\\b/, min: 25, g: 'potato' },\n    { key: 'potatoes', re: /\\bpotato(e?s)?\\b/, min: 20, g: 'potato' }\n  ];\n  // a mention anywhere of each kind (any rice, any pasta shape)\n  var GROUP = { rice: SIDES[2].re, quinoa: SIDES[3].re, farro: SIDES[4].re, couscous: SIDES[5].re, lentils: SIDES[6].re, pasta: SIDES[7].re, potato: /\\bpotato(e?s)?\\b/ };\n  var READY = /\\b(microwav\\w*|instant|minute rice|ready.?(to.?eat|rice|made)?|leftover|pre.?cooked|pouch|90.?second|store.?bought|rotisserie|canned|frozen)\\b/;\n  var MAKES_COOKED = /\\b(cook|boil|simmer|steam|make|prepare|prep|start)\\b/;\n  var MAKES_RAW = /\\b(cook|boil|simmer|steam|make|prepare|prep|start|add|roast|bake|fry|saut[eé]|toss)\\b/;\n  var MIXES = /\\b(make|whisk|stir|combine|blend|shake|mix)\\b/;\n  var SKIP_HEAD = /\\b(topping|toppings|serve|serving|garnish|to serve)\\b/;\n  function sentences(t) { return String(t).toLowerCase().split(/(?<=[.!?;])\\s+|\\n/); }\n  // does a sentence of the steps (up to and including step `upto`) make this kind of thing\n  function madeIn(list, groupRe, verbs, upto) {\n    for (var i = 0; i < list.length && i <= (upto == null ? list.length : upto); i++) {\n      var ss = sentences(list[i]);\n      for (var j = 0; j < ss.length; j++) if (groupRe.test(ss[j]) && verbs.test(ss[j].replace(/\\b(spice|seasoning) mix\\b/g, ''))) return true;\n    }\n    return false;\n  }\n  function firstUse(list, re) { for (var i = 0; i < list.length; i++) if (re.test(String(list[i]).toLowerCase())) return i; return -1; }\n  function nicer(n) { return String(n).replace(/\\b(greek|dijon|italian|mexican|cajun|worcestershire|parmesan)\\b/g, function (w) { return w[0].toUpperCase() + w.slice(1); }); }\n  function andList(a) { return a.length < 2 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]; }\n  function fillGaps(r, list, steps, md) {\n    var ings = ((r && r.ingredients) || []).map(function (l) { return String(l == null ? '' : l).replace(/<[^>]*>/g, '').trim(); });\n    var out = [], have = {}, low = list.map(function (s) { return s.toLowerCase(); });\n    // where in tonight's steps a thing is first used (the extra step is ready by then)\n    var useAt = function (re) { for (var i = 0; i < steps.length; i++) if (re.test(String(steps[i].text).toLowerCase())) return i; return -1; };\n    var side = function (o) { if (have[o.key]) return; have[o.key] = 1; out.push(o); };\n    var section = '', sauces = {}, order = [];\n    ings.forEach(function (line) {\n      var h = /^-{2,}\\s*(.+?)\\s*-{2,}$/.exec(line);\n      if (h) { section = h[1].toLowerCase(); if (!SKIP_HEAD.test(section)) { sauces[section] = []; order.push(section); } return; }\n      var l = line.toLowerCase().replace(/\\([^)]*\\)/g, ' ');\n      if (section && sauces[section]) sauces[section].push(line);\n      if (READY.test(l)) return;\n      // the one named first decides (\"cooked farro or brown rice\" is farro's time)\n      var s = null, at = 1e9; for (var i = 0; i < SIDES.length; i++) { var mi = l.search(SIDES[i].re); if (mi >= 0 && mi < at) { at = mi; s = SIDES[i]; } }\n      if (s) {\n        var cooked = /\\b(cooked|steamed|prepared|boiled)\\b/.test(l), g = GROUP[s.g];\n        var first = firstUse(low, g);\n        if (madeIn(list, g, cooked ? MAKES_COOKED : MAKES_RAW, first < 0 ? null : first)) return;\n        // \"cooked farro or brown rice\": both are named; the first one decides the time\n        var other = null; for (var k = 0; k < SIDES.length; k++) if (SIDES[k] !== s && SIDES[k].g !== s.g && SIDES[k].re.test(l)) { other = SIDES[k]; break; }\n        if (other && madeIn(list, GROUP[other.g], MAKES_COOKED)) return;\n        var what = (l.match(new RegExp('((jasmine|basmati|white|long.grain)\\\\s+)?(' + s.re.source + ')(\\\\s+or\\\\s+(\\\\w+\\\\s+)?(' + SIDES.map(function (x) { return x.key; }).join('|') + '))?')) || [s.key])[0].replace(/\\s+/g, ' ').trim();\n        if (s.g === 'pasta') what = 'pasta';\n        if (s.g === 'potato') what = s.key;\n        var txt = s.g === 'pasta' ? 'Boil the water and cook the pasta' : s.g === 'potato' ? 'Boil the ' + what + ' until tender' : 'Start the ' + what + ': simmer it covered until tender';\n        side({ key: s.g, label: what, use: useAt(other ? new RegExp(g.source + '|' + GROUP[other.g].source) : g), steps: [{ text: txt, min: s.min, wait: true, verb: 'cooks', added: true }] });\n        return;\n      }\n      var m = /\\b(steamed|melted)\\b/.exec(l); if (!m) return;\n      var p = parseIngredient(line); var nm = String((p && p.name) || '').replace(/\\b(steamed|melted)\\b/g, ' ').replace(/\\s+/g, ' ').trim(); if (!nm) return;\n      var head = nm.split(' ').pop(), hre = new RegExp('\\\\b' + head.replace(/[^a-z]/g, '') + '\\\\w*');\n      if (madeIn(list, hre, m[1] === 'steamed' ? /\\b(steam|cook|microwave|boil)\\b/ : /\\b(melt|microwave|heat|warm)\\b/)) return;\n      side({ key: m[1] + ':' + head, label: nm, use: useAt(hre), steps: [m[1] === 'steamed' ? { text: 'Steam the ' + nm, min: 6, wait: false, added: true } : { text: 'Melt the ' + nm, min: 2, wait: false, added: true }] });\n    });\n    // a sauce or spice mix under its own heading that no step mixes\n    order.forEach(function (sec) {\n      var items = sauces[sec].map(function (line) { var p = parseIngredient(line); var n = p ? p.name : String(line).toLowerCase().replace(/^(a\\s+)?(pinch|dash|splash|squeeze) of\\s+/, '').replace(/\\([^)]*\\)/g, ' ').trim(); return nicer(n.replace(/^cloves? (of )?/, '').replace(/\\s+/g, ' ').trim()); }).filter(function (n) { return n && !/^(salt|pepper|salt and pepper|salt, pepper)$/.test(n); });\n      if (!items.length) return;\n      var word = sec.replace(/\\b(the|sauce|mix)\\b/g, ' ').trim().split(/\\s+/).pop() || sec, wre = new RegExp('\\\\b' + word.replace(/[^a-z]/g, '') + '(s|es)?\\\\b');   // \"spices\" uses the spice mix (Oct 26 audit: it was mixed after they went in)\n      if (madeIn(list, wre, MIXES)) return;\n      var heads = items.map(function (n) { return n.split(' ').pop(); });\n      var covered = list.some(function (st) {\n        return sentences(st).some(function (s) { var t = s.replace(/\\b(spice|seasoning) mix\\b/g, ''); if (!MIXES.test(t)) return false; var n = heads.filter(function (hw) { return t.indexOf(hw) !== -1; }).length; return n >= Math.ceil(heads.length / 2); });\n      });\n      if (covered) return;\n      var nice = nicer(sec);\n      side({ key: 'sauce:' + sec, label: nice, use: useAt(wre), steps: [{ text: 'Make the ' + nice + ': ' + (/spice|season|rub/.test(sec) ? 'mix ' : 'stir together ') + 'the ' + andList(items), min: /spice|season|rub/.test(sec) ? 2 : 3, wait: false, added: true }] });\n    });\n    // \"Serve over rice, pasta, or with crusty bread\" with no rice in the recipe: offered, not assumed\n    if (!out.some(function (o) { return /^(rice|quinoa|farro|couscous|pasta)$/.test(o.key); })) {\n      var best = null;\n      ['rice', 'quinoa', 'farro', 'couscous', 'pasta'].forEach(function (g) {\n        if (ings.some(function (l) { return GROUP[g].test(l.toLowerCase()); })) return;   // in the recipe: handled above\n        var i = firstUse(low, GROUP[g]); if (i < 0 || madeIn(list, GROUP[g], MAKES_RAW)) return;\n        var pos = low[i].search(GROUP[g]); if (!best || i < best.i || (i === best.i && pos < best.pos)) best = { g: g, i: i, pos: pos };\n      });\n      if (best) {\n        var sd = SIDES.filter(function (x) { return x.g === best.g; }).pop();\n        side({ key: best.g, label: best.g, use: useAt(GROUP[best.g]), optional: true, steps: [{ text: 'If you’re serving it over ' + best.g + ', ' + (best.g === 'pasta' ? 'boil the water and cook the pasta' : 'cook the ' + best.g), min: sd.min, wait: true, verb: 'cooks', added: true }] });\n      }\n    }\n    // a grain step with no time of its own (\"Cook pasta per package\", \"Cook farro if not prepped already\")\n    steps.forEach(function (st) {\n      var t = String(st.text).toLowerCase();\n      if (st.preheat || st.wait && st.min >= 8) return;\n      if (!/\\b(cook|boil|simmer)\\b/.test(t)) return;\n      for (var i = 0; i < SIDES.length; i++) {\n        if (!SIDES[i].re.test(t) || !GROUP[SIDES[i].g].test(sentences(t).filter(function (s) { return /\\b(cook|boil|simmer)\\b/.test(s); }).join(' '))) continue;\n        if (minutesIn(t) && !/package/.test(t)) return;\n        st.min = SIDES[i].min; st.wait = true; st.verb = 'cooks'; return;\n      }\n    });\n    // baked or roasted with no \"preheat\" step: one before it\n    if (!low.some(function (s) { return PREHEAT.test(s); }) && steps.some(function (s) { return s.oven && s.wait; })) {\n      var bake = steps.filter(function (s) { return s.oven && s.wait; })[0], tm = /(\\d{3})\\s*°?\\s*f?\\b/.exec(String(bake.text)) || (md && md.temp ? [0, md.temp] : null);\n      steps.unshift({ text: 'Preheat the oven' + (tm ? ' to ' + tm[1] + '°F' : ''), min: 0, wait: false, preheat: true, added: true });\n      out.forEach(function (o) { if (o.use >= 0) o.use++; });\n    }\n    return out;\n  }\n  /* Tonight's timeline, worked back from when you eat.\n     recipes: [{ recipe, who? }]   eat: minutes after midnight (or \"18:00\")\n     -> { start, eat, total, steps: [{ at, min, text, wait, dish, during? }] } or null when nothing has steps.\n     One cook: hands-on steps never overlap; waits overlap anything. Each dish is timed to finish at the end. */\n  function tonightPlan(recipes, eat) {\n    eat = toMin(eat);\n    var chains = [], seen = {}, sides = [], sideSeen = {};\n    (recipes || []).forEach(function (x) {\n      var r = x && (x.recipe || x); if (!r || !r.name || seen[r.name]) return; seen[r.name] = 1;\n      var c = chainOf(r); if (!c.steps.length) return; c.who = x.who || null; chains.push(c);\n      // what the recipe's steps leave out (the rice, a sauce): a dish of its own beside it, ready by the step that uses it\n      (c.sides || []).forEach(function (s) {\n        if (sideSeen[s.key]) return; sideSeen[s.key] = 1;\n        sides.push({ name: c.name, side: s.label, who: c.who, main: c, use: s.use, steps: s.steps.map(function (t) { var o = {}; Object.keys(t).forEach(function (k) { o[k] = t[k]; }); return o; }) });\n      });\n    });\n    if (!chains.length) return null;\n    var len = function (c, from) { var s = 0; for (var i = from || 0; i < c.steps.length; i++) s += c.steps[i].min; return s; };\n    var E = 0; chains.forEach(function (c) { c.len = len(c); c.tail = 0; if (c.len > E) E = c.len; });\n    sides.forEach(function (c) { c.len = len(c); c.tail = c.use >= 0 ? len(c.main, c.use) : 0; if (c.len + c.tail > E) E = c.len + c.tail; });\n    var all = chains.concat(sides);\n    all.forEach(function (c, n) { c.i = 0; c.cid = n; c.free = Math.max(0, E - c.len - c.tail); });\n    var cook = 0, out = [], guard = 0;\n    while (guard++ < 400) {\n      var best = null;\n      all.forEach(function (c) {\n        if (c.i >= c.steps.length) return;\n        var s = c.steps[c.i], t = s.wait || s.preheat ? c.free : Math.max(c.free, cook), rem = len(c, c.i);\n        // the step that uses the rice (or the sauce) waits until it's ready\n        var blocked = false;\n        sides.forEach(function (x) { if (x.main !== c || x.use < 0 || c.i < x.use) return; if (x.i < x.steps.length) blocked = true; else t = Math.max(t, x.free); });\n        if (blocked) return;\n        // the earliest step goes first; on a tie, the dish with more left to do\n        if (!best || t < best.t || (t === best.t && rem > best.rem)) best = { c: c, s: s, t: t, rem: rem };\n      });\n      if (!best) break;\n      var row = { at: best.t, min: best.s.min, text: best.s.text, wait: !!best.s.wait, verb: best.s.verb || '', slow: !!best.s.slow, oven: !!best.s.oven, preheat: !!best.s.preheat, dish: best.c.name, who: best.c.who, cid: best.c.cid, side: best.c.side || '', added: !!best.s.added };\n      out.push(row); best.c.free = best.t + best.s.min; best.c.i++;\n      if (!best.s.wait && !best.s.preheat) cook = best.t + best.s.min;\n    }\n    // the oven heats for 10 minutes before the first thing goes in\n    out.forEach(function (r) {\n      if (!r.preheat) return;\n      var bake = out.filter(function (o) { return o.dish === r.dish && o.oven; })[0];\n      if (bake) r.at = bake.at - 10;\n    });\n    var first = Math.min.apply(null, out.map(function (r) { return r.at; }));\n    var end = Math.max.apply(null, out.map(function (r) { return r.at + r.min; }));\n    var total = end - first, start = Math.floor((eat - total) / 5) * 5;\n    out.forEach(function (r) { r.at = start + (r.at - first); });\n    out.sort(function (a, b) { return a.at - b.at || (a.wait ? -1 : 0) - (b.wait ? -1 : 0); });\n    // a hands-on step that happens while another dish waits says so (not for hours in the slow cooker)\n    out.forEach(function (r) {\n      if (r.wait || r.preheat) return;\n      var w = out.filter(function (o) { return o.wait && !o.slow && o.min <= 120 && o.cid !== r.cid && o.at <= r.at && r.at < o.at + o.min; })[0];\n      if (w) r.during = { dish: w.dish, verb: w.verb, min: w.min, side: w.side || '' };\n    });\n    return { start: start, eat: eat, total: eat - start, steps: out, dishes: chains.map(function (c) { return c.name; }) };\n  }\n  function dayAfter(k, n) { var s = k.split('-'); var d = new Date(+s[0], +s[1] - 1, +s[2] + (n || 1)); return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate()); }\n  /* Today's heads-ups: only what has to happen before you'd normally start cooking.\n     meals: [{ recipe, dateKey, slot }] for today and tomorrow   today: 'YYYY-MM-DD'   dinner: when you eat\n     -> up to two { id, at, when, text, sub } in time order. A 20-minute stove dinner gives none. */\n  function headsUps(meals, today, dinner, max) {\n    var eatAt = { breakfast: 8 * 60, lunch: 12 * 60, dinner: toMin(dinner), dessert: toMin(dinner) };\n    var tomorrow = dayAfter(today, 1), out = [], seen = {};\n    var forWhat = function (m) { return m.slot === 'dinner' ? 'tomorrow’s ' : 'tomorrow’s ' + m.slot + ', '; };\n    var add = function (h) { if (seen[h.id]) return; seen[h.id] = 1; out.push(h); };\n    (meals || []).forEach(function (m) {\n      var r = m && m.recipe; if (!r || !r.name) return;\n      var c = chainOf(r), nm = c.name, slot = m.slot || 'dinner', eat = eatAt[slot] != null ? eatAt[slot] : eatAt.dinner;\n      var meat = c.protein && !/tofu/.test(c.protein) ? c.protein : 'meat';\n      var tonight = slot === 'dinner' ? 'tonight' : slot === 'lunch' ? 'lunch' : slot;\n      if (m.dateKey === tomorrow) {\n        c.ahead.forEach(function (a) {\n          if (!a.night) return;\n          var id = a.kind + ':' + tomorrow + ':' + nm;\n          if (a.kind === 'thaw') add({ id: id, at: 20 * 60, when: 'Tonight', text: 'Take the ' + meat + ' out of the freezer', sub: 'Thaw it in the fridge for ' + forWhat(m) + nm });\n          else if (a.kind === 'soak') add({ id: id, at: 20 * 60 + 1, when: 'Tonight', text: 'Soak the beans', sub: 'Overnight, for ' + forWhat(m) + nm });\n          else if (a.kind === 'marinate') add({ id: id, at: 20 * 60 + 2, when: 'Tonight', text: 'Marinate the ' + meat, sub: 'Overnight, for ' + forWhat(m) + nm });\n          else add({ id: id, at: 20 * 60 + 3, when: 'Tonight', text: 'Make the ' + nm, sub: 'It needs the night in the fridge' + (slot === 'dinner' ? '' : ' · for tomorrow’s ' + slot) });\n        });\n        return;\n      }\n      if (m.dateKey !== today) return;\n      var p = tonightPlan([{ recipe: r }], eat);\n      var slow = p && p.steps.some(function (s) { return s.slow; });\n      if (p && (slow || p.total >= 120) && slot !== 'breakfast') {\n        var cook = p.steps.filter(function (s) { return s.slow; })[0];\n        add({ id: 'start:' + today + ':' + nm, at: p.start, when: fmtTime(p.start), text: 'Start ' + nm + (slow ? ' in the slow cooker' : ''),\n          sub: (slow ? fmtLen(cook.min) + ' on low' : fmtLen(p.total)) + ' · to eat at ' + fmtTime(eat) });\n      }\n      c.ahead.forEach(function (a) {\n        if (a.kind !== 'marinate' || a.night) return;\n        var at = a.min && p ? p.start - a.min : 8 * 60;\n        add({ id: 'marinate:' + today + ':' + nm, at: at, when: a.min && p ? fmtTime(at) : 'Morning', text: 'Marinate the ' + meat + ' for ' + tonight, sub: nm + (a.min ? ' · ' + fmtLen(a.min) : '') });\n      });\n    });\n    out.sort(function (a, b) { return a.at - b.at; });\n    return out.slice(0, max || 2);\n  }\n\n  window.dbkCookRules = { RULES: RULES, parseIngredient: parseIngredient, keyOf: keyOf, minutesIn: minutesIn, methodOf: methodOf, classify: classify, mainProtein: mainProtein, reheatOf: reheatOf,\n    chainOf: chainOf, tonightPlan: tonightPlan, headsUps: headsUps, toMin: toMin, fmtTime: fmtTime };\n\n  /* ============================== on the page ============================== */\n  if (typeof document === 'undefined' || !document.createElement) return;\n  function esc(s) { return String(s == null ? '' : s).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n  function key(d) { return d.getFullYear() + '-' + pad2(d.getMonth() + 1) + '-' + pad2(d.getDate()); }\n  function jget(k, d) { try { var v = JSON.parse(localStorage.getItem(k) || 'null'); return v == null ? d : v; } catch (e) { return d; } }\n  function people() { return (window.dbkModule && window.dbkModule.people) || 1; }\n  // two people who aren't planning together each see their own meals; together, both people's\n  function priv() { try { return people() > 1 && localStorage.getItem('mealShareTwo') !== 'true'; } catch (e) { return false; } }\n  function me() { try { return people() > 1 && localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) { return 'person1'; } }\n  function persons() { return people() < 2 ? ['person1'] : priv() ? [me()] : ['person1', 'person2']; }\n  function names() { var n = (window.HearthSettings && window.HearthSettings.current && window.HearthSettings.current.names) || jget('userNames', {}) || {}; return { person1: n.name1 || 'Person 1', person2: n.name2 || 'Person 2' }; }\n  // when you eat dinner (Meals settings > \"We eat dinner around\"); 6:00 pm until it's set\n  function dinnerTime() { var s = jget('mealplan_settings', {}) || {}; return /^\\d{1,2}:\\d{2}$/.test(s.dinnerTime || '') ? s.dinnerTime : '18:00'; }\n  window.dbkDinnerTime = dinnerTime;\n  window.dbkSetDinnerTime = function (v) {\n    if (!/^\\d{1,2}:\\d{2}$/.test(v || '')) return;\n    var s = jget('mealplan_settings', {}) || {}; s.dinnerTime = v;\n    try { localStorage.setItem('mealplan_settings', JSON.stringify(s)); localStorage.setItem('_settingsLastSaved', String(Date.now())); } catch (e) {}\n    try { if (window.dbkSettings && window.dbkSettings.save) window.dbkSettings.save(['mealplan_settings']); else if (typeof window.syncSettingsToFirebase === 'function') window.syncSettingsToFirebase(); } catch (e) {}\n  };\n  // the planner's schedule: live on the Meals page, the saved copy anywhere else\n  var cache = { raw: null, val: {} };\n  function schedule() {\n    if (window.mealSchedule && typeof window.mealSchedule === 'object') return window.mealSchedule;\n    var raw = null; try { raw = localStorage.getItem('mealplan_schedule'); } catch (e) {}\n    if (raw !== cache.raw) { cache.raw = raw; try { cache.val = JSON.parse(raw || '{}') || {}; } catch (e) { cache.val = {}; } }\n    return cache.val;\n  }\n  var bankCache = { raw: null, val: [] };\n  function bank() {\n    if (Array.isArray(window.recipeBank)) return window.recipeBank;\n    var raw = null; try { raw = localStorage.getItem('mealplan_recipes'); } catch (e) {}\n    if (raw !== bankCache.raw) { bankCache.raw = raw; try { var v = JSON.parse(raw || '[]'); bankCache.val = Array.isArray(v) ? v : (v && Array.isArray(v.recipes) ? v.recipes : []); } catch (e) { bankCache.val = []; } }\n    return bankCache.val;\n  }\n  function bankRecipe(n) { var b = bank(); for (var i = 0; i < b.length; i++) if (b[i] && b[i].name === n) return b[i]; return null; }\n  // the planned meal, with the recipe bank's steps and times laid over it when the plan's copy lacks them\n  function full(m) {\n    var b = bankRecipe(m.name); if (!b) return m;\n    var o = {}; Object.keys(m).forEach(function (k) { o[k] = m[k]; });\n    ['totalMinutes', 'cookMinutes', 'prepMinutes', 'category', 'keywords', 'frozen'].forEach(function (k) { if (b[k] != null && o[k] == null) o[k] = b[k]; });\n    if (!o.ingredients || !o.ingredients.length) o.ingredients = b.ingredients || [];\n    if (!o.steps || !o.steps.length) o.steps = b.steps || [];\n    return o;\n  }\n  function skipped(day, slot, p) {\n    var s = day && day.skippedSlots; if (!s) return false;\n    if (Array.isArray(s[p])) return s[p].indexOf(slot) !== -1;\n    if (Array.isArray(s)) return s.indexOf(slot) !== -1;\n    return false;\n  }\n  // the meals on a day for the people this phone plans for (the same dish for both counts once)\n  function mealsOn(dk, slots) {\n    var day = schedule()[dk], out = [], seen = {};\n    if (!day) return out;\n    persons().forEach(function (p) {\n      var pd = day[p]; if (!pd) return;\n      slots.forEach(function (slot) {\n        if (skipped(day, slot, p)) return;\n        var r = pd[slot]; if (!r || Array.isArray(r) || !r.name || seen[slot + '|' + r.name]) return;\n        seen[slot + '|' + r.name] = 1;\n        // leftovers from an earlier night (Plan open nights, meals-today.js): only reheating, nothing to thaw or buy\n        if (/^\\d{4}-\\d{2}-\\d{2}$/.test(String(r.leftover || ''))) {\n          var rh = reheatOf(r), how = !rh.min ? 'The leftovers are ready to eat' : 'Reheat the leftovers' + (/oven/.test(rh.how) ? ' in the oven' : '') + ', about ' + rh.min + ' minutes';\n          out.push({ recipe: { name: r.name, leftover: r.leftover, ingredients: [], steps: [how], totalMinutes: rh.min }, dateKey: dk, slot: slot, who: p });\n          return;\n        }\n        out.push({ recipe: full(r), dateKey: dk, slot: slot, who: p });\n      });\n    });\n    return out;\n  }\n\n  /* ---- Tonight's plan: a pop-up with when to start and each step in order ---- */\n  function aheadLine(c) {\n    var meat = c.protein && !/tofu/.test(c.protein) ? c.protein : 'meat';\n    return c.ahead.map(function (a) {\n      if (a.kind === 'thaw') return 'Thaw the ' + meat + ' in the fridge the night before';\n      if (a.kind === 'soak') return 'Soak the beans the night before';\n      if (a.kind === 'marinate') return a.night ? 'Marinate the ' + meat + ' the night before' : 'Marinate the ' + meat + (a.min ? ' ' + fmtLen(a.min) + ' ahead' : ' in the morning');\n      return a.text || 'Make it the night before';\n    });\n  }\n  function openTonight(dk) {\n    var old = document.getElementById('mcpPop'); if (old) old.remove();\n    var pop = document.createElement('div'); pop.id = 'mcpPop'; pop.className = 'mprj-scrim';\n    document.body.appendChild(pop);\n    drawTonight(pop, dk || key(new Date()));\n    var day = dk || key(new Date());\n    pop.addEventListener('click', function (e) {\n      var plan = e.target.closest('[data-c=\"plan\"]');\n      if (plan) {\n        var d = plan.getAttribute('data-day'), me = 'person1'; try { me = localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (x) {}\n        // the picker opens before this closes (closing first let the blur behind drop for a moment); once a dinner is\n        // picked, the plan for it shows straight away. Closed without picking: back on the page (the designer, Oct 21:\n        // \"I choose a recipe and nothing happens\")\n        try { window.openMealPicker(d, 'dinner', me); } catch (x) {}\n        close(); afterPick(d);\n        return;\n      }\n      if (e.target === pop || e.target.closest('[data-c=\"close\"]')) close(); else if (e.target.closest('[data-c=\"time\"]')) timePick(pop);\n    });\n    // pick the dinner time right here: the plan redraws for the new time\n    pop.addEventListener('change', function (e) {\n      if (!e.target.matches('[data-c=\"pick\"]')) return;\n      window.dbkSetDinnerTime(e.target.value);\n      var f = document.getElementById('settings-dinner-time'); if (f) f.value = e.target.value;\n      drawTonight(pop, day); timePick(pop);\n      var sv = pop.querySelector('.mcp-saved'); if (sv) sv.textContent = 'Saved. Dinner is at ' + fmtTime(toMin(e.target.value)) + (toMin(e.target.value) >= 720 ? ' pm' : '') + ' every day now.';\n    });\n    document.addEventListener('keydown', escKey);\n    try { var x = pop.querySelector('.mprj-x'); if (x) x.focus({ preventScroll: true }); } catch (e) {}\n  }\n  function afterPick(dk) {\n    var m = document.getElementById('meal-picker-modal'); if (!m || typeof MutationObserver !== 'function') return;\n    var mo = new MutationObserver(function () {\n      if (getComputedStyle(m).display !== 'none') return;\n      mo.disconnect();\n      if (mealsOn(dk, ['dinner']).length) openTonight(dk);   // in the same moment the picker goes, so nothing flashes\n    });\n    mo.observe(m, { attributes: true, attributeFilter: ['style', 'class'] });\n  }\n  function escKey(e) { if (e.key === 'Escape') close(); }\n  function close() { var p = document.getElementById('mcpPop'); if (p) p.remove(); document.removeEventListener('keydown', escKey); }\n  function timePick(pop) {\n    var foot = pop.querySelector('.mcp-foot'); if (!foot) return;\n    var cur = dinnerTime(), opts = '';\n    for (var m = 16 * 60; m <= 21 * 60; m += 15) { var v = pad2(Math.floor(m / 60)) + ':' + pad2(m % 60); opts += '<option value=\"' + v + '\"' + (toMin(v) === toMin(cur) ? ' selected' : '') + '>' + fmtTime(m) + (m >= 720 ? ' pm' : '') + '</option>'; }\n    foot.innerHTML = '<label class=\"mcp-timepick\"><span>We eat around</span><select data-c=\"pick\" aria-label=\"We eat dinner around\">' + opts + '</select></label>' +\n      '<p class=\"mcp-saved\" aria-live=\"polite\"></p><button type=\"button\" class=\"mcp-done\" data-c=\"close\">Done</button>';\n  }\n  // how much to make (Kasey, Oct 22: \"looking at it when making dinner and as a household\"): every plate, children's\n  // too, and nights it's eaten again as leftovers, against what the recipe itself makes (meal-portions.js)\n  function amountHtml(dk, meals) {\n    var PP = window.dbkPortions; if (!PP) return '';\n    var seen = {}, many = meals.length > 1, out = '';\n    meals.forEach(function (m) {\n      var n = m.recipe.name; if (seen[n] || m.recipe.leftover) return; seen[n] = 1;\n      var info = null; try { info = PP.forDinner(dk, n); } catch (e) {} if (!info) return;\n      var L = PP.makeLines(info);\n      if (PP.total(info) === 1 && !(info.kids || []).length && !(info.later || []).length && !info.servings) return;\n      out += '<div class=\"mcp-amount\"><div class=\"mcp-amt-h\">' + esc(L.head) + (many ? ' of ' + esc(n) : '') + '</div>' + L.lines.map(function (l) { return '<div class=\"mcp-amt-l\">' + esc(l) + '</div>'; }).join('') + '</div>';\n    });\n    return out;\n  }\n  function drawTonight(pop, dk) {\n    var meals = mealsOn(dk, ['dinner']), eat = toMin(dinnerTime()), two = persons().length > 1, nm = names();\n    var p = tonightPlan(meals, eat), isToday = dk === key(new Date());\n    var day = DAYN_[new Date(+dk.slice(0, 4), +dk.slice(5, 7) - 1, +dk.slice(8, 10)).getDay()];\n    var h = '<div class=\"mprj-pop mcp-pop\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"mcpT\"><button type=\"button\" class=\"mprj-x\" data-c=\"close\" aria-label=\"Close\">×</button>' +\n      '<h3 id=\"mcpT\">' + (isToday ? 'Tonight’s plan' : esc(day) + '’s plan') + '</h3>';\n    if (!meals.length) {\n      // nothing planned: plan it right here (opens Choose a meal for that day's dinner)\n      pop.innerHTML = h + '<p class=\"mcp-empty\">No dinner is planned for ' + (isToday ? 'tonight' : esc(day)) + ' yet.</p>' +\n        (typeof window.openMealPicker === 'function' ? '<div class=\"mcp-foot mcp-planit\"><button type=\"button\" class=\"mcp-done\" data-c=\"plan\" data-day=\"' + esc(dk) + '\">Plan dinner</button></div>' : '') + '</div>'; return;\n    }\n    if (!p) {\n      pop.innerHTML = h + '<p class=\"mprj-when\">To eat at ' + fmtTime(eat) + '</p>' + amountHtml(dk, meals) + '<p class=\"mcp-empty\">' + esc(meals.map(function (m) { return m.recipe.name; }).join(' and ')) + ' has no steps written down yet.</p>' +\n        '<div class=\"mcp-foot\"><button type=\"button\" class=\"mcp-link\" data-c=\"time\">Change dinner time</button></div></div>'; return;\n    }\n    h += '<p class=\"mprj-when\">Start by ' + fmtTime(p.start) + ' to eat at ' + fmtTime(eat) + '</p>' + amountHtml(dk, meals);\n    var many = p.dishes.length > 1, who = {};\n    meals.forEach(function (m) { who[m.recipe.name] = m.who; });\n    var byName = two && many && meals.some(function (m) { return m.who !== meals[0].who; });\n    if (many) h += '<p class=\"mcp-dishes\">' + meals.map(function (m) { return esc(m.recipe.name) + (byName ? ' <span>(' + esc(nm[m.who]) + ')</span>' : ''); }).join(' and ') + '</p>';\n    // what had to happen earlier (thaw, soak, marinate)\n    var before = [];\n    meals.forEach(function (m) { aheadLine(chainOf(m.recipe)).forEach(function (t) { before.push({ t: t, dish: m.recipe.name }); }); });\n    var wide = p.steps.some(function (s) { return /am$/.test(fmtTime(s.at)); }) || before.length;\n    h += '<ol class=\"mcp-steps' + (wide ? ' mcp-wide' : '') + '\">';\n    before.forEach(function (b) { h += '<li class=\"mcp-before\"><span class=\"mcp-at\">Before</span><span class=\"mcp-grow\"><span class=\"mcp-t\">' + esc(b.t) + '</span>' + (many ? '<span class=\"mcp-sub\">' + esc(b.dish) + '</span>' : '') + '</span></li>'; });\n    p.steps.forEach(function (s) {\n      // two dishes: each step says whose it is (a name when it's each person's own dinner, else the dish)\n      var dish = !many ? '' : two && meals.some(function (m) { return m.who !== who[s.dish]; }) ? esc(nm[who[s.dish]]) : esc(s.dish);\n      var sub = [];\n      if (s.wait) sub.push(fmtLen(s.min) + ', hands-off');\n      if (dish) sub.push(dish);\n      var lead = s.during ? 'While ' + (s.during.side ? 'the ' + esc(s.during.side) : many ? 'the ' + esc(s.during.dish) : 'it') + ' ' + esc(s.during.verb) + ' (' + fmtLen(s.during.min) + '): ' : '';\n      h += '<li class=\"' + (s.wait ? 'mcp-wait' : 'mcp-do') + '\"><span class=\"mcp-at\">' + esc(fmtTime(s.at)) + '</span><span class=\"mcp-grow\"><span class=\"mcp-t\">' + (lead ? '<em>' + lead + '</em>' : '') + esc(s.text) + '</span>' + (sub.length ? '<span class=\"mcp-sub\">' + sub.join(' · ') + '</span>' : '') + '</span></li>';\n    });\n    h += '<li class=\"mcp-eat\"><span class=\"mcp-at\">' + fmtTime(eat) + '</span><span class=\"mcp-grow\"><span class=\"mcp-t\">Dinner</span></span></li></ol>';\n    h += '<div class=\"mcp-foot\"><button type=\"button\" class=\"mcp-link\" data-c=\"time\">Change dinner time</button></div></div>';\n    pop.innerHTML = h;\n  }\n  var DAYN_ = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n  window.dbkOpenTonightPlan = openTonight;\n  window.dbkOpenCookingPlan = function (dk) { openTonight(typeof dk === 'string' ? dk : undefined); };\n\n  /* ---- Today: one or two heads-ups at the top of today's calendar (daybook-theme.js draws them) ---- */\n  function mealsShown() {\n    var M = window.dbkModule; if (!M) return true;\n    if (!M.on('meals') || (M.archived && M.archived('page:meals'))) return false;\n    if (M.forPerson && !M.forPerson('meals', me() === 'person2' ? 'p2' : 'p1')) return false;\n    return true;\n  }\n  function doneMap() { var m = jget('cookHeadsUpDone', {}); return m && typeof m === 'object' ? m : {}; }\n  window.dbkCookToday = {\n    list: function () {\n      if (!mealsShown()) return [];\n      var t = new Date(), today = key(t), tm = new Date(t); tm.setDate(t.getDate() + 1);\n      var slots = ['breakfast', 'lunch', 'dinner'];\n      var items = headsUps(mealsOn(today, slots).concat(mealsOn(key(tm), slots)), today, dinnerTime(), 2), done = doneMap();\n      items.forEach(function (h) { h.done = !!done[h.id]; h.today = h.id.indexOf(':' + today + ':') !== -1; });\n      // this person's own dinner reminders for today (meal-notes.js), after the heads-ups\n      try { if (window.dbkMealNotes) items = items.concat(window.dbkMealNotes.today()); } catch (e) {}\n      return items;\n    },\n    // a dinner reminder taken off from Today: returns what Undo needs\n    remove: function (id) { if (/^mn:/.test(id) && window.dbkMealNotes) return window.dbkMealNotes.remove(id.slice(3)); return null; },\n    restore: function (n) { if (n && window.dbkMealNotes) window.dbkMealNotes.restore(n); },\n    done: function (id, on) {\n      if (/^mn:/.test(id)) { if (window.dbkMealNotes) window.dbkMealNotes.done(id.slice(3), on); return; }\n      var m = doneMap(), cut = key(new Date(Date.now() - 3 * 864e5));\n      Object.keys(m).forEach(function (k) { if (String(m[k]) < cut) delete m[k]; });\n      if (on) m[id] = key(new Date()); else delete m[id];\n      try { localStorage.setItem('cookHeadsUpDone', JSON.stringify(m)); } catch (e) {}\n    },\n    html: function (items) {\n      return (items || []).map(function (h) {\n        return '<div class=\"hc-rem hc-cook' + (h.note ? ' hc-cook-x' : '') + (h.done ? ' is-done' : '') + '\"><span class=\"hc-rem-l\">' + esc(h.when) + '</span>' +\n          '<button type=\"button\" class=\"hc-rem-main\" data-cookgo=\"' + (h.today ? 'tonight' : '') + '\"><span class=\"hc-rem-name\">' + esc(h.text) + '</span><span class=\"hc-rem-when\">' + esc(h.sub) + '</span></button>' +\n          (h.done ? '<button type=\"button\" class=\"hm-link hc-cook-undo\" data-cookundo=\"' + esc(h.id) + '\">Undo</button>' : '<button type=\"button\" class=\"hm-link\" data-cookdone=\"' + esc(h.id) + '\">Done</button>') +\n          // a dinner reminder of your own can be taken off here (with Undo); the cooking heads-ups come from the plan\n          (h.note ? '<button type=\"button\" class=\"hm-link\" data-cookx=\"' + esc(h.id) + '\">Remove</button>' : '') + '</div>';\n      }).join('');\n    }\n  };\n\n  // the planner's own \"Cooking plan\" buttons open Tonight's plan\n  function hook() { if (typeof window.openCookingPlan === 'function' && window.openCookingPlan !== window.dbkOpenCookingPlan) { window._oldOpenCookingPlan = window.openCookingPlan; window.openCookingPlan = window.dbkOpenCookingPlan; } hookImport(); }\n  // Meals settings: show the saved dinner time (it can change on the other phone too)\n  function fillTime() {\n    var f = document.getElementById('settings-dinner-time'); if (!f || document.activeElement === f) return;\n    var v = dinnerTime(), hm = v.split(':'), h = +hm[0];\n    if (![].some.call(f.options, function (o) { return o.value === v; })) { var o = document.createElement('option'); o.value = v; o.textContent = (h % 12 || 12) + ':' + hm[1] + (h < 12 ? ' am' : ' pm'); f.appendChild(o); }\n    f.value = v;\n  }\n  window.addEventListener('storage', function (e) { if (!e.key || e.key === 'mealplan_settings') fillTime(); });\n  // a link from Today (meal-plan.html#tonight) opens it straight away\n  // (an old #tonight link first switches the page to Plan, so the page behind the pop-up is never blank)\n  function fromHash() {\n    var flag = false; try { flag = sessionStorage.getItem('dbkOpenTonight') === '1'; sessionStorage.removeItem('dbkOpenTonight'); } catch (e) {}\n    var old = /^#tonight$/.test(location.hash || '');\n    if (!(flag || old) || !window._mpX) return;\n    if (old) { try { history.replaceState(null, '', (window.__dbkPath||location.pathname) + location.search + '#plan'); } catch (e) {} }\n    setTimeout(function () { try { if (window.dbkModeShow) window.dbkModeShow('plan'); } catch (e) {} openTonight(); }, 300);\n  }\n\n  // a recipe imported from a link keeps the times and category the site published (read in app.bundle.js's\n  // extractFromJsonLd); they're attached when the imported recipe is saved\n  function hookImport() {\n    var orig = window.saveRecipeBankToFirebase; if (typeof orig !== 'function' || orig._mcp) return;\n    var wrapped = function () {\n      try {\n        var meta = window._dbkImportMeta, bank = window.recipeBank;\n        if (meta && Array.isArray(bank)) {\n          for (var i = bank.length - 1; i >= 0; i--) {\n            var r = bank[i];\n            if (r && r.name && r.name.trim().toLowerCase() === String(meta.name).trim().toLowerCase() && r.totalMinutes == null) {\n              ['totalMinutes', 'cookMinutes', 'prepMinutes'].forEach(function (k) { if (meta[k]) r[k] = meta[k]; });\n              if (meta.category) r.category = meta.category; if (meta.keywords) r.keywords = meta.keywords;\n              window._dbkImportMeta = null; break;\n            }\n          }\n        }\n      } catch (e) {}\n      return orig.apply(this, arguments);\n    };\n    wrapped._mcp = true; window.saveRecipeBankToFirebase = wrapped;\n  }\n  if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', function () { hook(); setTimeout(hook, 500); fromHash(); fillTime(); }); else { hook(); setTimeout(hook, 500); fromHash(); fillTime(); }\n  window.addEventListener('hashchange', fromHash);\n})();\n","dbk-welcome.js":"/* 2daysbook \"Getting started\": a few short cards about the main pages, shown once to each person the first time\n   Today opens after setup (and after signing in, where the copy uses Firebase). Skippable at any point; Settings >\n   Help > Getting started opens it again. Only pages that are on for this person (and not put away in Settings >\n   What shows) get a card: a line about the page and a few short steps for what isn't obvious (Kasey, Oct 22: \"point out\n   ... clicking on tonight's dinner name to view tonight's plan\"). One card per page, so up to eight. Remembered per person (dbkWelcomeSeen_person1 / _person2: on the phone and in the household's settings, so a new phone\n   or a re-added home-screen app doesn't show them again).\n   Nothing is fetched: the words are all here. Loaded on Today and Settings. */\n(function () {\n  if (window.dbkWelcome) return;\n  var page = ((window.__dbkPath||location.pathname).split('/').pop() || 'index.html').replace(/^([^.]+)$/, '$1.html');\n  var C = window.DAYBOOK_CONFIG || {}, MODS = C.modules || {};\n\n  function role() { try { return localStorage.getItem('myPersonRole') === 'person2' ? 'person2' : 'person1'; } catch (e) { return 'person1'; } }\n  function seenKey() { return 'dbkWelcomeSeen_' + role(); }\n  function seen() { try { return !!localStorage.getItem(seenKey()); } catch (e) { return true; } }   // no storage: never nag\n  // Seen follows the person, not the phone (Oct 29: Charlie's re-added home-screen app showed him the cards again): the\n  // key is a household setting (DBK_SETTINGS_KEYS, shared.js), so a phone that has it sends it up the next time the\n  // settings sync runs, and a new phone has it from the cloud as soon as it's signed in (dbkSignedInGo reads the\n  // settings before Today). The phone's own copy is read as before.\n  function markSeen() { try { localStorage.setItem(seenKey(), String(Date.now())); } catch (e) {} try { if (window.dbkSettings) window.dbkSettings.save([seenKey()]); } catch (e) {} }\n\n  /* ---- the cards: only what the app really does ---- */\n  function pageOn(mod, key) {\n    var M = window.dbkModule;\n    if (!M) return !!(MODS[mod] && MODS[mod].enabled);\n    if (mod === 'work') return M.workOn();\n    var ok = mod === 'habits' ? M.forPerson('habits', M.me()) : M.on(mod);\n    return ok && !M.archived(key);\n  }\n  // each card: a line about the page (p) and a few short steps for the things that aren't obvious at first (s)\n  // a part of a page that's put away in Settings > What shows (a Today section, or a part of another page)\n  function partOff(key) { var M = window.dbkModule; return !!(M && M.archived && M.archived(key)); }\n  function todayOff(k) { try { var f = JSON.parse(localStorage.getItem('dashboardFeatures') || '{}') || {}; return f[k] === false; } catch (e) { return false; } }\n  function manyBiz() { try { var w = JSON.parse(localStorage.getItem('wr:data') || '{}') || {}; return (Array.isArray(w.businesses) ? w.businesses : []).filter(function (b) { return b && b.name && b.name !== 'My Business'; }).length > 1; } catch (e) { return false; } }\n  function joinAnd(a) { return a.length < 2 ? a.join('') : a.slice(0, -1).join(', ') + ' and ' + a[a.length - 1]; }\n  function cards() {\n    var bank = !!(MODS.finance && MODS.finance.bankSync === 'simplefin');\n    var lists = pageOn('us', 'page:us'), travel = pageOn('travel', 'page:us'), work = pageOn('work', 'page:work');\n    // only what's on (overnight audit, Oct 24: the cards named Today's Three, the weather or a Budget tab that were off)\n    var three = !todayOff('three'), rems = !todayOff('reminders'), cal = !todayOff('calendar');\n    var wx = !todayOff('weather') && !document.documentElement.classList.contains('dbk-no-wx'), moon = !todayOff('moon');\n    var tParts = (three ? ['Today’s Three', 'the Back Burner for later'] : []).concat(rems ? ['your reminders'] : [], cal ? ['the calendar'] : []);\n    var all = [\n      { t: 'Today', p: [tParts.length ? 'Each day starts here: ' + joinAnd(tParts) + '.' : 'Each day starts here.'],\n        s: (three ? ['Tap a line of Today’s Three to write in it, and tick it when it’s done.',\n            'The arrow beside a Back Burner item moves it up into Today’s Three.'] : [])\n          .concat(cal ? ['Swipe the calendar sideways for the next or previous week or month.'] : [],\n            wx || moon ? ['Tap ' + (wx && moon ? 'the weather or the moon for more about them.' : wx ? 'the weather for more about it.' : 'the moon for more about it.')] : [],\n            work && (rems || cal) ? ['When you add an event or a reminder, Personal or Work says where it belongs.'] : []) },\n      { t: 'Capture and Inbox', p: ['Type anything in the bar at the bottom of any page and press return. It waits in the Inbox until you send it where it belongs.'],\n        s: ['Typing there also searches the app.',\n            'In the Inbox, tap a note, then Send to: the calendar, a reminder or a list.',\n            'On a phone, swipe a note to the left to delete it.'] }\n    ];\n    var mid = [];\n    var board = !partOff('habits:board'), routine = !partOff('habits:routine'), chal = !partOff('us:challenges'), wk = !partOff('habits:workouts');\n    var hParts = (board ? ['your Habits Bingo board'] : []).concat(routine ? ['your routine for the day'] : [], wk ? ['your workouts'] : [], chal ? ['a monthly challenge'] : []);\n    if (pageOn('habits', 'page:habits')) mid.push({ t: 'Habits', p: [hParts.length ? 'Habits holds ' + joinAnd(hParts) + '.' : 'Habits holds your habits.'],\n      s: (board ? ['Tap a square on the board when you’ve done that habit.', 'Edit Habits changes what’s on the board.'] : [])\n        .concat(routine ? ['Up next shows the next step of your routine; Done moves you on.'] : [], wk ? ['Workouts: make a plan or paste one in, then log each set. Only you see yours.'] : [], board ? ['History shows the weeks and months behind you.'] : []) });\n    var mTabs = [['recipes', 'Recipes'], ['grocery', 'Grocery'], ['journal', 'Journal']].filter(function (x) { return !partOff('meals:' + x[0]); }).map(function (x) { return x[1]; });\n    var groc = !partOff('meals:grocery');\n    if (pageOn('meals', 'page:meals')) mid.push({ t: 'Meals', p: ['Meals plans the week’s dinners' + (groc && !partOff('meals:recipes') ? ', keeps your recipes and makes the grocery list from the plan.' : groc ? ' and makes the grocery list from the plan.' : !partOff('meals:recipes') ? ' and keeps your recipes.' : '.')],\n      s: ['Tap tonight’s dinner to see Tonight’s plan: when to start, and the steps in order.',\n          'Tap another night in the week to plan its dinner, swap it or remove it.']\n        .concat(groc ? ['+ Ingredients to list puts the week’s ingredients on the grocery list.'] : [],\n          mTabs.length ? [joinAnd(mTabs) + (mTabs.length > 1 ? ' are the tabs' : ' is the tab') + ' at the top.'] : []) });\n    var lParts = [['us:restaurants', 'restaurants'], ['us:places', 'places to go'], ['us:wishlists', 'wishlists'], ['us:travel', 'trips'], ['us:shows-movies', 'shows'], ['us:reading', 'books']]\n      .filter(function (x) { return !partOff(x[0]) && (x[0] !== 'us:travel' || travel); }).map(function (x) { return x[1]; });\n    if (lists) mid.push({ t: 'Lists', p: [lParts.length ? 'Lists keeps ' + joinAnd(lParts) + ' in one place.' : 'Lists keeps the lists you make in one place.'],\n      s: ['Tap a list to open it; type in its box and press return to add something.',\n          'Tap anything on a list to see its details.',\n          'At the end of a list, Pin keeps it first on the Lists page.',\n          '+ New list makes a list of your own; you can rename or delete it from its end.'] });\n    else if (travel) mid.push({ t: 'Travel', p: ['Travel plans each trip day by day and keeps the places you’ve been.'], s: [] });\n    var budget = !partOff('money:budget'), accts = !partOff('money:accounts'), bills = !partOff('money:bills'), spend = !partOff('money:spending');\n    var moTabs = ['Month'].concat(budget ? ['Budget'] : [], accts ? ['Accounts'] : [], bills ? ['Bills'] : []);\n    var moParts = (accts ? ['accounts'] : []).concat(budget ? ['budget'] : [], bills ? ['bills'] : [], spend ? ['spending'] : []);\n    if (pageOn('finance', 'page:finance')) mid.push({ t: 'Money', p: ['Money shows your ' + (moParts.length ? joinAnd(moParts) : 'money') + '. Add things by hand' + (bank ? ', import a file from your bank, or connect your bank through SimpleFIN.' : ' or import a file from your bank.')],\n      s: [(moTabs.length > 1 ? joinAnd(moTabs) + ' are the tabs at the top. ' : '') + 'On Month, tap a day to see what went in and out.',\n          'Tap a payment to change its category. Every payment from that place can follow.']\n        .concat(budget ? ['On Budget, Sort them files the places still in Other.'] : [], accts ? ['Tap an account, card or loan for its details; Edit is at the bottom.'] : []) });\n    var w3 = !partOff('work:three'), spark = !partOff('work:sparkfile'), home = !partOff('work:homebase');\n    if (work) mid.push({ t: 'Work', p: ['Work has its own day: ' + joinAnd(['work events and reminders'].concat(w3 ? ['Work’s Three'] : [], !partOff('work:content') ? ['the posts going out'] : [])) + '.'],\n      s: (home ? [manyBiz() ? 'Tap a business’s name for its Home Base: everything about that business in one place.' : 'Tap the business name for Home Base: everything about the business in one place.'] : [])\n        .concat(w3 ? ['Work’s Three is for the day’s three work things.'] : [], spark ? ['The Spark File keeps business ideas until you’re ready for them.'] : [],\n          ['On Today, an event or reminder can be marked Work.']) });\n    var end = { t: 'Settings', p: ['Settings is where you change how the app looks, what shows on each page and notifications.'],\n      s: ['Tap the page’s name at the top to go to another page. The calendar at the top left brings you back to Today.',\n          'The gear at the top right opens Settings. On Meals and Work it goes straight to that page’s settings.',\n          'Deleted something by mistake? Recently removed keeps it for 5 days.',\n          'Under Help you can open this again, find answers and reach us.'] };\n    return all.concat(mid, [end]);\n  }\n\n  /* ---- the look: the theme's own pop-up card, its buttons and its title ---- */\n  var css = document.createElement('style');\n  css.textContent =\n    'html[data-dbk] .dbk-wl-card { text-align: center; }' +\n    'html[data-dbk]:not(#z):not(#y):not(#x) .dbk-wl-card { max-width: 440px !important; }' +\n    // every card's title and words sit in the same spot, so the pop-up is as tall as the longest card and never\n    // changes size or moves as you step through; each card's words sit in the middle of that space, up and down and side\n    // to side (Kasey, Oct 25: \"centered from every direction\"; the gap and line under the title are gone)\n    'html[data-dbk] :is(.dbk-wl-heads, .dbk-wl-deck) { display: grid; }' +\n    'html[data-dbk] :is(.dbk-wl-heads, .dbk-wl-deck) > * { grid-area: 1 / 1; visibility: hidden; }' +\n    'html[data-dbk] :is(.dbk-wl-heads, .dbk-wl-deck) > .on { visibility: visible; }' +\n    'html[data-dbk] .dbk-wl-deck > * { align-self: center; justify-self: center; }' +\n    'html[data-dbk] .dbk-wl-heads { margin: 0 0 12px; padding: 0; border: 0; }' +\n    'html[data-dbk]:not(#z):not(#y):not(#x) .dbk-wl-heads .dbk-info-title { margin: 0 !important; align-self: center; }' +\n    'html[data-dbk] .dbk-wl-p { margin: 0 0 10px; font-size: 17px; line-height: 1.5; text-wrap: balance; }' +\n    'html[data-dbk] .dbk-wl-p:last-child { margin-bottom: 0; }' +\n    // the steps: a short list under the page's line, left-aligned like every list in a pop-up, a soft dot before each\n    \"html[data-dbk] .dbk-wl-steps { list-style: none; width: fit-content; max-width: 100%; margin: 14px auto 0; padding: 0; text-align: left; }\" +\n    \"html[data-dbk] .dbk-wl-steps li { position: relative; margin: 0 0 9px; padding-left: 18px; font-size: 16px; line-height: 1.45; text-wrap: pretty; }\" +\n    \"html[data-dbk] .dbk-wl-steps li:last-child { margin-bottom: 0; }\" +\n    \"html[data-dbk] .dbk-wl-steps li::before { content: ''; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .5; }\" +\n    'html[data-dbk] .dbk-wl-n { margin: 18px 0 0; font-style: italic; font-size: 14px; opacity: .75; }' +\n    'html[data-dbk] .dbk-wl-acts { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 12px; }' +\n    'html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wl-acts :is(.dbk-obtn, .dbk-fbtn) { min-width: 120px; }' +\n    // the theme colors every button in a dark pop-up green; the filled one keeps dark words on its green\n    'html[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wl-card .dbk-fbtn { color: #0c1118 !important; }' +\n    '@media (max-width: 600px) { html[data-dbk] .dbk-wl-acts { flex-direction: column-reverse; gap: 10px; } }';\n  (document.head || document.documentElement).appendChild(css);\n\n  /* ---- the pop-up ---- */\n  var pop = null, at = 0, list = [], back = null;\n  function esc(s) { return String(s).replace(/[&<>\"']/g, function (c) { return { '&': '&amp;', '<': '&lt;', '>': '&gt;', '\"': '&quot;', \"'\": '&#39;' }[c]; }); }\n  function show(i) {\n    at = Math.max(0, Math.min(list.length - 1, i));\n    [].forEach.call(pop.querySelectorAll('.dbk-wl-heads > *, .dbk-wl-deck > *'), function (s) { var k = +s.getAttribute('data-k'); s.classList.toggle('on', k === at); s.setAttribute('aria-hidden', k === at ? 'false' : 'true'); });\n    var last = at === list.length - 1;\n    pop.querySelector('[data-wl=\"back\"]').textContent = at === 0 ? 'Skip' : 'Back';\n    pop.querySelector('[data-wl=\"next\"]').textContent = last ? 'Done' : 'Next';\n    pop.querySelector('.dbk-wl-n').textContent = (at + 1) + ' of ' + list.length;\n    pop.querySelector('[role=\"dialog\"]').setAttribute('aria-labelledby', 'dbkWlT' + at);\n  }\n  // seen only once it's finished, skipped or closed: if something interrupts it (an update reloading the app),\n  // it comes back the next time Today opens\n  function close() {\n    if (!pop) return;\n    markSeen();\n    pop.remove(); pop = null;\n    document.removeEventListener('keydown', onKey);\n    if (back) { try { back.focus({ preventScroll: true }); } catch (e) {} back = null; }\n  }\n  function onKey(e) {\n    if (!pop) return;\n    if (e.key === 'Escape') { close(); return; }\n    if (e.target && e.target.closest && e.target.closest('input, textarea, select')) return;\n    if (e.key === 'ArrowRight') { if (at < list.length - 1) show(at + 1); }\n    else if (e.key === 'ArrowLeft') { if (at > 0) show(at - 1); }\n  }\n  function open(opts) {\n    opts = opts || {};\n    if (pop) return;\n    list = cards(); at = 0;\n    back = opts.returnFocus || null;\n    var o = document.createElement('div'); o.className = 'dbk-infopop dbk-centerpop dbk-wl';\n    o.style.cssText = 'position:fixed;inset:0;z-index:99999;display:flex;justify-content:center;';\n    o.innerHTML = '<div class=\"dbk-infocard dbk-wl-card\" role=\"dialog\" aria-modal=\"true\" aria-labelledby=\"dbkWlT0\"><button type=\"button\" class=\"dbk-info-x\" aria-label=\"Close\">&times;</button>' +\n      '<div class=\"dbk-wl-heads\">' + list.map(function (c, k) { return '<h2 class=\"dbk-info-title\" id=\"dbkWlT' + k + '\" data-k=\"' + k + '\">' + esc(c.t) + '</h2>'; }).join('') + '</div>' +\n      '<div class=\"dbk-wl-deck\">' + list.map(function (c, k) {\n        return '<div class=\"dbk-wl-slide\" data-k=\"' + k + '\">' + c.p.map(function (p) { return '<p class=\"dbk-wl-p\">' + esc(p) + '</p>'; }).join('') +\n          (c.s && c.s.length ? '<ul class=\"dbk-wl-steps\">' + c.s.map(function (x) { return '<li>' + esc(x) + '</li>'; }).join('') + '</ul>' : '') + '</div>';\n      }).join('') + '</div>' +\n      '<p class=\"dbk-wl-n\" aria-live=\"polite\"></p>' +\n      '<div class=\"dbk-wl-acts\"><button type=\"button\" class=\"dbk-obtn\" data-wl=\"back\">Skip</button><button type=\"button\" class=\"dbk-fbtn\" data-wl=\"next\">Next</button></div></div>';\n    pop = o;\n    show(0);\n    o.addEventListener('click', function (e) {\n      if (e.target === o || e.target.closest('.dbk-info-x')) { close(); return; }\n      var b = e.target.closest('[data-wl]'); if (!b) return;\n      if (b.getAttribute('data-wl') === 'next') { if (at === list.length - 1) close(); else show(at + 1); }\n      else { if (at === 0) close(); else show(at - 1); }\n    });\n    document.addEventListener('keydown', onKey);\n    document.body.appendChild(o);\n    var x = o.querySelector('.dbk-info-x'); try { if (window.dbkQuietFocus) window.dbkQuietFocus(x); else x.focus({ preventScroll: true }); } catch (e) {}\n  }\n  window.dbkWelcome = { open: open, seen: seen, cards: cards };\n\n  /* ---- once, on Today, the first time this person opens the app ---- */\n  if (page !== 'index.html') return;\n  function hasCloud() {\n    try { var ent = window.HEARTH_ENTITLEMENTS || {}; return !!localStorage.getItem('firebaseConfig') || !!(ent.firebaseConfig && ent.firebaseConfig.apiKey); } catch (e) { return false; }\n  }\n  function setUp() { try { return !!localStorage.getItem('htSetupComplete') || hasCloud(); } catch (e) { return false; } }\n  function onScreen() {\n    if (document.documentElement.classList.contains('dbk-loading') || document.visibilityState === 'hidden') return false;\n    try { if (window.parent !== window && window.frameElement && !window.frameElement.classList.contains('on')) return false; } catch (e) {}\n    return true;\n  }\n  function busy() {\n    // another pop-up, the Inbox or the app's lock screen is up: wait for it\n    if (document.documentElement.classList.contains('dbk-pop-on')) return true;\n    var ps = document.getElementById('passwordScreen'); if (ps && ps.offsetParent !== null && getComputedStyle(ps).display !== 'none') return true;\n    var ib = document.getElementById('inboxOverlay'); if (ib && ib.classList.contains('visible')) return true;\n    // a login that isn't in the household yet (the partner, before entering the invite code): the code box comes first\n    if (document.getElementById('dbkRoleHelp')) return true;\n    if (hasCloud()) { try { if (!localStorage.getItem('dbkRoleUid')) return true; } catch (e) {} }\n    return false;\n  }\n  var cloudChecked = !hasCloud(), tries = 0, timer = null;\n  window.addEventListener('firebaseReady', function () { setTimeout(function () { cloudChecked = true; }, 1200); });\n  function tryShow() {\n    clearTimeout(timer);\n    if (pop || seen() || !setUp()) return;\n    if (hasCloud() && (!cloudChecked || !window.firebaseUser)) { if (++tries < 40) timer = setTimeout(tryShow, 500); return; }   // signed in first\n    if (!onScreen() || busy()) { if (++tries < 40) timer = setTimeout(tryShow, 500); return; }\n    open();\n  }\n  window.addEventListener('dbk-show', function () { tries = 0; timer = setTimeout(tryShow, 700); });\n  function start() { timer = setTimeout(tryShow, 900); }\n  if (document.readyState === 'complete') start(); else window.addEventListener('load', start);\n})();\n","shared.css":"/* 2daysbook — shared tokens, loaded on every page before daybook-theme.css.\n\n   FONTS: two choices, used everywhere.\n     --font-title  the display face: page titles, the greeting, the app name\n     --font-body   everything you read and type\n   The small-caps face used for headings, the menu and buttons is the title font's small-caps\n   companion; a template can point it at any family.\n\n   COLORS: the old per-phone color engine is gone. These are the base values every page starts from;\n   daybook-theme.css (the look you see) sets the real palette on top of them. */\n\n:root {\n  --font-title: 'Playfair Display', 'Iowan Old Style', Georgia, serif;\n  --font-title-caps: 'Playfair Display SC', 'Iowan Old Style', Georgia, serif;\n  --font-body: 'Lora', 'Iowan Old Style', Georgia, serif;\n}\n\nhtml {\n  --lh-accent: #d4919e;\n  --lh-accent-hover: #d99eaa;\n  --lh-accent-muted: rgba(212,145,158,0.2);\n  --lh-accent-border: rgba(212,145,158,0.3);\n  --lh-accent-text: rgba(212,145,158,0.6);\n  --lh-accent-rgb: 212,145,158;\n  --lh-bg: #2b2220;\n  --lh-bg-darker: #1e1816;\n  --lh-bg-rgb: 43,34,32;\n  --lh-secondary: #b0607a;\n  --lh-secondary-muted: rgba(176,96,122,0.15);\n  --lh-secondary-border: rgba(176,96,122,0.3);\n  --lh-secondary-rgb: 176,96,122;\n  --lh-text: #e0d2d0;\n  --lh-text-muted: rgba(var(--lh-text-rgb),0.6);\n  --lh-text-faint: rgba(var(--lh-text-rgb),0.4);\n  --lh-text-rgb: 224,210,208;\n  --lh-font: var(--font-body);\n  --lh-heading-font: var(--font-title);\n  --lh-nav-font: var(--font-title-caps);\n  --lh-nav-heading-font: var(--font-title-caps);\n  --lh-font-size: 16px;\n  font-size: 16px;\n  background: #2b2220;\n}\n\n/* The meal planner's own set: each person's color, the meal-slot colors, and the larger base size it was built at */\nhtml[data-dbk-page=\"meal-plan\"] {\n  --lh-accent-muted: rgba(212,145,158,0.25);\n  --lh-accent-border: rgba(212,145,158,0.35);\n  --lh-accent-text: rgba(212,145,158,0.65);\n  --lh-accent-on-text: #1a1412;\n  --lh-secondary-muted: rgba(176,96,122,0.18);\n  --lh-secondary-border: rgba(176,96,122,0.35);\n  --lh-secondary-dim: rgba(176,96,122,0.65);\n  --lh-secondary-on-text: #1a1412;\n  --lh-person1: #b0607a;\n  --lh-person1-rgb: 176,96,122;\n  --lh-person2: #d4919e;\n  --lh-person2-rgb: 212,145,158;\n  --lh-text-alpha-boost: 0.000;\n  --lh-font-size: 18px;\n  --slot-lunch: #b0607a;\n  --slot-lunch-rgb: 176,96,122;\n  --slot-lunch-on-text: #1a1412;\n  --slot-dinner: #d4919e;\n  --slot-dinner-rgb: 212,145,158;\n  --slot-dinner-on-text: #1a1412;\n  --slot-dessert: #c2798c;\n  --slot-dessert-rgb: 194,121,140;\n  --slot-dessert-on-text: #1a1412;\n  --slot-snack: #d4919e;\n  --slot-snack-rgb: 212,145,158;\n  --slot-snack-on-text: #1a1412;\n  --lh-warm-amber: #b0607a;\n  --muted-sage: #d4919e;\n  --warning-amber: #c9a84c;\n  --card-bg: #1e1816;\n  --border-color: rgba(212,145,158,0.25);\n  --card-shadow: none;\n  --lh-is-light: 0;\n  font-size: 18px;\n}\n\n/* The menu bar every page starts with: fixed to the top, one row. daybook-theme.css fills it and sets the look;\n   the links inside are drawn by daybook-theme.js. */\nnav.top-nav { position: fixed; top: 0; left: 0; right: 0; z-index: 9999; background: var(--lh-bg-darker); border-bottom: 1px solid var(--lh-accent-border, rgba(var(--lh-accent-rgb),0.2)); padding: 0 24px; height: auto; font-family: var(--lh-nav-font, var(--lh-font, Georgia, serif)); }\n@supports (padding-top: var(--dbk-safe-top, env(safe-area-inset-top))) { nav.top-nav { padding-top: var(--dbk-safe-top, env(safe-area-inset-top)); } }\nnav.top-nav .nav-container { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: auto 1fr auto; align-items: center; height: 64px; background: transparent; border: none; padding: 0; gap: 0; }\nnav.top-nav .nav-links { display: flex; gap: 28px; align-items: center; justify-content: center; height: 64px; }\nnav.top-nav .nav-link { color: var(--lh-text-muted, rgba(var(--lh-text-rgb),0.6)); text-decoration: none; font-size: .88rem; font-weight: 500; white-space: nowrap; transition: color .2s; display: inline-flex; align-items: center; height: 64px; min-height: auto; background: none; border: none; padding: 0; }\nnav.top-nav .nav-link:hover { color: var(--lh-text); }\nnav.top-nav .nav-link.active { color: var(--lh-accent); }\n@media (max-width: 768px) {\n  nav.top-nav { padding: 0; }\n  nav.top-nav .nav-container { height: 64px; max-width: 100%; width: 100%; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; margin: 0; box-sizing: border-box; grid-template-columns: none; }\n}\n","daybook-theme.css":"/* filled things (top bar, ticked boxes, filled buttons) in light looks: their own deep shade, separate from text */\nhtml[data-dbk=\"p1\"] { --dbk-fill: #2f3a2c; }\n/* ═══════════════════════════════════════════════════════════════\n   DAYBOOK THEME · Florist\n   p1 = Person 1: dusty pink paper, deep green, Playfair Display italic titles, folk flower\n   p2 = Person 2: stone paper, deep green, inked capitals for titles, fern\n   Loaded last on every page so it wins over the older settings engine.\n   ═══════════════════════════════════════════════════════════════ */\n\nhtml[data-dbk] {\n  --dbk-green: #2f3a2c;\n  --dbk-green-rgb: 47,58,44;\n  --dbk-sage: #b9bfa0;\n  --dbk-cream: #f3eee4;\n  --dbk-clay: #a5502f;\n  --dbk-script: var(--font-title);\n  --dbk-caps: var(--font-title-caps);\n  --dbk-serif: var(--font-body);\n  --dbk-sans: var(--font-body);\n\n  --lh-accent: var(--dbk-green) !important;\n  --lh-accent-hover: #46553f !important;\n  --lh-accent-rgb: 47,58,44 !important;\n  --lh-accent-muted: rgba(47,58,44,0.12) !important;\n  --lh-accent-border: rgba(47,58,44,0.28) !important;\n  --lh-accent-text: rgba(47,58,44,0.7) !important;\n  --lh-accent-on-text: var(--dbk-cream) !important;\n  --lh-secondary: var(--dbk-clay) !important;\n  --lh-secondary-rgb: 165,80,47 !important;\n  --lh-secondary-muted: rgba(165,80,47,0.12) !important;\n  --lh-secondary-border: rgba(165,80,47,0.3) !important;\n  --lh-secondary-on-text: var(--dbk-cream) !important;\n  --lh-text: var(--dbk-green) !important;\n  --lh-text-rgb: 47,58,44 !important;\n  --lh-text-muted: rgba(47,58,44,0.68) !important;\n  --lh-text-faint: rgba(47,58,44,0.48) !important;\n  --lh-text-alpha-boost: 0.15 !important;\n  --lh-bg-darker: var(--dbk-cream) !important;\n  --lh-font: var(--dbk-serif) !important;\n  --lh-nav-font: var(--dbk-caps) !important;\n  --lh-nav-heading-font: var(--dbk-caps) !important;\n  --lh-pink: var(--dbk-clay) !important;\n  --lh-person1: #8f5a6b !important;\n  --lh-person2: var(--dbk-green) !important;\n  color-scheme: light;\n}\nhtml[data-dbk=\"p1\"] {\n  --dbk-paper: #ebe5d7;\n  --dbk-paper-rgb: 235,229,215;\n  --dbk-title: var(--dbk-script);\n  --lh-bg: #ebe5d7 !important;\n  --lh-bg-rgb: 235,229,215 !important;\n  --lh-heading-font: var(--dbk-caps) !important;\n  --lh-secondary: #9b5a62 !important;\n  --lh-secondary-rgb: 155,90,98 !important;\n  --lh-secondary-muted: rgba(155,90,98,0.12) !important;\n  --lh-secondary-border: rgba(155,90,98,0.3) !important;\n  --lh-pink: #9b5a62 !important;\n}\nhtml[data-dbk=\"p2\"] {\n  --dbk-paper: #e3dccd;\n  --dbk-paper-rgb: 227,220,205;\n  --dbk-title: var(--dbk-caps);\n  --lh-bg: #e3dccd !important;\n  --lh-bg-rgb: 227,220,205 !important;\n  --lh-heading-font: var(--dbk-caps) !important;\n}\n\nhtml[data-dbk], html[data-dbk] body { background: var(--dbk-paper) !important; color: var(--dbk-green); }\nhtml[data-dbk] body { font-family: var(--dbk-serif) !important; font-weight: 400 !important; position: relative; }\nhtml[data-dbk] body::after { content: \"\"; position: fixed; inset: 0; pointer-events: none; z-index: 2147483000; opacity: 0.18; mix-blend-mode: multiply;\n  background-image: url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5  0 0 0 0 0.45  0 0 0 0 0.4  0 0 0 0.55 0'/></filter><rect width='160' height='160' filter='url(%23n)'/></svg>\"); }\n/* ── Titles ── */\n/* Script is kept for the few big page titles; everything else uses inked capitals */\n\nhtml[data-dbk] h1, html[data-dbk] .page-title, html[data-dbk] .main-title, html[data-dbk] .home-greeting, html[data-dbk] .home-names {\n  font-family: var(--dbk-caps) !important; font-weight: 400 !important; color: var(--dbk-green) !important; letter-spacing: 0.04em !important; }\nhtml[data-dbk=\"p1\"] :is(h1.page-title, .page-title, .home-greeting, .home-names) {\n  font-family: var(--dbk-script) !important; letter-spacing: 0 !important; }\nhtml[data-dbk=\"p1\"] :is(h1.page-title, .page-title) { font-size: 3rem !important; line-height: 1.05 !important; }\nhtml[data-dbk=\"p1\"] .home-greeting { font-size: 2.6rem !important; line-height: 1 !important; }\nhtml[data-dbk=\"p1\"] .home-names { font-size: 2rem !important; }\nhtml[data-dbk] .main-title { font-size: 1.6rem !important; }\nhtml[data-dbk] h2, html[data-dbk] h3, html[data-dbk] h4, html[data-dbk] h5,\nhtml[data-dbk] .section-title, html[data-dbk] .landing-section-title, html[data-dbk] .history-section-title,\nhtml[data-dbk] .wr-card-title, html[data-dbk] .settings-section .section-title {\n  font-family: var(--dbk-caps) !important; font-weight: 400 !important; letter-spacing: 0.08em; text-transform: none !important; color: var(--dbk-green) !important; }\n/* ── Top nav: deep green band ── */\n\nhtml[data-dbk] nav.top-nav { background: var(--dbk-fill, var(--dbk-green)) !important; border-bottom: none !important; overflow: hidden !important; }\n\nhtml[data-dbk] nav.top-nav .nav-link { color: rgba(243,238,228,0.78) !important; font-family: var(--dbk-caps) !important; font-size: 0.95rem !important; letter-spacing: 0.05em !important; position: relative; z-index: 2; }\nhtml[data-dbk] nav.top-nav .nav-link.active, html[data-dbk] nav.top-nav .nav-link:hover { color: var(--dbk-cream) !important; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }\n\nhtml[data-dbk] .dbk-ornament { position: absolute; z-index: 1; pointer-events: none; opacity: 0.9; }\nhtml[data-dbk] .dbk-ornament svg { width: 100%; height: 100%; }\n/* mobile menu */\n\n/* ── Buttons ── */\n\nhtml[data-dbk] button, html[data-dbk] .btn, html[data-dbk] .wr-btn { font-family: var(--dbk-caps) !important; letter-spacing: 0.05em; }\nhtml[data-dbk] .btn-primary, html[data-dbk] .wr-btn-primary, html[data-dbk] .btn:not(.btn-secondary):not(.btn-ghost) { border-radius: 4px !important; }\n/* ── Inputs ── */\n\nhtml[data-dbk] input, html[data-dbk] textarea, html[data-dbk] select { font-family: var(--dbk-serif) !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] input::placeholder, html[data-dbk] textarea::placeholder { color: rgba(47,58,44,0.45) !important; font-style: normal !important; }\n/* ── Footer ── */\n\n\n/* ── Password / sign-in screens ── */\n\nhtml[data-dbk] .lh-password-screen { background: var(--dbk-paper) !important; }\n\n@media (prefers-reduced-motion: reduce) { html[data-dbk] * { transition: none !important; } }\n/* ── Page-specific titles ── */\n\nhtml[data-dbk] :is(button, .btn):not([class*=\"dot\"]):not([class*=\"circle\"]) { box-shadow: none !important; }\nhtml[data-dbk] :is(.current-reminder, .action-tab, .week-day, .week-cal, #plan-first-run, .today-journal-input, .brain-dump) { box-shadow: none !important; border-radius: 6px !important; background-image: none !important; }\nhtml[data-dbk] input:not([type=\"checkbox\"]):not([type=\"radio\"]):not([type=\"range\"]), html[data-dbk] textarea, html[data-dbk] select { border-radius: 4px !important; }\nhtml[data-dbk] .home-widget-pill { border-radius: 6px !important; }\n/* Colors and fonts now come from the 2daysbook theme, so the old color pickers are hidden */\n\nhtml[data-dbk] #sec-appearance,\nhtml[data-dbk] a[href*=\"sec-appearance\"],\nhtml[data-dbk] [onclick*=\"sec-appearance\"],\nhtml[data-dbk] [onclick*=\"openPageThemePopup\"],\nhtml[data-dbk] [onclick*=\"openHubThemePopup\"],\nhtml[data-dbk] #hubThemePopup { display: none !important; }\n\n/* ═══════════════════════════════════════════════════════════════\n   STRUCTURE · header band, full-width color bands, ruled lists\n   ═══════════════════════════════════════════════════════════════ */\n\nhtml[data-dbk] .dbk-ornament { display: none !important; }\n/* Menu row: plain links on the green band, no logo (the title below is the logo) */\n\nhtml.dbk-has-hero nav.top-nav { height: 52px !important; }\nhtml.dbk-has-hero nav.top-nav .nav-container { height: 52px !important; grid-template-columns: 1fr auto !important; }\n\nhtml.dbk-has-hero nav.top-nav .nav-links { display: flex !important; justify-content: flex-start !important; gap: 22px !important; height: 52px !important; }\nhtml.dbk-has-hero nav.top-nav .nav-link { height: 52px !important; }\n\n@media (max-width: 768px) {\n  html.dbk-has-hero nav.top-nav .nav-container { padding: 0 14px 0 18px !important; display: flex !important; }\n  html.dbk-has-hero nav.top-nav .nav-links { gap: 14px !important; overflow: hidden; }\n  html.dbk-has-hero nav.top-nav .nav-link { font-size: 0.82rem !important; }\n\n}\n/* Title band */\n\nhtml[data-dbk] .dbk-hero { position: relative; overflow: hidden; background: var(--dbk-fill, var(--dbk-green)); color: var(--dbk-cream); margin-top: 52px; padding: 18px 22px 20px; min-height: 92px; display: flex; align-items: flex-end; }\nhtml[data-dbk] .dbk-hero-text { position: relative; z-index: 1; max-width: 1100px; width: 100%; margin: 0 auto; }\nhtml[data-dbk] .dbk-title { line-height: 0.95; color: var(--dbk-cream); }\nhtml[data-dbk=\"p1\"] .dbk-title { font-family: var(--dbk-script); font-size: 4.4rem; }\nhtml[data-dbk=\"p2\"] .dbk-title { font-family: var(--dbk-caps); font-size: 3rem; letter-spacing: 0.06em; }\nhtml[data-dbk] .dbk-sub { font-family: var(--dbk-caps); font-size: 0.95rem; letter-spacing: 0.1em; color: rgba(243,238,228,0.75); margin-top: 6px; }\nhtml.dbk-has-hero .container { padding-top: 0 !important; margin-top: 0 !important; }\n/* Full-width band helper: paints a color edge to edge behind a centered block */\n\nhtml[data-dbk] .dbk-band { position: relative; }\nhtml[data-dbk] .dbk-band::before { content: \"\"; position: absolute; top: 0; bottom: 0; left: -100vmax; right: -100vmax; background: var(--band); z-index: -1; }\nhtml[data-dbk] .dbk-rule-top { border-top: 1px solid rgba(47,58,44,0.18) !important; }\n/* Quiet the old sparkles and dividers */\n\nhtml[data-dbk] .page-nav-footer-divider, html[data-dbk] .wr-section-divider { display: none !important; }\n\nhtml[data-dbk] .dbk-h { font-family: var(--dbk-caps); font-size: 1.15rem; letter-spacing: 0.08em; color: var(--dbk-green); margin: 0 0 10px; }\nhtml[data-dbk], html[data-dbk] body { overflow-x: clip !important; }\n\nhtml[data-dbk] .dbk-h { font-family: var(--dbk-caps); font-size: 1.15rem; letter-spacing: 0.08em; color: var(--dbk-green); margin: 0 0 10px; }\nhtml[data-dbk], html[data-dbk] body { overflow-x: clip !important; }\n/* ── HUBS ─────────────────────────────────────────────────────── */\n\nhtml[data-dbk] .dbk-tabs { display: flex; gap: 20px; margin-top: 14px; flex-wrap: wrap; }\nhtml[data-dbk] .dbk-tabs a { font-family: var(--dbk-caps); font-size: 0.95rem; letter-spacing: 0.06em; color: rgba(243,238,228,0.68); text-decoration: none; padding-bottom: 3px; border-bottom: 1px solid transparent; }\nhtml[data-dbk] .dbk-tabs a.on { color: var(--dbk-cream); border-bottom-color: var(--dbk-cream); }\nhtml[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { font-family: var(--dbk-script) !important; font-size: 1.45rem !important; line-height: 1.05 !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { font-family: var(--dbk-caps) !important; }\n\nhtml[data-dbk] .dbk-hero { margin-left: calc(50% - calc(50 * var(--dbk-vw, 1vw))) !important; margin-right: calc(50% - calc(50 * var(--dbk-vw, 1vw))) !important; width: calc(100 * var(--dbk-vw, 1vw)); box-sizing: border-box; }\nhtml[data-dbk] .dbk-tabs { gap: 16px; }\nhtml[data-dbk] .dbk-tabs a { font-size: 0.88rem; }\n\nhtml[data-dbk-page=\"settings\"] .page-header, html[data-dbk-page=\"settings\"] .settings-header { display: none !important; }\n@media (max-width: 768px) { html.dbk-has-hero nav.top-nav .nav-links { gap: 12px !important; } }\nhtml[data-dbk-page=\"settings\"] .container, html[data-dbk-page=\"workroom\"] .container, html[data-dbk-page=\"meal-plan\"] .container { padding-top: 20px !important; }\nhtml[data-dbk-page=\"workroom\"] .brain-dump, html[data-dbk-page=\"workroom\"] .week-cal, html[data-dbk-page=\"meal-plan\"] #plan-first-run { background: none !important; border: none !important; border-bottom: 1px solid rgba(47,58,44,0.18) !important; padding-left: 0 !important; padding-right: 0 !important; }\nhtml[data-dbk-page=\"settings\"] .settings-section { border-radius: 0 !important; border-left: none !important; border-right: none !important; background: none !important; margin: 0 !important; border-top: none !important; }\n/* ═══ HOME ════════════════════════════════════════════════════════\n   Mockup C: green title band, then alternating pink / cream / sage bands.\n   Headings and titles centered; lists stay left inside a centered column. */\n\nhtml[data-dbk] { --dbk-pink: #ead3cf; --dbk-pink-rgb: 234,211,207; }\nhtml[data-dbk=\"p2\"] { --dbk-pink: #e3dccd; }\nhtml[data-dbk-page=\"index\"] { font-size: 17px !important; }\nhtml[data-dbk-page=\"index\"] .container { padding: 0 !important; max-width: none !important; margin: 0 !important; overflow: visible !important; }\n.hm { display: block; color: var(--dbk-green); font-family: var(--dbk-serif); }\n.hm-band { padding: 30px 22px 32px; }\n.hm-band > * { max-width: 560px; margin-left: auto; margin-right: auto; }\n.hm-pink { background: var(--dbk-pink); }\n.hm-cream { background: var(--dbk-cream); }\n.hm-sage { background: var(--dbk-sage); }\n.hm h2, .hm h3 { margin-top: 0; font-weight: 400; }\n.hm-h { font-family: var(--dbk-caps) !important; font-size: 1.35rem !important; letter-spacing: 0.08em !important; text-align: center; color: var(--dbk-green) !important; margin: 0 auto 16px !important; }\n.hm-center { text-align: center; margin-top: 16px; }\n.hm-link { all: unset; cursor: pointer; font-family: var(--dbk-serif); font-size: 0.98rem; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; text-decoration-color: rgba(var(--dbk-green-rgb),0.45); }\n.hm-link:hover { text-decoration-color: var(--dbk-green); }\n.hm-sep { color: var(--lh-text-faint); margin: 0 8px; }\n.hm-btn { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 0.98rem; letter-spacing: 0.05em; color: var(--dbk-green); border: 1px solid rgba(var(--dbk-green-rgb),0.45); padding: 8px 16px; border-radius: 2px; text-align: center; }\n.hm-btn-solid { background: var(--dbk-fill, var(--dbk-green)); color: var(--dbk-cream); border-color: var(--dbk-fill, var(--dbk-green)); }\n.hm-btn:focus-visible, .hm-link:focus-visible { outline: 2px solid var(--lh-secondary); outline-offset: 3px; }\n/* greeting */\n\n.hm-band:first-child { text-align: center; padding-top: 34px; }\n.hm .photo-wrapper { display: flex; justify-content: center; margin: 0 auto 14px !important; }\n.hm .photo-wrapper:not(.hm-has-photo) { display: none; }\n.hm .header-photo-container { width: 76px !important; height: 76px !important; border-radius: 50% !important; border: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; box-shadow: none !important; }\n.hm-greet { line-height: 1.05; margin: 0 auto !important; color: var(--dbk-green); }\nhtml[data-dbk=\"p1\"] .hm-greet { font-family: var(--dbk-script) !important; font-size: 3.3rem; }\nhtml[data-dbk=\"p2\"] .hm-greet { font-family: var(--dbk-caps) !important; font-size: 2.1rem; letter-spacing: 0.04em; }\n.hm-greet span { font: inherit !important; color: inherit !important; letter-spacing: inherit !important; margin: 0 !important; }\n.hm-greet .home-names { display: block; }\n.hm-date { margin-top: 12px; }\n.hm .home-date { font-family: var(--dbk-caps) !important; font-size: 1.12rem !important; letter-spacing: 0.08em; color: var(--lh-secondary) !important; }\n.hm-conds { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; margin-top: 8px; }\n.hm-cond { display: inline-flex; align-items: center; gap: 6px; font-size: 1rem; color: rgba(var(--dbk-green-rgb),0.75); cursor: pointer; }\n.hm-cond-icon { display: inline-flex; width: 17px; height: 17px; }\n.hm-cond-icon svg { width: 17px !important; height: 17px !important; }\n.hm-dim { color: var(--lh-text-faint); font-size: 0.92rem; }\n.hm-intention { margin: 16px auto 0 !important; font-style: italic !important; font-size: 1.08rem !important; color: rgba(var(--dbk-green-rgb),0.75) !important; line-height: 1.5; max-width: 30ch !important; }\n.hm-intention:empty { display: none; }\n/* today's three */\n\n.hm-list { list-style: none; margin: 0 auto !important; padding: 0; display: block !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.25); }\n.hm-thing { display: grid; grid-template-columns: 38px 26px 1fr; align-items: center; padding: 13px 0; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.25); cursor: pointer; }\n.hm-num { font-family: var(--dbk-script); font-style: italic; font-size: 1.3rem; color: var(--lh-secondary); }\n.hm-box { width: 15px !important; height: 15px !important; border: 1.4px solid var(--dbk-fill, var(--dbk-green)) !important; border-radius: 0 !important; background: none !important; display: inline-flex !important; align-items: center; justify-content: center; position: static !important; margin: 0 !important; box-shadow: none !important; }\n.hm-box .thing-check-mark { display: none; color: var(--dbk-cream); font-size: 11px; line-height: 1; }\n.hm-thing.done .hm-box { background: var(--dbk-fill, var(--dbk-green)) !important; }\n.hm-thing.done .hm-box .thing-check-mark { display: inline; }\n.hm .thing-text { font-family: var(--dbk-serif) !important; font-size: 1.15rem !important; color: var(--dbk-green) !important; font-style: normal !important; opacity: 1 !important; text-decoration: none !important; }\n.hm .thing-text.empty { color: rgba(var(--dbk-green-rgb),0.45) !important; }\n.hm-thing.done .thing-text { text-decoration: line-through !important; color: rgba(var(--dbk-green-rgb),0.55) !important; }\n.hm .thing-edit-input { width: 100%; background: none !important; border: none !important; border-bottom: 1px solid var(--dbk-green) !important; border-radius: 0 !important; font-size: 1.15rem !important; padding: 2px 0 !important; outline: none; color: var(--dbk-green) !important; }\n.hm-celeb { text-align: center; padding-top: 12px; font-style: italic; color: rgba(var(--dbk-green-rgb),0.7); }\n/* reminder */\n\n#currentReminder { text-align: center; }\n.hm-rem-title { font-size: 1.3rem; }\n.hm .reminder-title { font: inherit !important; color: var(--dbk-green) !important; }\n.hm-rem-desc { font-size: 1.02rem; color: rgba(var(--dbk-green-rgb),0.72); margin-top: 6px; }\n.hm-rem-desc:empty { display: none; }\n.hm-rem-meta { margin-top: 6px; }\n.hm .reminder-due { font-size: 1rem !important; color: var(--lh-secondary) !important; font-style: normal !important; }\n.hm .reminder-count { font-size: 0.92rem !important; color: var(--lh-text-faint) !important; background: none !important; margin-left: 8px; }\n.hm-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 20px; }\n/* this week */\n\n.hm-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; }\n.hm-events { margin-top: 14px; display: grid; gap: 0; }\n.hm-week-today { display: none; }\n.hm .calendar-full-view { background: none !important; border: none !important; padding: 0 !important; }\n.hm .calendar-full-view.expanded { margin-top: 18px !important; }\n.hm .calendar-full-view div { border-radius: 0 !important; box-shadow: none !important; }\n.hm .calendar-full-view button { border-radius: 2px !important; box-shadow: none !important; font-family: var(--dbk-caps) !important; }\n.hm .calendar-full-view .view-toggle-btn { background: none !important; border: 1px solid rgba(var(--dbk-green-rgb),0.4) !important; color: var(--dbk-green) !important; }\n.hm .calendar-full-view .view-toggle-btn.active { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\n.hm .calendar-title { font-family: var(--dbk-caps) !important; color: var(--dbk-green) !important; }\n.hm .calendar-full-view [class*=\"card\"] { background: rgba(243,238,228,0.5) !important; border: none !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; }\n/* grocery */\n\n.hm .collapsible-content.hm-open { max-height: none !important; overflow: visible !important; opacity: 1 !important; display: block !important; }\n.hm-groc { columns: 2; column-gap: 22px; border-top: 1px solid rgba(var(--dbk-green-rgb),0.25); padding-top: 6px; }\n.hm-groc:empty { display: none; }\n.hm .grocery-item { break-inside: avoid; display: flex !important; align-items: center; gap: 10px; padding: 6px 0 !important; font-size: 1.08rem; background: none !important; border: none !important; }\n.hm .grocery-item input[type=\"checkbox\"] { appearance: none; -webkit-appearance: none; width: 14px; height: 14px; border: 1.3px solid var(--dbk-fill, var(--dbk-green)); border-radius: 0; margin: 0; flex-shrink: 0; background: none; }\n.hm .grocery-item input[type=\"checkbox\"]:checked { background: var(--dbk-fill, var(--dbk-green)); }\n.hm .grocery-item.done span { text-decoration: line-through; color: rgba(var(--dbk-green-rgb),0.5); }\n.hm-add { display: flex; gap: 10px; align-items: center; margin-top: 14px; }\n.hm-add input { flex: 1; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; border-radius: 0 !important; padding: 8px 0 !important; font-size: 1.05rem !important; box-shadow: none !important; color: var(--dbk-green) !important; width: 100%; }\n\n\n/* capture bar */\n\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar { background: var(--dbk-fill, var(--dbk-green)) !important; border-top: none !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"index\"] .capture-bar-input { background: rgba(243,238,228,0.1) !important; border: 1px solid rgba(243,238,228,0.25) !important; color: var(--dbk-cream) !important; border-radius: 2px !important; font-size: 1rem !important; }\nhtml[data-dbk-page=\"index\"] .capture-bar-input::placeholder { color: rgba(243,238,228,0.6) !important; }\nhtml[data-dbk-page=\"index\"] .capture-bar-send { background: var(--dbk-cream) !important; color: var(--dbk-green) !important; border-radius: 2px !important; }\nhtml[data-dbk-page=\"index\"] .capture-inbox-btn { color: var(--dbk-cream) !important; border-color: rgba(243,238,228,0.3) !important; border-radius: 2px !important; font-family: var(--dbk-caps) !important; }\n/* centered titles everywhere */\n\nhtml[data-dbk] .dbk-hero { justify-content: center; text-align: center; padding-bottom: 26px; }\nhtml[data-dbk] .dbk-tabs { justify-content: center; }\nhtml[data-dbk=\"p1\"] .dbk-title { font-size: 5rem; }\nhtml[data-dbk=\"p2\"] .dbk-title { font-size: 3.2rem; }\n\nhtml[data-dbk] .toast, html[data-dbk] .toast-container > *, html[data-dbk] .dbk-notice { border-radius: 2px !important; box-shadow: none !important; background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border: none !important; font-family: var(--dbk-serif) !important; }\n.hm-list, .hm-thing, .hm-events, .hm-ev, .hm-groc, .hm .grocery-item { text-align: left !important; }\n.hm .grocery-item { flex-direction: row !important; justify-content: flex-start !important; }\n.hm .grocery-item span { order: 2; font-size: 1.08rem !important; color: var(--dbk-green) !important; font-family: var(--dbk-serif) !important; }\n.hm .grocery-item input[type=\"checkbox\"] { order: 1; width: 15px !important; height: 15px !important; min-width: 15px !important; min-height: 0 !important; border: 1.4px solid var(--dbk-fill, var(--dbk-green)) !important; border-radius: 0 !important; appearance: none !important; -webkit-appearance: none !important; padding: 0 !important; }\n.hm .grocery-item input[type=\"checkbox\"]:checked { background: var(--dbk-fill, var(--dbk-green)) !important; }\n.hm .grocery-item { align-items: flex-start !important; }\n.hm .grocery-item span { overflow-wrap: anywhere; min-width: 0; }\n.hm .grocery-item input[type=\"checkbox\"] { margin-top: 0.42em !important; }\n/* the pencil at the end of a grocery line, and the box it turns the words into (Oct 26) */\n.hm .grocery-item .dbk-groc-ed { order: 3; flex: none; margin-left: auto; padding: 2px 2px !important; background: none !important; border: 0 !important; color: inherit; opacity: 0.4; cursor: pointer; line-height: 1; min-height: 0 !important; width: auto !important; }\n.hm .grocery-item .dbk-groc-in { order: 2; flex: 1; min-width: 0; font: inherit; font-size: 16px !important; font-family: var(--dbk-serif) !important; color: inherit; background: rgba(255,255,255,0.55); border: 1px solid rgba(47,58,44,0.22); border-radius: 6px; padding: 4px 8px; outline: none; box-shadow: none; }\nhtml[data-dbk=\"p2\"] .hm .grocery-item .dbk-groc-in { background: rgba(255,255,255,0.06); border-color: rgba(230,234,239,0.22); }\n\nhtml[data-dbk-page=\"index\"] .hm { margin-top: 52px; }\n\nhtml[data-dbk]:not([data-dbk-page=\"index\"]) { font-size: 17px !important; }\nhtml[data-dbk]:not([data-dbk-page=\"index\"]) .container { max-width: none !important; padding: 0 !important; margin: 0 !important; overflow: visible !important; }\nhtml[data-dbk] .dbk-sec { padding: 30px max(22px, calc((100% - 560px) / 2)) 32px !important; margin: 0 !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; background-image: none !important; max-width: none !important; width: auto !important; text-align: left; }\nhtml[data-dbk] .dbk-pinkb { --bandc: var(--dbk-pink); }\nhtml[data-dbk] .dbk-creamb { --bandc: var(--dbk-cream); }\nhtml[data-dbk] .dbk-sageb { --bandc: var(--dbk-sage); }\n/* full-width color bands: painted with an outset border image so nothing inside gets clipped\n   (clip-path used to cut off pop-ups like the \"add a resource\" form) */\n\nhtml[data-dbk] .dbk-sec { background: var(--bandc) !important; box-shadow: none !important; clip-path: none !important; border-image: conic-gradient(var(--bandc) 0 0) fill 0 / 0 / 0 100vmax !important; }\nhtml[data-dbk] .dbk-sec :is(h2, .section-title, .main-title, .landing-section-title, .history-section-title, .journal-title, .journal-password-title, .wr-card-title) {\n  font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 1.35rem !important; letter-spacing: 0.08em !important; text-align: center !important; color: var(--dbk-green) !important; margin: 0 0 14px !important; text-transform: none !important; }\nhtml[data-dbk] .dbk-sec :is(.future-hint, .resource-hint, .journal-subtitle, .journal-password-subtitle, .wr-card-subtitle, .section-subtitle) { text-align: center !important; font-style: italic !important; font-size: 1.02rem !important; color: rgba(var(--dbk-green-rgb),0.72) !important; margin: -6px auto 16px !important; }\nhtml[data-dbk]:not([data-dbk-page=\"index\"]) :is(button.btn, .btn, .todo-add-btn, .wr-btn, .edit-routine-btn, .journal-unlock-btn, .journal-prompt-nav-btn) {\n  background: none !important; color: var(--dbk-green) !important; border: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; border-radius: 2px !important; box-shadow: none !important; font-family: var(--dbk-caps) !important; font-size: 0.98rem !important; letter-spacing: 0.05em !important; padding: 8px 16px !important; text-transform: none !important; font-weight: 400 !important; }\nhtml[data-dbk]:not([data-dbk-page=\"index\"]) :is(.wr-btn-primary, .journal-unlock-btn, button[type=\"submit\"].btn) { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border-color: var(--dbk-fill, var(--dbk-green)) !important; }\nhtml[data-dbk] .dbk-sec :is(input[type=\"text\"], input[type=\"url\"], input[type=\"search\"], input:not([type]), textarea, select) {\n  background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; border-radius: 0 !important; box-shadow: none !important; font-size: 1.05rem !important; padding: 8px 0 !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] .dbk-sec textarea { border: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; padding: 10px 12px !important; background: rgba(243,238,228,0.45) !important; line-height: 1.5; }\n/* hub header: tabs centered under the name */\n\nhtml[data-dbk] .dbk-tabs { justify-content: center; }\n/* hubs: up next line */\n\nhtml[data-dbk-page$=\"-hub\"] .schedule-up-next { text-align: center !important; padding: 0 0 14px !important; margin: 0 0 6px !important; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.2) !important; border-radius: 0 !important; box-shadow: none !important; font-size: 1.05rem !important; }\nhtml[data-dbk-page$=\"-hub\"] .schedule-up-next-label { font-family: var(--dbk-caps) !important; color: var(--lh-secondary) !important; font-size: 1rem !important; letter-spacing: 0.08em !important; text-transform: none !important; margin-right: 6px; }\n/* hubs: bingo */\n\nhtml[data-dbk-page$=\"-hub\"] .bingo-grid { gap: 0 !important; border-top: 1px solid var(--dbk-green) !important; border-left: 1px solid var(--dbk-green) !important; background: none !important; padding: 0 !important; border-radius: 0 !important; max-width: 420px; margin: 0 auto !important; }\nhtml[data-dbk-page$=\"-hub\"] .bingo-cell { background: none !important; border: none !important; border-right: 1px solid var(--dbk-green) !important; border-bottom: 1px solid var(--dbk-green) !important; border-radius: 0 !important; box-shadow: none !important; color: var(--dbk-green) !important; font-family: var(--dbk-serif) !important; font-weight: 400 !important; font-size: 1rem !important; line-height: 1.25 !important; aspect-ratio: 1; min-height: 0 !important; margin: 0 !important; transform: none !important; padding: 8px !important; }\nhtml[data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\nhtml[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { font-family: var(--dbk-script) !important; font-size: 1.6rem !important; line-height: 1.05 !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { font-family: var(--dbk-caps) !important; }\nhtml[data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { box-shadow: inset 0 0 0 3px var(--dbk-pink) !important; }\nhtml[data-dbk-page$=\"-hub\"] .controls { display: flex !important; justify-content: center !important; gap: 10px !important; margin: 20px 0 6px !important; flex-wrap: wrap; }\n/* hubs: routine */\n\nhtml[data-dbk-page$=\"-hub\"] .day-nav-wrapper { justify-content: center !important; gap: 18px !important; margin: 0 0 12px !important; }\nhtml[data-dbk-page$=\"-hub\"] .day-nav-label { font-family: var(--dbk-caps) !important; font-size: 1.35rem !important; color: var(--dbk-green) !important; letter-spacing: 0.08em; }\nhtml[data-dbk-page$=\"-hub\"] .day-nav-btn { background: none !important; border: none !important; color: var(--dbk-green) !important; box-shadow: none !important; font-size: 1.2rem !important; }\n/* the arrows sit on the same line as the day; a long day name gets a little smaller instead of wrapping */\nhtml[data-dbk-page$=\"-hub\"]:not(#z) .day-nav-wrapper { display: flex !important; flex-wrap: nowrap !important; align-items: center !important; gap: clamp(4px, calc(2.5 * var(--dbk-vw, 1vw)), 12px) !important; }\nhtml[data-dbk-page$=\"-hub\"]:not(#z) .day-nav-label { white-space: nowrap; flex: none; font-size: clamp(0.75rem, calc(3.9 * var(--dbk-vw, 1vw)), 1.35rem) !important; letter-spacing: 0.03em; }\nhtml[data-dbk-page$=\"-hub\"]:not(#z) .day-nav-btn { flex: none; padding: 6px clamp(2px, calc(1.5 * var(--dbk-vw, 1vw)), 8px) !important; }\nhtml[data-dbk-page$=\"-hub\"] #dailyScheduleContainer { align-items: stretch !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.3); }\nhtml[data-dbk-page$=\"-hub\"] .day-card { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; width: 100% !important; opacity: 1 !important; }\nhtml[data-dbk-page$=\"-hub\"] .day-header { padding: 14px 0 !important; background: none !important; }\nhtml[data-dbk-page$=\"-hub\"] .day-name { font-family: var(--dbk-caps) !important; font-size: 1.15rem !important; color: var(--dbk-green) !important; letter-spacing: 0.05em; font-weight: 400 !important; }\nhtml[data-dbk-page$=\"-hub\"] .edit-routine-btn { display: block !important; margin: 20px auto 0 !important; }\n/* hubs: back burner + todo lists */\n\n/* hubs: resources */\n\nhtml[data-dbk] .add-category-row { display: flex !important; gap: 10px !important; align-items: center !important; margin: 0 0 18px !important; }\nhtml[data-dbk] .add-category-row input { flex: 1; }\nhtml[data-dbk] #resourceCategories > * { background: none !important; border: none !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; }\nhtml[data-dbk] .resource-header { padding: 14px 0 !important; background: none !important; }\nhtml[data-dbk] .resource-name { font-family: var(--dbk-caps) !important; font-size: 1.15rem !important; color: var(--dbk-green) !important; letter-spacing: 0.05em; }\nhtml[data-dbk] .resource-item-title { font-size: 1.08rem !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] .resource-item-note { color: rgba(var(--dbk-green-rgb),0.72) !important; }\nhtml[data-dbk] .event-form { background: var(--dbk-cream) !important; border-radius: 2px !important; box-shadow: none !important; border: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; }\n/* hubs: journal */\n\nhtml[data-dbk] .journal-password-box { background: none !important; border: none !important; box-shadow: none !important; text-align: center; }\nhtml[data-dbk] .journal-pin-digit { width: 40px !important; height: 48px !important; border: none !important; border-bottom: 1.5px solid var(--dbk-green) !important; border-radius: 0 !important; background: none !important; font-size: 1.4rem !important; color: var(--dbk-green) !important; text-align: center; }\nhtml[data-dbk] .journal-pin-wrap { justify-content: center !important; gap: 8px !important; margin: 10px 0 20px !important; }\nhtml[data-dbk] .journal-type-selector { display: flex !important; justify-content: center !important; gap: 20px !important; background: none !important; border: none !important; padding: 0 !important; margin: 0 0 18px !important; }\nhtml[data-dbk] .journal-type-btn { all: unset !important; cursor: pointer !important; font-family: var(--dbk-caps) !important; font-size: 1.05rem !important; color: rgba(var(--dbk-green-rgb),0.6) !important; padding-bottom: 3px !important; border-bottom: 1px solid transparent !important; letter-spacing: 0.05em !important; }\nhtml[data-dbk] .journal-type-btn.active { color: var(--dbk-green) !important; border-bottom-color: var(--dbk-green) !important; }\nhtml[data-dbk] .journal-header { text-align: center !important; background: none !important; border: none !important; }\nhtml[data-dbk=\"p1\"] .journal-title { font-family: var(--dbk-script) !important; font-size: 2.6rem !important; letter-spacing: 0 !important; }\nhtml[data-dbk] .journal-about-toggle, html[data-dbk] .journal-phase-desc-toggle { all: unset !important; cursor: pointer !important; display: block !important; text-align: center !important; margin: 0 auto 14px !important; text-decoration: underline !important; text-underline-offset: 4px !important; font-size: 0.98rem !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] :is(.journal-about-panel, .journal-phase-card, .journal-prompt, .journal-entry-form) { background: none !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; text-align: center; }\nhtml[data-dbk] .journal-prompt { border-top: 1px solid rgba(var(--dbk-green-rgb),0.25) !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.25) !important; padding: 18px 0 !important; margin: 10px 0 18px !important; }\nhtml[data-dbk] .journal-prompt-label { font-family: var(--dbk-caps) !important; color: var(--lh-secondary) !important; font-size: 1rem !important; letter-spacing: 0.08em; }\nhtml[data-dbk=\"p1\"] .journal-prompt-text { font-family: var(--dbk-script) !important; font-size: 2rem !important; line-height: 1.2 !important; color: var(--dbk-green) !important; }\nhtml[data-dbk=\"p2\"] .journal-prompt-text { font-family: var(--dbk-script) !important; font-style: italic; font-size: 1.35rem !important; line-height: 1.35 !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] .journal-prompt-nav { justify-content: center !important; gap: 14px !important; margin-top: 14px !important; }\nhtml[data-dbk] .journal-phase-name, html[data-dbk] .journal-phase-title { font-family: var(--dbk-caps) !important; color: var(--dbk-green) !important; }\n/* ── US ── */\n\nhtml[data-dbk-page=\"our-dreams\"] .page-title, html[data-dbk-page=\"our-dreams\"] .page-subtitle { display: none !important; }\nhtml[data-dbk-page=\"our-dreams\"] #sectionTiles { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 0 !important; border-top: 1px solid var(--dbk-green) !important; max-width: 560px !important; margin: 0 auto !important; padding: 0 !important; background: none !important; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; border-radius: 0 !important; box-shadow: none !important; display: flex !important; flex-direction: row !important; justify-content: center !important; align-items: center !important; gap: 10px !important; padding: 18px 6px !important; font-family: var(--dbk-caps) !important; font-size: 1.1rem !important; color: var(--dbk-green) !important; min-height: 0 !important; width: auto !important; margin: 0 !important; letter-spacing: 0.05em; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile:nth-child(odd) { border-right: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile:last-child:nth-child(odd) { grid-column: 1 / -1; border-right: none !important; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile .tile-icon { width: 18px !important; height: 18px !important; margin: 0 !important; color: var(--lh-secondary) !important; }\nhtml[data-dbk-page=\"our-dreams\"] .section[data-dream-section=\"challenges\"] > div:last-of-type { text-align: center !important; }\n\nhtml[data-dbk] .dbk-sec h2 { border: none !important; padding-bottom: 0 !important; }\nhtml[data-dbk] .dbk-sec h2::after, html[data-dbk] .dbk-sec h2::before { display: none !important; }\nhtml[data-dbk]:not([data-dbk-page=\"index\"]) .hub-tab, html[data-dbk-page=\"our-dreams\"] #landing-tab, html[data-dbk-page=\"our-dreams\"] .dreams-tab { padding-left: 0 !important; padding-right: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }\nhtml[data-dbk-page=\"our-dreams\"] .page-header { display: none !important; }\n/* Us list panels: full-screen sheet in the same style */\n\nhtml[data-dbk] .section-modal-inner { border-radius: 0 !important; box-shadow: none !important; background: var(--dbk-band) !important; border: none !important; }\nhtml[data-dbk] .section-modal-header { border-radius: 0 !important; background: var(--dbk-fill, var(--dbk-green)) !important; border: none !important; padding: 18px 20px !important; justify-content: center !important; position: relative; }\nhtml[data-dbk] .section-modal-title { font-family: var(--dbk-title) !important; color: var(--dbk-cream) !important; font-size: 2.4rem !important; letter-spacing: 0 !important; text-transform: none !important; }\nhtml[data-dbk=\"p2\"] .section-modal-title { font-size: 1.6rem !important; letter-spacing: 0.06em !important; }\nhtml[data-dbk] .section-modal-header button, html[data-dbk] .section-modal-back { color: var(--dbk-cream) !important; background: none !important; border: none !important; position: absolute; right: 16px; }\nhtml[data-dbk] .section-modal-body { background: none !important; padding: 22px !important; }\nhtml[data-dbk] .section-modal-body > * , html[data-dbk] .section-modal-body [class*=\"card\"], html[data-dbk] .section-modal-body [class*=\"section\"], html[data-dbk] .section-modal-body [class*=\"box\"] { border-radius: 0 !important; box-shadow: none !important; background: none !important; }\nhtml[data-dbk] .section-modal-body [class*=\"card\"], html[data-dbk] .section-modal-body [class*=\"subsection\"] { border: none !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; }\nhtml[data-dbk] .section-modal-body :is(h3, h4, [class*=\"title\"], [class*=\"label\"]) { font-family: var(--dbk-caps) !important; text-align: center !important; font-size: 1.25rem !important; letter-spacing: 0.07em !important; color: var(--dbk-green) !important; text-transform: none !important; font-weight: 400 !important; }\nhtml[data-dbk] .section-modal-body button { background: none !important; color: var(--dbk-green) !important; border: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; border-radius: 2px !important; box-shadow: none !important; font-family: var(--dbk-caps) !important; font-size: 0.98rem !important; }\nhtml[data-dbk] .section-modal-body [class*=\"empty\"] { font-style: italic; text-align: center; color: rgba(var(--dbk-green-rgb),0.7) !important; font-size: 1.05rem !important; }\nhtml[data-dbk] .section-modal-body [class*=\"btn-row\"], html[data-dbk] .section-modal-body [class*=\"actions\"] { justify-content: center !important; }\nhtml[data-dbk] .section-modal-body div { border-radius: 0 !important; }\n/* ── WORKROOM ── */\n\nhtml[data-dbk-page=\"workroom\"] .section-nav-dropdown { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] .section-header { text-align: center !important; background: none !important; border: none !important; padding: 0 0 6px !important; }\nhtml[data-dbk-page=\"workroom\"] .section-subtitle { font-style: italic !important; font-size: 1.02rem !important; color: rgba(var(--dbk-green-rgb),0.72) !important; }\nhtml[data-dbk-page=\"workroom\"] .pipeline-tabs { display: flex !important; justify-content: center !important; gap: 20px !important; background: none !important; border: none !important; border-radius: 0 !important; margin: 18px 0 16px !important; padding: 0 !important; overflow: visible !important; }\nhtml[data-dbk-page=\"workroom\"] .pipeline-tab { all: unset !important; cursor: pointer !important; display: flex !important; flex-direction: column !important; align-items: center !important; font-family: var(--dbk-caps) !important; font-size: 1.02rem !important; color: rgba(var(--dbk-green-rgb),0.6) !important; letter-spacing: 0.05em !important; padding-bottom: 4px !important; border-bottom: 1px solid transparent !important; }\nhtml[data-dbk-page=\"workroom\"] .pipeline-tab.active { color: var(--dbk-green) !important; border-bottom-color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"workroom\"] .pipeline-tab .tab-count { font-family: var(--dbk-serif) !important; font-size: 1.2rem !important; color: var(--lh-secondary) !important; }\nhtml[data-dbk-page=\"workroom\"] .pipeline-view [class*=\"item\"], html[data-dbk-page=\"workroom\"] .pipeline-view [class*=\"card\"] { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.25) !important; border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"workroom\"] .empty-state { text-align: center !important; font-style: italic; color: rgba(var(--dbk-green-rgb),0.7) !important; font-size: 1.05rem !important; border: none !important; background: none !important; }\nhtml[data-dbk-page=\"workroom\"] .biz-switcher { justify-content: center !important; margin-top: 22px !important; }\nhtml[data-dbk-page=\"workroom\"] .biz-switcher button, html[data-dbk-page=\"workroom\"] .biz-switcher [class*=\"chip\"], html[data-dbk-page=\"workroom\"] .biz-switcher [class*=\"pill\"] { border-radius: 2px !important; background: none !important; border: 1px solid rgba(var(--dbk-green-rgb),0.4) !important; color: var(--dbk-green) !important; font-family: var(--dbk-caps) !important; }\nhtml[data-dbk-page=\"workroom\"] .wr-card [class*=\"field\"], html[data-dbk-page=\"workroom\"] .wr-card [class*=\"row\"] { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.22) !important; border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"workroom\"] .wr-card label, html[data-dbk-page=\"workroom\"] .wr-card [class*=\"label\"] { font-family: var(--dbk-caps) !important; letter-spacing: 0.06em !important; font-size: 0.92rem !important; color: rgba(var(--dbk-green-rgb),0.7) !important; text-transform: none !important; }\nhtml[data-dbk-page=\"workroom\"] .wr-card [class*=\"value\"] { font-size: 1.08rem !important; color: var(--dbk-green) !important; }\n/* ── SETTINGS ── */\n\nhtml[data-dbk-page=\"settings\"] .settings-section { border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.28) !important; background: none !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; }\nhtml[data-dbk-page=\"settings\"] .settings-section:first-of-type { border-top: 1px solid rgba(var(--dbk-green-rgb),0.28) !important; }\nhtml[data-dbk-page=\"settings\"] .section-header { padding: 18px 0 !important; background: none !important; border: none !important; }\nhtml[data-dbk-page=\"settings\"] .settings-section .section-title { font-size: 1.2rem !important; text-align: left !important; margin: 0 !important; }\nhtml[data-dbk-page=\"settings\"] .section-body { padding: 4px 0 20px !important; background: none !important; }\nhtml[data-dbk-page=\"settings\"] .section-body label, html[data-dbk-page=\"settings\"] .section-body [class*=\"label\"] { font-size: 1.02rem !important; color: var(--dbk-green) !important; }\n/* ── MEALS ── */\n\nhtml[data-dbk-page=\"meal-plan\"] .dbk-sec * { border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] #week-nav { justify-content: center !important; }\nhtml[data-dbk-page=\"meal-plan\"] #week-nav button { background: none !important; border: none !important; color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"] #plan-first-run { background: none !important; border: none !important; text-align: center; font-size: 1.05rem !important; }\nhtml[data-dbk-page=\"meal-plan\"] #plan-first-run button { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border: none !important; font-family: var(--dbk-caps) !important; font-size: 1rem !important; padding: 10px 18px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .calendar { background: none !important; border: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn { background: none !important; border: none !important; font-family: var(--dbk-caps) !important; color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn.active, html[data-dbk-page=\"meal-plan\"] .day-btn.is-today.active, html[data-dbk-page=\"meal-plan\"] .day-btn.selected { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .dual-goals, html[data-dbk-page=\"meal-plan\"] #dual-goals > * { background: none !important; border: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.25) !important; font-size: 1rem !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] [class*=\"label\"], html[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot-name\"] { font-family: var(--dbk-caps) !important; font-size: 1rem !important; color: var(--dbk-green) !important; letter-spacing: 0.06em; }\nhtml[data-dbk-page=\"meal-plan\"] .calendar, html[data-dbk-page=\"meal-plan\"] .calendar * { border: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn { font-size: 0.95rem !important; padding: 8px 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn.is-today { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] { font-size: 1.05rem !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] * { font-size: inherit; }\nhtml[data-dbk-page=\"meal-plan\"] #dual-goals { background: none !important; }\n  .hm-band:first-child .hm-intention:not(:empty) { display: inline-block !important; vertical-align: middle; max-width: 44ch !important; margin: 14px 0 0 22px !important; padding-left: 22px; border-left: 1px solid rgba(var(--dbk-green-rgb),0.3); text-align: left !important; font-size: 1.02rem !important; }\n}\n.hm-intention::before, .hm-intention::after { display: none !important; content: none !important; }\n/* Menu centered on every page; icons pinned to the right edge */\n\nhtml.dbk-has-hero nav.top-nav .nav-container { display: flex !important; justify-content: center !important; position: relative !important; max-width: none !important; }\nhtml.dbk-has-hero nav.top-nav .nav-links { justify-content: center !important; margin: 0 auto !important; }\n\n@media (max-width: 768px) {\n  html.dbk-has-hero nav.top-nav .nav-container { padding: 0 52px !important; }\n  html.dbk-has-hero nav.top-nav .nav-links { gap: 13px !important; }\n}\n\nhtml.dbk-has-hero nav.top-nav .nav-links, html.dbk-has-hero nav.top-nav .nav-links > * { align-items: center !important; }\n/* Us lists: name on top, one-line note underneath, left aligned like the mockup */\n\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile { flex-direction: column !important; align-items: flex-start !important; justify-content: flex-start !important; gap: 3px !important; padding: 16px 12px 15px !important; text-align: left !important; overflow: hidden; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile .tile-icon { display: none !important; }\nhtml[data-dbk-page=\"our-dreams\"] .dbk-tile-note { font-family: var(--dbk-serif); font-size: 0.98rem; letter-spacing: 0; color: rgba(var(--dbk-green-rgb),0.62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; text-transform: none; }\n/* Person 1's sage: the warmer olive from the mockup */\n\nhtml[data-dbk=\"p1\"] { --dbk-sage: #c7c494; }\n/* Menu bar: 52px row plus the phone's status-bar inset, never squeezed */\n\nhtml.dbk-has-hero nav.top-nav { height: auto !important; box-sizing: content-box !important; padding-top: var(--dbk-safe-top, env(safe-area-inset-top, 0px)) !important; }\nhtml.dbk-has-hero nav.top-nav .nav-container { height: 52px !important; }\nhtml[data-dbk-page=\"index\"] .hm { margin-top: 0; }\n@media (max-width: 380px) {\n  html.dbk-has-hero nav.top-nav .nav-container { padding: 0 46px 0 12px !important; }\n  html.dbk-has-hero nav.top-nav .nav-links { gap: 10px !important; }\n  html.dbk-has-hero nav.top-nav .nav-link { font-size: 0.76rem !important; letter-spacing: 0.03em !important; }\n\n}\n/* Phone: no hamburger; the five main links are the menu */\n\n@media (max-width: 768px) {\n\n  html.dbk-has-hero nav.top-nav .nav-container { padding: 0 12px !important; }\n}\n\nhtml[data-dbk] .dbk-tabs-pages { display: flex; width: fit-content; max-width: 100%; margin: 12px auto 0; padding-top: 10px; border-top: 1px solid rgba(243,238,228,0.22); }\nhtml[data-dbk] .dbk-tabs-pages a { font-size: 0.8rem; color: rgba(243,238,228,0.6); }\n/* room at the bottom so the last band clears the capture bar */\n\nhtml[data-dbk-page=\"index\"] main.hm { padding-bottom: 0 !important; }\n/* ── APP FEEL ───────────────────────────────────────────────────── */\n/* no rubber-band bounce; if a phone bounces anyway, the top shows green and the bottom paper */\n\nhtml[data-dbk], html[data-dbk] body { overscroll-behavior: none !important; }\nhtml[data-dbk] { background: linear-gradient(var(--dbk-green) 0 50%, var(--dbk-paper) 50% 100%) !important; }\nhtml[data-dbk] body { background: var(--dbk-paper) !important; }\n/* content waits for the layout and fonts; the menu stays put */\n\nhtml.dbk-loading body > *:not(nav):not(script):not(style) { visibility: hidden !important; }\n/* the old full-screen loading splash on Meals */\n\nhtml[data-dbk] #appLoadingOverlay { display: none !important; }\n/* ── ONE TITLE BAND FOR EVERY PAGE ──────────────────────────────── */\n\nhtml[data-dbk] .dbk-hero { min-height: 0 !important; padding: 18px 20px 20px !important; align-items: center !important; }\nhtml[data-dbk] .dbk-title { line-height: 1.05 !important; white-space: nowrap; }\nhtml[data-dbk=\"p1\"] .dbk-title { font-size: 50px !important; }\nhtml[data-dbk=\"p2\"] .dbk-title { font-size: 32px !important; letter-spacing: 0.06em !important; }\nhtml[data-dbk] .dbk-sub { font-size: 15px !important; margin-top: 4px !important; }\nhtml[data-dbk] .dbk-tabs { margin-top: 10px !important; gap: 6px 16px !important; }\nhtml[data-dbk] .dbk-tabs a { font-size: 15px !important; }\nhtml[data-dbk] .dbk-tabs-pages { margin-top: 10px !important; padding-top: 8px !important; }\nhtml[data-dbk] .dbk-tabs-pages a { font-size: 13.5px !important; }\n@media (min-width: 769px) {\n  html[data-dbk=\"p1\"] .dbk-title { font-size: 60px !important; }\n  html[data-dbk=\"p2\"] .dbk-title { font-size: 38px !important; }\n}\n/* calmer big type */\n\nhtml[data-dbk] .hm .home-greeting, html[data-dbk] #homeGreeting { font-size: 32px !important; line-height: 1.1 !important; }\nhtml[data-dbk] .hm .home-names, html[data-dbk] #homeNames { font-size: 24px !important; }\n@media (min-width: 769px) {\n  html[data-dbk] .hm .home-greeting, html[data-dbk] #homeGreeting { font-size: 38px !important; }\n  html[data-dbk] .hm .home-names, html[data-dbk] #homeNames { font-size: 28px !important; }\n}\n/* same menu bar on every page (Meals had an extra glow line) */\n\nhtml[data-dbk] nav.top-nav::after, html[data-dbk] nav.top-nav::before { display: none !important; content: none !important; }\n/* hubs: up next gets its own sage band right under the title */\n\nhtml[data-dbk-page$=\"-hub\"] .schedule-up-next.dbk-upnext { flex-direction: column !important; align-items: center !important; gap: 4px !important; text-align: center !important; margin: 0 !important; padding: 18px 22px 20px !important; border: none !important; border-radius: 0 !important; background: var(--dbk-sage) !important; box-shadow: none !important; border-image: conic-gradient(var(--dbk-sage) 0 0) fill 0 / 0 / 0 100vmax !important; }\nhtml[data-dbk-page$=\"-hub\"] .dbk-upnext .schedule-up-next-label { margin: 0 !important; font-family: var(--dbk-caps) !important; font-size: 14px !important; letter-spacing: 0.16em !important; color: rgba(var(--dbk-green-rgb),0.72) !important; }\nhtml[data-dbk-page$=\"-hub\"] .dbk-upnext .schedule-up-next-item { display: flex !important; flex-direction: column !important; align-items: center !important; font-family: var(--dbk-serif) !important; font-size: 20px !important; line-height: 1.25 !important; color: var(--dbk-green) !important; font-weight: 400 !important; }\nhtml[data-dbk-page$=\"-hub\"] .dbk-upnext .schedule-up-next-time { order: -1; margin: 0 0 2px !important; font-family: var(--dbk-caps) !important; font-size: 34px !important; line-height: 1.05 !important; letter-spacing: 0.04em !important; color: var(--dbk-green) !important; }\n/* Us: the odd tile at the end (Reading) sits centered across both columns */\n\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile:last-child:nth-child(odd) { align-items: center !important; justify-content: center !important; text-align: center !important; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile:last-child:nth-child(odd) > * { text-align: center !important; align-items: center !important; margin-left: auto !important; margin-right: auto !important; }\nhtml[data-dbk-page=\"our-dreams\"] .dbk-title { white-space: normal !important; }\n/* capture bar: Inbox is an outline button, cream text on the green */\n\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar .capture-inbox-btn,\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar .capture-inbox-btn:hover,\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar .capture-inbox-btn:active,\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar .capture-inbox-btn:focus { background: transparent !important; color: var(--dbk-cream) !important; border: 1px solid rgba(243,238,228,0.55) !important; opacity: 1 !important; font-size: 14px !important; letter-spacing: 0.08em !important; }\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar .capture-inbox-btn * { color: var(--dbk-cream) !important; }\n/* Us: every list tile centered */\n\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile { align-items: center !important; justify-content: center !important; text-align: center !important; }\nhtml[data-dbk-page=\"our-dreams\"] .landing-tile .dbk-tile-note { text-align: center !important; max-width: 100%; }\n/* ── ROUTINE (hubs) ─────────────────────────────────────────────── */\n\nhtml[data-dbk] #dailyScheduleContainer { align-items: stretch !important; width: 100%; max-width: 440px; margin: 0 auto; }\nhtml[data-dbk] .rt-group { margin: 6px 0 18px; }\nhtml[data-dbk] .rt-group-name { font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.12em; color: var(--lh-secondary); text-align: center; margin-bottom: 6px; }\nhtml[data-dbk] .rt-step { display: grid; grid-template-columns: 78px 1fr; gap: 12px; align-items: baseline; width: 100%; text-align: left; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.18) !important; border-radius: 0 !important; padding: 12px 4px !important; margin: 0 !important; color: var(--dbk-green) !important; cursor: pointer; box-shadow: none !important; font: inherit; min-height: 0 !important; }\nhtml[data-dbk] .rt-step:active { background: rgba(var(--dbk-green-rgb),0.06) !important; }\nhtml[data-dbk] .rt-time { font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; color: rgba(var(--dbk-green-rgb),0.7); white-space: nowrap; }\nhtml[data-dbk] .rt-what { font-family: var(--dbk-serif); font-size: 18px; line-height: 1.3; }\nhtml[data-dbk] .rt-notes { display: block; font-size: 14.5px; line-height: 1.45; color: rgba(var(--dbk-green-rgb),0.62); margin-top: 3px; }\nhtml[data-dbk] .rt-empty { text-align: center; font-style: italic; color: rgba(var(--dbk-green-rgb),0.6); margin: 14px 0 6px; font-size: 17px; }\n\nhtml[data-dbk] .rt-overlay { position: fixed; inset: 0; z-index: 10050; background: rgba(47,58,44,0.38); display: none; align-items: flex-end; justify-content: center; }\nhtml[data-dbk] .rt-overlay.open { display: flex; }\nhtml[data-dbk] .rt-sheet { position: relative; width: 100%; max-width: 460px; background: var(--dbk-cream); color: var(--dbk-green); padding: 30px 22px calc(22px + var(--dbk-safe-bottom, env(safe-area-inset-bottom, 0px))); display: flex; flex-direction: column; gap: 16px; box-sizing: border-box; max-height: calc(88 * var(--dbk-vh, 1vh)); overflow-y: auto; overscroll-behavior: contain; }\n@media (min-width: 769px) { html[data-dbk] .rt-overlay { align-items: center; } html[data-dbk] .rt-sheet { padding-bottom: 26px; } }\nhtml[data-dbk] .rt-x { position: absolute; top: 6px; right: 8px; background: none !important; border: none !important; font-size: 28px; line-height: 1; color: rgba(var(--dbk-green-rgb),0.6) !important; padding: 6px 10px !important; cursor: pointer; }\nhtml[data-dbk] .rt-sheet input, html[data-dbk] .rt-sheet textarea { font-family: var(--dbk-serif) !important; font-size: 18px !important; color: var(--dbk-green) !important; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; border-radius: 0 !important; padding: 8px 2px !important; width: 100%; box-sizing: border-box; outline: none; box-shadow: none !important; }\nhtml[data-dbk] .rt-sheet input:focus, html[data-dbk] .rt-sheet textarea:focus { border-bottom-color: var(--dbk-green) !important; }\nhtml[data-dbk] .rt-sheet .rt-in-time { width: auto; min-width: 150px; align-self: center; text-align: center; -webkit-appearance: none; appearance: none; }\nhtml[data-dbk] .rt-sheet textarea { resize: none; }\nhtml[data-dbk] .rt-days { display: flex; justify-content: center; gap: 7px; }\nhtml[data-dbk] .rt-day { width: 38px; height: 38px; border-radius: 50% !important; border: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; background: none !important; color: var(--dbk-green) !important; font-family: var(--dbk-caps); font-size: 15px; padding: 0 !important; cursor: pointer; min-height: 0 !important; }\nhtml[data-dbk] .rt-day.on { background: var(--dbk-fill, var(--dbk-green)) !important; border-color: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\nhtml[data-dbk] .rt-actions { display: flex; justify-content: center; }\nhtml[data-dbk] .rt-save { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border: none !important; border-radius: 2px !important; font-family: var(--dbk-caps); font-size: 17px; letter-spacing: 0.08em; padding: 11px 44px !important; cursor: pointer; }\nhtml[data-dbk] .rt-delete { align-self: center; background: none !important; border: none !important; color: var(--dbk-clay) !important; font-family: var(--dbk-serif); font-size: 15px; text-decoration: underline; text-underline-offset: 3px; padding: 2px 6px !important; cursor: pointer; }\n/* each person sees only their own page in the menus */\n\nhtml[data-dbk-me=\"person1\"] a[href^=\"person2-hub.html\"],\nhtml[data-dbk-me=\"person2\"] a[href^=\"person1-hub.html\"],\nhtml[data-dbk-me=\"person1\"] .nav-dropdown:has(> a[href*=\"person2-hub.html\"]),\nhtml[data-dbk-me=\"person2\"] .nav-dropdown:has(> a[href*=\"person1-hub.html\"]),\nhtml[data-dbk-me=\"person1\"] nav.top-nav .nav-links > a[href*=\"person2-hub.html\"],\nhtml[data-dbk-me=\"person2\"] nav.top-nav .nav-links > a[href*=\"person1-hub.html\"],\n\n/* ── MEALS, second pass: light cards, readable modals, same type as the rest ── */\n\nhtml[data-dbk-page=\"meal-plan\"] { --card-bg: var(--dbk-cream) !important; --border-color: rgba(47,58,44,0.2) !important; --card-shadow: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] body { background: var(--dbk-band) !important; }\nhtml[data-dbk-page=\"meal-plan\"] #page-title { display: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .tab-view, html[data-dbk-page=\"meal-plan\"] .tab-view > div { background: none !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .dbk-sec { padding-top: 22px !important; }\n/* recipes */\n\nhtml[data-dbk-page=\"meal-plan\"] .rb-toolbar { position: relative; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-toolbar > svg { position: absolute; left: 2px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: rgba(var(--dbk-green-rgb),0.55); pointer-events: none; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-search { padding: 10px 28px 10px 26px !important; font-size: 17px !important; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.4) !important; border-radius: 0 !important; color: var(--dbk-green) !important; width: 100%; box-sizing: border-box; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-grid { display: block !important; border-top: 1px solid var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.2) !important; border-left: 3px solid var(--rb-accent, var(--dbk-green)) !important; border-radius: 0 !important; margin: 0 !important; padding: 14px 6px 14px 14px !important; box-shadow: none !important; min-height: 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card::before, html[data-dbk-page=\"meal-plan\"] .rb-card::after { display: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card:active { background: rgba(var(--dbk-green-rgb),0.06) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card-name { font-family: var(--dbk-serif) !important; font-size: 18px !important; font-weight: 400 !important; color: var(--dbk-green) !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; line-height: 1.3 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card-act { background: none !important; border: none !important; color: rgba(var(--dbk-green-rgb),0.55) !important; padding: 8px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-card-act svg { width: 15px !important; height: 15px !important; }\nhtml[data-dbk-page=\"meal-plan\"] [class*=\"rb-count\"], html[data-dbk-page=\"meal-plan\"] #rb-count { font-size: 14px !important; color: rgba(var(--dbk-green-rgb),0.6) !important; }\n/* recipe + other modals */\n\nhtml[data-dbk-page=\"meal-plan\"] .modal-container { background: rgba(47,58,44,0.45) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal { background: var(--dbk-cream) !important; color: var(--dbk-green) !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-header { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border-radius: 0 !important; padding: 22px 54px 18px 22px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-header h3, html[data-dbk-page=\"meal-plan\"] #modal-title { color: var(--dbk-cream) !important; font-family: var(--dbk-caps) !important; font-size: 24px !important; font-weight: 400 !important; line-height: 1.2 !important; letter-spacing: 0.02em !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-header .meta, html[data-dbk-page=\"meal-plan\"] .modal-header .meta * { color: rgba(243,238,228,0.85) !important; font-family: var(--dbk-serif) !important; font-weight: 400 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-header .portion-tag { background: none !important; border: 1px solid rgba(243,238,228,0.4) !important; color: var(--dbk-cream) !important; border-radius: 0 !important; font-size: 13px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-close { background: none !important; border: 1px solid rgba(243,238,228,0.4) !important; color: var(--dbk-cream) !important; border-radius: 50% !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-body { color: var(--dbk-green) !important; padding: 20px 22px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-body h4 { font-family: var(--dbk-caps) !important; font-size: 18px !important; letter-spacing: 0.08em !important; text-transform: none !important; color: var(--lh-secondary) !important; font-weight: 400 !important; margin: 4px 0 8px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-body li, html[data-dbk-page=\"meal-plan\"] .modal-body p, html[data-dbk-page=\"meal-plan\"] .modal-body div { color: var(--dbk-green) !important; font-family: var(--dbk-serif) !important; font-size: 17px !important; line-height: 1.5 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal-body li { border-color: rgba(var(--dbk-green-rgb),0.15) !important; }\n/* no line over notes and tips (Kasey, Oct 25: \"tired of the unneccesary line elements\"; it drew one between the recipe\n   form's \"The whole recipe\" and its per-serving line) */\nhtml[data-dbk-page=\"meal-plan\"] .modal-body [class*=\"note\"], html[data-dbk-page=\"meal-plan\"] .modal-body [class*=\"tip\"] { background: none !important; border: none !important; border-radius: 0 !important; font-style: italic; }\nhtml[data-dbk-page=\"meal-plan\"] .modal input, html[data-dbk-page=\"meal-plan\"] .modal textarea, html[data-dbk-page=\"meal-plan\"] .modal select { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; border-radius: 0 !important; color: var(--dbk-green) !important; font-size: 17px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal label { color: rgba(var(--dbk-green-rgb),0.75) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .modal button:not(.modal-close):not(.rb-card-act) { border-radius: 2px !important; }\n/* plan */\n\nhtml[data-dbk-page=\"meal-plan\"] #plan-first-run p, html[data-dbk-page=\"meal-plan\"] #plan-first-run div { font-size: 16px !important; line-height: 1.55 !important; color: rgba(var(--dbk-green-rgb),0.8) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn { font-size: 15px !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] { padding: 12px 4px !important; font-size: 17px !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot\"] [class*=\"label\"], html[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"slot-name\"] { font-size: 15px !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"empty\"], html[data-dbk-page=\"meal-plan\"] #day-detail [class*=\"tap\"] { font-size: 15px !important; color: rgba(var(--dbk-green-rgb),0.55) !important; }\nhtml[data-dbk-page=\"meal-plan\"] #day-detail textarea { font-size: 17px !important; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; border-radius: 0 !important; }\n/* list + journal */\n\nhtml[data-dbk-page=\"meal-plan\"] .gen-btn { border-radius: 2px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.06em !important; padding: 10px 16px !important; }\nhtml[data-dbk-page=\"meal-plan\"] #grocery-view input, html[data-dbk-page=\"meal-plan\"] #journal-view input, html[data-dbk-page=\"meal-plan\"] #journal-view textarea { font-size: 17px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .journal-patterns-card, html[data-dbk-page=\"meal-plan\"] #journal-view [class*=\"card\"], html[data-dbk-page=\"meal-plan\"] #journal-view [class*=\"calendar\"] { background: none !important; border: none !important; border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] #journal-view [class*=\"day\"] { border-radius: 0 !important; }\nhtml[data-dbk][data-dbk-page=\"meal-plan\"] .rb-toolbar input#rb-search { padding-left: 28px !important; padding-right: 26px !important; }\n/* plan: meal slots */\n\nhtml[data-dbk-page=\"meal-plan\"] .mc-card { background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.22) !important; border-radius: 0 !important; box-shadow: none !important; padding: 14px 4px !important; margin: 0 !important; display: flex !important; align-items: center !important; gap: 10px; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-card:first-child { border-top: 1px solid var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-body { flex: 1; min-width: 0; display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-type { font-family: var(--dbk-caps) !important; font-size: 16px !important; letter-spacing: 0.06em !important; text-transform: none !important; color: var(--dbk-green) !important; font-weight: 400 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-name { font-family: var(--dbk-serif) !important; font-size: 17px !important; color: var(--dbk-green) !important; font-weight: 400 !important; text-align: right; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-name-empty { font-style: italic; color: rgba(var(--dbk-green-rgb),0.5) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-skip-link { border: none !important; background: none !important; font-size: 13px !important; color: rgba(var(--dbk-green-rgb),0.5) !important; text-decoration: underline; text-underline-offset: 3px; padding: 4px !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-macros { font-size: 14px !important; color: rgba(var(--dbk-green-rgb),0.6) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .detail-day-name { font-family: var(--dbk-caps) !important; font-size: 20px !important; font-weight: 400 !important; letter-spacing: 0.06em; }\nhtml[data-dbk-page=\"meal-plan\"] #detail-day-macros > div { background: none !important; border: none !important; border-radius: 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"] #detail-day-macros span { font-family: var(--dbk-caps) !important; font-size: 15px !important; text-transform: none !important; letter-spacing: 0.06em !important; }\nhtml[data-dbk-page=\"meal-plan\"] #detail-day-macros > div > div:first-child { font-family: var(--dbk-caps) !important; font-size: 16px !important; text-transform: none !important; color: var(--lh-secondary) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mc-card.mc-empty { opacity: 1 !important; }\nhtml[data-dbk-page=\"meal-plan\"] div:has(> .rb-toolbar) { flex-wrap: wrap !important; justify-content: center !important; gap: 12px !important; }\nhtml[data-dbk-page=\"meal-plan\"] div:has(> .rb-toolbar) > .rb-toolbar { flex: 1 1 100% !important; }\n/* bands must not trap pop-ups: a backdrop blur on a band turns it into the frame for every\n   fixed pop-up inside it, which cut the \"add a resource\" form in half */\n\nhtml[data-dbk] .dbk-sec, html[data-dbk] .dbk-sec .section, html[data-dbk] .dbk-band, html[data-dbk] .hm > * { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }\n/* no page titles; the band keeps only the tabs */\n\nhtml[data-dbk] .dbk-hero .dbk-title, html[data-dbk] .dbk-hero .dbk-sub { display: none !important; }\nhtml[data-dbk] .dbk-hero { min-height: 0 !important; padding: 10px 16px 12px !important; }\nhtml[data-dbk] .dbk-hero .dbk-tabs:first-child { margin-top: 0 !important; }\nhtml[data-dbk] .dbk-hero.dbk-hero-empty { padding: 0 !important; height: 0 !important; overflow: hidden !important; }\n/* ── WORKROOM: same rhythm as the other pages ─────────── */\n\nhtml[data-dbk-page=\"workroom\"] body { background: var(--dbk-band) !important; }\n/* no drawn ornaments, no intro blurbs */\n\nhtml[data-dbk-page=\"workroom\"] .wr-section-divider, html[data-dbk-page=\"workroom\"] .section-subtitle, html[data-dbk-page=\"workroom\"] .brain-dump-hint { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] #content-tab > .section-header > button { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] #content-tab > .section-header { padding: 0 !important; margin: 0 !important; min-height: 0 !important; }\n/* section headings: same caps heading as \"Our Lists\", \"This Week\" */\n\n/* workroom week: same strip as Home's This Week */\n\n/* quiet links row (business switcher + settings) */\n\nhtml[data-dbk-page=\"workroom\"] .biz-switcher { margin-top: 26px !important; gap: 10px !important; }\nhtml[data-dbk] .dbk-quiet-links { text-align: center; margin: 14px 0 6px; }\nhtml[data-dbk] .dbk-quiet-links button { all: unset; cursor: pointer; font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--dbk-green-rgb),0.7); text-decoration: underline; text-underline-offset: 4px; }\n/* home base: one underline per field, labels as small caps */\n\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card label, html[data-dbk-page=\"workroom\"] #homebase-tab [class*=\"field-label\"], html[data-dbk-page=\"workroom\"] #homebase-tab [class*=\"hb-label\"] { border: none !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.06em !important; text-transform: none !important; color: var(--lh-secondary) !important; font-weight: 400 !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card > div, html[data-dbk-page=\"workroom\"] #homebase-tab [class*=\"hb-row\"], html[data-dbk-page=\"workroom\"] #homebase-tab [class*=\"field\"] { border-top: none !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] .section-header > button[onclick*=\"openWorkroomSettings\"] { display: none !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] #homebase-tab .biz-field-group { border: none !important; margin: 0 !important; padding: 0 !important; background: none !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] #homebase-tab .biz-field { border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.22) !important; padding: 12px 4px !important; margin: 0 !important; background: none !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] #homebase-tab .biz-field-value { border: none !important; padding: 2px 0 0 !important; font-size: 17px !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] #homebase-tab .biz-field-value .empty { font-style: italic; color: rgba(var(--dbk-green-rgb),0.5) !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"] #homebase-tab .biz-field-label { border: none !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.06em !important; text-transform: none !important; color: var(--lh-secondary) !important; font-weight: 400 !important; padding: 0 !important; }\n/* pink is saved for Home's greeting; the everyday band is a warm linen (Person 2's stays his stone) */\n\nhtml[data-dbk] { --dbk-band: var(--dbk-pink); }\nhtml[data-dbk=\"p1\"] { --dbk-band: #e8e1d1; }\n/* short pages: the page color runs to the bottom of the screen (the menu-green top only shows on an overscroll) */\n\nhtml[data-dbk] { background: linear-gradient(var(--dbk-green) 0 50%, var(--dbk-band) 50% 100%) no-repeat var(--dbk-band) !important; }\nhtml[data-dbk] body { min-height: calc(100 * var(--dbk-vh, 1vh)); min-height: calc(100 * var(--dbk-vh, 1dvh)); }\n/* ── MORE BAND COLORS ─────────────────────────────────────────────\n   pink, cream, sage plus sand, celadon, linen and one deep band per page */\n\nhtml[data-dbk=\"p1\"] { --dbk-sand: #e7d5b6; --dbk-celadon: #dcdfc2; --dbk-linen: #e8e1d1; --dbk-deep: #2f3a2c; }\nhtml[data-dbk=\"p2\"] { --dbk-sand: #d9d1bf; --dbk-celadon: #cfd5c1; --dbk-linen: #ebe6da; --dbk-deep: #2f3a2c; }\nhtml[data-dbk] .dbk-sandb { --bandc: var(--dbk-sand); }\nhtml[data-dbk] .dbk-celadonb { --bandc: var(--dbk-celadon); }\nhtml[data-dbk] .dbk-linenb { --bandc: var(--dbk-linen); }\nhtml[data-dbk] .dbk-darkb { --bandc: var(--dbk-deep); }\n.hm-dark { background: var(--dbk-deep); }\nhtml[data-dbk=\"p1\"] { --dbk-band: var(--dbk-linen); }\n/* the deep band flips the ink: cream text and lines, green fills become cream */\n\nhtml[data-dbk] .hm-dark, html[data-dbk] .dbk-darkb {\n  --dbk-green: #f3eee4; --dbk-green-rgb: 243,238,228; --dbk-cream: #2f3a2c;\n  --lh-text: #f3eee4 !important; --lh-text-rgb: 243,238,228 !important;\n  --lh-text-muted: rgba(243,238,228,0.72) !important; --lh-text-faint: rgba(243,238,228,0.5) !important;\n  --lh-accent: #f3eee4 !important; --lh-accent-rgb: 243,238,228 !important; --lh-accent-on-text: #2f3a2c !important;\n  --lh-secondary: #e6bdb5 !important; --lh-secondary-rgb: 230,189,181 !important;\n  color: #f3eee4;\n}\nhtml[data-dbk] .hm-dark *, html[data-dbk] .dbk-darkb * { border-color: rgba(243,238,228,0.3) !important; }\nhtml[data-dbk] .hm-dark :is(h2, h3, .hm-h, .section-title, .reminder-title, .reminder-due, a, button, span, div, p),\nhtml[data-dbk] .dbk-darkb :is(h2, h3, .section-title, a, span, div, p) { color: inherit; }\nhtml[data-dbk] .hm-dark .reminder-btn.primary, html[data-dbk] .hm-dark button.primary { background: #f3eee4 !important; color: #2f3a2c !important; border-color: #f3eee4 !important; }\nhtml[data-dbk] .hm-dark .hm-btn-solid { background: #f3eee4 !important; color: #2f3a2c !important; border-color: #f3eee4 !important; }\nhtml[data-dbk] .hm-dark .hm-btn:not(.hm-btn-solid) { color: #f3eee4 !important; }\n/* ═══ PERSON 2: DARK MODE (black and navy, bright green accents) ═══\n   Every section flips to light text on near-black and navy. */\n\nhtml[data-dbk=\"p2\"]{--dbk-deep:#06080b;--dbk-pink:#0c1118;--dbk-band:#0c1118;--dbk-paper:#0c1118;--dbk-sage:#17263d;background:#0c1118!important}\nhtml[data-dbk=\"p2\"] body{--dbk-green:#e6eaef;--dbk-green-rgb:230,234,239;--dbk-cream:#06080b;--lh-text:#e6eaef!important;--lh-text-rgb:230,234,239!important;--lh-text-muted:rgba(230,234,239,.74)!important;--lh-text-faint:rgba(230,234,239,.52)!important;--lh-accent:#e6eaef!important;--lh-accent-rgb:230,234,239!important;--lh-accent-on-text:#06080b!important;--lh-secondary:#8fc98a!important;--lh-secondary-rgb:143,201,138!important;color:#e6eaef;background:#0c1118!important}\nhtml[data-dbk=\"p2\"] nav.top-nav, html[data-dbk=\"p2\"] .dbk-hero, html[data-dbk=\"p2\"] .capture-sticky-bar{background:#06080b!important;--dbk-cream:#e6eaef}\nhtml[data-dbk=\"p2\"] :is(.hm-pink,.dbk-pinkb){background:#0c1118!important;--bandc:#0c1118}\nhtml[data-dbk=\"p2\"] :is(.hm-cream,.dbk-creamb){background:#121c2b!important;--bandc:#121c2b}\nhtml[data-dbk=\"p2\"] :is(.hm-sand,.dbk-sandb){background:#0f1724!important;--bandc:#0f1724}\nhtml[data-dbk=\"p2\"] :is(.hm-celadon,.dbk-celadonb){background:#15233a!important;--bandc:#15233a}\nhtml[data-dbk=\"p2\"] :is(.hm-linen,.dbk-linenb){background:#0b1018!important;--bandc:#0b1018}\nhtml[data-dbk=\"p2\"] :is(.hm-dark,.dbk-darkb){background:#06080b!important;--bandc:#06080b}\nhtml[data-dbk=\"p2\"] body *{border-color:rgba(230,234,239,.26)!important}\nhtml[data-dbk=\"p2\"] :is(.hm-sage,.dbk-sageb,.dbk-upnext){background:#17263d!important;--bandc:#17263d}\nhtml[data-dbk=\"p2\"] .hm-dark .hm-btn-solid{background:#e6eaef!important;color:#06080b!important}\nhtml[data-dbk=\"p2\"] input::placeholder, html[data-dbk=\"p2\"] textarea::placeholder{color:rgba(230,234,239,.5)!important}\nhtml[data-dbk=\"p2\"] { color-scheme: dark; }\n/* Person 2 dark mode: pop-ups and forms that had their own light backgrounds */\n\nhtml[data-dbk=\"p2\"] :is(.inbox-modal, .inbox-modal-header, .edit-reminder-modal, .reminder-modal, .reminder-add-form, .week-day, #hh-toast, .copy-toast, .modal, .day-modal, .section-modal-inner, .section-modal form, .dream-form form, .rt-sheet, .hh-dp-popover, .detail-modal, .lightbox-content) { background: #121c2b !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] :is(.section-modal-header, .modal-header, .inbox-modal-header) { background: #06080b !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] :is(.section-modal-header, .modal-header, .inbox-modal-header) :is(h2, h3, div, span, button, .meta, .meta *) { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] body :is(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=color]), textarea, select, .hh-dp-trigger) { background: transparent !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] body select option { background: #121c2b; color: #e6eaef; }\n/* fills that would otherwise flip to white become the bright green */\n\nhtml[data-dbk=\"p2\"] body :is(.hm-btn-solid, .capture-bar-send, .inbox-capture-send, .view-toggle-btn.active, .hm-day.today, .day-btn.is-today, .day-btn.active, .day-btn.selected, .week-cal-day.is-today, .wr-btn-primary, .rt-save, .rt-day.on, .journal-unlock-btn, .journal-save-btn, .edit-reminder-modal .btn:not(.cancel-btn), .gen-btn:not([onclick*=\"Seasonal\"]), .save-btn, .re-save, #plan-first-run button, div:has(> .rb-toolbar) > button, .bingo-cell.completed) {\n  background: #8fc98a !important; color: #06080b !important; border-color: #8fc98a !important; }\nhtml[data-dbk=\"p2\"] body :is(.hm-btn-solid, .capture-bar-send, .inbox-capture-send, .hm-day.today, .day-btn.is-today, .week-cal-day.is-today, .rt-day.on, .bingo-cell.completed) * { color: #06080b !important; }\n/* only the current tab and menu item get an underline */\n\nhtml[data-dbk=\"p2\"] .dbk-tabs a:not(.on), html[data-dbk=\"p2\"] nav.top-nav a { border-color: transparent !important; }\nhtml[data-dbk=\"p2\"] .dbk-tabs a.on { border-color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] #modal-title { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] .dream-section-subtitle, html[data-dbk=\"p2\"] [class*=\"subtitle\"] { color: rgba(230,234,239,0.62) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .day-btn.is-today *, html[data-dbk-page=\"meal-plan\"] .day-btn.active * { color: var(--dbk-cream) !important; }\n\n/* keep the menu and the brain-dump bar pinned while scrolling on iPhone:\n   the paper grain scrolls with the page instead of being a fixed full-screen blend layer */\n\nhtml[data-dbk] body::after { position: absolute !important; inset: 0 !important; mix-blend-mode: normal !important; opacity: 0.1 !important; z-index: 1 !important; }\nhtml[data-dbk] nav.top-nav, html[data-dbk] .capture-sticky-bar { -webkit-transform: translateZ(0); transform: translateZ(0); }\n/* while a page is getting ready, the menu bar shows but its links wait too, so the old labels never flash */\n\nhtml.dbk-loading nav.top-nav .nav-container, html.dbk-loading nav.top-nav .nav-links { visibility: hidden !important; }\nhtml[data-dbk=\"p2\"] .hm-dark, html[data-dbk=\"p2\"] .dbk-darkb { --lh-secondary: #8fc98a !important; --lh-secondary-rgb: 143,201,138 !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { background: #8fc98a !important; color: #06080b !important; box-shadow: inset 0 0 0 3px #06080b !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo * { color: #06080b !important; }\n/* Home week: the tapped day gets an outline; its events show underneath */\n\n/* Person 2 dark mode: readability pass (settings lists, hints, faint labels) */\n\nhtml[data-dbk=\"p2\"] body { --lh-text-faint: rgba(230,234,239,0.66) !important; --lh-text-muted: rgba(230,234,239,0.8) !important; }\nhtml[data-dbk=\"p2\"] :is(.contact, .archive-item, .settings-group, .settings-card, .settings-section) { background: transparent !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] :is(.contact-edit-btn, .contact-delete-btn, .contact-link, .archive-item-name, .archive-item-desc, .archive-item-icon, .archive-toggle-btn) { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] :is(.contact-link, .archive-toggle-btn) { border-color: rgba(230,234,239,0.4) !important; background: transparent !important; }\nhtml[data-dbk=\"p2\"] :is([class*=\"empty\"], [class*=\"hint\"], [class*=\"-desc\"], [class*=\"subtitle\"], [class*=\"widget-detail\"], [class*=\"moon-sign\"], .widget-pill-text span, .hm-conds *, .home-date, .home-time, .hh-dp-chevron) { color: rgba(230,234,239,0.8) !important; }\nhtml[data-dbk=\"p2\"] .hm-conds .widget-pill-text span:first-child { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"] .section-modal p[style*=\"--lh-accent-text\"] { color: rgba(230,234,239,0.75) !important; }\nhtml[data-dbk=\"p2\"] #journal-view :is([class*=\"day\"], [class*=\"cal\"] *) { color: rgba(230,234,239,0.8) !important; }\nhtml[data-dbk=\"p2\"] #detail-day-macros span { color: rgba(230,234,239,0.85) !important; }\n/* settings gear, top right of the menu bar */\n\nhtml[data-dbk] #dbkGear { position: absolute; right: 12px; bottom: 0; height: 52px; display: flex; align-items: center; color: rgba(243,238,228,0.75); z-index: 3; }\nhtml[data-dbk=\"p2\"] #dbkGear { color: rgba(230,234,239,0.75); }\nhtml[data-dbk-page=\"settings\"] #dbkGear { color: #f3eee4; }\n@media (max-width: 380px) { html[data-dbk] #dbkGear { right: 6px; } }\nhtml[data-dbk=\"p2\"] #journal-view div, html[data-dbk=\"p2\"] #journal-view span { color: rgba(230,234,239,0.82) !important; }\n/* Person 1: faint labels and hints a step darker so they stay readable */\n\nhtml[data-dbk=\"p1\"] { --lh-text-muted: rgba(47,58,44,0.78) !important; --lh-text-faint: rgba(47,58,44,0.62) !important; }\nhtml[data-dbk=\"p1\"] :is(.hm-dim, .hm-sep, .hm-chev, .thing-text.empty, .week-day-date, .week-day-rel, .empty-state, .inbox-count, .inbox-empty, .inbox-modal-close, .contact-delete-btn, .contact-edit-btn) { color: rgba(47,58,44,0.68) !important; opacity: 1 !important; }\nhtml[data-dbk] #journal-view [style*=\"opacity\"] { opacity: 0.62 !important; }\nhtml[data-dbk=\"p2\"] #homeDate { color: #8fc98a !important; }\nhtml[data-dbk] .hm-dark .hm-sep { color: rgba(243,238,228,0.6) !important; }\nhtml[data-dbk=\"p1\"] .edit-reminder-modal .btn:not(.cancel-btn):not(.cancel-contact-btn) { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border-color: var(--dbk-fill, var(--dbk-green)) !important; }\nhtml[data-dbk=\"p1\"] :is(.reminder-empty, .cancel-contact-btn, .mc-name-empty, .mc-skip-link, .journal-patterns-empty, .landing-challenge-month) { color: rgba(47,58,44,0.72) !important; }\n/* Person 1: last faint spots */\n\nhtml[data-dbk=\"p1\"][data-dbk-page=\"meal-plan\"] .mc-name-empty,\nhtml[data-dbk=\"p1\"][data-dbk-page=\"workroom\"] #homebase-tab .biz-field-value .empty { color: rgba(47,58,44,0.7) !important; }\n/* \"not signed in\" notice sits above the capture bar so it can't hide behind it */\n\n#hh-signin-banner { bottom: calc(84px + var(--dbk-safe-bottom, env(safe-area-inset-bottom, 0px))) !important; z-index: 10070 !important; background: #2f3a2c !important; color: #f3eee4 !important; border: none !important; border-radius: 2px !important; }\n#hh-signin-banner a { color: #f3eee4 !important; text-decoration: underline !important; }\n#hh-signin-banner button { color: rgba(243,238,228,0.8) !important; }\n/* menu: full strength and a little larger so it reads clearly */\n\nhtml[data-dbk] nav.top-nav .nav-link { color: #f3eee4 !important; opacity: 1 !important; font-size: 16px !important; letter-spacing: 0.05em !important; -webkit-font-smoothing: antialiased; }\nhtml[data-dbk] nav.top-nav .nav-link.active { text-decoration: underline !important; text-decoration-thickness: 2px !important; text-underline-offset: 7px !important; }\nhtml[data-dbk=\"p1\"] nav.top-nav .nav-link.active { text-decoration-color: #e7a6b4 !important; }\nhtml[data-dbk=\"p2\"] nav.top-nav .nav-link.active { text-decoration-color: #8fc98a !important; }\nhtml.dbk-has-hero nav.top-nav .nav-links { gap: 18px !important; }\n@media (max-width: 380px) {\n  html[data-dbk] nav.top-nav .nav-link { font-size: 15px !important; }\n  html.dbk-has-hero nav.top-nav .nav-links { gap: 13px !important; }\n}\n/* Person 1's greeting, a size up */\n\nhtml[data-dbk=\"p1\"] .hm #homeGreeting, html[data-dbk=\"p1\"] #homeGreeting { font-size: 46px !important; line-height: 1.05 !important; }\nhtml[data-dbk=\"p1\"] .hm-greet .home-names, html[data-dbk=\"p1\"] #homeNames { font-size: 38px !important; line-height: 1.1 !important; margin-top: 2px !important; }\n/* journal: just the question, its short description, room to write, and past entries */\n\nhtml[data-dbk] :is(.journal-header, .journal-about-toggle, .journal-about-panel, #journalPhaseCard, .journal-prompt-label, .journal-prompt-nav, .journal-form-date) { display: none !important; }\nhtml[data-dbk] .journal-prompt { border: none !important; padding: 6px 0 4px !important; margin: 18px 0 6px !important; text-align: center !important; }\nhtml[data-dbk] .journal-prompt-text { display: block; }\nhtml[data-dbk] .journal-prompt-question { display: block; margin: 0 !important; color: var(--dbk-green) !important; font-weight: 400 !important; }\nhtml[data-dbk=\"p1\"] .journal-prompt-question { font-family: var(--dbk-script) !important; font-size: 2.05rem !important; line-height: 1.15 !important; }\nhtml[data-dbk=\"p2\"] .journal-prompt-question { font-family: var(--dbk-script) !important; font-style: italic; font-size: 1.4rem !important; line-height: 1.35 !important; }\nhtml[data-dbk] .journal-prompt-guidance { display: block; margin-top: 12px !important; font-family: var(--dbk-serif) !important; font-style: normal !important; font-size: 1rem !important; line-height: 1.55 !important; color: rgba(var(--dbk-green-rgb), 0.8) !important; max-width: 34em; margin-left: auto !important; margin-right: auto !important; }\nhtml[data-dbk] .journal-entry-form { margin-top: 10px !important; padding: 0 !important; }\nhtml[data-dbk] #journalTextarea.journal-textarea { min-height: 240px !important; padding: 16px !important; border: 1px solid rgba(var(--dbk-green-rgb), 0.28) !important; border-radius: 2px !important; background: rgba(255, 255, 255, 0.4) !important; color: var(--dbk-green) !important; font-size: 1.05rem !important; line-height: 1.7 !important; box-shadow: none !important; }\nhtml[data-dbk=\"p2\"] #journalTextarea.journal-textarea { background: rgba(255, 255, 255, 0.04) !important; border-color: rgba(230, 234, 239, 0.25) !important; color: #e6eaef !important; }\nhtml[data-dbk] .journal-save-btn { display: block !important; margin: 14px auto 0 !important; }\nhtml[data-dbk] .journal-entries-header { text-transform: none !important; font-weight: 400 !important; border: none !important; padding: 0 !important; text-align: center !important; font-family: var(--dbk-caps) !important; font-size: 1.25rem !important; letter-spacing: 0.05em !important; margin: 34px 0 6px !important; color: var(--dbk-green) !important; }\nhtml[data-dbk] .journal-change-pin { display: block !important; margin: 28px auto 0 !important; }\n\nhtml[data-dbk] .dbk-tabs-pages a { color: rgba(243,238,228,0.85) !important; }\nhtml[data-dbk] .dbk-tabs-pages a.on { color: #f3eee4 !important; }\n/* ===== Pop-ups: every add / edit window opens as a card near the top of the screen, never a drawer from the bottom ===== */\n\nhtml[data-dbk] { --dbk-pop-top: calc(var(--dbk-vvt, 0px) + var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + 14px); }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) {\n  align-items: flex-start !important; justify-content: center !important;\n  padding: var(--dbk-pop-top) 12px 12px !important; box-sizing: border-box !important;\n}\nhtml[data-dbk] :is(#dayModalOverlay > .day-modal, .edit-reminder-overlay > .edit-reminder-modal, #reminderModalOverlay > .reminder-modal, #rtSheet > .rt-sheet, #inboxModal, #habitsModalOverlay > .habits-modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal) {\n  position: relative !important; inset: auto !important; transform: none !important;\n  width: 100% !important; max-width: 460px !important; margin: 0 auto !important;\n  max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch;\n  border-radius: 8px !important; box-shadow: 0 18px 50px rgba(0,0,0,0.28) !important;\n  animation: dbkPopIn 0.16s ease-out;\n}\n/* the two windows that sit on their own (no flex backdrop) get pinned the same way */\n\nhtml[data-dbk] :is(#resourceForm.event-form) {\n  position: fixed !important; top: var(--dbk-pop-top) !important; bottom: auto !important; left: 50% !important; right: auto !important;\n  transform: translateX(-50%) !important; width: calc(100% - 24px) !important; max-width: 460px !important; margin: 0 !important;\n  max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; overflow-y: auto !important;\n  border-radius: 8px !important; box-shadow: 0 18px 50px rgba(0,0,0,0.28) !important; box-sizing: border-box !important;\n}\n@keyframes dbkPopIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }\n@media (prefers-reduced-motion: reduce) { html[data-dbk] * { animation: none !important; } }\nhtml[data-dbk] .edit-reminder-modal .modal-body { max-height: none !important; overflow: visible !important; }\n/* adding an event: just the form, no event list or second \"Add\" button above it */\n\nhtml[data-dbk] .day-modal:has(#dayModalForm.visible) :is(#dayModalEvents, .day-modal-add) { display: none !important; }\nhtml[data-dbk] #dayModalForm > div[style*=\"grid\"] > div { min-width: 0; }\nhtml[data-dbk] :is(#dayModalForm, .edit-reminder-modal, .reminder-modal, .rt-sheet) :is(input, textarea, select) { max-width: 100%; min-width: 0; box-sizing: border-box; }\nhtml[data-dbk] #dayModalForm input[type=\"time\"] { width: 100% !important; }\n/* buttons inside pop-ups: Save is solid and readable, Cancel is an outline */\n\nhtml[data-dbk=\"p1\"] :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, .habits-modal, #resourceForm, .modal) :is(.btn, .rt-save, button[type=\"submit\"], .journal-save-btn, .habits-modal-save) { background: #2f3a2c !important; color: #f3eee4 !important; border: 1px solid #2f3a2c !important; opacity: 1 !important; }\nhtml[data-dbk=\"p2\"] :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, .habits-modal, #resourceForm, .modal) :is(.btn, .rt-save, button[type=\"submit\"], .journal-save-btn, .habits-modal-save) { background: #8fc98a !important; color: #0c1118 !important; border: 1px solid #8fc98a !important; opacity: 1 !important; }\nhtml[data-dbk=\"p1\"] :is(.day-modal, .edit-reminder-modal, .reminder-modal, .modal) .cancel-contact-btn { background: transparent !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.45) !important; opacity: 1 !important; }\nhtml[data-dbk=\"p2\"] :is(.day-modal, .edit-reminder-modal, .reminder-modal, .modal) .cancel-contact-btn { background: transparent !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.4) !important; opacity: 1 !important; }\n/* pop-ups sit above the menu and the capture bar so their title and close button are never covered */\n\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay) { z-index: 30000 !important; }\nhtml[data-dbk] #resourceForm.event-form { z-index: 30001 !important; }\nhtml[data-dbk=\"p1\"] :is(.edit-reminder-modal, #resourceForm, .modal, .habits-modal) :is(.cancel-btn, .cancel-btn.btn, .btn-secondary, .habits-modal-cancel) { background: transparent !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.45) !important; }\nhtml[data-dbk=\"p2\"] :is(.edit-reminder-modal, #resourceForm, .modal, .habits-modal) :is(.cancel-btn, .cancel-btn.btn, .btn-secondary, .habits-modal-cancel) { background: transparent !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.4) !important; }\nhtml[data-dbk=\"p1\"] :is(.edit-reminder-modal, #resourceForm, .modal, .habits-modal, .day-modal) .btn:is([onclick*=\"hide\"], [onclick*=\"close\"], [onclick*=\"Cancel\"], [onclick*=\"cancel\"]) { background: transparent !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.45) !important; }\nhtml[data-dbk=\"p2\"] :is(.edit-reminder-modal, #resourceForm, .modal, .habits-modal, .day-modal) .btn:is([onclick*=\"hide\"], [onclick*=\"close\"], [onclick*=\"Cancel\"], [onclick*=\"cancel\"]) { background: transparent !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.4) !important; }\n/* New Event window */\n\nhtml[data-dbk] #addEventModalOverlay { align-items: flex-start !important; justify-content: center !important; padding: var(--dbk-pop-top) 12px 12px !important; box-sizing: border-box !important; z-index: 30000 !important; }\nhtml[data-dbk] #addEventModalOverlay > .modal { position: relative !important; inset: auto !important; transform: none !important; width: 100% !important; max-width: 460px !important; margin: 0 auto !important; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; overflow-y: auto !important; border-radius: 8px !important; box-shadow: 0 18px 50px rgba(0,0,0,0.28) !important; animation: dbkPopIn 0.16s ease-out; }\nhtml[data-dbk] #addEventModalOverlay .modal-body { max-height: none !important; overflow: visible !important; }\nhtml[data-dbk] #addEventModalOverlay form:not(.dbk-more-open) .dbk-more { display: none !important; }\nhtml[data-dbk] #addEventModalOverlay .form-row-2 { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; }\nhtml[data-dbk] #addEventModalOverlay .form-row-2 > * { min-width: 0 !important; }\nhtml[data-dbk] #addEventModalOverlay input[type=\"time\"] { width: 100% !important; min-width: 0 !important; box-sizing: border-box !important; }\nhtml[data-dbk] .dbk-more-toggle { all: unset; display: block; margin: 4px auto 14px; cursor: pointer; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\nhtml[data-dbk=\"p1\"] .dbk-more-toggle { color: #2f3a2c; }\nhtml[data-dbk=\"p2\"] .dbk-more-toggle { color: #e6eaef; }\nhtml[data-dbk] #addEventModalOverlay .form-actions { display: flex !important; justify-content: center !important; gap: 10px !important; }\nhtml[data-dbk=\"p1\"] #addEventModalOverlay .btn[type=\"submit\"] { background: #2f3a2c !important; color: #f3eee4 !important; border: 1px solid #2f3a2c !important; }\nhtml[data-dbk=\"p2\"] #addEventModalOverlay .btn[type=\"submit\"] { background: #8fc98a !important; color: #0c1118 !important; border: 1px solid #8fc98a !important; }\nhtml[data-dbk=\"p1\"] #addEventModalOverlay .cancel-btn { background: transparent !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.45) !important; }\nhtml[data-dbk=\"p2\"] #addEventModalOverlay .cancel-btn { background: transparent !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.4) !important; }\n/* the date picker opens above pop-ups */\n\nhtml[data-dbk] .hh-dp-popover { z-index: 30020 !important; }\n/* Us: a list opens as a pop-up near the top (above the menu), and its add form opens on top of that */\n\nhtml[data-dbk] #section-modal { top: 0 !important; bottom: 0 !important; z-index: 30000 !important; align-items: flex-start !important; justify-content: center !important; padding: var(--dbk-pop-top) 12px 12px !important; box-sizing: border-box !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(20,24,18,0.55) !important; }\nhtml[data-dbk] #section-modal .section-modal-inner { transform: none !important; width: 100% !important; max-width: 520px !important; margin: 0 auto !important; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; height: auto !important; overflow-y: auto !important; border-radius: 8px !important; box-shadow: 0 18px 50px rgba(0,0,0,0.28) !important; }\nhtml[data-dbk] .dream-form { z-index: 30010 !important; align-items: flex-start !important; padding: var(--dbk-pop-top) 12px 12px !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; background: rgba(20,24,18,0.55) !important; }\nhtml[data-dbk] .dream-form form { max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; border-radius: 8px !important; animation: dbkPopIn 0.16s ease-out; }\nhtml[data-dbk] .dream-form .checkbox-label span { font-size: 15px !important; letter-spacing: 0.02em !important; }\nhtml[data-dbk] .dream-form .checkbox-label { padding: 8px 10px !important; }\nhtml[data-dbk] .dream-form .form-actions { display: flex !important; justify-content: center !important; gap: 10px !important; }\nhtml[data-dbk=\"p1\"] .dream-form .save-btn { background: #2f3a2c !important; color: #f3eee4 !important; border: 1px solid #2f3a2c !important; }\nhtml[data-dbk=\"p2\"] .dream-form .save-btn { background: #8fc98a !important; color: #0c1118 !important; border: 1px solid #8fc98a !important; }\nhtml[data-dbk=\"p1\"] .dream-form .btn:not(.save-btn) { background: transparent !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.45) !important; }\nhtml[data-dbk=\"p2\"] .dream-form .btn:not(.save-btn) { background: transparent !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.4) !important; }\nhtml[data-dbk] .dream-form form:not(.dbk-more-open) .dbk-more { display: none !important; }\n/* pop-ups sit a little above the middle of the screen (centered in what's visible above the keyboard when it's up);\n   a pop-up taller than the space simply starts at the top and scrolls inside */\n\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form) {\n  padding: var(--dbk-pop-top) 12px calc(var(--dbk-kbh, 0px) + var(--dbk-popbias, calc(14 * var(--dbk-vh, 1vh))) + 12px) !important;\n  align-items: flex-start !important;\n}\nhtml[data-dbk] :is(#dayModalOverlay > .day-modal, .edit-reminder-overlay > .edit-reminder-modal, #reminderModalOverlay > .reminder-modal, #rtSheet > .rt-sheet, #inboxModal, #habitsModalOverlay > .habits-modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal, #addEventModalOverlay > .modal, #section-modal > .section-modal-inner, .dream-form > form) {\n  margin: auto !important;\n}\nhtml[data-dbk] #resourceForm.event-form.active {\n  top: var(--dbk-pop-top) !important; bottom: calc(var(--dbk-kbh, 0px) + var(--dbk-popbias, calc(14 * var(--dbk-vh, 1vh))) + 12px) !important;\n  left: 12px !important; right: 12px !important; width: auto !important; transform: none !important;\n  margin: auto !important; height: fit-content !important;\n}\n/* ===== One row under the top menu ===== */\n\nhtml[data-dbk] .dbk-subnav { display: flex; gap: 22px; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; -webkit-overflow-scrolling: touch;\n  margin: 0 -16px; padding: 2px 16px 4px; width: auto; justify-content: safe center;\n  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); mask-image: linear-gradient(90deg, transparent 0, #000 14px, #000 calc(100% - 22px), transparent 100%); }\nhtml[data-dbk] .dbk-subnav::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .dbk-subnav a { flex: none; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.05em; color: rgba(243,238,228,0.82); text-decoration: none; padding: 6px 0 5px; border-bottom: 2px solid transparent; white-space: nowrap; }\nhtml[data-dbk] .dbk-subnav a.on { color: #f3eee4; }\nhtml[data-dbk=\"p1\"] .dbk-subnav a.on { border-bottom-color: #e7a6b4; }\nhtml[data-dbk=\"p2\"] .dbk-subnav a.on { border-bottom-color: #8fc98a; color: #e6eaef; }\nhtml[data-dbk=\"p2\"] .dbk-subnav a { color: rgba(230,234,239,0.8); }\nhtml[data-dbk] .dbk-hero:has(.dbk-subnav) { padding: 4px 16px 10px !important; }\nhtml[data-dbk] .dbk-hero .dbk-subnav + .dbk-tabs { display: none !important; }\n/* a page's own sections: one quiet switch at the top of the page */\n\nhtml[data-dbk] .dbk-seg { display: flex; justify-content: center; gap: 0; margin: 18px auto 6px; width: fit-content; max-width: calc(100% - 32px); border: 1px solid rgba(var(--dbk-green-rgb), 0.35); border-radius: 999px; padding: 3px; }\nhtml[data-dbk] .dbk-seg button { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: 0.04em; padding: 7px 16px; border-radius: 999px; color: var(--dbk-green); white-space: nowrap; }\nhtml[data-dbk=\"p1\"] .dbk-seg button.on { background: #2f3a2c; color: #f3eee4; }\nhtml[data-dbk=\"p2\"] .dbk-seg { border-color: rgba(230,234,239,0.28); }\nhtml[data-dbk=\"p2\"] .dbk-seg button { color: #e6eaef; }\nhtml[data-dbk=\"p2\"] .dbk-seg button.on { background: #8fc98a; color: #0c1118; }\nhtml[data-dbk] .dbk-seg button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* the moon note keeps just the note; the phase is already up top */\n/* ===== Design pass ===== */\n/* Home: nothing to act on, nothing to press */\n\nhtml[data-dbk] #currentReminder.is-empty .hm-actions, html[data-dbk] #currentReminder.is-empty .hm-rem-meta { display: none !important; }\n/* nothing due: no Reminder section on Today at all */\nhtml[data-dbk]:not(#z) #currentReminder.is-empty { display: none !important; }\nhtml[data-dbk] section:has(#thing-0 .thing-text.empty):has(#thing-1 .thing-text.empty):has(#thing-2 .thing-text.empty) .hm-center > :is([onclick=\"threeThingsClear()\"], .hm-sep) { display: none !important; }\n/* Habits bingo: the three buttons become one quiet row of links */\n\nhtml[data-dbk] #bingoControls { display: flex !important; justify-content: center !important; flex-wrap: wrap !important; gap: 6px 18px !important; margin: 16px 0 6px !important; }\nhtml[data-dbk] #bingoControls .btn { all: unset !important; cursor: pointer !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.04em !important; color: var(--dbk-green) !important; text-decoration: underline !important; text-underline-offset: 5px !important; text-decoration-thickness: 1px !important; }\nhtml[data-dbk=\"p2\"] #bingoControls .btn { color: #e6eaef !important; }\n/* sections whose name is already the highlighted menu item don't repeat it */\n\n/* Us: empty lists don't each say so */\n\nhtml[data-dbk] #sectionTiles .dbk-tile-note:empty { display: none !important; }\n/* Meals: the plan already shows \"Tap to add\" on every meal; the extra start-here card goes */\n\nhtml[data-dbk] #plan-first-run { display: none !important; }\n/* Meals journal: no placeholder card until there are patterns to show */\n\nhtml[data-dbk] .journal-patterns-card:has(.journal-patterns-empty) { display: none !important; }\nhtml[data-dbk=\"p2\"] .dbk-subnav a:not(.on) { border-bottom-color: transparent !important; }\nhtml[data-dbk=\"p2\"] .dbk-subnav a.on { border-bottom-color: #8fc98a !important; }\nhtml[data-dbk-page=\"meal-plan\"] #week-nav { margin-bottom: 8px !important; }\n/* ===== Moving between pages ===== */\n/* pages cross-fade into each other and the menu stays put (iPhone on iOS 18.2+, Chrome) */\n\n@view-transition { navigation: auto; }\nhtml[data-dbk] nav.top-nav { view-transition-name: dbk-nav; }\nhtml[data-dbk-page=\"index\"] .capture-sticky-bar { view-transition-name: dbk-capture; }\n::view-transition-group(dbk-nav), ::view-transition-group(dbk-capture) { animation: none; }\n::view-transition-old(dbk-nav), ::view-transition-new(dbk-nav) { animation: none; }\n::view-transition-old(root) { animation: 160ms ease-out both dbkFadeOut; }\n::view-transition-new(root) { animation: 200ms ease-out both dbkFadeIn; }\n@keyframes dbkFadeOut { to { opacity: 0; } }\n@keyframes dbkFadeIn { from { opacity: 0; } }\n@media (prefers-reduced-motion: reduce) { ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; } }\n/* the menu never blinks out while a page loads; the page itself fades in instead of popping */\n\nhtml.dbk-loading nav.top-nav .nav-container, html.dbk-loading nav.top-nav .nav-links { visibility: visible !important; }\nhtml.dbk-loading body > *:not(nav):not(script):not(style) { visibility: visible !important; opacity: 0 !important; }\nhtml[data-dbk] body > *:not(nav):not(script):not(style) { transition: opacity 150ms ease-out; }\n/* ===== Workroom content ===== */\n\nhtml[data-dbk] { --wrc-ink: #2f3a2c; --wrc-ink-rgb: 47,58,44; --wrc-paper: #f3eee4; --wrc-accent: #b0596b; --wrc-solid: #2f3a2c; --wrc-solid-ink: #f3eee4; }\nhtml[data-dbk=\"p2\"] { --wrc-ink: #e6eaef; --wrc-ink-rgb: 230,234,239; --wrc-paper: #121c2b; --wrc-accent: #8fc98a; --wrc-solid: #8fc98a; --wrc-solid-ink: #0c1118; }\nhtml[data-dbk] .wrc-new { display: flex; gap: 8px; margin: 4px 0 6px; }\nhtml[data-dbk] .wrc-input, html[data-dbk] .wrc-ta, html[data-dbk] .wrc-select, html[data-dbk] .wrc-titlein { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--wrc-ink); background: rgba(255,255,255,0.35); border: 1px solid rgba(var(--wrc-ink-rgb),0.25); border-radius: 4px; padding: 10px 12px; }\nhtml[data-dbk=\"p2\"] :is(.wrc-input, .wrc-ta, .wrc-select, .wrc-titlein) { background: rgba(255,255,255,0.05); }\nhtml[data-dbk] .wrc-ta { resize: vertical; line-height: 1.5; }\nhtml[data-dbk] .wrc-new .wrc-input { flex: 1; min-width: 0; }\nhtml[data-dbk] .wrc-act { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: 0.04em; padding: 9px 15px; border-radius: 4px; border: 1px solid rgba(var(--wrc-ink-rgb),0.4); color: var(--wrc-ink); text-align: center; white-space: nowrap; }\nhtml[data-dbk] .wrc-act.wrc-solid { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .wrc-act.wrc-solid.quiet { background: transparent; color: var(--wrc-ink); border-color: rgba(var(--wrc-ink-rgb),0.4); }\nhtml[data-dbk] .wrc-link { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: 0.04em; color: var(--wrc-ink); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\nhtml[data-dbk] .wrc-center { text-align: center; margin: 8px 0 12px; }\nhtml[data-dbk] .wrc-empty { text-align: center; font-style: italic; color: rgba(var(--wrc-ink-rgb),0.7); padding: 18px 8px; }\nhtml[data-dbk] .wrc-card { padding: 14px 2px; border-top: 1px solid rgba(var(--wrc-ink-rgb),0.2); cursor: pointer; }\nhtml[data-dbk] .wrc-card:last-child { border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.2); }\nhtml[data-dbk] .wrc-title { font-size: 1.08rem; line-height: 1.4; color: var(--wrc-ink); overflow-wrap: anywhere; }\nhtml[data-dbk] .wrc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }\nhtml[data-dbk] .wrc-chip { font-family: var(--dbk-caps); font-size: 12.5px; letter-spacing: 0.04em; padding: 3px 9px; border-radius: 999px; border: 1px solid rgba(var(--wrc-ink-rgb),0.3); color: var(--wrc-ink); }\nhtml[data-dbk] .wrc-next { display: flex; align-items: center; gap: 10px; margin-top: 8px; font-size: 0.95rem; color: rgba(var(--wrc-ink-rgb),0.85); font-style: italic; }\nhtml[data-dbk] .wrc-dots { display: inline-flex; gap: 4px; font-style: normal; }\nhtml[data-dbk] .wrc-dots i { width: 8px; height: 8px; border-radius: 50%; border: 1px solid rgba(var(--wrc-ink-rgb),0.5); }\nhtml[data-dbk] .wrc-dots i.on { background: var(--wrc-ink); border-color: var(--wrc-ink); }\nhtml[data-dbk] .wrc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }\n/* the editor: a tall pop-up from near the top, scrolling inside */\n\nhtml[data-dbk] .wrc-overlay { position: fixed; inset: 0; z-index: 30000; display: none; align-items: flex-start; justify-content: center; padding: var(--dbk-pop-top) 10px calc(var(--dbk-kbh, 0px) + 10px); box-sizing: border-box; background: rgba(20,24,18,0.55); }\nhtml[data-dbk] .wrc-overlay.open { display: flex; }\nhtml[data-dbk] .wrc-sheet { position: relative; width: 100%; max-width: 560px; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 12px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--wrc-paper); color: var(--wrc-ink); border-radius: 8px; padding: 10px 18px 22px; box-shadow: 0 18px 50px rgba(0,0,0,0.3); animation: dbkPopIn 0.16s ease-out; }\nhtml[data-dbk] .wrc-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -10px; background: var(--wrc-paper); margin: -10px -18px 4px; padding: 8px 12px 4px 18px; z-index: 2; }\nhtml[data-dbk] .wrc-x { all: unset; cursor: pointer; font-size: 28px; line-height: 1; padding: 4px 8px; color: var(--wrc-ink); }\nhtml[data-dbk] .wrc-saved { font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.05em; opacity: 0; transition: opacity 0.2s; color: rgba(var(--wrc-ink-rgb),0.7); }\nhtml[data-dbk] .wrc-saved.on { opacity: 1; }\nhtml[data-dbk] .wrc-titlein { font-family: var(--dbk-caps); font-size: 20px; line-height: 1.3; letter-spacing: 0.02em; border: none; border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.3); border-radius: 0; background: transparent !important; padding: 6px 0 10px; resize: none; }\nhtml[data-dbk] .wrc-select { margin-top: 10px; }\nhtml[data-dbk] .wrc-chiprow, html[data-dbk] .wrc-starters { display: flex; flex-wrap: wrap; gap: 6px; }\nhtml[data-dbk] .wrc-chiprow[data-name=\"stage\"] { margin: 12px 0 4px; }\nhtml[data-dbk] .wrc-starters { margin-top: 8px; }\nhtml[data-dbk] .wrc-pick { all: unset; cursor: pointer; font-size: 14px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(var(--wrc-ink-rgb),0.32); color: var(--wrc-ink); line-height: 1.25; }\nhtml[data-dbk] .wrc-pick.on { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .wrc-steps { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }\nhtml[data-dbk] .wrc-step { all: unset; font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.04em; padding: 4px 10px; border-radius: 4px; color: rgba(var(--wrc-ink-rgb),0.75); border: 1px dashed rgba(var(--wrc-ink-rgb),0.35); }\nhtml[data-dbk] .wrc-step.manual { cursor: pointer; border-style: solid; }\nhtml[data-dbk] .wrc-step.done { color: var(--wrc-ink); border: 1px solid var(--wrc-ink); }\nhtml[data-dbk] .wrc-nextline { margin: 8px 0 4px; font-style: italic; color: var(--wrc-accent); font-size: 1rem; }\nhtml[data-dbk] .wrc-field { margin-top: 18px; }\nhtml[data-dbk] .wrc-label { font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.06em; margin-bottom: 7px; color: var(--wrc-ink); }\nhtml[data-dbk] .wrc-field .wrc-link { display: inline-block; margin-top: 8px; font-size: 13.5px; }\nhtml[data-dbk] .wrc-foot { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }\nhtml[data-dbk] .wrc-del { font-size: 13.5px; opacity: 0.75; }\nhtml[data-dbk] .wrc-prompt { font-family: var(--dbk-caps); font-size: 22px; line-height: 1.35; text-align: center; padding: 18px 6px 4px; text-wrap: balance; }\nhtml[data-dbk] .wrc-hint { text-align: center; font-size: 0.92rem; font-style: italic; color: rgba(var(--wrc-ink-rgb),0.7); margin-top: 14px; }\n/* Home Base: who sees it, and the content toolkit */\n\nhtml[data-dbk] .wrc-who { text-align: center; padding: 14px 16px; cursor: pointer; color: var(--wrc-ink); font-size: 1rem; }\nhtml[data-dbk] .wrc-who .wrc-link { margin-left: 8px; font-size: 13.5px; }\nhtml[data-dbk] .wrc-tk { margin-top: 14px; }\nhtml[data-dbk] .wrc-tk-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }\nhtml[data-dbk] .wrc-tk-chip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 6px 4px 11px; border-radius: 999px; border: 1px solid rgba(var(--wrc-ink-rgb),0.35); font-size: 14px; }\nhtml[data-dbk] :is(.wrc-tk-chip, .wrc-tk-li) button { all: unset; cursor: pointer; padding: 0 6px; font-size: 16px; opacity: 0.7; }\nhtml[data-dbk] .wrc-tk-li { display: flex; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.15); font-size: 0.98rem; }\nhtml[data-dbk] .wrc-tk-text { cursor: pointer; font-size: 0.98rem; line-height: 1.5; }\nhtml[data-dbk] .wrc-tk-text .empty { font-style: italic; opacity: 0.7; }\nhtml[data-dbk] .wrc-tk .wrc-link { font-size: 13.5px; }\n/* Home inbox: the two Workroom buttons stand out a little */\n\n/* Home inbox buttons readable */\n\nhtml[data-dbk] .wrc-starters[hidden] { display: none !important; }\nhtml[data-dbk] #homebaseBizSwitcher, html[data-dbk] #sparkBizSwitcher { margin: 6px 0 2px !important; }\n/* ===== Smooth scrolling ===== */\n/* the paper-grain overlay covered the whole page and had to be repainted while scrolling; it's gone */\n\nhtml[data-dbk] body::after { content: none !important; display: none !important; }\n/* blur behind solid bars and pop-ups costs a lot while scrolling and can't be seen anyway */\n\nhtml[data-dbk] *, html[data-dbk] *::before, html[data-dbk] *::after { backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }\n/* ===== Trip planner (Us > Travel) ===== */\n\nhtml[data-dbk] .tp-overlay { position: fixed; inset: 0; z-index: 30030; display: none; align-items: flex-start; justify-content: center; padding: var(--dbk-pop-top) 10px calc(var(--dbk-kbh, 0px) + 10px); box-sizing: border-box; background: rgba(20,24,18,0.55); }\nhtml[data-dbk] .tp-overlay.open { display: flex; }\nhtml[data-dbk] .tp-sheet { width: 100%; max-width: 560px; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 12px); overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; background: var(--wrc-paper); color: var(--wrc-ink); border-radius: 8px; padding: 10px 18px 26px; box-shadow: 0 18px 50px rgba(0,0,0,0.3); animation: dbkPopIn 0.16s ease-out; box-sizing: border-box; }\nhtml[data-dbk] .tp-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: -10px; background: var(--wrc-paper); margin: -10px -18px 0; padding: 8px 12px 2px 18px; z-index: 2; }\nhtml[data-dbk] .tp-x { all: unset; cursor: pointer; font-size: 28px; line-height: 1; padding: 4px 8px; color: var(--wrc-ink); }\nhtml[data-dbk] .tp-saved { font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.05em; opacity: 0; transition: opacity 0.2s; color: rgba(var(--wrc-ink-rgb),0.7); }\nhtml[data-dbk] .tp-saved.on { opacity: 1; }\nhtml[data-dbk=\"p1\"] .tp-title { font-family: var(--dbk-script); font-size: 40px; line-height: 1.1; text-align: center; }\nhtml[data-dbk=\"p2\"] .tp-title { font-family: var(--dbk-caps); font-size: 24px; letter-spacing: 0.04em; text-align: center; }\nhtml[data-dbk] .tp-field { display: block; }\nhtml[data-dbk] .tp-label { display: block; font-family: var(--dbk-caps); font-size: 13.5px; letter-spacing: 0.06em; margin-bottom: 6px; color: var(--wrc-ink); }\nhtml[data-dbk] .tp-input { width: 100%; box-sizing: border-box; font: inherit; font-size: 16px; color: var(--wrc-ink); background: rgba(255,255,255,0.35); border: 1px solid rgba(var(--wrc-ink-rgb),0.25); border-radius: 4px; padding: 9px 11px; min-width: 0; }\nhtml[data-dbk=\"p2\"] .tp-input { background: rgba(255,255,255,0.05); }\nhtml[data-dbk] .tp-ta { resize: vertical; line-height: 1.5; }\nhtml[data-dbk] .tp-stop { display: flex; gap: 12px; align-items: flex-start; padding: 11px 2px; border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.14); cursor: pointer; }\nhtml[data-dbk] .tp-time { flex: none; width: 66px; font-family: var(--dbk-caps); font-size: 13.5px; letter-spacing: 0.03em; padding-top: 2px; color: rgba(var(--wrc-ink-rgb),0.8); white-space: nowrap; }\nhtml[data-dbk] .tp-stop-main { flex: 1; min-width: 0; }\nhtml[data-dbk] .tp-stop-name { font-size: 1.05rem; line-height: 1.35; }\nhtml[data-dbk] .tp-stop-notes { font-size: 0.93rem; color: rgba(var(--wrc-ink-rgb),0.78); margin-top: 3px; line-height: 1.45; white-space: pre-wrap; }\nhtml[data-dbk] .tp-link { flex: none; font-family: var(--dbk-caps); font-size: 13px; color: var(--wrc-ink); text-decoration: underline; text-underline-offset: 4px; padding-top: 2px; }\nhtml[data-dbk] .tp-add { all: unset; cursor: pointer; display: block; margin: 10px auto 0; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; color: var(--wrc-ink); }\nhtml[data-dbk] .tp-mini { all: unset; cursor: pointer; padding: 2px 8px; font-size: 18px; line-height: 1; color: rgba(var(--wrc-ink-rgb),0.75); }\nhtml[data-dbk] .tp-center { text-align: center; margin-top: 20px; }\nhtml[data-dbk] .tp-btn { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: 0.04em; padding: 9px 16px; border-radius: 4px; border: 1px solid rgba(var(--wrc-ink-rgb),0.4); color: var(--wrc-ink); text-align: center; }\nhtml[data-dbk] .tp-btn.tp-solid { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .tp-btn.tp-danger, html[data-dbk] .tp-btn.sure { color: var(--wrc-accent); border-color: var(--wrc-accent); }\nhtml[data-dbk] .tp-pack { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.14); }\nhtml[data-dbk] .tp-pack input { width: 18px; height: 18px; accent-color: var(--wrc-solid); flex: none; }\nhtml[data-dbk] .tp-pack span { flex: 1; }\nhtml[data-dbk] .tp-pack input:checked + span { text-decoration: line-through; opacity: 0.6; }\nhtml[data-dbk] .tp-packadd { display: flex; gap: 8px; margin-top: 10px; }\n/* the little pop-up for a stop */\n\nhtml[data-dbk] .tp-pop-overlay { position: fixed; inset: 0; z-index: 30040; display: flex; align-items: flex-start; justify-content: center; padding: var(--dbk-pop-top) 12px calc(var(--dbk-kbh, 0px) + var(--dbk-popbias, calc(14 * var(--dbk-vh, 1vh))) + 12px); box-sizing: border-box; background: rgba(20,24,18,0.35); }\nhtml[data-dbk] .tp-pop { margin: auto; width: 100%; max-width: 440px; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px); overflow-y: auto; background: var(--wrc-paper); color: var(--wrc-ink); border-radius: 8px; padding: 10px 16px 18px; box-shadow: 0 18px 50px rgba(0,0,0,0.3); display: flex; flex-direction: column; gap: 10px; animation: dbkPopIn 0.16s ease-out; box-sizing: border-box; }\nhtml[data-dbk] .tp-pop-h { display: flex; justify-content: space-between; align-items: center; font-family: var(--dbk-caps); font-size: 17px; letter-spacing: 0.05em; }\nhtml[data-dbk] .tp-inline { display: flex; align-items: center; gap: 10px; }\nhtml[data-dbk] .tp-inline .tp-label { margin: 0; }\nhtml[data-dbk] .tp-inline .tp-input { width: auto; flex: 1; }\nhtml[data-dbk] .tp-kinds { display: flex; flex-wrap: wrap; gap: 6px; }\nhtml[data-dbk] .tp-pick { all: unset; cursor: pointer; font-size: 14px; padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(var(--wrc-ink-rgb),0.32); color: var(--wrc-ink); }\nhtml[data-dbk] .tp-pick.on { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .tp-pop-actions { display: flex; justify-content: center; margin-top: 4px; }\nhtml[data-dbk] .tp-linkbtn { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 13.5px; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 4px; color: var(--wrc-ink); opacity: 0.85; }\nhtml[data-dbk] .tp-pop .tp-center { margin-top: 0; }\nhtml[data-dbk] .tp-menu { display: flex; flex-direction: column; gap: 8px; }\n/* the trip button and summary in the Travel list */\n\nhtml[data-dbk] .detail-popup-actions .tp-open { order: -1; }\nhtml[data-dbk] .dream-item-trip { font-size: 0.88rem; font-style: italic; color: rgba(var(--wrc-ink-rgb),0.75); margin-top: 2px; }\nhtml[data-dbk=\"p1\"] .detail-popup-actions .icon-btn.tp-open { background: #2f3a2c !important; color: #f3eee4 !important; border-color: #2f3a2c !important; }\nhtml[data-dbk=\"p2\"] .detail-popup-actions .icon-btn.tp-open { background: #8fc98a !important; color: #0c1118 !important; border-color: #8fc98a !important; }\n/* Us: every pop-up that opens from a list sits above the list window, upper-middle like the rest */\n\nhtml[data-dbk] :is(#detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal) { z-index: 30020 !important; align-items: flex-start !important; justify-content: center !important; padding: var(--dbk-pop-top) 12px calc(var(--dbk-kbh, 0px) + var(--dbk-popbias, calc(14 * var(--dbk-vh, 1vh))) + 12px) !important; box-sizing: border-box !important; background: rgba(20,24,18,0.55) !important; }\nhtml[data-dbk] :is(#detailPopup > .detail-popup-box, #triedModal > .tried-modal-box, #pickerFilterModal > .picker-filter-box, #skippedAnswerModal > .skipped-answer-box) { margin: auto !important; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 14px) !important; overflow-y: auto !important; border-radius: 8px !important; animation: dbkPopIn 0.16s ease-out; }\nhtml[data-dbk] .lightbox { z-index: 30050 !important; }\n/* Lists: with every list put away in Settings, the empty \"Lists\" heading goes too */\nhtml[data-dbk] .dbk-sec:has(> #sectionTiles):not(:has(.landing-tile)) { display: none !important; }\n/* (the packing list uses the app's own tick boxes like everywhere else; Kasey, Oct 23: \"hate the black check boxes\") */\n/* trip planner, tidied: one section at a time, one day at a time */\n\nhtml[data-dbk] .tp-meta { all: unset; cursor: pointer; display: block; margin: 4px auto 0; text-align: center; font-style: italic; color: rgba(var(--wrc-ink-rgb),0.8); text-decoration: underline; text-decoration-color: rgba(var(--wrc-ink-rgb),0.3); text-underline-offset: 4px; }\nhtml[data-dbk] .tp-tabs { display: flex; gap: 4px; justify-content: center; margin: 16px -6px 6px; padding: 3px; border: 1px solid rgba(var(--wrc-ink-rgb),0.3); border-radius: 999px; overflow-x: auto; scrollbar-width: none; }\nhtml[data-dbk] .tp-tabs::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .tp-tabs button { all: unset; cursor: pointer; flex: 1 0 auto; text-align: center; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.03em; padding: 7px 10px; border-radius: 999px; color: var(--wrc-ink); white-space: nowrap; }\nhtml[data-dbk] .tp-tabs button.on { background: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .tp-body { padding-top: 10px; min-height: 160px; }\nhtml[data-dbk] .tp-first { margin-top: 36px; }\nhtml[data-dbk] .tp-daypills { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 4px 2px 10px; margin: 0 -4px; }\nhtml[data-dbk] .tp-daypills::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .tp-daypill { all: unset; cursor: pointer; flex: none; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 62px; padding: 7px 10px; border-radius: 6px; border: 1px solid rgba(var(--wrc-ink-rgb),0.3); color: var(--wrc-ink); }\nhtml[data-dbk] .tp-daypill b { font-family: var(--dbk-caps); font-weight: 400; font-size: 14.5px; letter-spacing: 0.03em; }\nhtml[data-dbk] .tp-daypill span { font-size: 12px; opacity: 0.8; white-space: nowrap; }\nhtml[data-dbk] .tp-daypill.on { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .tp-daypill.tp-plus { justify-content: center; font-size: 22px; line-height: 1; min-width: 44px; border-style: dashed; }\nhtml[data-dbk] .tp-body .tp-center { margin-top: 18px; }\nhtml[data-dbk] .tp-body .tp-field { margin-bottom: 14px; }\nhtml[data-dbk] .tp-body .tp-packadd { margin-top: 12px; }\n/* ===== Pop-ups: centered text, the close button tucked into the top-right corner ===== */\n\nhtml[data-dbk] :is(.detail-popup-box, #addEventModalOverlay > .modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal, .day-modal, .edit-reminder-modal, .reminder-modal, #inboxModal, .habits-modal, .rt-sheet, .tried-modal-box, .skipped-answer-box, .picker-filter-box, #resourceForm, .section-modal-inner, .ai-panel, .dream-form form, .seasonal-modal) { position: relative !important; }\nhtml[data-dbk] :is(.detail-popup-close, .modal-close, .day-modal-close, .habits-modal-close, .reminder-modal-close, .inbox-modal-close, .rt-x, .skipped-answer-close, .seasonal-modal-close, .section-modal-back) {\n  position: absolute !important; top: 0 !important; right: 0 !important; left: auto !important; bottom: auto !important; float: none !important;\n  width: 40px !important; height: 40px !important; margin: 0 !important; padding: 0 !important;\n  display: flex !important; align-items: center !important; justify-content: center !important;\n  font-size: 24px !important; line-height: 1 !important; background: none !important; border: none !important; box-shadow: none !important; border-radius: 50% !important; z-index: 5 !important;\n}\nhtml[data-dbk=\"p1\"] :is(.detail-popup-close, .modal-close, .day-modal-close, .habits-modal-close, .reminder-modal-close, .inbox-modal-close, .rt-x, .skipped-answer-close, .seasonal-modal-close) { color: #2f3a2c !important; }\nhtml[data-dbk=\"p2\"] :is(.detail-popup-close, .modal-close, .day-modal-close, .habits-modal-close, .reminder-modal-close, .inbox-modal-close, .rt-x, .skipped-answer-close, .seasonal-modal-close) { color: #e6eaef !important; }\n/* the sticky heads in the Workroom and trip editors: the x sits right in the corner too */\n\nhtml[data-dbk] :is(.wrc-head, .tp-head) { padding-right: 4px !important; padding-top: 4px !important; }\nhtml[data-dbk] :is(.wrc-x, .tp-x) { width: 42px; height: 42px; display: flex !important; align-items: center; justify-content: center; padding: 0 !important; font-size: 26px !important; }\nhtml[data-dbk] .tp-pop-h { position: relative; justify-content: center !important; text-align: center; padding: 6px 40px 2px !important; }\nhtml[data-dbk] .tp-pop-h .tp-x { position: absolute !important; top: -6px; right: -12px; }\n/* headers and titles in the middle, clear of the x */\n\nhtml[data-dbk] :is(.modal-header, .day-modal-header, .reminder-modal-header, .habits-modal-header, .skipped-answer-header, .picker-filter-header, .seasonal-modal-header, .section-modal-header) { justify-content: center !important; text-align: center !important; padding-left: 44px !important; padding-right: 44px !important; }\nhtml[data-dbk] :is(.detail-popup-title, .modal-title, .day-modal-title, .reminder-modal-title, .habits-modal-title, .tried-modal-title, .tried-modal-name, .ai-panel-title, .ai-panel-subtitle, .inbox-modal-title, .section-modal-title, .seasonal-modal-title) { text-align: center !important; margin-left: auto !important; margin-right: auto !important; padding-left: 0 !important; padding-right: 0 !important; width: 100%; }\nhtml[data-dbk] .detail-popup-title { padding: 4px 36px 0 !important; margin-bottom: 14px !important; box-sizing: border-box; }\nhtml[data-dbk] .detail-popup-meta, html[data-dbk] .detail-popup-details { text-align: center; justify-content: center; }\nhtml[data-dbk] .inbox-header-top { flex-direction: column !important; align-items: center !important; gap: 6px !important; padding-right: 0 !important; }\nhtml[data-dbk] .inbox-header-actions { justify-content: center !important; }\n/* the trip / item pop-up's buttons: the main one across the top, the rest in one even row */\n\nhtml[data-dbk] .detail-popup-actions { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; justify-content: center !important; }\nhtml[data-dbk] .detail-popup-actions .icon-btn { flex: 1 1 0 !important; min-width: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; text-align: center !important; padding: 11px 6px !important; line-height: 1.2 !important; }\nhtml[data-dbk] .detail-popup-actions .icon-btn.tp-open { flex: 1 1 100% !important; }\n/* every button's label sits in its middle */\n\nhtml[data-dbk] :is(button, .btn, .icon-btn, .wr-btn):not(.rt-step):not(.hh-dp-trigger):not(#reminderFormToggle):not(.inbox-item-text) { text-align: center; }\nhtml[data-dbk] :is(.btn, .icon-btn, .wr-btn, .hm-btn, .cancel-contact-btn, .tp-btn, .wrc-act, .journal-save-btn) { justify-content: center; text-align: center !important; }\n/* ===== Pop-ups stay put: the page behind can't scroll, and nothing in a pop-up slides sideways (the trip day row is the one exception) ===== */\n\nhtml[data-dbk], html[data-dbk] body { overscroll-behavior-x: none; }\nhtml[data-dbk] body { overflow-x: clip; }\nhtml.dbk-pop-open, html.dbk-pop-open body { overflow: hidden !important; overscroll-behavior: none !important; }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay, #resourceForm, #addEventModalOverlay, #section-modal, .wrc-overlay, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .lightbox, .tp-overlay, .tp-pop-overlay, .dream-form, .modal-overlay, .day-modal-overlay, .reminder-modal-overlay, .seasonal-modal-overlay, #seasonal-modal) { overflow-x: hidden !important; overscroll-behavior: contain !important; }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay, #resourceForm, #addEventModalOverlay, #section-modal, .wrc-overlay, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .lightbox, .tp-overlay, .tp-pop-overlay, .dream-form, .modal-overlay, .day-modal-overlay, .reminder-modal-overlay, .seasonal-modal-overlay, #seasonal-modal), html[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay, #resourceForm, #addEventModalOverlay, #section-modal, .wrc-overlay, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .lightbox, .tp-overlay, .tp-pop-overlay, .dream-form, .modal-overlay, .day-modal-overlay, .reminder-modal-overlay, .seasonal-modal-overlay, #seasonal-modal) * { touch-action: pan-y; }\nhtml[data-dbk] :is(.tp-daypills, .tp-daypills *, .rl-chips, .rl-chips *) { touch-action: pan-x pan-y !important; }\nhtml[data-dbk] .tp-daypills { overscroll-behavior-x: contain; }\n/* :where keeps this from outranking each pop-up's own max width (the #inboxModal id inside :is made it win, so pop-ups stretched across desktop) */\nhtml[data-dbk] :where(.tp-sheet, .tp-pop, .wrc-sheet, .detail-popup-box, .modal, .day-modal, .reminder-modal, .edit-reminder-modal, #inboxModal, .habits-modal, .rt-sheet, .section-modal-inner) { overflow-x: hidden !important; overscroll-behavior: contain; max-width: calc(calc(100 * var(--dbk-vw, 1vw)) - 20px); }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #resourceFormOverlay, #resourceForm, #addEventModalOverlay, #section-modal, .wrc-overlay, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .lightbox, .tp-overlay, .tp-pop-overlay, .dream-form, .modal-overlay, .day-modal-overlay, .reminder-modal-overlay, .seasonal-modal-overlay, #seasonal-modal) :is(input, select, textarea, img) { max-width: 100%; }\n/* the trip tabs fit on any phone instead of sliding */\n\nhtml[data-dbk] .tp-tabs { overflow-x: hidden !important; gap: 2px; }\nhtml[data-dbk] .tp-tabs button { flex: 1 1 auto !important; padding: 7px 6px !important; min-width: 0; }\n/* ===== Workroom: one plain ground, centered sections, business in one place ===== */\n\nhtml[data-dbk-page=\"workroom\"] #weekCalendars, html[data-dbk-page=\"workroom\"] :is(#contentBizSwitcher, #homebaseBizSwitcher, #sparkBizSwitcher), html[data-dbk-page=\"workroom\"] #wrcWho { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] .wrb-bar { display: flex; justify-content: center; margin: 14px 0 4px; }\nhtml[data-dbk-page=\"workroom\"] .wrb-name { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 10px; font-family: var(--dbk-caps); font-size: 26px; letter-spacing: 0.03em; color: var(--dbk-green); text-align: center; }\nhtml[data-dbk-page=\"workroom\"] .wrb-name svg { opacity: 0.7; flex: none; }\nhtml[data-dbk] .wrb-sheet { max-width: 420px !important; padding: 8px 18px 20px !important; display: flex; flex-direction: column; gap: 10px; margin: auto; }\nhtml[data-dbk] .wrb-h { position: relative; text-align: center; font-family: var(--dbk-caps); font-size: 20px; letter-spacing: 0.04em; padding: 10px 40px 4px; }\nhtml[data-dbk] .wrb-h .wrc-x { position: absolute; top: -4px; right: -14px; }\nhtml[data-dbk] .wrb-list { display: flex; flex-direction: column; gap: 8px; }\nhtml[data-dbk] .wrb-item { all: unset; box-sizing: border-box; cursor: pointer; text-align: center; min-height: 48px; padding: 12px 16px; border: 1px solid rgba(var(--wrc-ink-rgb),0.35); border-radius: 999px; font-family: var(--dbk-serif); font-size: 17px; color: var(--wrc-ink); }\nhtml[data-dbk] .wrb-item.on { background: var(--wrc-solid); color: var(--wrc-solid-ink); border-color: transparent; }\nhtml[data-dbk] .wrb-who { all: unset; cursor: pointer; text-align: center; font-family: var(--dbk-script); font-style: italic; font-size: 15px; line-height: 1.4; color: rgba(var(--wrc-ink-rgb),0.85); padding: 6px 8px; }\nhtml[data-dbk] .wrb-tools { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 22px; }\nhtml[data-dbk] .wrb-tool { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.03em; text-decoration: underline; text-underline-offset: 4px; padding: 8px 4px; min-height: 24px; color: rgba(var(--wrc-ink-rgb),0.85); }\nhtml[data-dbk] .wrb-tool:focus-visible { outline: 2px solid var(--lh-secondary, #b0596b); outline-offset: 3px; }\nhtml[data-dbk] .wrb-add { all: unset; cursor: pointer; align-self: center; text-align: center; font-family: var(--dbk-caps); font-size: 16px; letter-spacing: 0.03em; padding: 11px 26px; min-height: 22px; border-radius: 999px; background: var(--wrc-solid); color: var(--wrc-solid-ink); }\n/* plain sections: no colored bands, no boxes, a hairline between */\n\nhtml[data-dbk-page=\"workroom\"] .hub-tab .wr-card { background: none !important; border: none !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.18) !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; padding: 30px 6px 30px !important; border-image: none !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card:first-of-type, html[data-dbk-page=\"workroom\"] #homebase-tab > .wr-card:first-child { border-top: none !important; }\nhtml[data-dbk-page=\"workroom\"] .hub-tab .dbk-sec { border-image: none !important; background: none !important; }\nhtml[data-dbk-page=\"workroom\"] .hub-tab .wr-card-title { text-align: center !important; font-family: var(--dbk-caps) !important; font-size: 1.4rem !important; letter-spacing: 0.05em !important; margin: 0 0 16px !important; color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .biz-field-group { display: flex !important; flex-direction: column !important; gap: 0 !important; border: none !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab :is(.biz-field.is-empty, .biz-field-group.is-empty) { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .biz-field { text-align: center !important; padding: 10px 0 !important; border: none !important; cursor: pointer; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .biz-field-label { display: block; text-align: center !important; font-family: var(--dbk-caps) !important; font-size: 13px !important; letter-spacing: 0.1em !important; color: rgba(var(--dbk-green-rgb),0.72) !important; margin-bottom: 2px !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .biz-field-value { text-align: center !important; font-family: var(--dbk-serif) !important; font-size: 1.12rem !important; color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"workroom\"] .wrb-chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 2px; }\nhtml[data-dbk-page=\"workroom\"] .wrb-chips[hidden] { display: none; }\nhtml[data-dbk-page=\"workroom\"] .wrb-chips button { all: unset; cursor: pointer; text-align: center; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.03em; padding: 8px 14px; min-height: 20px; border: 1px solid rgba(var(--dbk-green-rgb),0.4); border-radius: 999px; color: var(--dbk-green); }\nhtml[data-dbk-page=\"workroom\"] .wrb-sub { text-align: center; font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.1em; color: rgba(var(--dbk-green-rgb),0.72); margin: 22px 0 6px; }\nhtml[data-dbk-page=\"workroom\"] .wrb-note { text-align: center !important; font-family: var(--dbk-script) !important; font-style: italic !important; font-size: 14px !important; color: rgba(var(--dbk-green-rgb),0.75) !important; margin: -8px 0 12px !important; }\n/* every add button in its section's middle, all the same quiet outline */\n\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card > .wr-btn, html[data-dbk-page=\"workroom\"] #wrcToolkit .wrc-link { display: table !important; margin: 14px auto 0 !important; text-align: center !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; padding: 9px 20px !important; border: 1px solid rgba(var(--dbk-green-rgb),0.45) !important; border-radius: 999px !important; background: none !important; color: var(--dbk-green) !important; text-decoration: none !important; box-shadow: none !important; }\nhtml[data-dbk-page=\"workroom\"] :is(#brandAssetsGrid, .brand-assets-row, #brandColorsList) { justify-content: center !important; }\nhtml[data-dbk-page=\"workroom\"] #wrcToolkit :is(.wrc-tk, .wrc-label, .wrc-tk-text, .wrc-tk-li) { text-align: center !important; }\nhtml[data-dbk-page=\"workroom\"] #wrcToolkit .wrc-tk { margin: 0 0 22px !important; }\nhtml[data-dbk-page=\"workroom\"] #wrcToolkit .wrc-label { font-family: var(--dbk-caps) !important; font-size: 13px !important; letter-spacing: 0.1em !important; color: rgba(var(--dbk-green-rgb),0.72) !important; }\nhtml[data-dbk-page=\"workroom\"] #wrcToolkit .wrc-tk-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; border: none !important; }\nhtml[data-dbk-page=\"workroom\"] #wrcToolkit .wrc-tk-row .wrc-link { margin: 0 !important; }\nhtml[data-dbk-page=\"workroom\"] #sparkfile-tab .quick-add, html[data-dbk-page=\"workroom\"] #content-tab .pipeline-tabs { margin-top: 18px !important; }\nhtml[data-dbk-page=\"workroom\"] :is(#content-tab, #homebase-tab, #sparkfile-tab) { padding-left: 22px !important; padding-right: 22px !important; box-sizing: border-box; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card { text-align: center !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card [class*=\"field\"] { border: none !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card .biz-field-label { color: rgba(var(--dbk-green-rgb),0.72) !important; }\n/* ===== Us lists: postcards, menu, checklist, index cards, A to Z, tags ===== */\n\nhtml[data-dbk] { --ul-t0: #d9d1bf; --ul-t1: #cfd5c1; --ul-t2: #ead3cf; --ul-t3: #b9bfa0; --ul-card: #fbf8f1; --ul-edge: #c98a8a; --ul-clay: #a5502f; --ul-soft: #4d5749; }\nhtml[data-dbk=\"p2\"] { --ul-t0: #1b2a40; --ul-t1: #172338; --ul-t2: #22314a; --ul-t3: #1a2b33; --ul-card: #162236; --ul-edge: #8fc98a; --ul-clay: #8fc98a; --ul-soft: #b9c2ce; }\nhtml[data-dbk] .ul-list { max-height: none !important; overflow: visible !important; }\nhtml[data-dbk] .ul button { all: unset; box-sizing: border-box; cursor: pointer; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk] .ul { color: var(--wrc-ink); padding: 4px 0 8px; }\nhtml[data-dbk] .ul .is-done { opacity: 0.55; }\nhtml[data-dbk] .ul-note { display: block; font-family: var(--dbk-script); font-style: italic; font-size: 15px; line-height: 1.35; color: var(--ul-soft); }\nhtml[data-dbk] .ul-meta { display: block; font-family: var(--dbk-sans); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ul-soft); }\nhtml[data-dbk] .ul-meta.is-top { color: var(--ul-clay); }\n/* postcards */\n\nhtml[data-dbk] .ul-post-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }\nhtml[data-dbk] .ul .ul-post { position: relative; min-height: 196px; padding: 12px 10px 14px; border-radius: 4px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; text-align: center; box-shadow: 0 2px 0 rgba(var(--wrc-ink-rgb),0.12); color: var(--wrc-ink); }\nhtml[data-dbk] .ul-tint0 { background: var(--ul-t0); } html[data-dbk] .ul-tint1 { background: var(--ul-t1); } html[data-dbk] .ul-tint2 { background: var(--ul-t2); } html[data-dbk] .ul-tint3 { background: var(--ul-t3); }\nhtml[data-dbk] .ul-stamp { align-self: flex-end; width: 40px; height: 48px; border: 1.5px dashed rgba(var(--wrc-ink-rgb),0.55); display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; box-sizing: border-box; }\nhtml[data-dbk] .ul-stamp b { font-family: var(--dbk-serif); font-weight: 400; font-size: 19px; }\nhtml[data-dbk] .ul-stamp span { font-family: var(--dbk-sans); font-size: 9.5px; letter-spacing: 0.08em; }\nhtml[data-dbk] .ul-stamp-blank { border-color: transparent; }\nhtml[data-dbk] .ul-post-name { font-family: var(--dbk-serif); font-size: 22px; line-height: 1.15; padding: 6px 2px; overflow-wrap: anywhere; }\nhtml[data-dbk] .ul-post-when { font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.04em; min-height: 16px; }\nhtml[data-dbk] .ul-mark { position: absolute; left: 8px; top: 10px; width: 54px; height: 54px; border-radius: 50%; border: 1.5px solid var(--ul-clay); color: var(--ul-clay); display: flex; align-items: center; justify-content: center; text-align: center; font-family: var(--dbk-caps); font-size: 12.5px; line-height: 1.05; transform: rotate(-14deg); }\n/* menu */\n\nhtml[data-dbk] .ul-menu { display: flex; flex-direction: column; align-items: center; }\nhtml[data-dbk] .ul .ul-menu-item { width: 100%; padding: 10px 6px; display: flex; flex-direction: column; align-items: center; gap: 3px; text-align: center; }\nhtml[data-dbk] .ul-menu-name { font-family: var(--dbk-caps); font-size: 21px; letter-spacing: 0.02em; line-height: 1.2; }\nhtml[data-dbk] .ul-menu-item.is-done .ul-menu-name { text-decoration: line-through; text-decoration-thickness: 1px; }\nhtml[data-dbk] .ul-menu-dot { color: rgba(var(--wrc-ink-rgb),0.45); line-height: 1; }\n/* checklist */\n\nhtml[data-dbk] .ul-check-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(var(--wrc-ink-rgb),0.18); }\nhtml[data-dbk] .ul-check-row:last-child { border-bottom: none; }\nhtml[data-dbk] .ul .ul-circle-btn { flex: none; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; }\nhtml[data-dbk] .ul-circle { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--wrc-ink); box-sizing: border-box; display: flex; align-items: center; justify-content: center; }\nhtml[data-dbk] .ul-check-row > .ul-circle { margin: 0 10px; }\nhtml[data-dbk] .ul-circle.on { background: var(--wrc-solid); border-color: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk] .ul .ul-check-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: 4px 0; text-align: left; }\nhtml[data-dbk] .ul-check-name { font-family: var(--dbk-serif); font-size: 19px; line-height: 1.25; }\nhtml[data-dbk] .ul-check-row.is-done .ul-check-name { text-decoration: line-through; text-decoration-thickness: 1px; }\nhtml[data-dbk] .ul-check-row.is-done { opacity: 1; }\nhtml[data-dbk] .ul-check-row.is-done .ul-check-main { opacity: 0.7; }\n/* index cards */\n\nhtml[data-dbk] .ul-cards { display: flex; flex-direction: column; gap: 12px; padding: 4px 2px; }\nhtml[data-dbk] .ul .ul-card { width: 100%; padding: 14px 16px 12px; border-top: 3px solid var(--ul-edge); background: repeating-linear-gradient(var(--ul-card) 0 27px, rgba(var(--wrc-ink-rgb),0.1) 27px 28px); box-shadow: 0 2px 6px rgba(0,0,0,0.12); display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; color: var(--wrc-ink); }\nhtml[data-dbk] .ul-tilt0 { transform: rotate(-0.6deg); } html[data-dbk] .ul-tilt1 { transform: rotate(0.5deg); } html[data-dbk] .ul-tilt2 { transform: rotate(-0.3deg); } html[data-dbk] .ul-tilt3 { transform: rotate(0.4deg); }\nhtml[data-dbk] .ul-card-name { font-family: var(--dbk-serif); font-size: 20px; line-height: 1.25; }\n/* A to Z */\n\nhtml[data-dbk] .ul-az-group { display: flex; gap: 14px; padding: 8px 0; border-top: 1px solid rgba(var(--wrc-ink-rgb),0.2); }\nhtml[data-dbk] .ul-az-group:first-child { border-top: none; }\nhtml[data-dbk] .ul-az-letter { width: 30px; flex: none; text-align: center; font-family: var(--dbk-caps); font-size: 30px; line-height: 44px; color: var(--ul-clay); }\nhtml[data-dbk] .ul-az-items { flex: 1; min-width: 0; display: flex; flex-direction: column; }\nhtml[data-dbk] .ul .ul-az-item { min-height: 44px; padding: 6px 0; display: flex; align-items: baseline; justify-content: space-between; gap: 10px; text-align: left; }\nhtml[data-dbk] .ul-az-name { font-family: var(--dbk-serif); font-size: 18px; line-height: 1.25; }\nhtml[data-dbk] .ul-az-item .ul-meta { flex: none; text-align: right; font-size: 10.5px; }\n/* tags */\n\nhtml[data-dbk] .ul-tag-group { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: 0 0 22px; }\nhtml[data-dbk] .ul-tag-head { font-family: var(--dbk-caps); font-size: 20px; letter-spacing: 0.03em; text-align: center; }\nhtml[data-dbk] .ul-tag-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }\nhtml[data-dbk] .ul .ul-tag { font-family: var(--dbk-serif); font-size: 16px; text-align: center; padding: 9px 16px; min-height: 22px; border: 1px solid rgba(var(--wrc-ink-rgb),0.5); border-radius: 999px; background: var(--ul-card); color: var(--wrc-ink); }\nhtml[data-dbk] .ul .ul-tag.is-must { background: var(--wrc-solid); color: var(--wrc-solid-ink); border-color: transparent; }\n/* the list items are buttons; keep the app's general button look off them */\n\nhtml[data-dbk] .ul button { border: none !important; background: none !important; box-shadow: none !important; border-radius: 0 !important; font-family: var(--dbk-serif) !important; font-size: inherit !important; text-transform: none !important; letter-spacing: normal !important; min-height: 0 !important; margin: 0 !important; color: var(--wrc-ink) !important; line-height: inherit !important; }\nhtml[data-dbk] .ul .ul-post { padding: 12px 10px 14px !important; border-radius: 4px !important; box-shadow: 0 2px 0 rgba(var(--wrc-ink-rgb),0.12) !important; }\nhtml[data-dbk] .ul .ul-post.ul-tint0 { background: var(--ul-t0) !important; } html[data-dbk] .ul .ul-post.ul-tint1 { background: var(--ul-t1) !important; } html[data-dbk] .ul .ul-post.ul-tint2 { background: var(--ul-t2) !important; } html[data-dbk] .ul .ul-post.ul-tint3 { background: var(--ul-t3) !important; }\nhtml[data-dbk] .ul .ul-menu-item { padding: 10px 6px !important; width: 100% !important; }\nhtml[data-dbk] .ul .ul-circle-btn { padding: 0 !important; width: 44px !important; height: 44px !important; }\nhtml[data-dbk] .ul .ul-check-main { padding: 4px 0 !important; }\nhtml[data-dbk] .ul .ul-card { padding: 14px 16px 12px !important; border-top: 3px solid var(--ul-edge) !important; background: repeating-linear-gradient(var(--ul-card) 0 27px, rgba(var(--wrc-ink-rgb),0.1) 27px 28px) !important; box-shadow: 0 2px 6px rgba(0,0,0,0.12) !important; width: 100% !important; }\nhtml[data-dbk] .ul .ul-az-item { padding: 6px 0 !important; width: 100% !important; }\nhtml[data-dbk] .ul .ul-tag { padding: 9px 16px !important; border: 1px solid rgba(var(--wrc-ink-rgb),0.5) !important; border-radius: 999px !important; background: var(--ul-card) !important; font-size: 16px !important; }\nhtml[data-dbk] .ul .ul-tag.is-must { background: var(--wrc-solid) !important; color: var(--wrc-solid-ink) !important; border-color: transparent !important; }\nhtml[data-dbk] .ul :is(.ul-menu-name, .ul-post-when, .ul-tag-head) { font-family: var(--dbk-caps) !important; }\nhtml[data-dbk] .ul :is(.ul-menu-name, .ul-post-name, .ul-check-name, .ul-card-name, .ul-az-name, .ul-post-when, .ul-note, .ul-meta, .ul-stamp, .ul-mark) { border: none !important; background: none !important; padding-left: 0; padding-right: 0; }\nhtml[data-dbk] .ul .ul-note { font-family: var(--dbk-script) !important; }\nhtml[data-dbk] .ul .ul-meta { font-family: var(--dbk-sans) !important; }\nhtml[data-dbk] .ul .ul-stamp { border: 1.5px dashed rgba(var(--wrc-ink-rgb),0.55) !important; }\nhtml[data-dbk] .ul .ul-stamp-blank { border-color: transparent !important; }\nhtml[data-dbk] .ul .ul-mark { border: 1.5px solid var(--ul-clay) !important; border-radius: 50% !important; font-family: var(--dbk-caps) !important; }\nhtml[data-dbk] .ul .ul-circle { border: 1.5px solid var(--wrc-ink) !important; border-radius: 50% !important; }\nhtml[data-dbk] .ul .ul-circle.on { background: var(--wrc-solid) !important; border-color: var(--wrc-solid) !important; }\nhtml[data-dbk] .ul .ul-post { min-height: 190px !important; }\nhtml[data-dbk] .ul .ul-circle-btn { min-height: 44px !important; }\nhtml[data-dbk] .ul .ul-az-item { min-height: 44px !important; }\nhtml[data-dbk] #section-modal div:has(> .add-dream-btn) { justify-content: center !important; flex-wrap: wrap; }\nhtml[data-dbk] #section-modal .add-dream-btn { text-align: center !important; }\nhtml[data-dbk] #section-modal :is(.section-description, .our-section-desc, .dream-section-subtitle, .section-subtitle) { text-align: center !important; }\nhtml[data-dbk] #section-modal p[style*=\"margin-bottom: 12px\"] { text-align: center !important; }\nhtml[data-dbk] .ai-actions { justify-content: center !important; }\nhtml[data-dbk] .ai-panel-title { text-align: center !important; }\nhtml[data-dbk] button.wrb-who { font-family: var(--dbk-script) !important; font-style: italic !important; text-transform: none !important; letter-spacing: normal !important; font-variant: normal !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab .wr-card:not(.wr-card ~ .wr-card) { border-top: none !important; }\n/* ===== Pop-ups: the backdrop never scrolls; the pop-up always fits on screen and scrolls inside itself.\n   Short ones sit a little above the middle, tall ones fill the space between the top and the bottom (or the keyboard). ===== */\n\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .tp-pop-overlay, .tp-overlay, .wrc-overlay) { flex-direction: column !important; align-items: center !important; justify-content: flex-start !important; overflow: hidden !important; padding-bottom: calc(var(--dbk-kbh, 0px) + 12px) !important; box-sizing: border-box !important; }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .tp-pop-overlay, .tp-overlay, .wrc-overlay)::before { content: '' !important; display: block !important; position: static !important; flex: 1 1 0 !important; min-height: 0 !important; height: 0; width: 0; }\nhtml[data-dbk] :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .tp-pop-overlay, .tp-overlay, .wrc-overlay)::after { content: '' !important; display: block !important; position: static !important; flex: 2 1 0 !important; min-height: 0 !important; height: 0; width: 0; }\nhtml[data-dbk] :is(#dayModalOverlay > .day-modal, .edit-reminder-overlay > .edit-reminder-modal, #reminderModalOverlay > .reminder-modal, #rtSheet > .rt-sheet, #inboxModal, #habitsModalOverlay > .habits-modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal, #addEventModalOverlay > .modal, #section-modal > .section-modal-inner, .dream-form > form, #detailPopup > .detail-popup-box, #triedModal > .tried-modal-box, #pickerFilterModal > .picker-filter-box, #skippedAnswerModal > .skipped-answer-box, .tp-pop-overlay > .tp-pop, .tp-overlay > .tp-sheet, .wrc-overlay > .wrc-sheet) { flex: 0 1 auto !important; max-height: 100% !important; min-height: 0 !important; margin: 0 !important; overflow-y: auto !important; overscroll-behavior: contain !important; -webkit-overflow-scrolling: touch; box-sizing: border-box !important; }\nhtml[data-dbk] :is(.dream-form > form, .tp-overlay > .tp-sheet, .wrc-overlay > .wrc-sheet, .tp-pop-overlay > .tp-pop, #section-modal > .section-modal-inner) { width: 100% !important; }\nhtml[data-dbk] #section-modal > .section-modal-inner { display: flex !important; flex-direction: column !important; }\nhtml[data-dbk] #section-modal .section-modal-header { flex: none !important; }\nhtml[data-dbk] #section-modal .section-modal-body { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain !important; }\n/* ===== Page changes: the menu stays put and the page underneath swaps in place, no fade to blank ===== */\n\n::view-transition-old(root), ::view-transition-new(root) { animation: none !important; }\n/* the very top of the screen (behind the clock) matches the menu, so iPhone's top fade blends into green instead of washing it out */\n\nhtml[data-dbk] { background-color: #2f3a2c !important; }\nhtml[data-dbk=\"p2\"] { background-color: #06080b !important; }\n/* Our Lists: every tile the same height, whether or not it has a line under its name */\n\nhtml[data-dbk-page=\"our-dreams\"] #sectionTiles { grid-auto-rows: 1fr !important; }\nhtml[data-dbk-page=\"our-dreams\"] #sectionTiles .landing-tile { min-height: 92px !important; height: 100% !important; box-sizing: border-box !important; }\n/* ===== Page changes: no cross-fade at all. Each page stays hidden until it's built, then shows in one go,\n   while the phone holds the previous page on screen. Nothing fades in, nothing reshuffles. ===== */\n\n@view-transition { navigation: none; }\nhtml.dbk-loading body > *:not(script):not(style), html.dbk-loading nav.top-nav, html.dbk-loading nav.top-nav .nav-container, html.dbk-loading nav.top-nav .nav-links { visibility: hidden !important; }\nhtml.dbk-loading body > *:not(script):not(style) { opacity: 1 !important; }\nhtml[data-dbk] body > *:not(nav):not(script):not(style) { transition: none !important; }\nhtml[data-dbk] :is(.container, .hub-tab) { animation: none !important; }\n/* one line under a search or add box, not two: the list right below doesn't draw its own top line */\n\nhtml[data-dbk] #resourceCategories > :first-child, html[data-dbk] #resourceCategories > .empty-state, html[data-dbk] #futureTodoList, html[data-dbk] #futureTodoList > :first-child { border-top: none !important; }\n/* Brand Assets: no line under the photos, and the add button sits a little lower */\n\nhtml[data-dbk-page=\"workroom\"] #homebase-tab :is(#brandAssetsGrid, .brand-assets-row) { border: none !important; padding-bottom: 0 !important; }\nhtml[data-dbk-page=\"workroom\"] #homebase-tab #brandAssetsGrid + .wr-btn, html[data-dbk-page=\"workroom\"] #homebase-tab .wr-card > .wr-btn[onclick*=\"addBrandAsset\"] { margin-top: 26px !important; }\n/* every add button in the Us lists sits in the middle, whether it's on its own or next to \"Choose for Us\" */\n\nhtml[data-dbk] #section-modal div:has(> .add-dream-btn) { display: flex !important; justify-content: center !important; flex-wrap: wrap !important; gap: 10px !important; }\nhtml[data-dbk] #section-modal .section > .add-dream-btn { display: table !important; margin-left: auto !important; margin-right: auto !important; }\n/* ===== Home calendar: Week or Month, tap a day to see it ===== */\n\nhtml[data-dbk-page=\"index\"] #calendarSection :is(#calendarSummary, #calendarExpandBtn, #calendarFullView) { display: none !important; }\nhtml[data-dbk-page=\"index\"] #calendarSection .hm-center:has(#calendarExpandBtn) { display: none !important; }\nhtml[data-dbk-page=\"index\"] .hc-head { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 0 12px; }\nhtml[data-dbk-page=\"index\"] .hc-head button { all: unset; cursor: pointer; text-align: center; color: var(--dbk-green); -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk-page=\"index\"] .hc-arrow { width: 44px; height: 44px; display: flex !important; align-items: center; justify-content: center; font-size: 30px; line-height: 1; }\nhtml[data-dbk-page=\"index\"] .hc-label { font-family: var(--dbk-caps); font-size: 1.45rem; letter-spacing: 0.05em; min-width: 9.5em; padding: 6px 0; }\nhtml[data-dbk-page=\"index\"] .hc-seg { margin: 0 auto 16px !important; }\nhtml[data-dbk-page=\"index\"] #hmWeek { display: block !important; }\nhtml[data-dbk-page=\"index\"] .hc-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); row-gap: 4px; text-align: center; }\nhtml[data-dbk-page=\"index\"] .hc-l { font-family: var(--dbk-caps); font-size: 0.9rem; letter-spacing: 0.04em; color: rgba(var(--dbk-green-rgb),0.7); padding-bottom: 4px; }\nhtml[data-dbk-page=\"index\"] .hc-day { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; height: 46px; position: relative; color: var(--dbk-green); -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk-page=\"index\"] .hc-week .hc-day { height: 54px; }\nhtml[data-dbk-page=\"index\"] .hc-n { font-family: var(--dbk-serif); font-size: 1.2rem; width: 38px; height: 38px; line-height: 38px; border-radius: 50%; text-align: center; }\nhtml[data-dbk-page=\"index\"] .hc-day.out .hc-n { opacity: 0.38; }\nhtml[data-dbk-page=\"index\"] .hc-day.today .hc-n { box-shadow: inset 0 0 0 1.5px currentColor; }   /* the number's own color: readable on every card (2timelines' lilac card had a cream ring) */\nhtml[data-dbk-page=\"index\"] .hc-day.sel .hc-n { background: var(--dbk-fill, var(--dbk-green)); color: var(--dbk-cream); box-shadow: none; }\nhtml[data-dbk-page=\"index\"] .hc-day.ev::after { content: ''; position: absolute; bottom: 1px; width: 5px; height: 5px; border-radius: 50%; background: var(--lh-secondary, #b0596b); }\nhtml[data-dbk-page=\"index\"] .hc-week .hc-day.ev::after { bottom: 3px; }\nhtml[data-dbk-page=\"index\"] #hmEvents { margin-top: 18px; border-top: 1px solid rgba(var(--dbk-green-rgb),0.25); padding-top: 14px; text-align: center !important; }\nhtml[data-dbk-page=\"index\"] .hc-dayname { font-family: var(--dbk-caps); font-size: 1.1rem; letter-spacing: 0.05em; text-align: center; margin-bottom: 8px; }\nhtml[data-dbk-page=\"index\"] .hc-ev { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: baseline; gap: 14px; width: 100%; padding: 10px 2px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.18); text-align: left; color: var(--dbk-green); }\nhtml[data-dbk-page=\"index\"] .hc-t { flex: none; min-width: 74px; font-family: var(--dbk-caps); font-size: 0.95rem; letter-spacing: 0.04em; color: rgba(var(--dbk-green-rgb),0.75); }\nhtml[data-dbk-page=\"index\"] .hc-title { font-family: var(--dbk-serif); font-size: 1.08rem; }\nhtml[data-dbk-page=\"index\"] .hc-empty { text-align: center; font-style: italic; color: rgba(var(--dbk-green-rgb),0.7); padding: 6px 0 2px; }\nhtml[data-dbk-page=\"index\"] .hc-add { text-align: center; margin-top: 14px; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"index\"] .hc-day.sel .hc-n { background: var(--wrc-solid); color: var(--wrc-solid-ink); }\nhtml[data-dbk-page=\"index\"] .hc-label { font-size: 22px !important; }\nhtml[data-dbk-page=\"index\"] .hc-arrow { font-size: 32px !important; }\n/* The arrows stay put and are a full 44px to tap (Kasey, Oct 31: \"trying to move forward a month … it took several\n   clicks\"): `.hc-head button { all: unset }` outranked the arrow's and the label's own sizes, so each arrow was only its\n   11px-wide character and moved up to 40px sideways every month as the label's width changed (\"November\", \"September\n   2027\"), so the next tap landed beside it. The label now has one width (wide enough for \"September 2027\"; narrower only\n   when the card is), and the head's buttons take quick taps one after another (no double-tap zoom on an iPhone). */\nhtml[data-dbk-page=\"index\"] .hc-head .hc-arrow { flex: none; box-sizing: border-box; width: 44px; height: 44px; touch-action: manipulation; }\nhtml[data-dbk-page=\"index\"] .hc-head .hc-label { flex: 0 1 9.5em; box-sizing: border-box; width: 9.5em; min-width: 0; padding: 6px 0; white-space: nowrap; touch-action: manipulation; }\n/* (a 320 phone: the longest month with its year fits the narrower label a size down) */\n@media (max-width: 359px) { html[data-dbk-page=\"index\"]:not(#z) .hc-head .hc-label { font-size: 19px !important; } }\nhtml[data-dbk-page=\"index\"] #dayModalOverlay.hc-editing :is(#dayModalEvents, .day-modal-add) { display: none !important; }\nhtml[data-dbk-page=\"index\"] #dayModalOverlay:not(.hc-editing) #dbkEvDel { display: none !important; }\nhtml[data-dbk-page=\"index\"] .hc-del { text-align: center; margin-top: 14px; }\nhtml[data-dbk-page=\"index\"] .hc-del .hm-link { color: var(--lh-secondary, #b0596b) !important; }\nhtml[data-dbk-page=\"index\"] #dayModalForm { border-top: none !important; }\nhtml[data-dbk-page=\"index\"] #dayModalOverlay.hc-editing .day-modal-header { border-bottom: none !important; }\nhtml[data-dbk-page=\"index\"] #dayModalForm div:has(> button) { justify-content: center !important; }\n/* ===== Desktop matches the phone: same menu (one gear, no hover menus), same centered layouts ===== */\n\nhtml[data-dbk-page=\"index\"] .hc-head { margin: 0 auto 12px !important; max-width: 560px; }\nhtml[data-dbk-page=\"index\"] .hc-seg { display: flex !important; width: max-content; }\nhtml[data-dbk-page=\"index\"] .hm-band .hm-intention, html[data-dbk-page=\"index\"] #homeIntention { display: block !important; border: none !important; padding: 0 !important; margin: 14px auto 0 !important; text-align: center !important; max-width: 36ch !important; font-size: 1.08rem !important; flex: none !important; }\nhtml[data-dbk-page=\"index\"] #homeIntention::before, html[data-dbk-page=\"index\"] #homeIntention::after { content: none !important; display: none !important; }\nhtml[data-dbk-page=\"index\"] #homeIntention:empty { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] :is(#content-tab, #homebase-tab, #sparkfile-tab) { max-width: 600px !important; margin-left: auto !important; margin-right: auto !important; }\n\n/* Home screen app: the iPhone softens everything right under the clock, so the menu words sit\n   a little lower, clear of it. The page below follows the menu's height on its own. */\n\n@media (display-mode: standalone) {\n  html.dbk-has-hero nav.top-nav { padding-top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + 14px) !important; }\n}\nhtml.dbk-standalone.dbk-has-hero nav.top-nav { padding-top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + 14px) !important; }\n/* calendar dots sit under the day's circle with a little gap, never under the filled circle */\n\nhtml[data-dbk-page=\"index\"] .hc-day { justify-content: flex-start !important; height: 54px !important; padding-top: 2px !important; }\nhtml[data-dbk-page=\"index\"] .hc-week .hc-day { height: 60px !important; padding-top: 4px !important; }\nhtml[data-dbk-page=\"index\"] .hc-day.ev::after, html[data-dbk-page=\"index\"] .hc-week .hc-day.ev::after { position: static !important; flex: none; margin-top: 8px; }\n/* trip pop-ups: a clear way back to the plan under Save, and the smaller actions on one line */\n\nhtml[data-dbk] .tp-pop .tp-more { display: flex; justify-content: center; align-items: center; gap: 12px; margin-top: 2px !important; }\nhtml[data-dbk] .tp-pop .tp-more .tp-linkbtn { padding: 8px 2px; opacity: 0.75; }\nhtml[data-dbk] .tp-pop .tp-dot { opacity: 0.5; }\n/* ===== Content first: buttons never outweigh what they belong to ===== */\n/* Home reminder: the reminder is the big thing; what you can do with it is one quiet line under it */\n\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-rem-title { font-size: 1.7rem !important; line-height: 1.25; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-rem-title .reminder-title { font-size: inherit !important; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-actions { gap: 0 !important; margin-top: 14px !important; align-items: center; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-actions .hm-btn { background: none !important; border: none !important; padding: 8px 9px !important; min-height: 0; font-size: 15px !important; color: rgba(243,238,228,0.72) !important; letter-spacing: 0.04em; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-actions .hm-btn + .hm-btn::before { content: '·'; margin-right: 18px; margin-left: -9px; color: rgba(243,238,228,0.4); text-decoration: none; display: inline-block; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-actions .hm-btn-solid { color: #f3eee4 !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-center { margin-top: 10px; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-center .hm-link { font-size: 0.86rem !important; opacity: 0.6; }\n/* All reminders is for looking over and editing them; adding happens from Add a reminder (it opens the Add Reminder pop-up) */\n/* an Add next to a box reads as part of the box, not a separate button */\n\nhtml[data-dbk] :is(.hm-add .hm-btn, .todo-add-btn, button[onclick=\"addResourceCategory()\"], #wrcNewIdea .wrc-act) {\n  background: none !important; border: none !important; box-shadow: none !important; color: inherit !important;\n  padding: 8px 4px 8px 12px !important; min-width: 0 !important; width: auto !important; font-size: 15px !important;\n  text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; opacity: 0.85;\n}\nhtml[data-dbk] #wrcNewIdea .wrc-act { color: var(--wrc-ink) !important; }\n\nhtml[data-dbk] .edit-routine-btn {\n  background: none !important; border: none !important; box-shadow: none !important; padding: 8px 6px !important;\n  color: var(--dbk-green) !important; font-size: 15px !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px;\n}\n/* All reminders: a plain list. Each row is the reminder and when it's due; tap it to edit */\n\nhtml[data-dbk] #reminderModalCount, html[data-dbk] #reminderModalList .reminder-list-chevron, html[data-dbk] #reminderModalList .reminder-list-details { display: none !important; }\nhtml[data-dbk] #reminderModalList .reminder-list-item { border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.16) !important; background: none !important; box-shadow: none !important; margin: 0 !important; border-radius: 0 !important; }\nhtml[data-dbk] #reminderModalList .reminder-list-row { border: none !important; background: none !important; padding: 13px 2px !important; display: flex !important; align-items: baseline !important; gap: 14px !important; cursor: pointer; }\nhtml[data-dbk] #reminderModalList .reminder-list-title { flex: 1; font-size: 16.5px !important; text-align: left; }\nhtml[data-dbk] #reminderModalList .reminder-list-due { background: none !important; border: none !important; padding: 0 !important; font-size: 13.5px !important; color: rgba(var(--dbk-green-rgb),0.6) !important; white-space: nowrap; font-style: normal !important; }\nhtml[data-dbk] #reminderModalList .reminder-list-item.overdue .reminder-list-due { color: var(--lh-secondary, #b0596b) !important; }\nhtml[data-dbk] #reminderModalOverlay #reminderSearch { border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.3) !important; background: none !important; border-radius: 0 !important; padding: 8px 2px !important; font-size: 16px !important; }\n/* edit pop-up: Save, and a quiet Delete under it */\n\nhtml[data-dbk] #editReminderOverlay .form-actions { justify-content: center !important; }\nhtml[data-dbk] #editReminderOverlay .dbk-rem-del { text-align: center; margin-top: 12px; }\nhtml[data-dbk] #editReminderOverlay .dbk-rem-del .hm-link { font-size: 14.5px; color: var(--lh-secondary, #b0596b) !important; }\nhtml[data-dbk-page=\"index\"] #currentReminder .hm-actions { flex-wrap: nowrap !important; }\n/* Us lists: \"Add a trip · Choose for us\" as one quiet line, so the list itself is what you see */\n\nhtml[data-dbk] #section-modal div:has(> .add-dream-btn) { gap: 0 !important; align-items: center !important; margin-bottom: 6px !important; }\nhtml[data-dbk] #section-modal .add-dream-btn { background: none !important; border: none !important; box-shadow: none !important; border-radius: 0 !important; padding: 8px 10px !important; margin: 0 !important; width: auto !important; flex: none !important;\n  color: var(--dbk-green) !important; font-size: 15.5px !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; transform: none !important; }\nhtml[data-dbk] #section-modal .add-dream-btn + .add-dream-btn::before { content: '·'; display: inline-block; text-decoration: none; margin: 0 14px 0 -4px; opacity: 0.45; }\n/* a list item's pop-up: the trip plan is a clear line; what you can do with the item is a quiet row */\n\nhtml[data-dbk] #detailActions { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center; gap: 0 !important; }\nhtml[data-dbk] #detailActions .icon-btn { flex: none !important; min-width: 0 !important; background: none !important; border: none !important; box-shadow: none !important; padding: 8px 10px !important; font-size: 14px !important; color: var(--dbk-green) !important; opacity: 0.8; text-decoration: underline; text-underline-offset: 4px; text-transform: none !important; letter-spacing: 0.02em !important; }\nhtml[data-dbk] #detailActions .icon-btn.tp-open { order: -1; flex: 1 1 100% !important; opacity: 1; font-size: 16px !important; padding: 12px 10px 14px !important; margin-bottom: 4px; border-top: 1px solid rgba(var(--dbk-green-rgb),0.18) !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.18) !important; text-decoration: none; }\nhtml[data-dbk] #detailActions .icon-btn:not(.tp-open) { margin: 0 6px !important; }\n/* Meals: adding and generating are quiet links around the list, not blocks */\n\nhtml[data-dbk] #grocery-view .gen-btn, html[data-dbk] button.gen-btn[onclick=\"openAddRecipeModal()\"] { background: none !important; border: none !important; box-shadow: none !important; color: var(--dbk-green) !important; padding: 8px 8px !important; font-size: 15px !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; letter-spacing: 0.02em !important; font-weight: 400 !important; text-transform: none !important; }\n/* Spark File and other Workroom adds: Add reads as part of its box */\n\nhtml[data-dbk][data-dbk-page] .wr-input + button.wr-btn.wr-btn-primary { background: none !important; border: none !important; color: var(--wrc-ink, var(--dbk-green)) !important; padding: 8px 4px 8px 10px !important; font-size: 15px !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\n/* Habits routine: Add a step as a plain link (beats the general button look) */\n\nhtml[data-dbk][data-dbk-page] button.edit-routine-btn { background: none !important; border: none !important; box-shadow: none !important; padding: 8px 6px !important; color: var(--dbk-green) !important; font-size: 15px !important; text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\n/* a phone that isn't signed in only saves to itself, so say so where it can't be missed */\n\nhtml[data-dbk] #hh-signin-banner { top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + 74px) !important; bottom: auto !important; left: 16px !important; right: 16px !important; transform: none !important; max-width: 560px !important; margin: 0 auto !important;\n  z-index: 30050 !important; background: #f3eee4 !important; color: #2f3a2c !important; border: 1px solid rgba(47,58,44,0.35) !important; border-radius: 4px !important; box-shadow: 0 10px 30px rgba(0,0,0,0.25) !important;\n  flex-direction: column !important; gap: 8px !important; text-align: center !important; padding: 16px 18px 14px !important; font-family: var(--dbk-serif) !important; font-size: 16px !important; }\nhtml[data-dbk] #hh-signin-banner a { color: #2f3a2c !important; font-family: var(--dbk-caps) !important; text-decoration: underline !important; text-underline-offset: 4px; font-size: 16px !important; }\nhtml[data-dbk] #hh-signin-banner button { position: absolute; top: 4px; right: 8px; color: #2f3a2c !important; font-size: 20px !important; }\n/* ===== Trip planner: days as small numbered circles (8 or so fit across), the day you're on named above its stops,\n   adds as quiet links, the day menu as plain text ===== */\n\nhtml[data-dbk] .tp-daypills { gap: 6px !important; padding: 4px 2px 12px !important; scroll-behavior: auto; }\nhtml[data-dbk] .tp-daypill { min-width: 0 !important; width: 38px; height: 38px; padding: 0 !important; border-radius: 50% !important; justify-content: center !important; }\nhtml[data-dbk] .tp-daypill b { font-family: var(--dbk-serif); font-size: 16px; letter-spacing: 0; }\nhtml[data-dbk] .tp-daypill.tp-plus { width: 38px; min-width: 0 !important; font-size: 20px; }\nhtml[data-dbk] .tp-body .tp-linkbtn.tp-add { font-size: 15.5px; opacity: 1; padding: 10px 8px; }\nhtml[data-dbk] .tp-stop .tp-stop-main { min-width: 0; }\nhtml[data-dbk] .tp-pop .tp-menu { gap: 2px !important; align-items: center; }\nhtml[data-dbk] .tp-pop .tp-menu .tp-linkbtn { font-size: 16px; padding: 10px 8px; opacity: 1; }\nhtml[data-dbk] .tp-pop .tp-menu .tp-linkbtn.tp-danger, html[data-dbk] .tp-pop .tp-menu .tp-linkbtn.sure { color: var(--wrc-accent, #b0596b) !important; }\nhtml[data-dbk] .tp-packadd .tp-linkbtn { flex: none; padding: 8px 4px 8px 10px; font-size: 15px; opacity: 1; }\n/* Us: \"We traveled!\" asks one plain question; the answers say exactly what happens */\n\nhtml[data-dbk] .tried-modal-box { position: relative; text-align: center !important; padding: 26px 20px 18px !important; }\nhtml[data-dbk] .tried-modal-box .tried-x { all: unset; position: absolute; top: 6px; right: 8px; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 26px; cursor: pointer; color: var(--dbk-green); }\nhtml[data-dbk] .tried-modal-ask { margin: 14px 0 12px; font-size: 16px; }\nhtml[data-dbk] .tried-modal-buttons { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 4px !important; }\nhtml[data-dbk] .tried-modal-buttons .tried-btn-again { width: auto !important; flex: none !important; padding: 10px 18px !important; background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; border: none !important; border-radius: 4px !important; font-size: 15px !important; }\nhtml[data-dbk] .tried-modal-buttons .tried-btn-pass { width: auto !important; flex: none !important; background: none !important; border: none !important; padding: 10px 8px !important; font-size: 14.5px !important; color: var(--dbk-green) !important; text-decoration: underline; text-underline-offset: 4px; opacity: 0.8; }\n/* trip type and other multi-pick boxes in the Us forms: tappable pills, like everywhere else */\n\nhtml[data-dbk] .dream-form .checkbox-group, html[data-dbk] .dream-form .checkbox-grid { display: flex !important; flex-wrap: wrap !important; gap: 8px !important; }\nhtml[data-dbk] .dream-form .checkbox-label { position: relative; display: inline-flex !important; align-items: center; width: auto !important; padding: 7px 14px !important; border-radius: 999px !important; border: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; background: none !important; cursor: pointer; margin: 0 !important; }\nhtml[data-dbk] .dream-form .checkbox-label input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }\nhtml[data-dbk] .dream-form .checkbox-label span { text-transform: none !important; font-size: 15px !important; letter-spacing: 0.01em !important; }\nhtml[data-dbk] .dream-form .checkbox-label:has(input:checked) { background: var(--dbk-fill, var(--dbk-green)) !important; border-color: var(--dbk-fill, var(--dbk-green)) !important; }\nhtml[data-dbk] .dream-form .checkbox-label:has(input:checked) span { color: var(--dbk-cream) !important; }\n/* Today's Three: a small × on a filled line clears just that one */\n\nhtml[data-dbk-page=\"index\"] .hm-thing { position: relative; }\nhtml[data-dbk-page=\"index\"] .hm-thing .thing-x { all: unset; flex: none; margin-left: auto; width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; color: rgba(var(--dbk-green-rgb),0.45); cursor: pointer; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk-page=\"index\"] .hm-thing:has(.thing-text.empty) .thing-x { display: none; }\nhtml[data-dbk-page=\"index\"] .hm-thing { grid-template-columns: 38px 26px 1fr 36px !important; }\nhtml[data-dbk-page=\"index\"] .hm-thing .thing-x { margin-left: 0; }\nhtml[data-dbk-page=\"index\"] .hm-thing:has(.thing-text.empty) .thing-x { display: flex; visibility: hidden; }\n/* Workroom editor: the essentials up front, the rest behind More */\n\nhtml[data-dbk] .wrc-sheet:not(.wrc-more-open) .wrc-extra:not(.wrc-has) { display: none !important; }\nhtml[data-dbk-page=\"index\"] .hc-ev.is-post .hc-title { opacity: 0.85; }\n/* \"Are you sure?\" pop-up (and Workroom's older one, made to match) */\n\n.dbk-confirm { position: fixed; inset: 0; z-index: 40000; background: rgba(20,24,18,0.5); display: flex; align-items: flex-start; justify-content: center; padding: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + calc(22 * var(--dbk-vh, 1vh))) 16px 16px; }\n.dbk-confirm-card { width: 100%; max-width: 340px; background: #f3eee4; color: #2f3a2c; border-radius: 6px; padding: 22px 20px 16px; text-align: center; box-shadow: 0 16px 40px rgba(0,0,0,0.3); }\nhtml[data-dbk=\"p2\"] .dbk-confirm-card { background: #10151c; color: #e6eaef; }\n.dbk-confirm-msg { font-family: var(--dbk-serif, Georgia, serif); font-size: 17px; line-height: 1.4; }\n.dbk-confirm-act { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }\n.dbk-confirm-act button { all: unset; cursor: pointer; font-family: var(--dbk-caps, serif); font-size: 15px; letter-spacing: 0.03em; padding: 9px 4px; }\n.dbk-confirm-no { text-decoration: underline; text-underline-offset: 4px; opacity: 0.8; }\n.dbk-confirm-yes { background: #b0596b; color: #fff !important; padding: 9px 18px !important; border-radius: 4px; }\nhtml[data-dbk] .lh-confirm-overlay { align-items: flex-start !important; padding-top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + calc(22 * var(--dbk-vh, 1vh))) !important; }\nhtml[data-dbk] .lh-confirm-box { text-align: center !important; max-width: 340px !important; }\nhtml[data-dbk] .lh-confirm-btns { display: flex !important; justify-content: center !important; align-items: center !important; gap: 22px !important; }\nhtml[data-dbk] .lh-confirm-btn { flex: none !important; width: auto !important; }\nhtml[data-dbk] .lh-confirm-cancel { background: none !important; border: none !important; text-decoration: underline; text-underline-offset: 4px; padding: 9px 4px !important; }\n/* ===== Buttons, one rule everywhere: the main action is one small solid button,\n   everything else (cancel, clear, secondary, delete) is a plain text link, and the row is centered ===== */\n\nhtml[data-dbk] { --bx-ink: var(--dbk-green); --bx-solid: var(--dbk-green); --bx-solid-ink: #f3eee4; --bx-danger: #a94f61; }\nhtml[data-dbk=\"p2\"] { --bx-ink: #e6eaef; --bx-solid: #8fc98a; --bx-solid-ink: #0c1118; --bx-danger: #e79aa9; }\nhtml[data-dbk] :is(.form-actions, .day-modal-form-actions, .reminder-form-actions, .habits-modal-actions, .ai-actions, .dbk-links) {\n  display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; gap: 10px 22px !important; text-align: center !important; width: auto !important; }\nhtml[data-dbk] :is(.form-actions, .day-modal-form-actions, .reminder-form-actions, .habits-modal-actions, .ai-actions) { margin: 16px auto 0 !important; padding: 0 !important; border: none !important; background: none !important; }\n/* the main action */\n\nhtml[data-dbk] :is(.form-actions, .day-modal-form-actions, .reminder-form-actions) .btn:not(.cancel-btn):not(.cancel-contact-btn), html[data-dbk] :is(.habits-save-btn, .ai-actions .wr-btn-primary) {\n  all: unset; box-sizing: border-box; cursor: pointer; order: 2; flex: none !important; width: auto !important; min-width: 0 !important;\n  background: var(--bx-solid) !important; color: var(--bx-solid-ink) !important; border-radius: 4px !important; border: none !important;\n  padding: 8px 18px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; line-height: 1.2 !important; text-transform: none !important; box-shadow: none !important; }\n/* everything else in those rows, plus standalone quiet actions */\n\nhtml[data-dbk] :is(.form-actions, .day-modal-form-actions, .reminder-form-actions) :is(.cancel-btn, .cancel-contact-btn), html[data-dbk] :is(.habits-cancel-btn, .cancel-contact-btn, .ai-actions .wr-btn-secondary, .dbk-link, .wrb-add), html[data-dbk-page=\"workroom\"] .wr-btn-sm.wr-btn-secondary, html[data-dbk-page=\"settings\"] :is(.btn-secondary, .btn-danger).btn-small:not([onclick^=\"adjustFontSize\"]) {\n  all: unset; box-sizing: border-box; cursor: pointer; order: 1; flex: none !important; width: auto !important;\n  padding: 8px 2px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; line-height: 1.2 !important;\n  color: var(--bx-ink) !important; opacity: 0.78; text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 1px; background: none !important; border: none !important; box-shadow: none !important; }\nhtml[data-dbk] :is(.dbk-danger, .btn-danger.btn-small) { color: var(--bx-danger) !important; opacity: 1 !important; order: 3; }\nhtml[data-dbk] :is(.habits-save-btn, .dbk-link, .wrb-add, .habits-cancel-btn, .cancel-contact-btn, .cancel-btn):focus-visible { outline: 2px solid var(--lh-secondary, #b0596b); outline-offset: 3px; }\n/* Resources: the add/delete pair under each category */\n\nhtml[data-dbk] .resource-content .dbk-links { margin: 12px auto 4px !important; }\n\n/* Workroom: business list as plain rows, the current one marked, \"Add a business\" as a link */\n\nhtml[data-dbk] .wrb-list { gap: 0 !important; }\nhtml[data-dbk] .wrb-item { min-height: 46px !important; padding: 12px 8px !important; border: none !important; border-bottom: 1px solid rgba(var(--wrc-ink-rgb, 47,58,44),0.12) !important; border-radius: 0 !important; background: none !important; color: inherit !important; font-family: var(--dbk-serif, Georgia, serif) !important; font-size: 17px !important; }\nhtml[data-dbk] .wrb-item:last-child { border-bottom: none !important; }\nhtml[data-dbk] .wrb-item.on { font-weight: 600 !important; text-decoration: underline; text-underline-offset: 5px; }\nhtml[data-dbk] .wrb-add { align-self: center; margin-top: 4px; }\n/* Workroom settings: small actions as centered links */\n\nhtml[data-dbk-page=\"workroom\"] div:has(> .wr-btn-sm) { justify-content: center !important; gap: 8px 22px !important; }\nhtml[data-dbk-page=\"workroom\"] .wr-card > .wr-btn-sm { display: block !important; margin: 8px auto 0 !important; }\n/* Settings: Save buttons and the backup row centered */\n\nhtml[data-dbk-page=\"settings\"] div[style*=\"text-align:right\"], html[data-dbk-page=\"settings\"] div[style*=\"text-align: right\"] { text-align: center !important; }\nhtml[data-dbk-page=\"settings\"] div:has(> .btn-small) { justify-content: center !important; gap: 8px 22px !important; }\nhtml[data-dbk-page=\"settings\"] .btn.btn-small:not(.btn-secondary):not(.btn-danger) { background: var(--bx-solid) !important; color: var(--bx-solid-ink) !important; border: none !important; border-radius: 4px !important; padding: 8px 18px !important; font-size: 15px !important; width: auto !important; }\n/* older per-pop-up rules used ids; this makes the link look win everywhere */\n\nhtml[data-dbk]:not(#z):not(#z) :is(.form-actions, .day-modal-form-actions, .reminder-form-actions, .ai-actions) :is(.cancel-btn, .cancel-contact-btn, .wr-btn-secondary), html[data-dbk]:not(#z):not(#z) :is(.habits-cancel-btn, .cancel-contact-btn, .dbk-link, .wrb-add), html[data-dbk-page=\"workroom\"]:not(#z):not(#z) .wr-btn-sm.wr-btn-secondary, html[data-dbk-page=\"settings\"]:not(#z):not(#z) :is(.btn-secondary, .btn-danger).btn-small:not([onclick^=\"adjustFontSize\"]) {\n  background: none !important; border: none !important; box-shadow: none !important; padding: 8px 2px !important; border-radius: 0 !important; min-height: 0 !important; width: auto !important; }\nhtml[data-dbk]:not(#z):not(#z) :is(.form-actions, .day-modal-form-actions, .reminder-form-actions, .ai-actions) :is(.cancel-btn, .cancel-contact-btn, .wr-btn-secondary), html[data-dbk]:not(#z):not(#z) :is(.habits-cancel-btn, .cancel-contact-btn, .dbk-link:not(.dbk-danger), .wrb-add), html[data-dbk-page=\"workroom\"]:not(#z):not(#z) .wr-btn-sm.wr-btn-secondary, html[data-dbk-page=\"settings\"]:not(#z):not(#z) .btn-secondary.btn-small:not([onclick^=\"adjustFontSize\"]) { color: var(--bx-ink) !important; }\nhtml[data-dbk]:not(#z):not(#z) :is(.dbk-danger, .btn-danger.btn-small) { color: var(--bx-danger) !important; }\nhtml[data-dbk]:not(#z):not(#z) :is(.form-actions, .day-modal-form-actions, .reminder-form-actions) .btn:not(.cancel-btn):not(.cancel-contact-btn), html[data-dbk]:not(#z):not(#z) :is(.habits-save-btn, .ai-actions .wr-btn-primary) {\n  background: var(--bx-solid) !important; color: var(--bx-solid-ink) !important; border: none !important; border-radius: 4px !important; padding: 8px 18px !important; width: auto !important; min-height: 0 !important; }\n/* Person 2: the contact pop-up and Workroom settings were still cream with light text */\n\nhtml[data-dbk=\"p2\"]:not(#z) :is(.ai-panel, .habits-modal, #resourceForm, .tried-modal-box, .skipped-answer-box, .picker-filter-box, .seasonal-modal, .detail-popup-box) { background: #121c2b !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .ai-panel .wr-card { background: rgba(230,234,239,0.04) !important; border-color: rgba(230,234,239,0.12) !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .ai-panel :is(.wr-card-title, .wr-label, label, .ai-panel-title) { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .ai-panel :is(.wr-card-subtitle, .ai-panel-subtitle) { color: rgba(230,234,239,0.7) !important; }\nhtml[data-dbk=\"p2\"]:not(#z) :is(.ai-panel) :is(input, textarea, select) { background: rgba(230,234,239,0.06) !important; color: #e6eaef !important; border-color: rgba(230,234,239,0.22) !important; }\nhtml[data-dbk=\"p2\"]:not(#z) :is(.ai-panel) :is(input, textarea)::placeholder { color: rgba(230,234,239,0.45) !important; }\n/* small icon buttons on a saved resource: no boxes */\n\nhtml[data-dbk]:not(#z) .resource-content .resource-item .btn, html[data-dbk]:not(#z) .resource-content button.btn[onclick^=\"editResource\"], html[data-dbk]:not(#z) .resource-content button.btn[onclick^=\"deleteResource(\"] { background: none !important; border: none !important; box-shadow: none !important; min-width: 36px; padding: 6px 8px !important; opacity: 0.6; color: inherit !important; }\n/* Settings: Archive / Restore on each page row as a quiet link */\n\n/* ===== Modes ===== */\n\n/* Home: the picker under the greeting and weather */\n\n/* asking: just the top of Home and the four choices */\n\n/* ===== Capture a thought + modes, on every page ===== */\n\nhtml[data-dbk] .dbk-capbar-global { position: fixed; bottom: 0; left: 0; right: 0; z-index: 900; padding: 8px 12px calc(6px + var(--dbk-safe-bottom, env(safe-area-inset-bottom))); transition: transform 0.25s ease; }\nhtml[data-dbk] .dbk-capbar-global .capture-bar-row { display: flex; align-items: center; gap: 8px; max-width: 680px; margin: 0 auto; }\nhtml[data-dbk] .dbk-capbar-global .capture-bar-input { flex: 1; min-width: 0; padding: 9px 12px; font-family: inherit; }\nhtml[data-dbk] .dbk-capbar-global .capture-bar-input:focus { outline: none; border-color: rgba(243,238,228,0.55) !important; }\nhtml[data-dbk] .dbk-capbar-global .capture-bar-send { border: none; width: 34px; height: 34px; font-size: 1rem; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }\nhtml[data-dbk] .dbk-capbar-global .capture-inbox-btn { position: relative; display: inline-flex; align-items: center; text-decoration: none; padding: 7px 10px; text-transform: uppercase; white-space: nowrap; }\nhtml[data-dbk] .dbk-capbar-global .capture-inbox-badge { position: absolute; top: -5px; right: -6px; background: var(--lh-secondary, #b0596b); color: #fff; font-size: 0.6rem; font-weight: 700; width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }\nhtml[data-dbk] .dbk-capbar-global .capture-inbox-badge:empty { display: none; }\n/* same look as Home's bar, on every page */\n\nhtml[data-dbk] .capture-sticky-bar { background: var(--dbk-fill, var(--dbk-green)) !important; border-top: none !important; box-shadow: none !important; }\nhtml[data-dbk] .capture-bar-input { background: rgba(243,238,228,0.1) !important; border: 1px solid rgba(243,238,228,0.25) !important; color: var(--dbk-cream) !important; border-radius: 2px !important; font-size: 1rem !important; }\nhtml[data-dbk] .capture-bar-input::placeholder { color: rgba(243,238,228,0.6) !important; font-style: italic; }\nhtml[data-dbk] .capture-bar-send { background: var(--dbk-cream) !important; color: var(--dbk-green) !important; border-radius: 2px !important; }\nhtml[data-dbk] .capture-sticky-bar .capture-inbox-btn { background: transparent !important; color: var(--dbk-cream) !important; border: 1px solid rgba(243,238,228,0.55) !important; border-radius: 2px !important; font-family: var(--dbk-caps) !important; font-size: 14px !important; letter-spacing: 0.08em !important; opacity: 1 !important; }\nhtml[data-dbk] .capture-sticky-bar .capture-inbox-btn * { color: var(--dbk-cream) !important; }\nhtml[data-dbk] .capture-sticky-bar .capture-inbox-badge { color: #fff !important; }\n/* dark looks: the badge is a light pink, so its number is dark */\nhtml[data-dbk=\"p2\"]:not(#z) :is(.dbk-capbar-global, .capture-sticky-bar) .capture-inbox-badge { color: #0c1118 !important; }\n/* the mode switch under it */\n\n/* Home keeps the big choices only while it's asking; after that the switch lives in the bottom bar */\n\n#dbkCapSpace { height: 100px; }\n\n.dbk-cap-toast { position: fixed; left: 50%; bottom: calc(110px + var(--dbk-safe-bottom, env(safe-area-inset-bottom))); transform: translateX(-50%) translateY(8px); background: #2f3a2c; color: #f3eee4; padding: 9px 18px; border-radius: 4px; font-size: 15px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 950; }\n.dbk-cap-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }\nhtml[data-dbk=\"p2\"] .dbk-cap-toast { background: #e6eaef; color: #0c1118; }\nhtml[data-dbk=\"p2\"]:not(#z) .capture-sticky-bar { background: #06080b !important; --dbk-cream: #e6eaef; }\nhtml[data-dbk=\"p2\"]:not(#z) .capture-bar-send { background: #8fc98a !important; color: #06080b !important; }\n/* ===== Mode menus: Home plus the mode's own pages ===== */\n\nhtml[data-dbk] nav.top-nav .nav-links > :not(.dbk-ml-box) { display: none !important; }\nhtml[data-dbk] nav.top-nav .dbk-ml-box { display: contents; }\nhtml[data-dbk] nav.top-nav .nav-links { gap: 0 16px !important; }\n\n/* ===== Work mode: Today ===== */\n\nhtml.wt-on[data-dbk-page=\"workroom\"] .container { padding-top: 0 !important; }\nhtml.wt-on[data-dbk-page=\"workroom\"] :is(.wrb-bar, #wrBizBar, #dbkWrSettings, .section-nav-dropdown) { display: none !important; }\nhtml[data-dbk-page=\"workroom\"] #today-tab { margin: 0 calc(50% - calc(50 * var(--dbk-vw, 1vw))); }\nhtml[data-dbk] .wt-band { text-align: center; }\nhtml[data-dbk] .wt-hero { padding-top: 34px !important; padding-bottom: 34px !important; }\nhtml[data-dbk] .wt-title { font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 2.3rem !important; letter-spacing: 0.02em; margin: 0 !important; line-height: 1.15; text-transform: none !important; }\nhtml[data-dbk] .wt-date { margin-top: 8px; font-family: var(--dbk-caps); letter-spacing: 0.06em; font-size: 1.02rem; color: var(--lh-secondary, #e6bdb5) !important; }\nhtml[data-dbk] .wt-sum { margin: 12px auto 0; max-width: 32ch; font-style: italic; font-size: 1.08rem; line-height: 1.45; opacity: 0.85; }\nhtml[data-dbk] .wt-h { font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 1.4rem !important; letter-spacing: 0.04em; margin: 0 0 14px !important; text-align: center; text-transform: none !important; }\nhtml[data-dbk] .wt-empty { font-style: italic; opacity: 0.75; margin: 0; font-size: 1.02rem; }\nhtml[data-dbk] .wt-next { margin: 10px 0 0; font-size: 0.98rem; opacity: 0.85; }\nhtml[data-dbk] .wt-list { list-style: none; margin: 0 auto; padding: 0; max-width: 460px; text-align: left; }\nhtml[data-dbk] .wt-list li { border-top: 1px solid rgba(var(--dbk-green-rgb),0.16); }\nhtml[data-dbk] .wt-list li:first-child { border-top: none; }\nhtml[data-dbk] .wt-list li, html[data-dbk] .wt-list li > a { display: flex; gap: 14px; align-items: baseline; padding: 11px 2px; color: inherit !important; text-decoration: none !important; }\nhtml[data-dbk] .wt-list li > a { padding: 0; width: 100%; }\nhtml[data-dbk] .wt-list li > .wt-row { display: flex; gap: 14px; align-items: baseline; width: 100%; }\nhtml[data-dbk] .wt-tap li { padding: 0; } html[data-dbk] .wt-tap li > a { padding: 11px 2px; }\nhtml[data-dbk] .wt-when { flex: none; width: 88px; font-family: var(--dbk-caps); font-size: 0.92rem; letter-spacing: 0.03em; opacity: 0.75; }\nhtml[data-dbk] .wt-late { color: var(--lh-secondary, #b0596b) !important; opacity: 1; }\nhtml[data-dbk] .wt-what { flex: 1; min-width: 0; font-size: 1.04rem; line-height: 1.35; }\nhtml[data-dbk] .wt-what em { display: block; font-size: 0.86rem; opacity: 0.65; margin-top: 2px; }\nhtml[data-dbk] .wt-counts { display: flex; justify-content: center; gap: 34px; }\nhtml[data-dbk] .wt-counts .wt-count span { border-bottom: none; }\nhtml[data-dbk] .wt-counts :is(a, .wt-count) { display: flex; flex-direction: column; align-items: center; gap: 2px; color: inherit !important; text-decoration: none !important; }\nhtml[data-dbk] .wt-counts b { font-family: var(--dbk-caps); font-weight: 400; font-size: 1.9rem; line-height: 1; }\nhtml[data-dbk] .wt-counts span { font-size: 0.86rem; letter-spacing: 0.04em; opacity: 0.75; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.35); padding-bottom: 2px; }\nhtml[data-dbk] .wt-links { display: flex; justify-content: center; margin-top: 10px; }\nhtml[data-dbk=\"p2\"] .wt-date { color: #8fc98a !important; }\n/* ===== Meals mode: tonight ===== */\n\nhtml[data-dbk] .mt-band { text-align: center; }\nhtml[data-dbk] .mt-h { font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 1.05rem !important; letter-spacing: 0.1em; margin: 0 0 8px !important; opacity: 0.75; text-transform: none !important; }\nhtml[data-dbk] .mt-dinner { font-family: var(--dbk-caps); font-size: 1.9rem; line-height: 1.2; margin: 0; }\nhtml[data-dbk] .mt-none { font-family: var(--dbk-caps); font-size: 1.35rem; margin: 0; }\nhtml[data-dbk] .mt-idea { margin: 10px 0 0; font-style: italic; font-size: 1.06rem; }\nhtml[data-dbk] .mt-idea b { font-style: normal; font-weight: 500; }\nhtml[data-dbk] .mt-band .dbk-links { margin-top: 8px !important; }\nhtml[data-dbk] .mt-rest { margin: 12px 0 0; font-size: 0.95rem; opacity: 0.75; }\nhtml[data-dbk-page=\"workroom\"]:not(#z) #today-tab .dbk-sec { background: var(--bandc) !important; border-image: conic-gradient(var(--bandc) 0 0) fill 0 / 0 / 0 100vmax !important; }\nhtml[data-dbk-page=\"workroom\"] #today-tab { margin: 0 !important; }\n/* ===== Settings ===== */\n\nhtml[data-dbk] .dbk-retired { display: none !important; }\nhtml[data-dbk-page=\"settings\"] .dbk-autosave .btn { display: none !important; }\nhtml[data-dbk-page=\"settings\"] .dbk-autosave { text-align: center !important; min-height: 18px; }\nhtml[data-dbk-page=\"settings\"] .dbk-conn { align-items: center; }\nhtml[data-dbk-page=\"settings\"] .dbk-conn-state { margin-left: auto; font-family: var(--dbk-caps); letter-spacing: 0.03em; font-size: 1rem; }\nhtml[data-dbk-page=\"settings\"] .dbk-conn-note, html[data-dbk-page=\"settings\"] .dbk-about { font-size: 0.98rem; line-height: 1.5; opacity: 0.8; margin: 8px 0 4px; text-align: center; }\nhtml[data-dbk-page=\"settings\"] .dbk-version { font-family: var(--dbk-caps); letter-spacing: 0.06em; font-size: 0.9rem; opacity: 0.6; }\n/* the opened page */\n/* chapters in the full book */\n/* the contents line: what's in the book, as words, not pills */\n/* no script lettering anywhere in the book */\n/* Today's sections use the same lines */\n\n@media (prefers-reduced-motion: no-preference) {\n  @keyframes sbOpen { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }\n}\n/* empty space under the last section takes that section's color (set by matchBottom in daybook-theme.js) */\n\nhtml[data-dbk].dbk-tail { background: linear-gradient(var(--dbk-green) 0 50%, var(--dbk-tail) 50% 100%) no-repeat var(--dbk-tail) !important; }\nhtml[data-dbk].dbk-tail:not(#z) body { background: var(--dbk-tail) !important; }\n/* script titles are drawn at their real weight, never thickened */\n\nhtml[data-dbk=\"p1\"] :is(.section-modal-title, .home-greeting, .home-names, .page-title, .dbk-title, .hm-greet, .tp-title, .journal-title, .brain-dump-label) { font-weight: 400 !important; font-synthesis: none; }\n/* Habits bingo: a done square keeps the same lettering as the rest of the card */\n\nhtml[data-dbk=\"p1\"]:not(#z)[data-dbk-page$=\"-hub\"] .bingo-cell.completed, html[data-dbk=\"p1\"]:not(#z)[data-dbk-page$=\"-hub\"] .bingo-cell.in-bingo { font-family: var(--dbk-serif) !important; font-size: 17px !important; line-height: 1.25 !important; font-style: normal !important; }\n/* Home's choices screen: fixed to the screen, no scrolling */\n\n/* the choices sit a little below the middle of the screen */\n\n/* nothing but that pink anywhere on the screen, whatever the phone does with its edges */\n\n/* shorter phones: the choices screen tightens up so it still fits without scrolling */\n\n/* ===== Meal Plan: each meal is a tidy row. Kind on the left, the meal (wrapping, never cut off)\n   with its numbers and ratings under it, and swap or skip on the right ===== */\n\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card {\n  display: grid !important; grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: \"type name side\" \"type macros side\" \"type rate side\";\n  column-gap: 12px; row-gap: 2px; align-items: baseline; padding: 14px 2px !important; position: relative; min-height: 0 !important; height: auto !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-body { display: contents !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-type { grid-area: type; margin: 0 !important; white-space: nowrap; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-name { grid-area: name; text-align: left !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; -webkit-line-clamp: unset !important; display: block !important; line-height: 1.3 !important; margin: 0 !important; max-width: none !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-macros { grid-area: macros; text-align: left !important; font-style: italic; font-size: 14px !important; line-height: 1.35 !important; white-space: normal !important; margin: 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-rating { grid-area: rate; position: static !important; display: flex !important; gap: 18px; margin: 6px 0 0 !important; opacity: 1 !important; transform: none !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-rate-btn { all: unset; cursor: pointer; display: inline-flex; padding: 2px; color: var(--dbk-green); opacity: 0.45; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-rate-btn.active, html[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-rate-btn[class*=\"on\"] { opacity: 1; color: var(--lh-secondary, #b0596b); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-rate-btn svg { width: 15px !important; height: 15px !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-swap { grid-area: side; align-self: center; position: static !important; background: none !important; border: none !important; box-shadow: none !important; padding: 8px !important; margin: 0 !important; color: var(--dbk-green) !important; opacity: 0.6; width: auto !important; height: auto !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-swap svg { width: 16px !important; height: 16px !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-skip-link { grid-area: side; position: static !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mc-card .mc-name-empty { font-size: 16px !important; }\n/* the week strip doesn't need a tall band */\n\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) section.dbk-sec:has(#week-nav) { padding-top: 18px !important; padding-bottom: 16px !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #week-nav { margin-top: 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mt-hide { display: none !important; }\n/* ===== Meal Plan: the recipe box =====\n   Index cards with a rose rule under the name and faint ruled lines, filed behind divider tabs. */\n\nhtml[data-dbk-page=\"meal-plan\"] { --rb-card: #fbf8f1; --rb-ink: #2f3a2c; --rb-ink-rgb: 47,58,44; --rb-rule: rgba(176,89,107,0.55); --rb-line: rgba(84,112,140,0.16); }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"] { --rb-card: #121c2b; --rb-ink: #e6eaef; --rb-ink-rgb: 230,234,239; --rb-rule: rgba(231,154,169,0.55); --rb-line: rgba(230,234,239,0.08); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 14px; border: none !important; padding: 4px 2px 10px !important; }\n@media (min-width: 640px) { html[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box { grid-template-columns: repeat(3, minmax(0, 1fr)); } }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card {\n  position: relative; display: flex !important; flex-direction: column; align-items: stretch !important; justify-content: flex-start !important; gap: 0 !important;\n  min-height: 132px; padding: 14px 12px 34px !important; margin: 0 !important; border: 1px solid rgba(var(--rb-ink-rgb),0.16) !important; border-left: 1px solid rgba(var(--rb-ink-rgb),0.16) !important;\n  border-radius: 3px !important; background: var(--rb-card) !important;\n  background-image: repeating-linear-gradient(to bottom, transparent 0 23px, var(--rb-line) 23px 24px) !important; background-position: 0 6px !important;\n  box-shadow: 0 2px 0 rgba(var(--rb-ink-rgb),0.07), 0 6px 14px -10px rgba(var(--rb-ink-rgb),0.35) !important; cursor: pointer; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card:nth-of-type(4n+1) { transform: rotate(-0.6deg); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card:nth-of-type(4n+2) { transform: rotate(0.5deg); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card:nth-of-type(4n+3) { transform: rotate(0.3deg); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card:nth-of-type(4n) { transform: rotate(-0.4deg); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card:active { transform: none; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-name {\n  display: block !important; white-space: normal !important; overflow: visible !important; text-overflow: clip !important; -webkit-line-clamp: unset !important;\n  font-family: var(--dbk-serif) !important; font-size: 16.5px !important; line-height: 1.3 !important; color: var(--rb-ink) !important; text-align: left !important;\n  padding: 0 22px 9px 0 !important; margin: 0 0 7px !important; border-bottom: 1.5px solid var(--rb-rule); background: var(--rb-card); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-meta { font-family: var(--dbk-script); font-style: italic; font-size: 14px; line-height: 24px; color: rgba(var(--rb-ink-rgb),0.72); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-top-right { position: static !important; display: block !important; opacity: 1 !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-act { position: absolute !important; bottom: 3px; padding: 6px !important; color: rgba(var(--rb-ink-rgb),0.45) !important; opacity: 0 !important; pointer-events: none; }\n@media (hover: hover) { html[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card:hover .rb-card-act { opacity: 1 !important; pointer-events: auto; } }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box > .rb-card { padding-bottom: 14px !important; min-height: 118px; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-fav { opacity: 0.6 !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-act:nth-child(1) { right: 34px; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-act:nth-child(2) { right: 6px; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card-fav { position: absolute !important; top: 9px; right: 6px; background: none !important; border: none !important; padding: 4px !important; }\n/* Planning meals for both (Kasey, Oct 22: \"what's the initial under the hearts?\"): each person has their own heart, with\n   their initial under it. Both sat in the same corner, one on top of the other, so the two initials ran together and a\n   tap always reached the top one (the second person's) whoever tapped. Side by side: first person's, then second's. */\nhtml[data-dbk-page=\"meal-plan\"]:not(.mp-private):not(#z):not(#y) #rb-grid.rb-box .rb-card:has(.rb-fav-p2) .rb-fav-p1 { right: 34px; }\nhtml[data-dbk-page=\"meal-plan\"]:not(.mp-private):not(#z):not(#y) #rb-grid.rb-box .rb-card:has(.rb-fav-p2) .rb-card-name { padding-right: 52px !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(.mp-private):not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box > .rb-card:has(.rb-fav-p2) { padding-right: 66px !important; }\n/* divider tabs */\n\nhtml[data-dbk-page=\"meal-plan\"] .rb-tab { grid-column: 1 / -1; border-bottom: 1.5px solid var(--rb-ink); margin: 18px 0 2px; padding-left: 6px; line-height: 0; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-tab:first-child { margin-top: 4px; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-tab span { display: inline-block; line-height: 1.2; font-family: var(--dbk-caps); font-size: 17px; letter-spacing: 0.03em; color: var(--rb-ink);\n  padding: 7px 18px 5px; border: 1.5px solid var(--rb-ink); border-bottom: none; border-radius: 12px 12px 0 0; background: var(--dbk-pink); margin-bottom: -1.5px; }\nhtml[data-dbk-page=\"meal-plan\"] .rb-tab-main span { background: var(--dbk-sand, #e7d5b6); }\nhtml[data-dbk-page=\"meal-plan\"] .rb-tab-sweet span { background: var(--dbk-celadon, #dcdfc2); }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"] .rb-tab span { background: #17263d; }\n/* opening a pop-up never changes the page behind it (pages used to switch off scrolling, which made\n   iPhones move the capture bar); the pop-up itself keeps its own scrolling */\n\nhtml[data-dbk] body[style*=\"overflow: hidden\"], html[data-dbk] body[style*=\"overflow:hidden\"] { overflow-y: visible !important; }\n/* ...and only the pop-up's own layer and box keep a scroll to themselves (so reaching the end of one doesn't move the\n   page behind). This used to be every element (*): on a laptop (Safari) a text box, or any row that clips its words,\n   then kept the mouse wheel / trackpad scroll to itself and nothing moved while the pointer was over it (Kasey, Oct 22:\n   stuck over text boxes, and In and out wouldn't scroll at all). Text boxes always pass a scroll on. */\nhtml.dbk-pop-open[data-dbk] :is([data-dbk-scrim], [data-dbk-scrim] > *:not(input, textarea, select), .section-modal-inner, .section-modal-body) { overscroll-behavior: contain; }\nhtml[data-dbk] :is(input, select) { overscroll-behavior: auto !important; }\nhtml[data-dbk] .capture-sticky-bar { position: fixed !important; bottom: 0 !important; left: 0 !important; right: 0 !important; top: auto !important; }\nhtml[data-dbk] .dbk-endclose { display: flex; justify-content: center; padding: 18px 0 8px !important; margin: 0 !important; border: none !important; background: none !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #rb-grid.rb-box .rb-card.rb-show-actions .rb-card-act { opacity: 1 !important; pointer-events: auto; }\n/* Meal Plan week strip: the day you're looking at is filled; today keeps a thin outline when it isn't the one */\n\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.dbk-sel { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream) !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.dbk-sel * { color: var(--dbk-cream) !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.is-today:not(.dbk-sel) { background: none !important; box-shadow: inset 0 0 0 1.5px var(--dbk-green) !important; color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.is-today:not(.dbk-sel) * { color: var(--dbk-green) !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.dbk-sel { background: #8fc98a !important; color: #06080b !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.dbk-sel * { color: #06080b !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.is-today:not(.dbk-sel) { background: none !important; box-shadow: inset 0 0 0 1.5px #8fc98a !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"]:not(#z) .day-btn.is-today:not(.dbk-sel) * { color: #e6eaef !important; }\n/* ===== Meal Plan journal ===== */\n\nhtml[data-dbk-page=\"meal-plan\"] .mj-band { text-align: center; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-h { font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 1.35rem !important; letter-spacing: 0.04em; margin: 0 0 14px !important; text-transform: none !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-label { display: block; text-align: left; max-width: 520px; margin: 12px auto 4px; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; color: rgba(var(--dbk-green-rgb),0.75); }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) .mj-input { display: block; width: 100%; max-width: 520px; margin: 0 auto; box-sizing: border-box; background: none !important; border: none !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.4) !important; border-radius: 0 !important; padding: 8px 2px !important; font-family: var(--dbk-serif) !important; font-size: 17px !important; color: var(--dbk-green) !important; resize: vertical; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-input:focus { outline: none; border-bottom-color: var(--dbk-green) !important; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-saved { min-height: 18px; margin: 6px 0 0; font-style: italic; font-size: 14px; opacity: 0.7; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-list { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; text-align: left; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-list li { border-top: 1px solid rgba(var(--dbk-green-rgb),0.16); }\nhtml[data-dbk-page=\"meal-plan\"] .mj-list li:first-child { border-top: none; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-list button { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 14px; width: 100%; padding: 11px 2px; align-items: baseline; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-day { flex: none; width: 92px; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.03em; opacity: 0.8; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-what { flex: 1; min-width: 0; font-size: 16px; line-height: 1.35; color: var(--dbk-green); }\nhtml[data-dbk-page=\"meal-plan\"] .mj-what em { display: block; font-size: 14.5px; opacity: 0.75; margin-top: 2px; }\nhtml[data-dbk-page=\"meal-plan\"] .mj-empty { font-style: italic; opacity: 0.5; font-size: 15px; }\nhtml[data-dbk-page=\"meal-plan\"] #journal-patterns:empty, html[data-dbk-page=\"meal-plan\"] #journal-patterns:has(.journal-patterns-empty) { display: none !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #journal-timeline.mj-cal > div:first-child { margin-top: 0 !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) #mjToday { margin-top: -22px !important; }\n/* ===== Inbox: a plain notes list. A note shows just its words; tap it to send it somewhere ===== */\n\nhtml[data-dbk]:not(#z) .inbox-item { padding: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.14) !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .inbox-item { border-bottom-color: rgba(230,234,239,0.12) !important; }\nhtml[data-dbk]:not(#z) .inbox-item-row1 { display: flex; align-items: baseline; gap: 10px; padding: 14px 20px !important; cursor: pointer; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z) .inbox-item-text { flex: 1; min-width: 0; font-family: var(--dbk-serif) !important; font-size: 17px !important; line-height: 1.4 !important; text-align: left !important; }\nhtml[data-dbk]:not(#z) .inbox-item-meta { flex: none; font-size: 13px !important; font-style: italic; opacity: 0.55; }\nhtml[data-dbk]:not(#z) .inbox-item:not(.open) .inbox-item-row2 { display: none !important; }\nhtml[data-dbk]:not(#z) .inbox-item.open { background: rgba(var(--dbk-green-rgb),0.05); }\nhtml[data-dbk=\"p2\"]:not(#z) .inbox-item.open { background: rgba(230,234,239,0.05); }\nhtml[data-dbk]:not(#z) .inbox-item-row2 { display: block !important; padding: 0 20px 14px !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z) .inbox-route-btn:focus-visible, html[data-dbk]:not(#z) .inbox-item-row1:focus-visible { outline: 2px solid var(--lh-secondary, #b0596b); outline-offset: 2px; }\nhtml[data-dbk]:not(#z) .inbox-modal-title { font-family: var(--dbk-caps) !important; font-size: 1.35rem !important; letter-spacing: 0.04em !important; text-transform: none !important; }\nhtml[data-dbk]:not(#z) .inbox-count { font-style: italic; font-size: 14px !important; text-transform: none !important; letter-spacing: 0 !important; opacity: 0.6; }\nhtml[data-dbk]:not(#z) .inbox-clear-btn { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14px; text-decoration: underline; text-underline-offset: 4px; opacity: 0.7; padding: 4px 2px; }\n/* ═══ Oct 12: wishlists, inbox, Meal Plan list, Workroom ideas, Home ═══ */\n/* Home: the greeting and choices sit in the middle of the screen, a touch above */\n\n/* Wishlists: a gift list, no ruled cards */\n\nhtml[data-dbk] .dream-list.ul-list:has(.ul-gifts) { width: 100% !important; align-self: stretch !important; }\nhtml[data-dbk] .ul .ul-gifts { display: flex; flex-direction: column; gap: 18px; padding: 6px 4px 4px; text-align: left; width: 100% !important; max-width: none !important; align-items: stretch !important; }\nhtml[data-dbk] .ul .ul-gifts > .ul-gift { all: unset; display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 3px; cursor: pointer; width: 100% !important; max-width: none !important; margin: 0 !important; padding: 0 !important; box-sizing: border-box; text-align: left !important; background: none !important; border: 0 !important; box-shadow: none !important; transform: none !important; }\nhtml[data-dbk] .ul-gift-line { width: 100%; display: flex; align-items: baseline; gap: 8px; min-width: 0; }\nhtml[data-dbk] .ul-gift-name { font-family: var(--dbk-serif); font-size: 20px; line-height: 1.25; color: var(--dbk-green); min-width: 0; }\nhtml[data-dbk] .ul-heart { font-style: normal; color: var(--lh-secondary); font-size: .8em; margin-right: 7px; position: relative; top: -1px; }\nhtml[data-dbk] .ul-gift-dots { flex: 1 1 18px; min-width: 18px; border-bottom: 1.5px dotted rgba(var(--dbk-green-rgb),.35); transform: translateY(-4px); }\nhtml[data-dbk] .ul-gift-shop { flex: none; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: .04em; color: var(--lh-secondary); }\nhtml[data-dbk] .ul-gift-note { font-family: var(--dbk-serif); font-style: italic; font-size: 15px; color: rgba(var(--dbk-green-rgb),.7); }\nhtml[data-dbk] .ul-gift:has(.ul-heart) .ul-gift-note { padding-left: 21px; }\nhtml[data-dbk] .ul-gift.is-done .ul-gift-name { text-decoration: line-through; opacity: .55; }\nhtml[data-dbk] .ul-gift:focus-visible { outline: 2px solid var(--lh-secondary); outline-offset: 4px; }\n/* Inbox: tags and times readable, not ghosted */\n\nhtml[data-dbk] .inbox-item-meta, html[data-dbk] .inbox-item-meta * { opacity: 1 !important; color: rgba(var(--dbk-green-rgb),.62) !important; }\nhtml[data-dbk] .inbox-item-tag { color: var(--lh-secondary) !important; border-color: rgba(var(--lh-secondary-rgb),.35) !important; background: none !important; }\n/* Meal Plan list: square checkboxes like the rest of the app, not the browser's dark ones */\n\nhtml[data-dbk] #grocery-view input[type=\"checkbox\"] { appearance: none !important; -webkit-appearance: none !important; width: 16px !important; height: 16px !important; min-width: 16px !important; border: 1.4px solid var(--dbk-fill, var(--dbk-green)) !important; border-radius: 0 !important; background: transparent !important; margin: 0 !important; cursor: pointer; }\nhtml[data-dbk] #grocery-view input[type=\"checkbox\"]:checked { background: var(--dbk-fill, var(--dbk-green)) !important; box-shadow: inset 0 0 0 3px var(--dbk-cream) !important; }\n/* Workroom: actions on an idea are quiet links, so the idea stays the thing you read */\n\nhtml[data-dbk] .wrc-act { background: none !important; border: 0 !important; color: inherit !important; padding: 2px 0 !important; margin-right: 18px !important; min-height: 0 !important; box-shadow: none !important; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; font-size: .92em !important; opacity: .85; }\nhtml[data-dbk] .wrc-act.wrc-solid { opacity: 1; }\n/* ═══ Oct 12: Home is Today; modes switch from the button at the top left ═══ */\n\n/* room kept clear under a pop-up: the capture bar and the home bar below it */\n\nhtml[data-dbk] { --dbk-capspace: calc(66px + var(--dbk-safe-bottom, env(safe-area-inset-bottom, 0px))); }\n/* ═══ Oct 12: pop-ups run from the top of the menu down to just above the capture bar. They sit a little above the\n   middle with the page showing around them, and anything longer scrolls inside. With the keyboard up\n   they use the space left above it. ═══ */\n\nhtml[data-dbk]:not(#z) :is(#dayModalOverlay > .day-modal, .edit-reminder-overlay > .edit-reminder-modal, #reminderModalOverlay > .reminder-modal, #rtSheet > .rt-sheet, #inboxModal, #habitsModalOverlay > .habits-modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal, #addEventModalOverlay > .modal, #section-modal > .section-modal-inner, .dream-form > form, #resourceForm.event-form) {\n  max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - var(--dbk-capspace)) !important;\n  overflow-y: auto !important; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;\n}\nhtml[data-dbk]:not(#z) :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form) {\n  padding-bottom: calc(var(--dbk-kbh, 0px) + var(--dbk-capspace)) !important;\n}\n/* Us lists: a slimmer title bar, so more of the list fits */\n\nhtml[data-dbk] #section-modal .section-modal-header { padding: 12px 20px !important; position: sticky !important; top: 0 !important; z-index: 2 !important; }\nhtml[data-dbk] #section-modal .section-modal-title { font-size: 2rem !important; line-height: 1.1 !important; }\nhtml[data-dbk=\"p2\"] #section-modal .section-modal-title { font-size: 1.4rem !important; }\nhtml[data-dbk] #section-modal .section-modal-body { padding: 16px 18px 20px !important; }\n/* Cancel in the Us add forms is a quiet link, like everywhere else; Save is the one button */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dream-form .form-actions .btn:not(.save-btn) { background: none !important; border: 0 !important; box-shadow: none !important; color: inherit !important; text-decoration: underline; text-underline-offset: 4px; padding-left: 6px !important; padding-right: 6px !important; }\n/* every pop-up dims the page the same way, so you can still see where you are */\n\nhtml[data-dbk]:not(#z) #addContactModal { background: rgba(20,24,18,0.55) !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }\n/* Us > Challenge History > Skipped: the month, the challenge, then a quiet row of links. Nothing beside the text. */\n\nhtml[data-dbk] .dbk-skip { padding: 14px 0 16px; border-bottom: 1px solid rgba(var(--dbk-green-rgb), 0.18); text-align: left; }\nhtml[data-dbk] .dbk-skip:last-child { border-bottom: 0; }\nhtml[data-dbk] .dbk-skip-month { font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.05em; color: var(--lh-secondary); margin-bottom: 6px; }\nhtml[data-dbk] .dbk-skip-text { display: flex !important; align-items: flex-start; gap: 12px; cursor: pointer; font-family: var(--dbk-serif); font-size: 17px; line-height: 1.4; color: var(--dbk-green); }\nhtml[data-dbk] .dbk-skip-text span { flex: 1; min-width: 0; }\nhtml[data-dbk] .dbk-skip-check { appearance: none !important; -webkit-appearance: none !important; flex: none; width: 16px !important; height: 16px !important; min-width: 16px !important; margin: 4px 0 0 !important; border: 1.4px solid var(--dbk-fill, var(--dbk-green)) !important; border-radius: 0 !important; background: transparent !important; cursor: pointer; }\nhtml[data-dbk] .dbk-skip-check:checked { background: var(--dbk-fill, var(--dbk-green)) !important; box-shadow: inset 0 0 0 3px var(--dbk-band, var(--dbk-cream)) !important; }\nhtml[data-dbk] .dbk-skip.is-done .dbk-skip-text span { text-decoration: line-through; opacity: 0.6; }\nhtml[data-dbk] .dbk-skip-note { margin: 6px 0 0 28px; font-family: var(--dbk-serif); font-style: italic; font-size: 15px; line-height: 1.4; color: rgba(var(--dbk-green-rgb), 0.72); }\nhtml[data-dbk] .dbk-skip-links { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 10px 0 0 28px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-skip-links button { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.04em; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; padding: 2px 0; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-skip-links .dbk-skip-rm { color: var(--lh-secondary); }\nhtml[data-dbk] .dbk-skip-links button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\nhtml[data-dbk] .dbk-skip-notes { margin: 10px 0 0 28px; }\nhtml[data-dbk] .dbk-skip-notes .dbk-skip-links { margin-left: 0; }\n/* ═══ Oct 12: nothing squeezed beside buttons ═══ */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-skip-check { width: 16px !important; height: 16px !important; min-height: 16px !important; max-height: 16px !important; align-self: flex-start !important; padding: 0 !important; }\n/* Today's calendar: time on the left, the event reads left to right beside it */\n\nhtml[data-dbk]:not(#z) .hc-ev { display: grid !important; grid-template-columns: 78px minmax(0,1fr) !important; align-items: baseline !important; text-align: left !important; column-gap: 10px !important; }\nhtml[data-dbk]:not(#z) .hc-ev .hc-title { text-align: left !important; }\n/* Inbox: the note gets the whole width; when and what kind sit under it */\n\nhtml[data-dbk]:not(#z) .inbox-item-row1 { flex-direction: column !important; align-items: flex-start !important; gap: 3px !important; }\nhtml[data-dbk]:not(#z) .inbox-item-row1 .inbox-item-text { width: 100% !important; }\nhtml[data-dbk]:not(#z) .inbox-item-row1 .inbox-item-meta { display: flex !important; align-items: center !important; gap: 8px !important; margin: 0 !important; }\n/* a day's events: title, time, then Edit and Delete as quiet links under them */\n\nhtml[data-dbk]:not(#z) .day-modal-event { display: flex !important; flex-direction: column !important; gap: 3px !important; background: none !important; border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.16) !important; border-radius: 0 !important; padding: 12px 2px !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z) .day-modal-event-header { display: contents !important; }\nhtml[data-dbk]:not(#z) .day-modal-event-title { order: 1; font-size: 17px !important; line-height: 1.35 !important; }\nhtml[data-dbk]:not(#z) .day-modal-event-meta { order: 2; }\nhtml[data-dbk]:not(#z) .day-modal-event-actions { order: 3; display: flex !important; gap: 18px !important; margin-top: 4px !important; }\nhtml[data-dbk]:not(#z):not(#y) .day-modal-event-actions button { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 4px; color: var(--dbk-green); }\nhtml[data-dbk]:not(#z):not(#y) .day-modal-event-actions .day-modal-delete { font-size: 0 !important; color: var(--lh-secondary); }\nhtml[data-dbk]:not(#z):not(#y) .day-modal-event-actions .day-modal-delete::after { content: 'Delete'; font-size: 14px; }\n/* Back Burner: a small × like Today's Three, so the item keeps the room */\n\n/* Habit resources: plain rows under each heading, no boxed cards */\n\nhtml[data-dbk]:not(#z):not(#y) .resource-item { background: none !important; border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.14) !important; border-radius: 0 !important; box-shadow: none !important; padding: 12px 2px !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .resource-item::before { display: none !important; }\n/* a day's \"+ Add Event\": a quiet centered link, not a boxed button */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .day-modal-add { all: unset; display: block; box-sizing: border-box; width: max-content; margin: 16px auto 4px; padding: 6px 4px; cursor: pointer; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 4px; text-align: center; }\n/* Inbox: when and what kind share one quiet line under the note */\n\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-row1 { flex-direction: row !important; flex-wrap: wrap !important; align-items: baseline !important; column-gap: 12px !important; row-gap: 4px !important; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-row1 .inbox-item-text { flex: 0 0 100% !important; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-row1 .inbox-item-meta { order: 2; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-row1 .inbox-item-tag { order: 3; margin: 0 !important; }\n/* Habit resources: each category is a heading with a rule under it, not a box inside a box */\n\nhtml[data-dbk]:not(#z):not(#y) :is(.resource-category, .resource-content, .resource-header) { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; backdrop-filter: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .resource-category { margin: 0 0 22px !important; padding: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .resource-header { padding: 12px 2px !important; border-bottom: 1.5px solid rgba(var(--dbk-green-rgb),0.35) !important; }\nhtml[data-dbk]:not(#z):not(#y) .resource-content { padding: 0 !important; }\n/* Inbox filters: plain words in a centered line, the one you're on underlined. No pills. */\n\nhtml[data-dbk]:not(#z):not(#y) div:has(> .inbox-tag-btn) { justify-content: center !important; column-gap: 16px !important; row-gap: 6px !important; padding: 12px 20px 6px !important; }\n/* Grocery list: categories are headings with a rule, the items plain rows. No grey boxes. */\n\nhtml[data-dbk]:not(#z):not(#y) :is(.grocery-category, .grocery-cat-header, .grocery-cat-items) { background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .grocery-category { margin: 0 0 22px !important; padding: 0 !important; overflow: visible !important; }\nhtml[data-dbk]:not(#z):not(#y) .grocery-cat-header { padding: 10px 2px 8px !important; border-bottom: 1.5px solid rgba(var(--dbk-green-rgb),0.35) !important; }\nhtml[data-dbk]:not(#z):not(#y) .grocery-cat-items { padding: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .grocery-cat-items .grocery-item { padding-left: 2px !important; padding-right: 2px !important; }\n/* the Send / Copy line sticks above the capture bar, so it needs the page color behind it */\n\nhtml[data-dbk]:not(#z) #grocery-send-bar { background: var(--bandc, var(--dbk-pink)) !important; border-top: 1px solid rgba(var(--dbk-green-rgb),0.14); }\n/* Food journal calendar: a dot on the days you wrote something, not tiny squeezed words */\n\nhtml[data-dbk]:not(#z) #journal-timeline [onclick^=\"window._openJournalDay\"] > div:nth-child(2) { font-size: 0 !important; width: 5px !important; height: 5px !important; padding: 0 !important; border-radius: 50% !important; background: var(--lh-secondary) !important; opacity: 0.8 !important; margin-top: 7px !important; display: block !important; -webkit-line-clamp: unset !important; }\nhtml[data-dbk]:not(#z) #journal-timeline [onclick^=\"window._openJournalDay\"][style*=\"0.06)\"] { background: none !important; border-color: transparent !important; }\nhtml[data-dbk]:not(#z) #journal-timeline [onclick^=\"window._openJournalDay\"] { min-height: 42px !important; }\nhtml[data-dbk]:not(#z) #journal-timeline [onclick^=\"window._openJournalDay\"] > div:first-child { font-size: 15px !important; }\nhtml[data-dbk]:not(#z) #journal-timeline > div:nth-child(3) > div { background: none !important; border-color: transparent !important; min-height: 42px !important; }\nhtml[data-dbk]:not(#z) #journal-timeline > div:nth-child(3) > div > div:first-child { font-size: 15px !important; }\nhtml[data-dbk]:not(#z) #journal-timeline > div:nth-child(3) > div[style*=\"2px solid\"] { border: 1.5px solid var(--dbk-fill, var(--dbk-green)) !important; border-radius: 10px !important; }\n/* Food journal: whose journal is a pair of words at the top of the calendar band, not a grey switch */\n\nhtml[data-dbk]:not(#z) #journal-person-tabs { --bandc: var(--dbk-linen); background: var(--bandc) !important; box-shadow: 0 0 0 100vmax var(--bandc) !important; clip-path: inset(0 -100vmax) !important; padding: 30px 0 0 !important; margin: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z) #journal-person-tabs { --bandc: #0b1018; }\nhtml[data-dbk]:not(#z) #journal-person-tabs > div { border: 0 !important; justify-content: center !important; gap: 28px !important; margin: 0 !important; overflow: visible !important; }\nhtml[data-dbk]:not(#z) #journal-person-tabs > div > button { flex: 0 0 auto !important; background: none !important; border: 0 !important; padding: 4px 2px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.04em !important; font-weight: 400 !important; color: rgba(var(--dbk-green-rgb),0.55) !important; }\nhtml[data-dbk]:not(#z) #journal-person-tabs > div > button[style*=\"accent-rgb),0.12\"] { color: var(--dbk-green) !important; text-decoration: underline !important; text-underline-offset: 6px !important; }\nhtml[data-dbk]:not(#z) #journal-timeline.mj-cal { margin-top: 0 !important; }\n/* switches between views read as words, the one you're on underlined, like the menu. No filled pill. */\n\nhtml[data-dbk]:not(#z) .dbk-seg { border: 0 !important; border-radius: 0 !important; gap: 22px !important; }\nhtml[data-dbk]:not(#z) .dbk-seg button { padding: 6px 2px !important; border-radius: 0 !important; color: rgba(var(--dbk-green-rgb),0.6) !important; }\nhtml[data-dbk]:not(#z) .dbk-seg button.on { background: none !important; color: var(--dbk-green) !important; text-decoration: underline; text-decoration-color: var(--lh-secondary); text-decoration-thickness: 1.5px; text-underline-offset: 7px; }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-seg button { color: rgba(230,234,239,0.55) !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-seg button.on { color: #e6eaef !important; }\n/* ═══ Oct 12: one title per pop-up ═══ */\n/* Us lists: the pop-up's own title already names the list, so the first heading inside goes (wishlists keep each person's name) */\n\nhtml[data-dbk]:not(#z):not(#y) #section-modal .section > .section-title:first-child:not(:has([data-hh-name])) { display: none !important; }\n/* Edit My Habits: no second line under the title; habits read as plain rows */\n\nhtml[data-dbk]:not(#z):not(#y) #habitCount { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .habit-item { background: none !important; border: 0 !important; border-left: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.14) !important; border-radius: 0 !important; box-shadow: none !important; padding: 2px 2px !important; margin: 0 !important; display: flex !important; align-items: center !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .habit-item input { background: none !important; border: 0 !important; box-shadow: none !important; padding: 11px 0 !important; flex: 1 !important; min-width: 0 !important; font-size: 16px !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .habit-delete { background: none !important; border: 0 !important; opacity: 0.5; font-size: 20px !important; padding: 4px 2px 4px 10px !important; width: auto !important; min-width: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .habits-list { gap: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .add-habit-row { display: flex !important; align-items: center !important; gap: 14px !important; margin-top: 14px !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .add-habit-row input { flex: 1 !important; min-width: 0 !important; background: none !important; border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.35) !important; border-radius: 0 !important; box-shadow: none !important; padding: 10px 0 !important; font-size: 16px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .habits-modal .add-habit-btn { all: unset; cursor: pointer; font-size: 0; color: var(--dbk-green); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .habits-modal .add-habit-btn::after { content: 'Add'; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; text-decoration: underline; text-underline-offset: 4px; }\n/* Choose a meal: recipes as plain rows (no boxes, no letter badge); full names wrap instead of cutting off */\n\nhtml[data-dbk]:not(#z) #picker-recipe-list { gap: 0 !important; }\nhtml[data-dbk]:not(#z) #picker-recipe-list > button { background: none !important; border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.14) !important; border-radius: 0 !important; padding: 12px 2px !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z) #picker-recipe-list > button > div:first-child:not(:last-child) { display: none !important; }\nhtml[data-dbk]:not(#z) #picker-recipe-list > button > div:last-child > div:first-child { white-space: normal !important; font-size: 16px !important; line-height: 1.35 !important; }\nhtml[data-dbk]:not(#z) #picker-recipe-list > button > div:last-child > div:last-child { font-size: 13px !important; margin-top: 2px; }\nhtml[data-dbk]:not(#z):not(#y) .picker-new-btn { background: none !important; border: 0 !important; padding: 6px 4px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.04em; color: var(--dbk-green) !important; text-decoration: underline; text-underline-offset: 4px; }\nhtml[data-dbk]:not(#z) .seasonal-season-label { display: none !important; }\n/* ═══ Oct 12: behind every pop-up the page is heavily blurred and softly dimmed, so the eye stays on the pop-up ═══ */\n\nhtml[data-dbk] { --dbk-pop-veil: rgba(28,34,26,0.32); --dbk-pop-blur: blur(22px) saturate(0.7); }\nhtml[data-dbk=\"p2\"] { --dbk-pop-veil: rgba(4,6,9,0.5); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(#dayModalOverlay, .edit-reminder-overlay, #addReminderOverlay, #editReminderOverlay, #reminderModalOverlay, .rt-overlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #resourceFormOverlay, .event-form-overlay, #seasonal-modal-overlay, .ht-estimator-overlay, #ht-wizard-overlay, #wiz-help-overlay, #hiw-overlay, #aiOverlay, #locationSetupOverlay, #psdRepoOverlay, #voiceSetupOverlay, #hubThemeOverlay, .tp-overlay, .tp-pop-overlay, .wrc-overlay) {\n  background: var(--dbk-pop-veil) !important;\n  backdrop-filter: var(--dbk-pop-blur) !important; -webkit-backdrop-filter: var(--dbk-pop-blur) !important;\n}\n/* the setup screen is a full page of light text, not a pop-up over the page: keep it solid and dark */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #ht-wizard-overlay { background: #2f3a2c !important; backdrop-filter: none !important; -webkit-backdrop-filter: none !important; }\nhtml[data-dbk] #ht-wizard-overlay .ht-wiz-sub { color: rgba(232,224,212,0.82); }\nhtml[data-dbk]:not(#z):not(#y) #ht-wizard-overlay .ht-wiz-nav { background: #2f3a2c !important; }\nhtml[data-dbk] #ht-wizard-overlay .ht-wiz-divider, html[data-dbk] #ht-wizard-overlay .ht-wiz-divider-sm { color: rgba(163,184,153,0.8); }\n/* a form opened on top of an Us list already has the blurred page behind the list */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dream-form.active { background: rgba(28,34,26,0.18) !important; backdrop-filter: blur(10px) !important; -webkit-backdrop-filter: blur(10px) !important; }\n/* ═══ Oct 12: organization pass ═══ */\n/* which mode you're in, in small caps under the mode button */\n\n/* Later, under Today's Three */\n\nhtml[data-dbk] #dbkLaterToggle.on { text-decoration-color: var(--lh-secondary); }\nhtml[data-dbk] .dbk-later { margin-top: 16px; }\nhtml[data-dbk] .dbk-later[hidden] { display: none !important; }\nhtml[data-dbk] .dbk-later-list { list-style: none; margin: 6px 0 0; padding: 0; }\nhtml[data-dbk] .dbk-later-item { display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.16); }\nhtml[data-dbk] .dbk-later-item label { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; font-family: var(--dbk-serif); font-size: 1.05rem; line-height: 1.35; color: var(--dbk-green); }\nhtml[data-dbk] .dbk-later-item input { flex: 0 0 auto; width: 16px; height: 16px; margin: 0; accent-color: var(--dbk-green); }\nhtml[data-dbk] .dbk-later-item.done span { text-decoration: line-through; opacity: 0.5; }\nhtml[data-dbk] .dbk-later-x { all: unset; cursor: pointer; font-size: 20px; line-height: 1; padding: 6px 2px 6px 10px; color: var(--dbk-green); opacity: 0.5; }\nhtml[data-dbk] .dbk-later-empty { padding: 14px 0 4px; text-align: center; font-family: var(--dbk-serif); font-style: italic; opacity: 0.65; }\n/* Back Burner: a small + under the list, and the one-line box it opens */\nhtml[data-dbk] .dbk-later-addrow { display: flex; justify-content: center; margin-top: 12px; }\nhtml[data-dbk] .dbk-later-plus { all: unset; box-sizing: border-box; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; border: 1px solid rgba(var(--dbk-green-rgb),0.4); display: grid; place-items: center; font-family: var(--dbk-serif); font-size: 20px; line-height: 1; color: var(--dbk-green); }\nhtml[data-dbk] .dbk-later-plus[hidden], html[data-dbk] .dbk-later-form[hidden] { display: none !important; }\nhtml[data-dbk] .dbk-later-form { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 360px; }\nhtml[data-dbk] .dbk-later-form input { flex: 1; min-width: 0; box-sizing: border-box; font: 16px var(--dbk-serif); text-align: center; color: var(--dbk-green); background: transparent; border: 0; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.4); border-radius: 0; padding: 8px 4px; outline: none; }\nhtml[data-dbk] .dbk-later-form input::placeholder { color: var(--dbk-green); opacity: .5; font-style: italic; }\nhtml[data-dbk] .dbk-later-go { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--dbk-fill, var(--dbk-green)); color: var(--dbk-cream); font-size: 16px; line-height: 1; }\nhtml[data-dbk] .dbk-later-close { all: unset; cursor: pointer; flex: none; font-size: 20px; line-height: 1; padding: 6px 4px; color: var(--dbk-green); opacity: .55; }\nhtml[data-dbk=\"p2\"] :is(.dbk-later-plus, .dbk-later-close, .dbk-later-form input) { color: #e6eaef; }\nhtml[data-dbk=\"p2\"] .dbk-later-plus, html[data-dbk=\"p2\"] .dbk-later-form input { border-color: rgba(230,234,239,.4); }\nhtml[data-dbk=\"p2\"] .dbk-later-form input::placeholder { color: #e6eaef; }\nhtml[data-dbk=\"p2\"] .dbk-later-go { background: #8fc98a; color: #06080b; }\n/* Habits: Resources is a link at the bottom; Resources has its way back at the top */\n\nhtml[data-dbk] #dbkResLink { margin: 0 !important; padding: 26px 0 30px !important; }\nhtml[data-dbk] .dbk-quiet-links a { font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--dbk-green-rgb),0.75); text-decoration: underline; text-underline-offset: 4px; }\nhtml[data-dbk] .dbk-back { margin: 0 0 6px !important; padding-top: 18px; }\n/* Settings: Today's sections */\n\nhtml[data-dbk] .dbk-set-note { font-family: var(--dbk-serif); font-size: 15px; line-height: 1.45; margin: 4px 0 10px; opacity: 0.75; text-align: left; }\nhtml[data-dbk] .dbk-set-gap { margin-top: 22px; }\nhtml[data-dbk] .dbk-set-row { display: flex; align-items: center; gap: 12px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.14); }\nhtml[data-dbk] .dbk-set-check { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px 0; cursor: pointer; font-family: var(--dbk-serif); font-size: 16px; }\nhtml[data-dbk] .dbk-set-check input { width: 16px; height: 16px; margin: 0; flex: 0 0 auto; accent-color: var(--dbk-green); }\nhtml[data-dbk] .dbk-set-row.off .dbk-set-check span { opacity: 0.5; }\nhtml[data-dbk] .dbk-set-move { display: flex; gap: 2px; }\nhtml[data-dbk] .dbk-set-move button { all: unset; cursor: pointer; width: 30px; height: 30px; display: grid; place-items: center; font-size: 16px; color: var(--dbk-green); opacity: 0.7; }\nhtml[data-dbk] .dbk-set-move button:disabled { opacity: 0.18; cursor: default; }\nhtml[data-dbk] .dbk-set-move button:focus-visible { outline: 2px solid currentColor; }\nhtml[data-dbk=\"p2\"] :is(.dbk-later-item label, .dbk-later-x, .dbk-set-move button) { color: #e6eaef; }\n/* Search results above the capture bar */\n\nhtml[data-dbk] .dbk-find { position: fixed; left: 0; right: 0; z-index: 9990; padding: 0 10px 8px; pointer-events: none; }\nhtml[data-dbk] .dbk-find[hidden] { display: none; }\nhtml[data-dbk] .dbk-find-card { pointer-events: auto; max-width: 560px; margin: 0 auto; max-height: min(calc(52 * var(--dbk-vh, 1vh)), 420px); overflow-y: auto; overscroll-behavior: contain; background: #f3eee4; color: #2f3a2c; border-radius: 12px; box-shadow: 0 10px 34px rgba(20,24,18,0.28); padding: 6px 16px; }\nhtml[data-dbk] .dbk-find-card button { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 11px 2px; border-bottom: 1px solid rgba(47,58,44,0.12); }\nhtml[data-dbk] .dbk-find-card button:focus-visible { outline: 2px solid #2f3a2c; outline-offset: -2px; }\nhtml[data-dbk] .dbk-find-t { display: block; font-family: var(--dbk-serif); font-size: 16px; line-height: 1.3; }\nhtml[data-dbk] .dbk-find-k { display: block; margin-top: 2px; font-family: var(--dbk-caps); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: #8f4253; }\nhtml[data-dbk] .dbk-find-hint { padding: 10px 2px 6px; font-family: var(--dbk-serif); font-style: italic; font-size: 13px; opacity: 0.6; text-align: center; }\nhtml[data-dbk=\"p2\"] .dbk-find-card { background: #141b25; color: #e6eaef; }\nhtml[data-dbk=\"p2\"] .dbk-find-card button { border-bottom-color: rgba(230,234,239,0.12); }\nhtml[data-dbk=\"p2\"] .dbk-find-k { color: #8fc98a; }\nhtml[data-dbk] .dbk-find-card button, html[data-dbk] .dbk-find-t, html[data-dbk] .dbk-find-k { text-align: left; }\n/* just the icon in the corner, no mode name */\n\n/* weather and moon pop-ups: upper-middle like the rest, the page blurred behind, and every line easy to read */\n\nhtml[data-dbk]:not(#z):not(#y) .dbk-infopop { align-items: flex-start !important; padding: var(--dbk-pop-top, 90px) 16px var(--dbk-capspace, 80px) !important; background: var(--dbk-pop-veil) !important; backdrop-filter: var(--dbk-pop-blur) !important; -webkit-backdrop-filter: var(--dbk-pop-blur) !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-infocard { max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 90px) - var(--dbk-capspace, 80px)) !important; overflow-y: auto !important; }\nhtml[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.3\"], html[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.35\"], html[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.4\"] { opacity: 0.7 !important; }\nhtml[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.5\"], html[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.6\"] { opacity: 0.78 !important; }\nhtml[data-dbk]:not(#z) .dbk-infocard [style*=\"opacity:0.7\"] { opacity: 0.88 !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-infocard { background: #f3eee4 !important; color: #2f3a2c !important; border: 0 !important; box-shadow: 0 18px 50px rgba(20,24,18,0.3) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .dbk-infocard { background: #121925 !important; color: #e6eaef !important; box-shadow: 0 18px 50px rgba(0,0,0,0.5) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .dbk-infocard button { color: #8fc98a !important; }\n/* Us lists: the × sits level with the title */\n\nhtml[data-dbk]:not(#z):not(#y) #section-modal .section-modal-header { position: sticky !important; display: flex !important; align-items: center !important; justify-content: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #section-modal .section-modal-back { top: 50% !important; bottom: auto !important; transform: translateY(-50%) !important; margin: 0 !important; }\n/* Meals pop-ups have a dark title bar, so their × is light */\n\nhtml[data-dbk-page=\"meal-plan\"]:not(#z):not(#y) .modal .modal-close { color: rgba(243,238,228,0.9) !important; opacity: 1 !important; }\n/* Person 2's: the last few lines that were too faint on the dark background */\n\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) :is(.empty-state, .mj-empty, .cs-label, .snack-meta, #grocery-send-bar > div, #mobile-person-toggle button) { opacity: 1 !important; color: rgba(230,234,239,0.78) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .grocery-item.checked span, html[data-dbk=\"p2\"]:not(#z):not(#y) .grocery-item [style*=\"line-through\"] { color: rgba(230,234,239,0.6) !important; opacity: 1 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #journal-timeline > div:nth-child(3) > div > div:first-child { color: #e6eaef !important; opacity: 0.85 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #journal-timeline > div:nth-child(3) > div { opacity: 1 !important; }\n/* ═══ checkboxes: drawn the same everywhere, light when empty (iPhone was drawing them dark) ═══ */\n\nhtml[data-dbk] input[type=\"checkbox\"]:not(.settings-toggle-label > input):not([role=\"switch\"]) {\n  -webkit-appearance: none !important; appearance: none !important;\n  width: 18px !important; height: 18px !important; min-width: 18px !important; min-height: 18px !important; max-width: 18px !important; max-height: 18px !important;\n  flex: 0 0 18px !important; margin: 0 !important; padding: 0 !important; border-radius: 3px !important;\n  border: 1.5px solid rgba(var(--dbk-green-rgb), 0.55) !important; background: #fffdf8 !important; box-shadow: none !important;\n  cursor: pointer; display: inline-grid !important; place-content: center; vertical-align: middle; position: relative; opacity: 1;\n}\nhtml[data-dbk] input[type=\"checkbox\"]:not(.settings-toggle-label > input):not([role=\"switch\"]):checked {\n  background: var(--dbk-fill, var(--dbk-green)) url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%23f3eee4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / 14px no-repeat !important;\n  border-color: var(--dbk-fill, var(--dbk-green)) !important;\n}\nhtml[data-dbk] input[type=\"checkbox\"]:not(.settings-toggle-label > input):focus-visible { outline: 2px solid var(--lh-secondary) !important; outline-offset: 2px; }\nhtml[data-dbk=\"p2\"] input[type=\"checkbox\"]:not(.settings-toggle-label > input):not([role=\"switch\"]) { border-color: rgba(230,234,239,0.6) !important; background: rgba(230,234,239,0.08) !important; }\nhtml[data-dbk=\"p2\"] input[type=\"checkbox\"]:not(.settings-toggle-label > input):not([role=\"switch\"]):checked { background: #8fc98a url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 8.5l3 3 6-7' fill='none' stroke='%230c1118' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") center / 14px no-repeat !important; border-color: #8fc98a !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .grocery-item.checked { opacity: 0.6 !important; }\n/* What's in Season: a line under the produce saying what's on the list, and Done */\n\nhtml[data-dbk] .dbk-season-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 20px 20px; text-align: center; font-family: var(--dbk-serif); font-size: 15px; font-style: italic; color: rgba(var(--dbk-green-rgb),0.8); border-top: 1px solid rgba(var(--dbk-green-rgb),0.12); }\nhtml[data-dbk] .dbk-season-foot .hm-link { font-style: normal; }\nhtml[data-dbk] .dbk-season-foot [hidden] { display: none !important; }\nhtml[data-dbk=\"p2\"] .dbk-season-foot { color: rgba(230,234,239,0.8); border-top-color: rgba(230,234,239,0.12); }\nhtml[data-dbk=\"p2\"] .dbk-season-foot .hm-link { color: #8fc98a; }\n/* an item you've added shows a check, and every name reads the same way */\n\nhtml[data-dbk]:not(#z) .seasonal-pill { text-transform: lowercase !important; }\nhtml[data-dbk]:not(#z) .seasonal-pill-add.seasonal-added::before { content: '\\2713\\00a0'; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .cs-trigger { background: transparent !important; border-color: rgba(230,234,239,0.35) !important; color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .cs-trigger .cs-label, html[data-dbk=\"p2\"]:not(#z):not(#y) .cs-trigger .cs-arrow { color: #e6eaef !important; }\n/* ═══ weather and moon pop-ups, option B ═══ */\n\nhtml[data-dbk] .dbk-infocard { --info-ink: 47,58,44; --info-acc: #8f4253; --info-moon: #b98590; position: relative; width: 100%; max-width: 380px; box-sizing: border-box; border-radius: 14px; padding: 22px 22px 18px; }\nhtml[data-dbk=\"p2\"] .dbk-infocard { --info-ink: 230,234,239; --info-acc: #8fc98a; --info-moon: #8fc98a; }\nhtml[data-dbk] .dbk-info-x { all: unset; position: absolute; right: 16px; top: 22px; font-size: 22px; line-height: 1; cursor: pointer; color: inherit; opacity: 0.7; padding: 2px 4px; }\nhtml[data-dbk] .dbk-info-x:focus-visible { outline: 2px solid currentColor; }\nhtml[data-dbk] .dbk-info-title { margin: 0 34px; font-family: var(--dbk-caps); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; text-align: center; text-wrap: balance; color: inherit; }\nhtml[data-dbk] .dbk-info-sub { margin: 6px 0 0; text-align: center; font-family: var(--dbk-serif); font-size: 16px; color: rgba(var(--info-ink),0.8); }\nhtml[data-dbk] .dbk-info-quote { margin: 12px 0 6px; text-align: center; font-family: var(--dbk-serif); font-style: italic; font-size: 17px; line-height: 1.5; color: inherit; }\nhtml[data-dbk] .dbk-info-rows { display: grid; grid-template-columns: 1fr auto; margin-top: 10px; font-family: var(--dbk-serif); font-size: 16px; }\nhtml[data-dbk] .dbk-info-rows > * { padding: 9px 0; border-bottom: 1px solid rgba(var(--info-ink),0.14); }\nhtml[data-dbk] .dbk-info-rows > :nth-child(odd) { color: rgba(var(--info-ink),0.8); }\nhtml[data-dbk] .dbk-info-rows > :nth-child(even) { text-align: right; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .dbk-info-rows > :nth-last-child(-n+2) { border-bottom: 0; }\nhtml[data-dbk] .dbk-phases { display: grid; grid-template-columns: repeat(8, 1fr); justify-items: center; margin: 16px 0 4px; }\nhtml[data-dbk] .dbk-phases > div { display: flex; flex-direction: column; align-items: center; gap: 6px; }\nhtml[data-dbk] .dbk-phases i { width: 5px; height: 5px; border-radius: 50%; }\nhtml[data-dbk] .dbk-phases .now i { background: var(--info-acc); }\nhtml[data-dbk] .dbk-wx-big { margin-top: 12px; text-align: center; font-family: var(--dbk-serif); font-size: 64px; line-height: 1; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .dbk-wx-hours { display: flex; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; -webkit-overflow-scrolling: touch; text-align: center; margin: 16px -4px 6px; padding: 12px 0; border-top: 1px solid rgba(var(--info-ink),0.14); border-bottom: 1px solid rgba(var(--info-ink),0.14); font-family: var(--dbk-serif); font-size: 16px; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }\nhtml[data-dbk] .dbk-wx-hours::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .dbk-wx-hours > div { flex: 0 0 58px; scroll-snap-align: start; }\nhtml[data-dbk] .dbk-wx-hours i { font-style: normal; font-family: var(--dbk-caps); font-size: 12px; letter-spacing: 0.03em; min-height: 15px; color: rgba(var(--info-ink),0.72); }\nhtml[data-dbk] .dbk-wx-rain { margin: 10px 0 0; text-align: center; font-family: var(--dbk-serif); font-style: italic; font-size: 16px; text-wrap: balance; }\nhtml[data-dbk] .dbk-wx-aq { margin: 14px 0 0; text-align: center; font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--info-ink),0.85); text-wrap: balance; }\nhtml[data-dbk] .dbk-wx-als { margin: 12px 0 0; border-top: 1px solid rgba(var(--info-ink),0.14); }\nhtml[data-dbk] .dbk-wx-al { border-bottom: 1px solid rgba(var(--info-ink),0.14); }\nhtml[data-dbk] .dbk-wx-al summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 10px 2px; cursor: pointer; text-align: left; }\nhtml[data-dbk] .dbk-wx-al summary::-webkit-details-marker { display: none; }\nhtml[data-dbk] .dbk-wx-al summary > svg:first-child { width: 22px; height: 22px; flex: none; color: #b4483c; }\nhtml[data-dbk=\"p2\"] .dbk-wx-al summary > svg:first-child { color: #e79aa9; }\nhtml[data-dbk] .dbk-wx-al summary span { flex: 1; min-width: 0; }\nhtml[data-dbk] .dbk-wx-al summary b { display: block; font-weight: 600; font-family: var(--dbk-serif); font-size: 16px; }\nhtml[data-dbk] .dbk-wx-al summary small { display: block; font-family: var(--dbk-serif); font-size: 14px; color: rgba(var(--info-ink),0.75); }\nhtml[data-dbk] .dbk-wx-chev { width: 18px; height: 18px; flex: none; opacity: .6; transition: transform .2s; }\nhtml[data-dbk] .dbk-wx-al[open] .dbk-wx-chev { transform: rotate(180deg); }\nhtml[data-dbk] .dbk-wx-alt { padding: 0 2px 12px 34px; text-align: left; font-family: var(--dbk-serif); font-size: 14.5px; line-height: 1.5; max-height: calc(40 * var(--dbk-vh, 1vh)); overflow-y: auto; scrollbar-width: none; }\nhtml[data-dbk] .dbk-wx-alt::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .dbk-wx-alt p { margin: 0 0 8px; }\n/* Today: an official weather alert under the weather */\nhtml[data-dbk] .dbk-wx-chip { display: flex; align-items: center; gap: 7px; margin: 10px auto 0; padding: 5px 14px; border: 1px solid rgba(var(--dbk-green-rgb),0.45); border-radius: 999px; background: none; color: inherit; font-family: var(--dbk-serif); font-size: 15px; letter-spacing: 0; text-transform: none; font-variant: normal; cursor: pointer; max-width: 100%; }\nhtml[data-dbk] .dbk-wx-chip svg { width: 17px; height: 17px; flex: none; color: #b4483c; }\nhtml[data-dbk=\"p2\"] .dbk-wx-chip svg { color: #e79aa9; }\nhtml[data-dbk] .dbk-wx-chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }\nhtml[data-dbk] .dbk-wx-chip em { font-style: normal; flex: none; opacity: .75; }\nhtml[data-dbk] .dbk-wx-hours > div { display: flex; flex-direction: column; align-items: center; gap: 5px; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .dbk-wx-hours small, html[data-dbk] .dbk-wx-trio small { font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.05em; color: rgba(var(--info-ink),0.8); }\nhtml[data-dbk] .dbk-wx-hours svg { width: 24px; height: 24px; display: block; }\nhtml[data-dbk] .dbk-wx-trio { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; margin-top: 12px; }\nhtml[data-dbk] .dbk-wx-trio b { display: block; font-weight: 400; font-family: var(--dbk-serif); font-size: 20px; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .dbk-wx-sun { display: flex; justify-content: space-between; margin-top: 14px; font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--info-ink),0.85); }\nhtml[data-dbk] .dbk-info-link { all: unset; display: block; width: max-content; margin: 16px auto 0; cursor: pointer; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; color: var(--info-acc); text-decoration: underline; text-underline-offset: 4px; }\nhtml[data-dbk] .dbk-info-link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\nhtml[data-dbk]:not(#z) .dbk-wx-hours svg { width: 28px !important; height: 28px !important; }\n/* a skipped meal reads as a normal row: name, \"Skipped\", undo */\n\nhtml[data-dbk]:not(#z):not(#y) .mc-card.mc-skipped[data-dbk-skip] { opacity: 1 !important; }\nhtml[data-dbk]:not(#z):not(#y) .mc-card.mc-skipped .dbk-skipped-note { font-style: italic; opacity: 0.75; }\nhtml[data-dbk]:not(#z):not(#y) .mc-card.mc-skipped .mc-type { opacity: 0.6; }\n/* whose meals: two words, the one you're looking at underlined. No filled switch. */\n\nhtml[data-dbk]:not(#z):not(#y) #mobile-person-toggle { border: 0 !important; border-radius: 0 !important; justify-content: center !important; gap: 28px !important; margin: 4px 0 10px !important; overflow: visible !important; }\nhtml[data-dbk]:not(#z):not(#y) #mobile-person-toggle > button { flex: 0 0 auto !important; background: none !important; padding: 4px 2px !important; font-family: var(--dbk-caps) !important; font-size: 16px !important; font-weight: 400 !important; letter-spacing: 0.04em !important; color: rgba(var(--dbk-green-rgb),0.6) !important; }\nhtml[data-dbk]:not(#z):not(#y) #mobile-person-toggle > button[style*=\"255, 255, 255\"] { color: var(--dbk-green) !important; text-decoration: underline !important; text-decoration-color: var(--lh-secondary) !important; text-underline-offset: 6px !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #mobile-person-toggle > button { color: rgba(230,234,239,0.6) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #mobile-person-toggle > button[style*=\"255, 255, 255\"] { color: #e6eaef !important; }\n/* weather and moon are short: they sit a little lower, still in the upper half */\n\nhtml[data-dbk]:not(#z):not(#y) .dbk-infopop { padding-top: calc(var(--dbk-pop-top, 90px) + calc(10 * var(--dbk-vh, 1vh))) !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-infocard { max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 90px) - calc(10 * var(--dbk-vh, 1vh)) - var(--dbk-capspace, 80px)) !important; }\n/* Habits: Resources is its own section at the bottom, with each category listed */\n\nhtml[data-dbk]:not(#z) #dbkResLink { margin: 0 !important; padding: 34px 0 38px !important; text-align: center; }\nhtml[data-dbk] .dbk-res-h { margin: 0; font-family: var(--dbk-caps); font-weight: 400; font-size: 26px; letter-spacing: 0.05em; color: var(--dbk-green); }\nhtml[data-dbk] .dbk-res-note { margin: 6px 0 14px; font-family: var(--dbk-serif); font-style: italic; font-size: 16px; color: rgba(var(--dbk-green-rgb),0.78); }\nhtml[data-dbk] .dbk-res-list { list-style: none; margin: 0 auto; padding: 0; max-width: 520px; text-align: left; border-top: 1px solid rgba(var(--dbk-green-rgb),0.2); }\nhtml[data-dbk] .dbk-res-list a { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 14px 2px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.2); text-decoration: none; color: var(--dbk-green); font-family: var(--dbk-serif); font-size: 18px; }\nhtml[data-dbk] .dbk-res-count { font-size: 15px; color: rgba(var(--dbk-green-rgb),0.7); white-space: nowrap; }\nhtml[data-dbk] .dbk-res-count b { font-weight: 400; font-size: 18px; margin-left: 4px; }\nhtml[data-dbk] .dbk-res-list a:focus-visible, html[data-dbk] .dbk-res-all:focus-visible { outline: 2px solid var(--lh-secondary); outline-offset: 2px; }\nhtml[data-dbk] .dbk-res-all { display: inline-block; margin-top: 18px; font-family: var(--dbk-caps); font-size: 16px; letter-spacing: 0.04em; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 5px; }\nhtml[data-dbk=\"p2\"] :is(.dbk-res-h, .dbk-res-list a, .dbk-res-all) { color: #e6eaef; }\nhtml[data-dbk=\"p2\"] :is(.dbk-res-note, .dbk-res-count) { color: rgba(230,234,239,0.78); }\nhtml[data-dbk=\"p2\"] :is(.dbk-res-list, .dbk-res-list a) { border-color: rgba(230,234,239,0.2); }\nhtml[data-dbk]:not(#z) #dbkResLink { padding-left: 22px !important; padding-right: 22px !important; }\n/* Meals week: the dates sit centered with the days under them; the cooking plan button sits off to the side */\n\n@media (min-width: 600px) {\n  html[data-dbk]:not(#z) #week-nav { position: relative !important; padding-left: 68px !important; padding-right: 68px !important; box-sizing: border-box !important; }\n  html[data-dbk]:not(#z) #week-nav #cooking-plan-btn { position: absolute !important; right: 12px !important; top: 50% !important; transform: translateY(-50%) !important; margin: 0 !important; }\n}\n/* Resources on the Habits page */\n\nhtml[data-dbk]:not(#z) #dbkResLink #resourceCategories { max-width: 560px; margin: 0 auto; text-align: left; }\nhtml[data-dbk] .dbk-res-more { margin-top: 8px; }\nhtml[data-dbk] button.dbk-res-all { all: unset; cursor: pointer; display: inline-block; margin-top: 10px; font-family: var(--dbk-caps); font-size: 16px; letter-spacing: 0.04em; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 5px; }\nhtml[data-dbk=\"p2\"] button.dbk-res-all { color: #e6eaef; }\n/* the New category pop-up */\n\nhtml[data-dbk] .dbk-catcard input { display: block; width: 100%; box-sizing: border-box; margin: 18px 0 6px; padding: 10px 2px; background: none; border: 0; border-bottom: 1.5px solid rgba(var(--info-ink),0.4); border-radius: 0; font-family: var(--dbk-serif); font-size: 17px; color: inherit; outline: none; }\nhtml[data-dbk] .dbk-catcard input:focus { border-bottom-color: var(--info-acc); }\nhtml[data-dbk] .dbk-cat-act { display: flex; justify-content: center; align-items: center; gap: 22px; margin-top: 18px; }\nhtml[data-dbk] .dbk-cat-cancel { all: unset; cursor: pointer; font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--info-ink),0.8); text-decoration: underline; text-underline-offset: 4px; }\nhtml[data-dbk] .dbk-cat-save { all: unset; cursor: pointer; padding: 8px 20px; background: var(--dbk-fill, var(--dbk-green)); color: #f3eee4; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.04em; border-radius: 3px; }\nhtml[data-dbk=\"p2\"] .dbk-cat-save { background: #8fc98a; color: #0c1118; }\nhtml[data-dbk] :is(.dbk-cat-cancel, .dbk-cat-save):focus-visible { outline: 2px solid var(--lh-secondary); outline-offset: 3px; }\n/* the resource form: Save and Cancel centered, Cancel as a quiet link */\n\nhtml[data-dbk]:not(#z):not(#y) #resourceForm form > div:last-child { justify-content: center !important; align-items: center !important; gap: 22px !important; flex-direction: row-reverse !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #resourceForm form > div:last-child > button[type=\"button\"] { all: unset; cursor: pointer; font-family: var(--dbk-serif); font-size: 15px; text-decoration: underline; text-underline-offset: 4px; opacity: 0.8; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .add-category-row[hidden] { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) body > #resourceForm.active { position: fixed !important; top: var(--dbk-pop-top, 90px) !important; left: 50% !important; right: auto !important; bottom: auto !important; transform: translateX(-50%) !important; width: min(420px, calc(calc(100 * var(--dbk-vw, 1vw)) - 32px)) !important; box-sizing: border-box !important; margin: 0 !important; z-index: 30001 !important; }\nhtml[data-dbk]:not(#z):not(#y) body > #resourceFormOverlay.active { position: fixed !important; inset: 0 !important; z-index: 30000 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #resourceForm form > div:last-child > button[type=\"button\"] { border: 0 !important; background: none !important; padding: 4px 2px !important; box-shadow: none !important; color: inherit !important; }\nhtml[data-dbk] #resourceForm .dbk-rf-title { margin: 0 0 14px; text-align: center; font-family: var(--dbk-caps); font-weight: 400; font-size: 22px; letter-spacing: 0.04em; color: var(--dbk-green); }\nhtml[data-dbk=\"p2\"] #resourceForm .dbk-rf-title { color: #e6eaef; }\n/* a day in the food journal opens upper-middle, page blurred behind, like every other pop-up */\n\nhtml[data-dbk]:not(#z):not(#y) #journal-day-popup { align-items: flex-start !important; padding: var(--dbk-pop-top, 90px) 16px var(--dbk-capspace, 80px) !important; background: var(--dbk-pop-veil) !important; backdrop-filter: var(--dbk-pop-blur) !important; -webkit-backdrop-filter: var(--dbk-pop-blur) !important; }\nhtml[data-dbk]:not(#z):not(#y) #journal-day-popup > div { max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 90px) - var(--dbk-capspace, 80px)) !important; overflow-y: auto !important; }\n/* days you can open look tappable */\n\nhtml[data-dbk]:not(#z) #journal-timeline [onclick*=\"_openJournalDay\"] { cursor: pointer; -webkit-tap-highlight-color: rgba(0,0,0,0.06); }\n/* search results sit just above the capture bar, inside it */\n\nhtml[data-dbk]:not(#z) #captureBar { overflow: visible !important; }\nhtml[data-dbk]:not(#z) #captureBar > .dbk-find { position: absolute !important; left: 0 !important; right: 0 !important; bottom: 100% !important; top: auto !important; padding: 0 10px 8px !important; z-index: 5 !important; }\n/* \"Are you sure?\" pop-up: Delete is always a solid, readable button, and the page blurs behind it */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-confirm .dbk-confirm-yes { background: #8f4253 !important; color: #fff !important; padding: 9px 18px !important; border-radius: 4px !important; opacity: 1 !important; text-decoration: none !important; border: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-confirm .dbk-confirm-yes { background: #c26b7d !important; color: #0c1118 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-confirm .dbk-confirm-no { color: inherit !important; background: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-confirm { background: var(--dbk-pop-veil) !important; backdrop-filter: var(--dbk-pop-blur) !important; -webkit-backdrop-filter: var(--dbk-pop-blur) !important; }\n/* Resources on Habits: everything centered, like the rest of the page */\n\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .resource-header { justify-content: center !important; gap: 10px !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .resource-arrow { position: static !important; margin: 0 !important; font-size: 12px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .resource-item { position: relative !important; text-align: center !important; padding-left: 52px !important; padding-right: 52px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .resource-item-content { text-align: center !important; margin: 0 auto !important; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .resource-item-actions { position: absolute !important; right: 0 !important; top: 12px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dbkResLink .empty-state, html[data-dbk]:not(#z):not(#y) #dbkResLink .resource-hint { text-align: center !important; }\n/* Inbox: a smaller search box, centered */\n\nhtml[data-dbk]:not(#z):not(#y) #inboxSearchInput { display: block !important; flex: 0 0 auto !important; width: 60% !important; max-width: 240px !important; margin-left: auto !important; margin-right: auto !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-search-row { justify-content: center !important; }\nhtml[data-dbk] .dbk-toc-n { font-family: var(--dbk-serif); font-size: 15px; letter-spacing: 0; color: rgba(var(--dbk-green-rgb),0.7); white-space: nowrap; }\nhtml[data-dbk] .dbk-toc-n b { font-weight: 400; font-size: 18px; margin-left: 4px; }\n/* Today's calendar: the time on the left and the event left-aligned next to it at every width, lined up with reminder rows */\n/* under a \"Herbs & Plants\" heading, each entry doesn't need to say \"herb\" again */\n/* Today's grocery list: a short rule under the heading, and \"No items yet\" centered */\n\nhtml[data-dbk]:not(#z):not(#y) .hm-groc { border-top: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) #groceryContent::before { content: ''; display: block; width: 72px; height: 1px; margin: -4px auto 12px; background: rgba(var(--dbk-green-rgb),0.35); }\nhtml[data-dbk]:not(#z):not(#y) .hm-groc:has(> :only-child[style*=\"italic\"]) { columns: 1 !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-groc > div[style*=\"italic\"] { text-align: center !important; padding: 8px 0 4px !important; }\n/* food journal day: centered at eye level */\n\nhtml[data-dbk]:not(#z):not(#y) .dbk-infopop.dbk-centerpop, html[data-dbk]:not(#z):not(#y) #journal-day-popup { align-items: center !important; padding: 24px 16px calc(var(--dbk-capspace, 80px) + 10px) !important; }\nhtml[data-dbk] .dbk-jd .dbk-info-title { margin-bottom: 14px; }\nhtml[data-dbk] .dbk-jd-empty { margin: 8px 0 4px; text-align: center; font-family: var(--dbk-serif); font-style: italic; font-size: 17px; color: rgba(var(--info-ink),0.8); }\nhtml[data-dbk] .dbk-jd-block { padding: 10px 0; border-top: 1px solid rgba(var(--info-ink),0.14); text-align: center; }\nhtml[data-dbk] .dbk-jd-label { font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: rgba(var(--info-ink),0.75); margin-bottom: 4px; }\nhtml[data-dbk] .dbk-jd-block p { margin: 0; font-family: var(--dbk-serif); font-size: 17px; line-height: 1.45; }\nhtml[data-dbk] .dbk-jd-note { font-style: italic; }\nhtml[data-dbk] .dbk-jd-nut { margin: 0 0 8px; text-align: center; font-family: var(--dbk-serif); font-size: 15px; color: rgba(var(--info-ink),0.8); font-variant-numeric: tabular-nums; }\nhtml[data-dbk]:not(#z) #journal-timeline > div:nth-child(3) > div { pointer-events: auto !important; cursor: pointer; }\n/* mode switcher: centered on the screen */\n\n/* ═══ Oct 12: every pop-up sits centered between the menu and the capture bar.\n   Tall ones still fill that space and scroll inside. ═══ */\n\nhtml[data-dbk] { --dbk-popbias: 0px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-infopop, .dbk-confirm, .wrc-overlay, .tp-overlay, .tp-pop-overlay, #journal-day-popup, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, #seasonal-modal-overlay, .ht-estimator-overlay, #hubThemeOverlay, #locationSetupOverlay) {\n  align-items: center !important;\n  padding-top: var(--dbk-pop-top, 14px) !important; padding-bottom: calc(var(--dbk-kbh, 0px) + var(--dbk-capspace, 80px)) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-infopop > *, .dbk-confirm > *, .wrc-overlay > *, .tp-overlay > *, .tp-pop-overlay > *, #journal-day-popup > *) { margin-top: auto !important; margin-bottom: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-infocard { max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 14px) - var(--dbk-capspace, 80px)) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) body > #resourceForm.active { top: calc(var(--dbk-pop-top, 14px) + (var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 14px) - var(--dbk-capspace, 80px)) / 2) !important; transform: translate(-50%, -50%) !important; max-height: calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top, 14px) - var(--dbk-capspace, 80px)) !important; overflow-y: auto !important; }\n/* meal plan: rating lives in the recipe book, not on each planned meal */\n\nhtml[data-dbk]:not(#z) .mc-card .mc-rating { display: none !important; }\n/* the rest of the pop-ups, centered too */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, .dream-form, #section-modal) {\n  align-items: center !important;\n  padding-top: var(--dbk-pop-top, 14px) !important; padding-bottom: calc(var(--dbk-kbh, 0px) + var(--dbk-capspace, 80px)) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(#dayModalOverlay > .day-modal, .edit-reminder-overlay > .edit-reminder-modal, #reminderModalOverlay > .reminder-modal, #habitsModalOverlay > .habits-modal, :is(#goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal) > .modal, #addEventModalOverlay > .modal, .dream-form > form, #section-modal > .section-modal-inner) { margin-top: auto !important; margin-bottom: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, .dream-form, #section-modal, .dbk-infopop, .dbk-confirm, .wrc-overlay, .tp-overlay, .tp-pop-overlay, #journal-day-popup, #seasonal-modal-overlay) { justify-content: center !important; }\n/* the space above and below a pop-up is now equal, so short ones sit in the middle */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(#dayModalOverlay, .edit-reminder-overlay, #reminderModalOverlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #section-modal, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, .tp-pop-overlay, .tp-overlay, .wrc-overlay)::after { flex: 1 1 0 !important; }\nhtml[data-dbk]:not(#z) #plan-view .mc-rating, html[data-dbk]:not(#z) #mobile-meal-content .mc-rating, html[data-dbk]:not(#z) .dual-col-wrap .mc-rating { display: none !important; }\n/* smart reminders: who to reach, and one tap to do it */\n\nhtml[data-dbk] .dbk-rem-contact { margin: 14px auto 2px; text-align: center; }\nhtml[data-dbk] .dbk-rem-contact[hidden] { display: none !important; }\nhtml[data-dbk] .dbk-rc-name { font-family: var(--dbk-serif); font-size: 16px; opacity: 0.9; }\nhtml[data-dbk] .dbk-rc-phone { opacity: 0.75; font-variant-numeric: tabular-nums; margin-left: 4px; }\nhtml[data-dbk] .dbk-rc-acts { margin-top: 6px; display: flex; justify-content: center; align-items: baseline; flex-wrap: wrap; gap: 4px 0; }\nhtml[data-dbk] .dbk-rc-acts a { font-family: var(--dbk-caps); font-size: 16px; letter-spacing: 0.04em; color: inherit; text-decoration: underline; text-underline-offset: 4px; padding: 4px 2px; }\nhtml[data-dbk] .dbk-rc-sep { margin: 0 12px; opacity: 0.45; }\nhtml[data-dbk] #currentReminder .dbk-rc-acts a { color: #f3eee4; }\nhtml[data-dbk] .dbk-rem-contact-sm { margin: 6px 0 8px; text-align: left; }\nhtml[data-dbk] .dbk-rem-contact-sm .dbk-rc-name { font-size: 14px; }\nhtml[data-dbk] .dbk-rem-contact-sm .dbk-rc-acts { justify-content: flex-start; margin-top: 2px; }\nhtml[data-dbk] .dbk-rem-contact-sm .dbk-rc-acts a { font-size: 14px; }\n/* Today's Three: number and checkbox on the left, the item centered in the row */\n\nhtml[data-dbk]:not(#z):not(#y) .hm-thing { grid-template-columns: 38px 26px minmax(0,1fr) 64px !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-thing .thing-text { text-align: center !important; justify-self: center !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-thing .thing-x { justify-self: end !important; grid-column: 4 !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-thing input.thing-input, html[data-dbk]:not(#z):not(#y) .hm-thing input { text-align: center !important; }\n/* recipe book on a wide screen: the same single stack of cards as on a phone */\n\n@media (min-width: 600px) {\n  html[data-dbk]:not(#z):not(#y) .rb-grid { grid-template-columns: minmax(0,1fr) !important; display: grid !important; max-width: 560px !important; margin-left: auto !important; margin-right: auto !important; }\n}\n/* Settings: each section name centered, its arrow off to the right */\n\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .settings-section > .section-header { position: relative !important; justify-content: center !important; text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .settings-section > .section-header .section-title { text-align: center !important; margin-left: auto !important; margin-right: auto !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .settings-section > .section-header .section-arrow { position: absolute !important; right: 4px !important; top: 50% !important; transform: translateY(-50%) !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .settings-section.open > .section-header .section-arrow { transform: translateY(-50%) rotate(180deg) !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z) .dbk-set-note { text-align: center !important; }\n/* Settings: the arrow sits right next to the section name */\n\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .settings-section > .section-header { gap: 10px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .settings-section > .section-header .section-title { margin: 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .settings-section > .section-header .section-arrow { position: static !important; transform: none !important; font-size: 12px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .settings-section.open > .section-header .section-arrow { transform: rotate(180deg) !important; }\n/* a page with little on it yet starts a bit lower, so it doesn't hug the menu */\n\nhtml[data-dbk]:not(#z) .dbk-sparse { padding-top: calc(9 * var(--dbk-vh, 1vh)) !important; }\nhtml[data-dbk] .dbk-groc-empty { margin: 28px 0 0; text-align: center; font-family: var(--dbk-serif); font-style: italic; font-size: 16px; color: rgba(var(--dbk-green-rgb),0.7); }\nhtml[data-dbk=\"p2\"] .dbk-groc-empty { color: rgba(230,234,239,0.75); }\nhtml[data-dbk-page=\"workroom\"]:not(#z) .dbk-sparse { padding-top: 0 !important; }\nhtml[data-dbk]:not(#z) .dbk-sparse { padding-top: calc(6 * var(--dbk-vh, 1vh)) !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-sparse { padding-top: 0 !important; }\n/* Big titles: Playfair Display italic (Person 1's view). Person 2's stay in small caps. */\n\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) :is(h1.page-title, .page-title, .home-greeting, .home-names, .dbk-title, .hm-greet, .hm-greet span, .section-modal-title, .tp-title, .journal-title, .journal-prompt-text, .journal-prompt-question, .brain-dump-label, .moon-phase-name, .bingo-cell.completed, .bingo-cell.in-bingo) { font-style: italic !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) .hm-greet, html[data-dbk=\"p1\"]:not(#z):not(#y) .hm-greet span { font-size: 38px !important; line-height: 1.12 !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) .dbk-title { font-size: 3rem !important; line-height: 1.1 !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) .section-modal-title { font-size: 1.9rem !important; }\nhtml[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y) .bingo-cell.completed, html[data-dbk=\"p1\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y) .bingo-cell.in-bingo { font-size: 1.15rem !important; line-height: 1.2 !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) .journal-title { font-size: 2rem !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) :is(.journal-prompt-text, .journal-prompt-question) { font-size: 1.5rem !important; line-height: 1.3 !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y) .tp-title { font-size: 32px !important; }\n/* No leftover script fonts anywhere */\n\nhtml[data-dbk]:not(#z):not(#y) [style*=\"Dancing Script\"], html[data-dbk]:not(#z):not(#y) [style*=\"Great Vibes\"] { font-family: var(--dbk-caps) !important; letter-spacing: 0.04em !important; }\n:is(.ht-wiz-logo, .ht-wiz-step-logo) { font-family: var(--font-title) !important; font-style: italic !important; }\n.ht-wiz-h1 { font-family: var(--font-title-caps) !important; font-weight: 400 !important; }\n:is(.ht-wiz-sub, .ht-wiz-card p, .ht-wiz-card li) { font-family: var(--font-body) !important; }\nhtml[data-dbk]:not(#z):not(#y) :is(#ht-est-modal-title, [style*=\"Playfair Display\"]) { font-family: var(--dbk-caps) !important; font-weight: 400 !important; }\n/* Inbox: Send to opens a small list under the note, styled like the rest of the row */\n\n@keyframes dbkSendIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }\n/* Inbox tidy-up: the kind of note sits after the time; the filter line only shows once something is tagged */\n\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-meta .inbox-item-tag { all: unset; font-family: var(--dbk-caps); font-style: normal; font-size: 13px; letter-spacing: 0.04em; color: var(--lh-secondary, #a94f61); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .inbox-item-meta .inbox-item-tag { color: #e79aa9; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-meta .inbox-item-tag::before { content: \"\\00b7\"; margin: 0 8px; color: inherit; opacity: 0.6; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-tagbar { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 18px; row-gap: 6px; padding: 12px 20px 8px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.1); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .inbox-tagbar { border-bottom-color: rgba(230,234,239,0.12); }\nhtml[data-dbk]:not(#z):not(#y) .inbox-empty { max-width: 280px; margin: 0 auto; text-align: center; font-style: italic; opacity: 0.7; padding: 28px 0 !important; line-height: 1.5; }\n/* messages (and their Undo) always show above pop-ups */\n\nhtml[data-dbk] #toastContainer { z-index: 2147483000 !important; }\nhtml[data-dbk] #toastContainer .toast { pointer-events: auto; }\nhtml[data-dbk]:not(#z):not(#y) .inbox-item-meta .inbox-item-tag::before { margin: 0 6px 0 2px; }\n/* Settings: no rule above the first section */\n\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y) .settings-section { border-top: 0 !important; }\n/* Connections: the linked / not linked line sits centered under the name */\n\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .dbk-conn { flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 4px !important; text-align: center; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .dbk-conn-state { margin: 0 !important; text-align: center; align-self: center !important; }\n/* Section headings: bigger Playfair Display italic in Person 1's view, so each page reads in clear parts */\n\nhtml[data-dbk=\"p1\"]:not([data-dbk-page=\"settings\"]):not(#z):not(#y):not(#x) :is(h3.hm-h, .main-title, h2.dbk-res-h, h2.section-title, .landing-section-title, .history-section-title, h3.mj-h, h2.wt-title, h3.wt-h, .journal-password-title) {\n  font-family: var(--dbk-script) !important; font-style: italic !important; font-weight: 400 !important; font-size: 30px !important; line-height: 1.15 !important; letter-spacing: 0 !important; text-transform: none !important; font-variant: normal !important; }\n/* Client visit pop-up: move it or cancel it */\n/* Today's grocery list: two columns that sit centered as a block, whatever the screen width */\n\nhtml[data-dbk]:not(#z):not(#y) .hm-groc { columns: auto !important; display: grid !important; grid-template-columns: repeat(2, minmax(0, max-content)); justify-content: center; column-gap: clamp(22px, calc(8 * var(--dbk-vw, 1vw)), 96px); }\nhtml[data-dbk]:not(#z):not(#y) .hm-groc:has(> :only-child[style*=\"italic\"]) { grid-template-columns: 1fr; }\n/* the mode icon, a little bigger and the same weight as the gear across from it */\n\n/* a pop-up's last row of buttons, with Close in it: one centered line */\n\nhtml[data-dbk]:not(#z):not(#y) .dbk-actrow { display: flex !important; flex-wrap: wrap; justify-content: center !important; align-items: center !important; gap: 10px 24px !important; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-actrow > * { margin: 0 !important; width: auto !important; }\nhtml[data-dbk] .wt-who { font-family: var(--dbk-caps); font-weight: 400; font-size: 0.85em; letter-spacing: 0.06em; color: var(--lh-secondary, #a94f61); margin-right: 4px; }\n/* Home Base: the \"+ Tagline\" adders are quiet links, not pills, so the filled-in details stay the focus */\n\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .wrb-chips { gap: 6px 20px; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .wrb-chips button { border: 0 !important; background: none !important; border-radius: 0 !important; box-shadow: none !important; padding: 6px 2px !important; min-height: 0 !important; font-size: 14px; opacity: 0.75; text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(var(--dbk-green-rgb),0.3); }\n/* Spark File: Edit, Done with this and Delete as one centered row of links */\n\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .spark-actions { display: flex !important; justify-content: center !important; align-items: center; flex-wrap: wrap; gap: 6px 22px !important; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .brand-asset-act { all: unset; cursor: pointer; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: 0.02em; text-decoration: underline; text-underline-offset: 3px; padding: 6px 0; color: inherit; opacity: 0.85; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .brand-asset-act:focus-visible { outline: 2px solid var(--lh-secondary, #b0596b); outline-offset: 2px; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) .spark-actions .btn-delete { all: unset; cursor: pointer; order: 3; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.02em; color: #a94f61; text-decoration: underline; text-underline-offset: 4px; padding: 5px 0; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y) .spark-actions .btn-delete { color: #e79aa9; }\n/* Settings: everything inside a section sits centered under its name */\n\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body .setting-row:not(.dbk-conn):not(:has(input[type=\"checkbox\"])) { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 4px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body :is(.setting-label-inline, .setting-label, label) { text-align: center !important; width: auto !important; margin-left: auto !important; margin-right: auto !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body .setting-label-inline:empty { display: none !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body :is(input[type=\"text\"], input[type=\"password\"], input[type=\"email\"], select) { text-align: center !important; text-align-last: center; width: 100% !important; max-width: 300px !important; margin-left: auto !important; margin-right: auto !important; display: block; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body :is(#passwordStatus, #passwordStatus *, #passwordForm p) { text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .section-body #passwordForm :is(.btn, button) { display: block; margin: 14px auto 0 !important; }\n/* Meal Settings: the same look as the main Settings page. Rows with a rule between them, names centered with\n   the arrow beside them, no boxes. Names and appearance live in the main Settings, so they're not repeated here. */\n\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group { background: none !important; border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.22) !important; border-radius: 0 !important; box-shadow: none !important; margin: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #settings-view .settings-group { border-bottom-color: rgba(230,234,239,0.18) !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group-header { justify-content: center !important; gap: 10px; padding: 22px 8px !important; background: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .sg-title-text { font-family: var(--dbk-caps) !important; font-size: 20px !important; letter-spacing: 0.06em !important; text-transform: none !important; font-weight: 400 !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .sg-chevron { position: static !important; margin: 0 !important; width: 14px; height: 14px; opacity: 0.6; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group-content { padding: 0 8px 24px !important; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-label { text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view :is(.settings-input, select.settings-input) { text-align: center; text-align-last: center; max-width: 300px; margin-left: auto; margin-right: auto; display: block; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-toggle-label { justify-content: center; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group-save { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group:has(#settings-bg-dropdown),\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group:has(#pw-status),\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-group:has(#settings-name1) > .settings-group-content > div:has(#settings-name1) { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view input[type=\"checkbox\"] { -webkit-appearance: none; appearance: none; width: 18px !important; height: 18px !important; flex: 0 0 18px; margin: 0 8px 0 0; border: 1.5px solid rgba(var(--dbk-green-rgb),0.45); border-radius: 3px; background: #fbf8f1; display: inline-grid; place-content: center; cursor: pointer; vertical-align: middle; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view input[type=\"checkbox\"]:checked { background: var(--dbk-fill, var(--dbk-green)); border-color: var(--dbk-fill, var(--dbk-green)); }\nhtml[data-dbk]:not(#z):not(#y) #settings-view input[type=\"checkbox\"]:checked::after { content: \"\"; width: 9px; height: 5px; border-left: 2px solid #fbf8f1; border-bottom: 2px solid #fbf8f1; transform: rotate(-45deg) translate(1px, -1px); }\nhtml[data-dbk]:not(#z):not(#y) #settings-view .settings-page-body > button, html[data-dbk]:not(#z):not(#y) #settings-view button[onclick^=\"saveAllSettings\"]:not(.settings-group-save) { display: block; margin: 28px auto 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) #settings-view label.settings-toggle-label { display: flex !important; align-items: center; width: max-content !important; max-width: 100%; margin: 8px auto !important; }\n/* Settings > Notifications */\n\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .dbk-nt-quiet { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; max-width: 300px; margin: 0 auto; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .dbk-nt-quiet input { max-width: 130px !important; margin: 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) .dbk-nt-quiet span { font-style: italic; opacity: 0.7; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #sec-notify .setting-row[hidden] { display: none !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #ntActs { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #ntState:empty { display: none; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #sec-notify .setting-row { margin-top: 18px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #sec-notify .setting-row[id$=\"TimeRow\"] { margin-top: 8px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y) #sec-notify #ntState { margin-top: 20px; }\n/* Recipe pop-up: ingredients, then instructions under them, at every width (no skinny side column) */\n\nhtml[data-dbk]:not(#z):not(#y) #modal .modal-columns { display: block !important; columns: auto !important; }\nhtml[data-dbk]:not(#z):not(#y) #modal .modal-col-divider { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #modal :is(.modal-col-left, .modal-col-right) { width: auto !important; max-width: none !important; flex: none !important; padding-left: 0 !important; padding-right: 0 !important; border: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) #modal .modal-col-right { margin-top: 26px !important; padding-top: 0 !important; border-top: 0 !important; }   /* no line above Instructions (Oct 25) */\nhtml[data-dbk]:not(#z):not(#y) #modal .portions-row { justify-content: center !important; display: flex; }\n/* Add a recipe: \"Recipe makes _ servings\" and Estimate Nutrition on one line */\n\nhtml[data-dbk]:not(#z):not(#y) #ar-estimate-btn.dbk-est-right { margin-left: auto !important; }\n/* ═══ Calmer pages ═══ */\n/* Habits: Resources gets its own band so it doesn't run into the schedule */\n/* Habits board: one link under it */\n\nhtml[data-dbk]:not(#z):not(#y) #bingoControls .btn:not(:first-child) { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-habit-more { display: flex; justify-content: center; gap: 24px; margin: 14px 0 4px; flex-wrap: wrap; }\n/* Reminder card: Done and Later; Later opens its three choices */\n\nhtml[data-dbk]:not(#z):not(#y) #panelReminder .hm-actions .dbk-later-opt { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #panelReminder .hm-actions.dbk-later-open .dbk-later-opt { display: inline-flex !important; }\n/* All reminders: no second search box (the capture bar searches reminders); adding opens the add pop-up */\n\nhtml[data-dbk]:not(#z):not(#y) div:has(> #reminderSearch) { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #reminderFormToggle { all: unset !important; display: block !important; margin: 4px auto 10px !important; width: max-content !important; cursor: pointer !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; text-decoration: underline !important; text-underline-offset: 4px !important; text-decoration-color: rgba(var(--dbk-green-rgb),0.35) !important; }\n/* Meals: no \"skip\" on every row; it's in the meal pop-up */\n\nhtml[data-dbk]:not(#z):not(#y) .mc-skip-link { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-pick-skip { text-align: center; margin: 16px 0 4px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-pick-skip[hidden] { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #reminderFormToggleLabel { font-size: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) #reminderFormToggleLabel::before { content: \"Add a reminder\"; font-size: 15px; }\n/* Us: no Challenge History section */\n\nhtml[data-dbk]:not(#z):not(#y) [data-dream-section=\"history\"] { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-greet .home-names { display: inline !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-greet .home-names, html[data-dbk]:not(#z):not(#y) .hm-greet .home-greeting { margin: 0 !important; padding: 0 !important; }\n/* Empty boxes: the words that stand in for nothing yet are always the lightest text on the page */\n\nhtml[data-dbk]:not(#z):not(#y) input::placeholder, html[data-dbk]:not(#z):not(#y) textarea::placeholder { color: rgba(47,58,44,0.36) !important; font-style: italic !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) input::placeholder, html[data-dbk=\"p2\"]:not(#z):not(#y) textarea::placeholder { color: rgba(230,234,239,0.36) !important; }\nhtml[data-dbk]:not(#z):not(#y) .capture-bar-input::placeholder { color: rgba(243,238,228,0.5) !important; }\nhtml[data-dbk]:not(#z):not(#y) :is(.thing-text.empty, .mc-name-empty, .biz-field-value .empty) { color: rgba(47,58,44,0.36) !important; font-style: italic !important; text-decoration: none !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) :is(.thing-text.empty, .mc-name-empty, .biz-field-value .empty) { color: rgba(230,234,239,0.36) !important; }\nhtml[data-dbk]:not(#z):not(#y) .hm-thing:has(.thing-text.empty) :is(.thing-x, .hm-box) { opacity: 0.35; }\n/* Today's Three: words start right after the box, like every other list (centered text next to left-anchored boxes is what looked off) */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing .thing-text { text-align: left !important; justify-self: start !important; padding-left: 4px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing input.thing-input, html[data-dbk]:not(#z):not(#y):not(#x) .hm-thing input { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing { grid-template-columns: 38px 30px minmax(0,1fr) 40px !important; }\n/* Today's Three: empty spots say \"Add\" on the right; the title is a small quiet label */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing .thing-text.empty { text-align: right !important; justify-self: end !important; padding-right: 6px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) h3.hm-h.dbk-three-h { font-family: var(--dbk-caps) !important; font-style: normal !important; font-size: 14px !important; letter-spacing: 0.1em !important; opacity: 0.6; margin-bottom: 4px !important; line-height: 1.3 !important; }\n/* Today's Three: an empty spot is just a blank line; tap anywhere on it to type */\n\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing .thing-text.empty { min-height: 1.5em; width: 100%; justify-self: stretch !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing:has(.thing-text.empty) { cursor: text; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-thing input { width: 100% !important; box-sizing: border-box; }\nhtml[data-dbk]:not(#z):not(#y) #panelReminder #reminderCount { display: none !important; }\n\n/* ===== Routine: checks on today's steps (Habits page) and the Routine band on Today ===== */\nhtml[data-dbk] .rt-row { display: flex; align-items: baseline; gap: 10px; }\nhtml[data-dbk] .rt-row .rt-check { margin-top: 14px !important; flex: 0 0 15px !important; width: 15px !important; height: 15px !important; min-width: 15px !important; min-height: 15px !important; max-width: 15px !important; max-height: 15px !important; }\nhtml[data-dbk] .rt-row .rt-step { flex: 1; min-width: 0; }\nhtml[data-dbk] .rt-row.is-done .rt-what { text-decoration: line-through; color: rgba(var(--dbk-green-rgb),0.62); }\n\n/* ===== Habits: the week under the board ===== */\nhtml[data-dbk=\"p2\"] :is(.hw-n, .hw-name) { color: #e6eaef; }\nhtml[data-dbk=\"p2\"] :is(.hw-dow, .hw-count) { color: rgba(230,234,239,0.65); }\nhtml[data-dbk=\"p2\"] :is(.hw-day, .hw-row) { border-bottom-color: rgba(230,234,239,0.16); }\n\n/* ===== The menu: the page's name in the middle of the bar opens the list of pages; the Today mark at the left ===== */\nhtml[data-dbk] #dbkHomeBtn { position: absolute; left: 12px; bottom: 0; height: 52px; display: flex; align-items: center; color: rgba(243,238,228,0.75); z-index: 3; }\nhtml[data-dbk=\"p2\"] #dbkHomeBtn { color: rgba(230,234,239,0.75); }\nhtml[data-dbk] #dbkHomeBtn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n@media (max-width: 380px) { html[data-dbk] #dbkHomeBtn { left: 6px; } }\nhtml[data-dbk] nav.top-nav .dbk-title-btn { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; height: 52px; padding: 0 10px; font-family: var(--dbk-caps); font-size: 1.05rem; letter-spacing: 0.06em; color: var(--dbk-cream); }\nhtml[data-dbk] nav.top-nav .dbk-title-btn:focus-visible { outline: 2px solid currentColor; outline-offset: -6px; }\nhtml[data-dbk] nav.top-nav .dbk-title-chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); opacity: 0.7; }\nhtml[data-dbk] nav.top-nav .dbk-title-btn[aria-expanded=\"true\"] .dbk-title-chev { transform: translateY(2px) rotate(225deg); }\n.dbk-pagepop { position: fixed; inset: 0; z-index: 40000; background: rgba(20,24,18,0.35); display: flex; align-items: flex-start; justify-content: center; padding: calc(52px + var(--dbk-safe-top, env(safe-area-inset-top, 0px))) 16px 0; }\n/* the page behind the open menu goes soft (the theme turns blur off everywhere unless a rule turns it back on) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-pagepop { top: calc(52px + var(--dbk-safe-top, env(safe-area-inset-top, 0px))); padding-top: 0; -webkit-backdrop-filter: blur(12px) saturate(0.8) !important; backdrop-filter: blur(12px) saturate(0.8) !important; background: var(--dbk-pop-veil) !important; }\n.dbk-pagepop-card { width: 100%; max-width: 300px; background: #f3eee4; color: #2f3a2c; border-radius: 0 0 6px 6px; padding: 6px 18px 10px; box-shadow: 0 16px 40px rgba(0,0,0,0.3); display: flex; flex-direction: column; }\nhtml[data-dbk=\"p2\"] .dbk-pagepop-card { background: #10151c; color: #e6eaef; }\n.dbk-pagepop-card a { text-decoration: none; color: inherit; text-align: center; font-family: var(--dbk-caps, serif); font-size: 20px; letter-spacing: 0.04em; padding: 12px 0; border-bottom: 1px solid rgba(var(--dbk-green-rgb, 47,58,44),0.14); }\nhtml[data-dbk=\"p2\"] .dbk-pagepop-card a { border-bottom-color: rgba(230,234,239,0.14); }\n.dbk-pagepop-card a:last-child { border-bottom: 0; }\n.dbk-pagepop-card a.on { color: var(--lh-secondary, #9b5a62); }\n/* the page you're on also gets a small dot, so it stands out in every color (gray and white looks included) */\n.dbk-pagepop-card .dbk-pagepop-item > a.on::before, .dbk-pagepop-card .dbk-pagepop-item > a.on::after { content: \"\"; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; vertical-align: middle; position: relative; top: -2px; }\n.dbk-pagepop-card .dbk-pagepop-item > a.on::before { margin-right: 9px; }\n.dbk-pagepop-card .dbk-pagepop-item > a.on::after { margin-left: 9px; visibility: hidden; }\n.dbk-pagepop-card a:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }\n/* a band that only carries the page's tabs stays short */\nhtml[data-dbk] .dbk-hero.dbk-hero-tabs { min-height: 0 !important; padding: 8px 22px 10px !important; }\nhtml[data-dbk] .dbk-hero.dbk-hero-tabs .dbk-tabs { margin-top: 0; }\n/* the dropdown: a page's views sit under it, smaller */\n.dbk-pagepop-item { border-bottom: 1px solid rgba(var(--dbk-green-rgb, 47,58,44),0.14); }\nhtml[data-dbk=\"p2\"] .dbk-pagepop-item { border-bottom-color: rgba(230,234,239,0.14); }\n.dbk-pagepop-item:last-child { border-bottom: 0; }\n.dbk-pagepop-card .dbk-pagepop-item > a { display: block; border-bottom: 0; }\n.dbk-pagepop-views { display: flex; justify-content: center; flex-wrap: wrap; gap: 2px 18px; padding: 0 0 10px; margin-top: -4px; }\n.dbk-pagepop-card .dbk-pagepop-views a { font-size: 15px; letter-spacing: 0.05em; padding: 2px 0; border-bottom: 0; opacity: 0.7; }\n.dbk-pagepop-card .dbk-pagepop-views a.on { opacity: 1; color: var(--lh-secondary, #9b5a62); text-decoration: underline; text-underline-offset: 4px; }\n\n/* Habits Bingo: the color of the \"Bingo!\" word and its petals (bingo-celebrate.js reads it) */\nhtml[data-dbk] { --dbk-bingo-accent: #9b5a62; }\nhtml[data-dbk=\"p2\"] { --dbk-bingo-accent: #8fc98a; }\n/* the pop-up for a finished dream on Us (our-dreams.html), in each person's colors */\nhtml[data-dbk]:not(#z) .celebration { width: min(320px, calc(calc(100 * var(--dbk-vw, 1vw)) - 48px)); box-sizing: border-box; padding: 30px 26px 24px !important; border-radius: 6px; background: #f3eee4 !important; color: #2f3a2c !important; border: 0 !important; box-shadow: 0 18px 50px rgba(0,0,0,0.35) !important; z-index: 30050; }\nhtml[data-dbk]:not(#z) .celebration h2 { font-family: var(--dbk-caps); font-size: 2.1rem !important; letter-spacing: 0.08em !important; color: #9b5a62 !important; margin: 0 0 8px !important; }\nhtml[data-dbk]:not(#z) .celebration p { font-family: var(--dbk-serif); font-size: 1.05rem !important; line-height: 1.45; color: #2f3a2c !important; margin: 0 0 18px !important; }\nhtml[data-dbk]:not(#z) .celebration .btn { font-family: var(--dbk-caps); background: #2f3a2c !important; color: #f3eee4 !important; border: 0 !important; border-radius: 4px; padding: 10px 26px !important; letter-spacing: 0.06em; }\nhtml[data-dbk=\"p2\"]:not(#z) .celebration { background: #10151c !important; color: #e6eaef !important; border: 1px solid rgba(230,234,239,0.14) !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .celebration h2 { color: #e79aa9 !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .celebration p { color: #e6eaef !important; }\nhtml[data-dbk=\"p2\"]:not(#z) .celebration .btn { background: #e6eaef !important; color: #06080b !important; }\n/* Person 2's ticked squares are in small caps, which run wider: a touch smaller so words don't split */\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z) .bingo-cell.completed, html[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z) .bingo-cell.in-bingo { font-size: 0.86em !important; letter-spacing: 0.01em !important; overflow-wrap: normal !important; word-break: normal !important; hyphens: manual !important; }\n\n/* ═══ Content you read or scan sits on the left; page and section titles stay centered ═══ */\n/* Habits > Resources: category name on the left with its arrow at the right; items read left to right */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-header { justify-content: space-between !important; text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-name { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-item { text-align: left !important; padding-left: 2px !important; padding-right: 64px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-item-content { text-align: left !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-content :is(.empty-state, .resource-item-title, .resource-item-link, .resource-item-note) { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-content .dbk-links { justify-content: flex-start !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-content .empty-state { padding-left: 2px !important; padding-right: 0 !important; }\n/* Today > Grocery List: one plain list, lined up with \"Add an item\" */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-groc:not(:empty) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; justify-content: start !important; column-gap: 16px !important; text-align: left !important; }\n/* Home Base: the \"+ Tagline\" style links line up on the left too */\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) #homebase-tab .wrb-chips { justify-content: flex-start !important; }\n/* Settings: section name on the left, arrow at the right */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .settings-section > .section-header { justify-content: space-between !important; text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .settings-section > .section-header .section-title { text-align: left !important; margin: 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .dbk-set-note { text-align: left !important; }\n/* Work > Home Base: label over value, on the left, like a form */\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) #homebase-tab .wr-card { text-align: left !important; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) #homebase-tab .wr-card-title { text-align: center !important; }\nhtml[data-dbk-page=\"workroom\"]:not(#z):not(#y) #homebase-tab :is(.biz-field, .biz-field-label, .biz-field-value) { text-align: left !important; }\n/* Lists: \"Add a ...\" and \"Choose for us\" sit side by side; no separator dot left stranded when they wrap */\nhtml[data-dbk]:not(#z):not(#y) #section-modal .add-dream-btn + .add-dream-btn::before { content: none !important; display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #section-modal :has(> .add-dream-btn + .add-dream-btn) { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: baseline !important; gap: 6px 26px !important; }\n\n/* ═══ Settings: everything inside a section sits on the left (labels, fields, notes, buttons, links) ═══ */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body { text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body .setting-row:not(:has(input[type=\"checkbox\"])) { align-items: flex-start !important; text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body :is(.setting-label-inline, .setting-label, label) { text-align: left !important; margin-left: 0 !important; margin-right: 0 !important; align-self: flex-start !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body :is(input[type=\"text\"], input[type=\"password\"], input[type=\"email\"], select) { text-align: left !important; text-align-last: left !important; margin-left: 0 !important; margin-right: 0 !important; width: 100% !important; max-width: 100% !important; padding-left: 2px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body :is(p, .dbk-set-note, .dbk-conn-note, .dbk-about, .dbk-autosave, #passwordStatus, #passwordStatus *, [style*=\"text-align:center\"], [style*=\"text-align: center\"], [style*=\"text-align:right\"], [style*=\"text-align: right\"], .hm-center) { text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body :is(.btn, button.btn, .btn-small) { margin-left: 0 !important; margin-right: 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body #passwordForm :is(.btn, button) { margin: 14px 0 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body :is(.dbk-links, #ntActs, .habit-actions, div:has(> .btn-small), .dbk-nt-quiet) { justify-content: flex-start !important; margin-left: 0 !important; margin-right: 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body .dbk-conn { align-items: flex-start !important; text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body .dbk-conn-state { align-self: flex-start !important; text-align: left !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w) .section-body .dbk-quiet-links { text-align: left !important; justify-content: flex-start !important; margin-left: 0 !important; }\n\n/* ==== Redesign: Habits \"This week\" pop-up (habit-history.js) ==== */\nhtml[data-dbk] .hwk-card { --hwk-done: #2f3a2c; --hwk-miss: #b07a82; --hwk-off: rgba(47,58,44,0.14); --hwk-rule: rgba(47,58,44,0.13); --hwk-soft: rgba(47,58,44,0.66); --hwk-acc: #8f4253; max-width: 420px !important; text-align: left; }\nhtml[data-dbk=\"p2\"] .hwk-card { --hwk-done: #8fc98a; --hwk-miss: #e79aa9; --hwk-off: rgba(230,234,239,0.14); --hwk-rule: rgba(230,234,239,0.12); --hwk-soft: rgba(230,234,239,0.66); --hwk-acc: #8fc98a; }\nhtml[data-dbk] .hwk-title { font-family: var(--font-title); font-style: italic; font-weight: 400; font-size: 1.7rem; line-height: 1.15; text-align: center; margin: 0; }\nhtml[data-dbk=\"p2\"] .hwk-title { font-style: normal; font-family: var(--font-title-caps); letter-spacing: .04em; font-size: 1.5rem; }\nhtml[data-dbk] .hwk-sub { text-align: center; font-style: italic; font-size: .88rem; color: var(--hwk-soft); margin: 2px 0 10px; }\nhtml[data-dbk] .hwk-switch { display: flex; justify-content: center; gap: 4px; margin: 0 auto 12px; width: max-content; border: 1px solid var(--hwk-rule); border-radius: 999px; padding: 3px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hwk-switch button { all: unset; cursor: pointer; padding: 4px 14px; border-radius: 999px; font-family: var(--font-title-caps); letter-spacing: .05em; font-size: .82rem; color: var(--hwk-soft) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hwk-switch button[aria-pressed=\"true\"] { background: var(--hwk-done); color: #f3eee4 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .hwk-switch button[aria-pressed=\"true\"] { color: #06080b !important; }\nhtml[data-dbk] .hwk-switch button:focus-visible, html[data-dbk] .hwk-link:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk] .hwk-headrow, html[data-dbk] .hwk-main { display: grid; grid-template-columns: minmax(0, 1fr) auto 34px; align-items: center; gap: 10px; }\nhtml[data-dbk] .hwk-headrow { padding-bottom: 2px; }\nhtml[data-dbk] .hwk-dots { display: grid; grid-template-columns: repeat(7, 13px); gap: 4px; justify-items: center; align-items: center; }\nhtml[data-dbk] .hwk-dh { font-family: var(--font-title-caps); font-size: .68rem; color: var(--hwk-soft); text-align: center; }\nhtml[data-dbk] .hwk-dh.is-today { color: var(--hwk-acc); }\nhtml[data-dbk] .hwk-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; box-sizing: border-box; }\nhtml[data-dbk] .hwk-dot.is-d { background: var(--hwk-done); }\nhtml[data-dbk] .hwk-dot.is-m { border: 1.5px solid var(--hwk-miss); }\nhtml[data-dbk] .hwk-dot.is-p { border: 1.5px dashed var(--hwk-off); }\nhtml[data-dbk] .hwk-dot.is-o { width: 5px; height: 5px; background: var(--hwk-off); }\nhtml[data-dbk] .hwk-grp { margin-top: 12px; }\nhtml[data-dbk] .hwk-gl { font-family: var(--font-title-caps); letter-spacing: .08em; font-size: .78rem; color: var(--hwk-acc); padding-bottom: 2px; border-bottom: 1px solid var(--hwk-rule); }\nhtml[data-dbk] .hwk-gl.is-quiet { color: var(--hwk-soft); }\nhtml[data-dbk] .hwk-row { padding: 9px 0; border-bottom: 1px solid var(--hwk-rule); }\nhtml[data-dbk] .hwk-row:last-child { border-bottom: 0; }\nhtml[data-dbk] .hwk-name { font-size: .95rem; line-height: 1.3; min-width: 0; overflow-wrap: anywhere; }\nhtml[data-dbk] .hwk-n { font-size: .8rem; color: var(--hwk-soft); text-align: right; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .hwk-nudge { font-size: .84rem; font-style: italic; color: var(--hwk-soft); margin-top: 2px; }\nhtml[data-dbk] .hwk-acts { display: flex; gap: 16px; margin-top: 6px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hwk-link { all: unset; cursor: pointer; font-family: var(--font-title-caps); letter-spacing: .05em; font-size: .8rem; border-bottom: 1px solid currentColor; color: inherit !important; }\nhtml[data-dbk] .hwk-grid { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, 20px); gap: 4px; align-items: center; margin-top: 4px; }\nhtml[data-dbk] .hwk-gname { font-size: .86rem; line-height: 1.2; padding-right: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }\nhtml[data-dbk] .hwk-sq { display: inline-block; width: 20px; height: 20px; border-radius: 4px; }\nhtml[data-dbk] .hwk-sq.is-d { background: var(--hwk-done); }\nhtml[data-dbk] .hwk-sq.is-m { background: var(--hwk-miss); opacity: .55; }\nhtml[data-dbk] .hwk-sq.is-o, html[data-dbk] .hwk-sq.is-p { background: var(--hwk-off); }\nhtml[data-dbk] .hwk-legend { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 14px; font-size: .78rem; color: var(--hwk-soft); margin-top: 14px; }\nhtml[data-dbk] .hwk-legend span { display: inline-flex; align-items: center; gap: 5px; }\nhtml[data-dbk] .hwk-legend .hwk-sq { width: 10px; height: 10px; border-radius: 2px; }\nhtml[data-dbk] .hwk-foot { text-align: center; font-size: .82rem; color: var(--hwk-soft); margin: 10px 0 0; }\nhtml[data-dbk] .hwk-empty { text-align: center; font-style: italic; color: var(--hwk-soft); margin: 14px 0 4px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #bingoControls #habitWeekBtn { display: inline-block !important; }\n/* Habits routine: the same tick box as every other list (a square that fills in with a tick) */\nhtml[data-dbk]:not(#z):not(#y) #dailyScheduleContainer .rt-check { -webkit-appearance: none !important; appearance: none !important; flex: none; width: 19px !important; height: 19px !important; margin: 0 !important; border: 1.5px solid rgba(47,58,44,0.6) !important; border-radius: 3px !important; background: transparent center / 12px 12px no-repeat !important; cursor: pointer; }\nhtml[data-dbk]:not(#z):not(#y) #dailyScheduleContainer .rt-check:checked { background-color: #2f3a2c !important; border-color: #2f3a2c !important; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23f3eee4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #dailyScheduleContainer .rt-check { border-color: rgba(230,234,239,0.6) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #dailyScheduleContainer .rt-check:checked { background-color: #8fc98a !important; border-color: #8fc98a !important; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%2306080b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\") !important; }\nhtml[data-dbk] #dailyScheduleContainer .rt-check:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n\n/* ===== Centering and spacing pass (the designer: \"these kind of things should be centered\") =====\n   Lists, notes and settings rows stay left-aligned. Centered: empty messages, lone links and buttons,\n   section and pop-up titles, standalone helper lines, and single-line fields in pop-ups. */\n\n/* --- every pop-up title looks the same: Playfair italic for Person 1, small caps for Person 2 --- */\nhtml[data-dbk]:not(#z):not(#y) :is(.modal-title, .reminder-modal-title, .habits-modal-title, .tried-modal-title, .section-modal-title, .seasonal-modal-title, .random-choice-title, .inbox-modal-title, .detail-popup-title, .day-modal-title, .ai-panel-title, .hwk-title, #modal-title, #picker-title, #mprjPopT, .wb-pop-title, .dbk-setx-h, .fin-sheet > h3, .dbk-info-title, .dbk-rf-title, .wrc-sheet > h3, .cp-title) {\n  font-family: var(--dbk-script) !important; font-style: italic !important; font-weight: 400 !important; font-size: 27px !important;\n  line-height: 1.15 !important; letter-spacing: 0 !important; text-transform: none !important; text-align: center !important; text-wrap: balance; color: inherit !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) :is(.modal-title, .reminder-modal-title, .habits-modal-title, .tried-modal-title, .section-modal-title, .seasonal-modal-title, .random-choice-title, .inbox-modal-title, .detail-popup-title, .day-modal-title, .ai-panel-title, .hwk-title, #modal-title, #picker-title, #mprjPopT, .wb-pop-title, .dbk-setx-h, .fin-sheet > h3, .dbk-info-title, .dbk-rf-title, .wrc-sheet > h3, .cp-title) {\n  font-family: var(--dbk-caps) !important; font-style: normal !important; font-size: 23px !important; letter-spacing: 0.04em !important; }\n/* Settings pop-up titles: same height in light and dark, so picking your own color never shifts the pop-up */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-setx-h { line-height: 31px !important; }\n/* titles keep clear of the × in the corner */\nhtml[data-dbk]:not(#z):not(#y) :is(.wb-pop-title, .fin-sheet > h3, .dbk-setx-h, .hwk-title, #mprjPopT, .ai-panel-title, .detail-popup-title, .dbk-info-title, .dbk-rf-title) { padding-left: 30px !important; padding-right: 30px !important; }\n/* headers that held a title beside a close button: the title sits in the middle, the × in the corner */\nhtml[data-dbk]:not(#z):not(#y) :is(.reminder-modal-header, .habits-modal-header, .modal-header, .inbox-header-top) { position: relative; justify-content: center !important; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) :is(.reminder-modal-header, .habits-modal-header) { padding: 4px 34px 12px !important; }\nhtml[data-dbk]:not(#z):not(#y) :is(.reminder-modal-close, .habits-modal-close) { position: absolute !important; right: 0; top: 0; }\n/* Meals: the recipe and \"Choose dinner\" pop-ups had a dark green header; they use the paper card like every other pop-up */\nhtml[data-dbk]:not(#z):not(#y) :is(#modal, #meal-picker-modal) .modal-header { background: transparent !important; color: inherit !important; border-bottom: 1px solid var(--lh-accent-muted, rgba(47,58,44,.14)) !important; padding: 22px 46px 14px !important; }\nhtml[data-dbk]:not(#z):not(#y) :is(#modal, #meal-picker-modal) .modal-header .modal-close { color: inherit !important; opacity: .55; }\nhtml[data-dbk]:not(#z):not(#y) :is(#modal, #meal-picker-modal) .modal-header :is(.meta, #modal-person-badge, #picker-subtitle, div, span) { color: inherit !important; }\n/* Cooking plan: its header is built in code; centre the title, keep the × in the corner */\nhtml[data-dbk]:not(#z):not(#y) #prep-guide-overlay div[style*=\"space-between\"]:has(> span + button) { justify-content: center !important; position: relative; padding: 18px 46px 12px !important; }\nhtml[data-dbk]:not(#z):not(#y) #prep-guide-overlay div[style*=\"space-between\"]:has(> span + button) > span { font-family: var(--dbk-script) !important; font-style: italic; font-weight: 400 !important; font-size: 27px !important; color: inherit !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #prep-guide-overlay div[style*=\"space-between\"]:has(> span + button) > span { font-family: var(--dbk-caps) !important; font-style: normal; font-size: 23px !important; letter-spacing: .04em; }\nhtml[data-dbk]:not(#z):not(#y) #prep-guide-overlay div[style*=\"space-between\"]:has(> span + button) > button { position: absolute; right: 12px; top: 14px; }\n\n/* --- the old pill buttons in Meals pop-ups read as links now (one filled button per screen) --- */\nhtml[data-dbk]:not(#z):not(#y) :is(#modal-swap-section button, #modal-swap-btn, #picker-clear-btn, .picker-new-btn, body.rl .landing-skip-btn, .landing-skip-btn) {\n  all: unset; box-sizing: border-box; cursor: pointer; display: inline-block; padding: 8px 2px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important;\n  letter-spacing: 0.03em !important; line-height: 1.2 !important; color: inherit !important; opacity: .8; text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 1px;\n  background: none !important; border: 0 !important; border-radius: 0 !important; box-shadow: none !important; text-transform: none !important; }\n/* the dinner picker's Remove is a plain outline button like the rest (Oct 22 audit: it was the only red one in the picker) */\nhtml[data-dbk]:not(#z):not(#y) #modal-swap-section button[onclick*=\"Remove\"] { color: var(--bx-danger, #a0483f) !important; opacity: 1; }\nhtml[data-dbk]:not(#z):not(#y) #picker-clear-btn { opacity: 1; }\nhtml[data-dbk]:not(#z):not(#y) :is(#modal-swap-section > div, #picker-browse-mode > div:has(> .picker-new-btn)) { gap: 22px !important; justify-content: center !important; }\n\n/* --- no focus box around × or stars when a pop-up opens on a phone (keyboard focus still shows) --- */\n@media (hover: none) {\n  html[data-dbk]:not(#z) :is(.dbk-info-x, .fin-x, .rl-x, .mprj-x, .wrc-x, .modal-close, .reminder-modal-close, .habits-modal-close, .detail-popup-close, .rt-x, .dbk-confirm-no, [aria-label=\"Close\"], .mprj-pop button, .fin-sheet button):focus:not(:focus-visible) { outline: none !important; box-shadow: none !important; }\n  html[data-dbk]:not(#z) :is(.dbk-info-x, .fin-x, .rl-x, .mprj-x, .wrc-x, .modal-close, [aria-label=\"Close\"], .mprj-pop .mprj-star, .mprj-pop [data-star]):focus { outline: none !important; box-shadow: none !important; }\n}\n\n/* --- single-line fields in pop-ups: the text sits in the middle --- */\nhtml[data-dbk]:not(#z):not(#y) :is(.dbk-infocard, .dbk-catcard, .rl-pop-box, .mprj-pop, .wb-sheet, .wrc-sheet, .rt-sheet, .inbox-modal, .habits-modal, #resourceForm, .dbk-confirm-card, #picker-browse-mode) :is(input[type=\"text\"], input[type=\"search\"], input[type=\"email\"], input[type=\"url\"], input[type=\"tel\"], input[type=\"password\"], input[type=\"number\"], input:not([type])) { text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) :is(.dbk-infocard, .dbk-catcard, .rl-pop-box, .mprj-pop, .wb-sheet, .wrc-sheet, .rt-sheet, .inbox-modal, .habits-modal, #resourceForm, .dbk-confirm-card, #picker-browse-mode) :is(input)::placeholder { text-align: center; }\n/* the habit list inside Edit habits is a list: its names stay left */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .habits-modal .habit-item :is(input, span, div) { text-align: left !important; }\n/* labels above pop-up fields read like the rest of the app: quiet small caps, centred over their field */\nhtml[data-dbk]:not(#z):not(#y) :is(#resourceForm, .dbk-setx-in) label { display: block; text-align: center !important; font-family: var(--dbk-caps) !important; font-weight: 400 !important; font-size: 13px !important; letter-spacing: .08em !important; opacity: .7; text-transform: none !important; }\n\n/* --- Settings pop-ups: helper text, fields and their buttons are centred --- */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in :is(p.dbk-about, p.dbk-conn-note, p.dbk-hh-status, #passwordStatus p, #passwordStatus, .dbk-appname-tip, .dbk-hh-msg, #pwError) { text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .setting-row { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 6px !important; margin: 0 auto 14px !important; text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .setting-row > :is(input, select) { width: 100% !important; max-width: 300px !important; text-align: center !important; text-align-last: center !important; margin: 0 auto !important; padding-left: 12px !important; padding-right: 12px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .setting-row > label { align-self: center !important; text-align: center !important; margin: 0 auto !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .section-body :is(.btn, button.btn, .btn-small) { margin-left: auto !important; margin-right: auto !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .dbk-nt-quiet input { text-align-last: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .setting-row > label:empty { display: none !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in :is(.dbk-links, #ntActs, .habit-actions, div:has(> .btn-small), .dbk-nt-quiet, .dbk-autosave, #passwordForm > div:has(> button)) { justify-content: center !important; text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in :is(.dbk-hh-signin, .dbk-hh-invite) { display: block !important; margin: 10px auto 0 !important; text-align: center; }\n\n/* --- empty messages, lone link rows and standalone buttons are centred on the pages too --- */\nhtml[data-dbk]:not(#z):not(#y) #groceryList > .empty-state { grid-column: 1 / -1; text-align: center; padding: 6px 0 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkResLink .resource-content .dbk-links, html[data-dbk]:not(#z):not(#y) .resource-content .dbk-links { justify-content: center !important; gap: 22px !important; }\nhtml[data-dbk]:not(#z):not(#y) .resource-content :is(.empty-state, .resource-empty, .no-resources, p:only-child) { text-align: center !important; }\n/* the short rule under \"Grocery List\" was the only one of its kind; titles don't carry a rule */\nhtml[data-dbk]:not(#z):not(#y) #groceryContent::before { display: none !important; }\n\n/* --- Lists landing: a list's name fits on one line (\"Places to Go\", \"TV & Movies\") --- */\nhtml[data-dbk]:not(#z):not(#y) body.rl .rl-tile-nm { font-size: 15px; letter-spacing: .03em; padding-right: 0; }\nhtml[data-dbk]:not(#z):not(#y) body.rl .landing-tile:has(.rl-mini-stamp) .rl-tile-nm { padding-right: 34px; }\n\n/* --- Meals sets a scrollbar gutter that leaves a strip down the right edge on computers --- */\nhtml[data-dbk-page=\"meal-plan\"]:not(#z) { scrollbar-gutter: auto !important; overflow-y: auto !important; }\n/* Today's add/edit forms (event, reminder): field labels and single-line fields centred like the other pop-ups; notes boxes stay left */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.edit-reminder-modal, #addEventModalOverlay .modal) .form-group > label { text-align: center !important; display: block; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.edit-reminder-modal, #addEventModalOverlay .modal) :is(input[type=\"text\"], input[type=\"email\"], input[type=\"tel\"], input[type=\"url\"], input[type=\"time\"], input[type=\"date\"], input:not([type]), select) { text-align: center !important; text-align-last: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.edit-reminder-modal, #addEventModalOverlay .modal) :is(input, select)::placeholder { text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.edit-reminder-modal, #addEventModalOverlay .modal) .hh-dp-trigger { justify-content: center !important; gap: 8px; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.edit-reminder-modal, #addEventModalOverlay .modal) :is(.form-group > label + :is(.allday-row), .allday-row) { justify-content: center !important; }\n/* Work's \"Ready to post\" pop-up: the date and \"Open & paste\" are small helper lines, centred under the title */\nhtml[data-dbk]:not(#z):not(#y) #aiPanel > div[style*=\"0.72rem\"] { text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #aiPanel .go-post-links { justify-content: center !important; text-align: center; }\n/* page titles that didn't match the rest (Settings, Work › Content): Playfair italic for Person 1, small caps for Person 2 */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-setx-title, .wb-title) { font-family: var(--dbk-script) !important; font-style: italic !important; font-weight: 400 !important; font-size: 32px !important; letter-spacing: 0 !important; text-transform: none !important; text-align: center !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) :is(.dbk-setx-title, .wb-title) { font-family: var(--dbk-caps) !important; font-style: normal !important; font-size: 27px !important; letter-spacing: .04em !important; }\n/* Work › Overview: the date beside \"Going out this week\" rows stays on one line */\nhtml[data-dbk]:not(#z):not(#y) .wt-band :is(.wt-when, .wt-date, .wt-day) { white-space: nowrap !important; }\n/* Habits routine: the dividing line runs under the tick box too, like Today's Three */\nhtml[data-dbk]:not(#z):not(#y) #dailyScheduleContainer .rt-row { border-bottom: 1px solid rgba(var(--dbk-green-rgb), 0.18); }\nhtml[data-dbk]:not(#z):not(#y) #dailyScheduleContainer .rt-row .rt-step { border-bottom: 0 !important; }\n/* an empty message is always one lone line: centred everywhere (overrides the earlier \"resources on the left\" rule) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.empty-state, .inbox-empty, .rl-empty, .mj-empty) { text-align: center !important; padding-left: 0 !important; padding-right: 0 !important; }\n/* Person 2: the filled \"Add\" in New category had green text on a green button */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-infocard :is(.dbk-cat-save, button[type=\"submit\"]) { color: #06080b !important; }\n/* Person 2: the Cooking plan pop-up came up in paper colours with light text; it uses the navy card like other pop-ups */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #prep-guide-overlay > div { background: #121925 !important; color: #e6eaef !important; }\n/* Person 2: filled buttons inside pop-ups (Save password, Make an invite code) had green text on green */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-infocard :is(.btn, button.btn):not(.btn-secondary):not(.btn-danger):not(.dbk-link) { color: #06080b !important; }\n/* Person 2: Work's \"Ready to post\" caption box and Copy caption button were paper-coloured with light text */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #aiPanel .go-post-caption { background: rgba(230,234,239,0.06) !important; color: #e6eaef !important; border-color: rgba(230,234,239,0.14) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #aiPanel .go-post-copy-btn { background: #8fc98a !important; color: #06080b !important; border-color: #8fc98a !important; }\n/* the sign-in / password screen: its one field is centred like the pop-up fields */\nhtml[data-dbk]:not(#z):not(#y) :is(#passwordScreen, #dbkLock) :is(input[type=\"password\"], input[type=\"text\"], input[type=\"email\"]) { text-align: center !important; text-align-last: center !important; }\n/* Meals › Journal: \"Add a note\" under a day is a lone link, centred */\nhtml[data-dbk]:not(#z):not(#y) .mprj-addnote { display: block !important; margin-left: auto !important; margin-right: auto !important; text-align: center !important; }\n/* Meals › Journal: the page behind the diary was a green band that showed as an empty strip under short weeks; it takes the diary's cream instead */\nhtml[data-dbk]:not(#z):not(#y) #journal-view.dbk-celadonb:has(#mprJournal) { --bandc: var(--dbk-cream); background: var(--dbk-cream) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #journal-view.dbk-celadonb:has(#mprJournal) { --bandc: #121c2b; background: #121c2b !important; }\n/* Money: \"Nothing here for this month yet\" is an empty message, centred */\nhtml[data-dbk]:not(#z):not(#y) #finLatest p.fin-muted, html[data-dbk]:not(#z):not(#y) .fin-sheet p.fin-muted:only-child { text-align: center !important; }\n/* Meals › Settings: its page title matches the other page titles */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #page-title-settings h1 { font-family: var(--dbk-script) !important; font-style: italic !important; font-weight: 400 !important; font-size: 32px !important; letter-spacing: 0 !important; text-transform: none !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) #page-title-settings h1 { font-family: var(--dbk-caps) !important; font-style: normal !important; font-size: 27px !important; letter-spacing: .04em !important; }\n/* the same breathing room at the top of every band, on every page (they ranged from 22px to 34px) */\nhtml[data-dbk]:not(#z):not(#y) :is(.hm-band, .dbk-sec):not(:has(.dbk-sec, .hm-band)):not(.mpr-hero):not(.wt-hero) { padding-top: 32px !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-res-sec { padding-bottom: 32px !important; }\n/* Settings: the page title sat lower than every other page's */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-setx-title { margin-top: 0 !important; }\n/* no visible scrollbars anywhere (pop-ups, lists, chip rows, menus, the page); scrolling still works */\nhtml[data-dbk], html[data-dbk] * { scrollbar-width: none !important; }\nhtml[data-dbk]::-webkit-scrollbar, html[data-dbk] *::-webkit-scrollbar { display: none !important; width: 0 !important; height: 0 !important; }\n/* Edit habits: the row × buttons keep some room from the card's edge */\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .habit-item { padding-right: 6px !important; }\nhtml[data-dbk]:not(#z):not(#y) .habits-modal .dbk-endclose { display: none !important; }\n/* Settings pop-ups: no extra gap under the last field */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .setting-row:last-of-type { margin-bottom: 4px !important; }\n\n/* ===== Today: the grocery list lives on Meals › Grocery (copies with Meals); Today keeps it only without Meals ===== */\nhtml.dbk-groc-on-meals:not(#z) :is([data-sortkey=\"grocery\"], [data-module=\"grocery\"]) { display: none !important; }\n\n/* ===== Small icons in place of row-level words (marked in daybook-theme.js: data-dbk-icon = tick | plus | x).\n   One size, one soft ink colour, the person's accent on hover/press, a 40px tap area. The words stay as aria-labels. ===== */\n:root { --dbk-icon-ink: rgba(var(--dbk-green-rgb), 0.5); --dbk-icon-on: #9b5a62; --dbk-icon-paper: #f3eee4; }\nhtml[data-dbk=\"p2\"] { --dbk-icon-on: #8fc98a; --dbk-icon-paper: #06080b; }\nhtml[data-dbk=\"p2\"] body { --dbk-icon-ink: rgba(var(--dbk-green-rgb), 0.55); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon] {\n  position: relative !important; flex: none !important; box-sizing: border-box !important;\n  width: 40px !important; min-width: 40px !important; height: 40px !important; min-height: 40px !important; max-width: none !important;\n  margin: 0 !important; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;\n  font-size: 0 !important; line-height: 0 !important; letter-spacing: 0 !important; color: var(--dbk-icon-ink) !important;\n  text-decoration: none !important; text-indent: 0 !important; opacity: 1 !important; cursor: pointer; -webkit-tap-highlight-color: transparent;\n  vertical-align: middle; align-self: center !important;\n  margin-block: -6px !important;   /* the 40px tap area doesn't make the row taller */\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon]::after { content: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon]::before {\n  content: \"\" !important; position: absolute; inset: 0; margin: auto; display: block; box-sizing: border-box;\n}\n/* + and ×: two thin strokes, the same 14px either way */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is([data-dbk-icon=\"plus\"], [data-dbk-icon=\"x\"])::before {\n  width: 15px; height: 15px;\n  background: linear-gradient(currentColor, currentColor) center / 100% 1.6px no-repeat, linear-gradient(currentColor, currentColor) center / 1.6px 100% no-repeat;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon=\"x\"]::before { width: 13px; height: 13px; transform: rotate(45deg); }\n/* the round tick: an empty circle; filled with a check only once it's done (never while a finger is on it: a scroll that\n   started on one looked ticked, Kasey Oct 31) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon=\"tick\"]::before { width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon=\"tick\"]::after {\n  content: \"\" !important; position: absolute; left: 50%; top: 50%; width: 5px; height: 10px; margin: -7px 0 0 -3px;\n  border: solid var(--dbk-icon-paper); border-width: 0 2px 2px 0; transform: rotate(45deg); opacity: 0;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is([data-dbk-icon]:hover, [data-dbk-icon]:focus-visible) { color: var(--dbk-icon-on) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon]:focus-visible { outline: 2px solid var(--dbk-icon-on) !important; outline-offset: -2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon=\"tick\"].is-ticked::before { background: var(--dbk-icon-on); border-color: var(--dbk-icon-on); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon=\"tick\"].is-ticked::after { opacity: 1; }\n/* a + inside a row of text (the journal's empty day) sits at the end of the row, no extra height */\nhtml[data-dbk]:not(#z):not(#y):not(#x) span[data-dbk-icon] { display: inline-block !important; width: 32px !important; min-width: 32px !important; height: 32px !important; min-height: 32px !important; pointer-events: none; }\n/* fields with a + at the end: the field keeps its line, the + sits inside its end */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.wrc-new, .tp-packadd, .add-habit-row) { align-items: center !important; gap: 4px !important; }\n@media (prefers-reduced-motion: no-preference) { html[data-dbk]:not(#z):not(#y):not(#x) [data-dbk-icon]::before { transition: background-color .12s, border-color .12s; } }\n/* ===== Habits: the monthly challenge card, under the bingo card ===== */\nhtml[data-dbk]:not(#z) #dbkChallenge { padding-top: 32px !important; padding-bottom: 32px !important; margin: 0 !important; text-align: center; }\nhtml[data-dbk]:not(#z) #dbkChallenge:empty { display: none !important; }\nhtml[data-dbk]:not(#z) .dbk-chal { max-width: 34rem; margin: 0 auto; display: flex; flex-direction: column; align-items: center; gap: 14px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-chal .dbk-chal-h { margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-chal-row { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: flex-start; justify-content: center; gap: 12px; max-width: 30rem; text-align: left; color: var(--dbk-green); font-family: var(--dbk-serif, 'Lora'), Georgia, serif; font-size: 1.05rem; line-height: 1.5; -webkit-tap-highlight-color: transparent; }\n/* the theme sets every button in small capitals; the challenge reads as a sentence */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-chal-row, .dbk-chal-text) { font-family: var(--dbk-serif, 'Lora'), Georgia, serif !important; font-size: 1.05rem !important; letter-spacing: 0 !important; text-transform: none !important; font-variant: normal !important; font-weight: 400 !important; line-height: 1.5 !important; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-chal-row:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 2px; }\nhtml[data-dbk]:not(#z) .dbk-chal-box { flex: none; width: 19px; height: 19px; margin-top: 4px; border: 1.5px solid rgba(47,58,44,0.6); border-radius: 3px; background: transparent no-repeat center / 12px 12px; }\nhtml[data-dbk]:not(#z) .dbk-chal-row.is-done .dbk-chal-box { background-color: #2f3a2c; border-color: #2f3a2c; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%23f3eee4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\"); }\nhtml[data-dbk]:not(#z) .dbk-chal-row.is-done .dbk-chal-text { opacity: .62; }\nhtml[data-dbk]:not(#z) .dbk-chal-links { display: flex; justify-content: center; gap: 18px; min-height: 1.4em; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-chal-link { all: unset; cursor: pointer; font-family: var(--dbk-caps) !important; font-size: 15px; letter-spacing: .04em; color: var(--dbk-green); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }\nhtml[data-dbk]:not(#z) .dbk-chal-note { font-style: italic; font-size: .95rem; color: rgba(var(--dbk-green-rgb), .72); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) :is(.dbk-chal-row, .dbk-chal-link) { color: #e6eaef; }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-chal-box { border-color: rgba(230,234,239,0.6); }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-chal-row.is-done .dbk-chal-box { background-color: #8fc98a; border-color: #8fc98a; background-image: url(\"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.3 2.3 4.7-5' fill='none' stroke='%2306080b' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E\"); }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-chal-note { color: rgba(230,234,239,.64); }\n\n/* ===== Meals pop-ups (plan the open nights, cooking plan): titles use the shared pop-up style ===== */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop h3 { font-family: var(--font-title, 'Playfair Display'), Georgia, serif !important; font-style: italic !important; text-transform: none !important; font-variant: normal !important; letter-spacing: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .mprj-pop h3 { font-family: var(--font-title-caps, 'Playfair Display SC'), Georgia, serif !important; font-style: normal !important; letter-spacing: .04em !important; }\n\n/* ===== Meals spacing: day totals centered, week card columns that don't collide, picker header breathing room ===== */\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-tot-h { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; margin-top: 28px; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-tot { grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-tot > div { display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-tot .mpr-track { width: 100%; max-width: 140px; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-tot-link { text-align: center; margin-top: 14px; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-card-h { letter-spacing: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) #mprPlan .mpr-card-h { letter-spacing: .04em !important; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-wrow { gap: 14px; align-items: baseline; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-day { width: 4.4em; min-width: 4.4em; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-wrow .mpr-grow, html[data-dbk]:not(#z):not(#y) #mprPlan .mpr-wrow .mpr-nm { min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y) #meal-picker-modal .modal-header { padding: 24px 52px 16px !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #meal-picker-modal #picker-title { margin: 0 !important; padding: 0 !important; line-height: 1.15 !important; }\nhtml[data-dbk]:not(#z):not(#y) #meal-picker-modal #picker-subtitle { display: block; margin: 6px 0 0 !important; padding: 0 !important; text-align: center !important; }\n\n/* ===== Journal pop-ups (a day, or one meal): a form with labels, so labels and fields line up on the left ===== */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop .mprj-lab { display: block; text-align: left !important; margin: 18px 0 6px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop :is(h3 + .mprj-lab, .mprj-when + .mprj-lab, .mprj-pick + .mprj-lab) { margin-top: 20px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop :is(input[type=\"text\"], textarea) { text-align: left !important; width: 100% !important; max-width: none !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop :is(input[type=\"text\"], textarea)::placeholder { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-pop .mprj-save { margin-top: 22px !important; }\n\n/* trip planner: type-and-go line under the day's stops */\nhtml[data-dbk] .tp-body .tp-quick { margin-top: 14px; }\nhtml[data-dbk] .tp-quick-hint { margin: 8px 0 0; text-align: center; font-style: italic; font-size: 13.5px; opacity: .7; min-height: 1.3em; }\n/* end trip planner type-and-go */\n/* back burner: the add button shows a + big enough to read */\nhtml[data-dbk]:not(#z):not(#y) .dbk-later-go { font-family: system-ui, sans-serif !important; font-size: 22px !important; font-weight: 300 !important; letter-spacing: 0 !important; padding-bottom: 2px !important; }\n/* end back burner add button */\n/* ===== Pop-up sizes and action buttons =====\n   1. On wider screens every pop-up is a small centered card: 440px, or 520px for the busy ones\n      (recipe, cooking plan, budget setup, What shows, trip planner). Phones keep the current width.\n   2. Filled buttons in pop-ups fit their words instead of stretching across the card.\n   3. A pop-up's action row (the filled button and its text links) sits on one line on wider screens,\n      and stacks on phones. */\n@media (min-width: 600px) {\n  html[data-dbk]:not(#z):not(#y):not(#x) :is(.mprj-pop, .rl-pop-box, .dbk-infocard, .dbk-catcard, .wb-sheet, .wrb-sheet, .rt-sheet, #inboxModal, .inbox-modal, .habits-modal, #resourceForm, .dbk-confirm-card, .lh-confirm-box, .fin-sheet, .edit-reminder-modal, .reminder-modal, .day-modal, .modal-container > .modal, #addEventModalOverlay > .modal, #hh-confirm-modal > .modal, .detail-popup-box, .tried-modal-box, .picker-filter-box, .skipped-answer-box, .seasonal-modal, .tp-pop, .dream-form > form) {\n    max-width: 440px !important; margin-left: auto !important; margin-right: auto !important;\n  }\n  html[data-dbk]:not(#z):not(#y):not(#x) :is(.mprj-pop.mcp-pop, #add-recipe-modal > .modal, #meal-picker-modal > .modal, #goals-modal > .modal, .fin-sheet[aria-label=\"Monthly budget\"], .fin-sheet[aria-label=\"Our budget\"], .dbk-setx-card:has([data-sx-order]), .tp-sheet, .wrc-sheet) {\n    max-width: 520px !important; margin-left: auto !important; margin-right: auto !important;\n  }\n  /* Businesses, Work settings and Ready to post are short, not busy */\n  html[data-dbk]:not(#z):not(#y):not(#x) #aiPanel.ai-panel { max-width: 440px !important; margin-left: auto !important; margin-right: auto !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .wrc-sheet.wrb-sheet { max-width: 440px !important; }\n}\n\n/* filled action buttons: as wide as their words, centered */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.mprj-pop, .rl-pop-box, .dbk-infocard, .dbk-catcard, .wb-sheet, .wrb-sheet, .wrc-sheet, .rt-sheet, #inboxModal, .habits-modal, #resourceForm, .dbk-confirm-card, .lh-confirm-box, .fin-sheet, .edit-reminder-modal, .reminder-modal, .day-modal, .modal, .detail-popup-box, .tried-modal-box, .picker-filter-box, .skipped-answer-box, .seasonal-modal, .tp-pop, .tp-sheet, .dream-form, .rl-view, #aiPanel) :is(.rl-btn, .rl-btn.wide, .mprj-save, .fin-btn:not(.ghost), .tp-btn.tp-solid, .wrc-solid, .wr-btn-primary, .save-btn, .habits-save-btn, .rt-save, .inbox-edit-save, .dbk-cat-save, .picker-go-btn, .lh-confirm-btn, .hm-btn-solid, .go-post-copy-btn, .icon-btn.tp-open, .settings-group-save, .wt-go) {\n  width: fit-content !important; max-width: 100% !important; flex: 0 0 auto !important; box-sizing: border-box !important;\n  min-height: 44px; padding-left: 24px !important; padding-right: 24px !important; white-space: normal; text-wrap: balance;\n}\n/* a lone button in the card's own flow: center it */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.mprj-pop, .fin-sheet, .rt-sheet, .habits-modal, #resourceForm, .modal, .tp-pop, .detail-popup-box, .wrc-sheet, .tp-sheet) > :is(.mprj-save, .fin-btn:not(.ghost), .rt-save, .habits-save-btn, .save-btn, .tp-btn.tp-solid, .wrc-solid, .go-post-copy-btn) {\n  display: flex !important; align-items: center; justify-content: center; margin-left: auto !important; margin-right: auto !important;\n}\n\n/* action rows: button and links stacked and centered on phones, one line on wider screens */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.tp-actrow, .fin-actrow, .mprj-actrow, .rl-actrow) { display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.tp-actrow, .mprj-actrow, .rl-actrow) > * { margin-top: 0 !important; margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .mprj-actrow { margin-top: 22px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .tp-actrow { margin-top: 6px; }\n@media (min-width: 600px) {\n  html[data-dbk]:not(#z):not(#y):not(#x) :is(.tp-actrow, .fin-actrow, .mprj-actrow, .rl-actrow) { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 12px 22px !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) :is(.tp-actrow, .rl-actrow) :is(.tp-more, .rl-links) { display: contents !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .tp-actrow .tp-dot { display: none; }\n}\n\n/* Work > ready to post: \"I posted it\" is the one filled button, so Copy caption becomes a small-caps link */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #aiPanel .go-post-copy-btn, html[data-dbk]:not(#z):not(#y):not(#x) #aiPanel .go-post-copy-btn.copied {\n  display: block !important; width: fit-content !important; min-height: 0 !important; margin: 4px auto 0 !important; padding: 0 0 1px !important;\n  background: none !important; border: 0 !important; border-radius: 0 !important; color: inherit !important; text-decoration: underline !important; text-underline-offset: 4px; text-decoration-thickness: 1px;\n  font-family: var(--dbk-caps, var(--font-title-caps)) !important; font-weight: 400 !important; letter-spacing: .05em !important; font-size: 15px !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x) #aiPanel .go-post-copy-btn:focus-visible { outline: 2px solid currentColor !important; outline-offset: 3px !important; }\n\n/* keyboard focus stays visible on the buttons and links in pop-ups */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.tp-actrow, .fin-actrow, .mprj-actrow, .rl-actrow, #detailActions) :is(button, a):focus-visible { outline: 2px solid currentColor !important; outline-offset: 3px !important; }\n/* the close row at the top of the Work and trip sheets floats over the title instead of pushing it down,\n   so the space above the title matches the space under the last line */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.wrc-sheet, .tp-sheet) { padding-top: 22px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.wrc-head, .tp-head) { height: 44px !important; box-sizing: border-box !important; margin: -22px -18px -22px !important; background: transparent !important; pointer-events: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.wrc-head, .tp-head) > * { pointer-events: auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.wrc-sheet, .tp-sheet) > :is(.wb-pop-title, .tp-title, h2, h3) { padding-left: 36px !important; padding-right: 36px !important; box-sizing: border-box; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wrc-sheet > .wrc-titlein { padding-right: 36px !important; box-sizing: border-box; }\n/* Settings pop-ups: the autosave line under the fields is empty (the card's own Saved line does that job),\n   and the Saved line floats in the bottom padding, so the card ends as close to its last field as it starts above its title */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-setx-in .dbk-autosave { display: none !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) :has(> .dbk-setx-saved) { position: relative; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-setx-saved { position: absolute; left: 0; right: 0; bottom: 4px; margin: 0 !important; min-height: 0 !important; }\n/* Work pop-ups: a lone filled button (Done) sits in the middle like every other pop-up's */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wb-sheet .wb-act { display: flex !important; justify-content: center !important; }\n/* ===== end pop-up sizes ===== */\n\n/* time boxes (New Event and the other calendar forms): each its own box, never wider than its half of the row.\n   iPhone Safari gives a time box a fixed natural width unless its native look is turned off. */\nhtml[data-dbk]:not(#z):not(#y) .form-row-2 { display: grid !important; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; gap: 12px !important; }\nhtml[data-dbk]:not(#z):not(#y) .form-row-2 > * { min-width: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y) .form-row-2 input[type=\"time\"] { -webkit-appearance: none !important; appearance: none !important; display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; min-height: 46px; border: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .28) !important; border-radius: 6px !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .form-row-2 input[type=\"time\"] { border-color: rgba(230,234,239,.28) !important; }\nhtml[data-dbk] .form-row-2 input[type=\"time\"]::-webkit-date-and-time-value { text-align: center; margin: 0; }\n/* the date chooser: centred under its box, a little bigger */\nhtml[data-dbk]:not(#z) .hh-dp-popover .hh-dp-day { min-height: 38px; font-size: 15px; }\n/* end time boxes + date chooser */\n\n/* bingo card: open squares on a short list are a quiet + that adds a habit */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y) .bingo-cell.bingo-empty { color: rgba(var(--dbk-green-rgb, 47,58,44), .45) !important; font-family: system-ui, sans-serif !important; font-size: 26px !important; font-weight: 300 !important; letter-spacing: 0 !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y) .bingo-cell.bingo-empty { color: rgba(230,234,239,.45) !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y) .bingo-cell.bingo-empty:hover { background: rgba(var(--dbk-green-rgb, 47,58,44), .05) !important; }\n/* end bingo open squares */\n\n/* New Event: colour dots centred; even space between the time boxes and the next label */\nhtml[data-dbk]:not(#z):not(#y) #addEventModalOverlay .color-picker-row { justify-content: center !important; flex-wrap: wrap; margin-bottom: 8px !important; }\nhtml[data-dbk]:not(#z):not(#y) #addEventModalOverlay #calendarEventNote { text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y) #addEventModalOverlay #singleTimeFields { margin-bottom: 16px !important; }\n/* end New Event colour row */\n\n/* Habits page: Your day (no day arrows, one list in time order), This week with a dot per day, the challenge, Resources behind a link */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #scheduleSectionWrap.dbk-day .day-nav-wrapper { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-day-h, html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-h { text-align: center; margin: 0 0 12px !important; border: 0 !important; padding-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #scheduleSectionWrap.dbk-day #dailyScheduleContainer { border-top: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #scheduleSectionWrap.dbk-day .rt-group-name { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #scheduleSectionWrap.dbk-day .rt-group { margin: 0 !important; padding: 0 !important; }\nhtml[data-dbk] .dbk-paperb { --bandc: var(--dbk-cream); background: var(--dbk-cream); }\nhtml[data-dbk=\"p2\"]:not(#z) .dbk-paperb { background: #121c2b !important; --bandc: #121c2b; }\nhtml[data-dbk] #dbkWeekBody { max-width: 520px; margin: 0 auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-g { font-family: var(--dbk-caps) !important; letter-spacing: .07em; font-size: 13.5px; color: rgba(var(--dbk-green-rgb, 47,58,44), .78); margin: 16px 0 2px; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-g { color: rgba(230,234,239,.78); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-g:first-child { margin-top: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 9px 0; border-top: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .14); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-row { border-top-color: rgba(230,234,239,.12); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-g + .dbk-wk-row { border-top: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-nm { font-size: 16px; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots { display: flex; gap: 5px; flex: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i { width: 10px; height: 10px; border-radius: 50%; background: rgba(var(--dbk-green-rgb, 47,58,44), .3); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-d { background: var(--dbk-fill, var(--dbk-green)); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-o { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(var(--dbk-green-rgb, 47,58,44), .45); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-p { background: transparent; box-shadow: inset 0 0 0 1.5px rgba(var(--dbk-green-rgb, 47,58,44), .6); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i { background: rgba(230,234,239,.3); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-o { box-shadow: inset 0 0 0 1.5px rgba(230,234,239,.45); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-p { box-shadow: inset 0 0 0 1.5px rgba(230,234,239,.6); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-dots i.is-d { background: #8fc98a; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-empty { text-align: center; font-style: italic; opacity: .7; margin: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hab-foot { text-align: center; padding: 22px 0 28px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hab-res { all: unset; cursor: pointer; font-family: var(--dbk-caps) !important; letter-spacing: .06em; font-size: 15px; border-bottom: 1px solid currentColor; padding-bottom: 1px; }\nhtml[data-dbk] #dbkResLink[hidden] { display: none !important; }\n/* Habits page: actions look like buttons (an outline that fits the words), not underlined words */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) :is(#bingoControls .btn[onclick^=\"openHabitsEditor\"], .edit-routine-btn, .dbk-chal-link, .dbk-hab-res) { all: unset; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; width: auto !important; min-height: 40px; padding: 8px 20px !important; margin: 0 auto !important; border: 1px solid currentColor !important; border-radius: 6px !important; background: transparent !important; color: var(--dbk-green) !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: .05em !important; text-decoration: none !important; cursor: pointer; box-shadow: none !important; transform: none !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) :is(#bingoControls .btn[onclick^=\"openHabitsEditor\"], .edit-routine-btn, .dbk-chal-link, .dbk-hab-res) { color: #e6eaef !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) :is(#bingoControls .btn[onclick^=\"openHabitsEditor\"], .edit-routine-btn, .dbk-chal-link, .dbk-hab-res):hover { background: rgba(var(--dbk-green-rgb, 47,58,44), .07) !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) :is(#bingoControls .btn[onclick^=\"openHabitsEditor\"], .edit-routine-btn, .dbk-chal-link, .dbk-hab-res):focus-visible { outline: 2px solid currentColor !important; outline-offset: 3px; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) #scheduleSectionWrap .edit-routine-btn { display: flex !important; width: fit-content !important; margin: 20px auto 0 !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #scheduleSectionWrap .edit-routine-btn { margin: 22px auto 0 !important; }\n/* end Habits page layout */\n\n/* the Close at the end of long pop-ups: an outline button, not an underlined word */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-endclose-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex !important; align-items: center; justify-content: center; min-height: 40px; padding: 8px 22px !important; border: 1px solid currentColor !important; border-radius: 6px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: .05em !important; text-decoration: none !important; opacity: 1 !important; color: inherit !important; background: transparent !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-endclose-btn:focus-visible { outline: 2px solid currentColor !important; outline-offset: 3px; }\n/* end pop-up Close button */\n\n/* trip planner: a day is \"Day 1\" and its date; a name is optional (one tap for Arrival day / Rest day, or your own) */\nhtml[data-dbk] .tp-dayhead2 { position: relative; text-align: center; margin: 6px 0 2px; padding: 0 36px; }\nhtml[data-dbk]:not(#z) .tp-dh-t { font-family: var(--dbk-serif, 'Playfair Display'), Georgia, serif; font-size: 20px; line-height: 1.25; }\nhtml[data-dbk=\"p1\"]:not(#z) .tp-dh-t { font-family: 'Playfair Display', Georgia, serif; }\nhtml[data-dbk] .tp-dh-d { font-family: var(--dbk-caps); letter-spacing: .05em; font-size: 13px; opacity: .65; margin-top: 2px; }\nhtml[data-dbk] .tp-dayhead2 .tp-mini { position: absolute; right: 0; top: 0; }\nhtml[data-dbk] .tp-dh-name { display: flex; gap: 8px; align-items: center; margin: 8px 0 6px; }\nhtml[data-dbk]:not(#z):not(#y) .tp-dh-ok { all: unset; cursor: pointer; flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; border: 1px solid rgba(var(--wrc-ink-rgb), .35); font-size: 16px; }\n/* end trip day names */\n\n/* ===== Work overview and Personal / Work (work-today.js, work-spaces.js) ===== */\n/* an outline button that fits its words (not an underlined word) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-obtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px; border: 1px solid currentColor; border-radius: 6px; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: .05em; line-height: 1.2; text-align: center; color: inherit; background: transparent; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-obtn:hover { background: rgba(var(--dbk-green-rgb, 47,58,44), .06); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-obtn:hover { background: rgba(255,255,255,.06); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-obtn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-obtn.wk-small { min-height: 34px; padding: 5px 14px; font-size: 14px; }\nhtml[data-dbk] .wk-btns { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: 20px; }\n@media (max-width: 520px) { html[data-dbk] .wk-btns { gap: 8px; } }   /* side by side on a phone too; wraps only when they don't fit */\n/* Today on Work: label, what, and a round tick on reminders */\nhtml[data-dbk]:not(#z):not(#y) .wk-list { max-width: 520px; }\nhtml[data-dbk]:not(#z):not(#y) .wk-list li.wk-row { align-items: center; }\nhtml[data-dbk]:not(#z):not(#y) .wk-lbl { color: var(--lh-secondary, #9b5a62) !important; opacity: 1; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk-lbl { color: #8fc98a !important; }\nhtml[data-dbk]:not(#z):not(#y) .wk-list .wt-what em.wt-late { opacity: 1; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk-tick { flex: none; margin: -6px -6px -6px 0; }\n/* a reminder's link: a small chain icon of its own beside the tick (Work's Today and Today's calendar), 40px to tap */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-remlink { flex: none; display: inline-grid; place-items: center; width: 40px; height: 40px; margin: -8px 0; color: inherit; opacity: .78; text-decoration: none; border-radius: 50%; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-remlink:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.hc-rem.hc-rem-lk, .hc-rem.hc-cook-x) { grid-template-columns: 78px minmax(0,1fr) auto auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-rem > .dbk-remlink { align-self: center; margin: -8px -4px; }\n/* no work reminders: one small, quiet line */\nhtml[data-dbk]:not(#z):not(#y) .wk-norem { margin: 10px 0 0; font-size: .86rem; font-style: italic; opacity: .62; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y) .wk-ev { all: unset; box-sizing: border-box; cursor: pointer; display: flex; gap: 14px; align-items: baseline; width: 100%; text-align: left; }\nhtml[data-dbk]:not(#z):not(#y) .wk-ev:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y) .wt-band .wt-h + .wt-empty { margin-top: 2px; }\n/* Work's Three */\nhtml[data-dbk] .wk3 { max-width: 460px; margin: 0 auto; text-align: left; }\nhtml[data-dbk] .wk3-row { display: flex; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .16); }\nhtml[data-dbk=\"p2\"] .wk3-row { border-top-color: rgba(230,234,239,.12); }\nhtml[data-dbk] .wk3-row:first-child { border-top: 0; }\nhtml[data-dbk] .wk3-n { flex: none; width: 30px; font-family: 'Playfair Display', Georgia, serif; font-style: italic; font-size: 1.3rem; color: var(--lh-secondary, #9b5a62); }\nhtml[data-dbk=\"p2\"] .wk3-n { color: #8fc98a; }\nhtml[data-dbk]:not(#z):not(#y) .wk3-box { all: unset; box-sizing: border-box; flex: none; width: 20px; height: 20px; border: 1.5px solid rgba(var(--dbk-green-rgb, 47,58,44), .55); border-radius: 3px; cursor: pointer; display: grid; place-items: center; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk3-box { border-color: rgba(230,234,239,.5); }\nhtml[data-dbk]:not(#z):not(#y) .wk3-box:disabled { cursor: default; opacity: .45; }\nhtml[data-dbk]:not(#z):not(#y) .wk3-box.on { background: var(--dbk-green, #2f3a2c); border-color: var(--dbk-green, #2f3a2c); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk3-box.on { background: #8fc98a; border-color: #8fc98a; }\nhtml[data-dbk]:not(#z):not(#y) .wk3-box.on::after { content: ''; width: 5px; height: 10px; margin-top: -2px; border: solid #f3eee4; border-width: 0 2px 2px 0; transform: rotate(45deg); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk3-box.on::after { border-color: #0c1118; }\nhtml[data-dbk]:not(#z):not(#y) .wk3-box:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk3-in { all: unset; box-sizing: border-box; flex: 1; min-width: 0; font-size: 1.04rem; line-height: 1.35; padding: 4px 0; color: inherit; cursor: text; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk3-in::placeholder { font-style: italic; color: inherit; opacity: .5; }\nhtml[data-dbk] .wk3-row.done .wk3-in { text-decoration: line-through; opacity: .55; }\nhtml[data-dbk] .wk3-msg { text-align: center; font-style: italic; opacity: .8; margin: 14px 0 0; }\n/* Next step */\nhtml[data-dbk]:not(#z):not(#y) .wt-hero .wt-next-h { margin-bottom: 2px !important; font-size: 1rem !important; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y) .wt-hero .wk-light { color: inherit; margin-top: 12px; }\n/* the rest of the week */\nhtml[data-dbk] .wk-day { max-width: 520px; margin: 0 auto; text-align: left; }\nhtml[data-dbk] .wk-day + .wk-day { margin-top: 16px; }\nhtml[data-dbk] .wk-dayh { font-family: var(--dbk-caps); letter-spacing: .05em; font-size: .95rem; color: var(--lh-secondary, #9b5a62); padding-bottom: 6px; border-bottom: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .16); }\nhtml[data-dbk=\"p2\"] .wk-dayh { color: #8fc98a; border-bottom-color: rgba(230,234,239,.12); }\nhtml[data-dbk]:not(#z):not(#y) .wk-day .wt-list li:first-child { border-top: 0; }\n/* this month */\nhtml[data-dbk]:not(#z):not(#y) .wk-money, html[data-dbk]:not(#z):not(#y) .wk-wins { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; max-width: 520px; margin: 0 auto; text-align: center; color: inherit; }\nhtml[data-dbk]:not(#z):not(#y) .wk-money-n { font-family: 'Playfair Display', Georgia, serif; font-size: 1.6rem; line-height: 1.2; }\nhtml[data-dbk]:not(#z):not(#y) .wk-in { color: #5f7a4f; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk-in { color: #8fc98a; }\nhtml[data-dbk]:not(#z):not(#y) .wk-money-s { font-style: italic; font-size: .95rem; opacity: .7; }\nhtml[data-dbk]:not(#z):not(#y) .wk-wins.wk-sep { margin-top: 22px; padding-top: 20px; border-top: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .16); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .wk-wins.wk-sep { border-top-color: rgba(230,234,239,.12); }\nhtml[data-dbk]:not(#z):not(#y) .wk-wins .wk-wins-h { margin: 0 !important; font-size: 1rem !important; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y) .wk-wins-l { font-size: 1.04rem; line-height: 1.4; max-width: 36ch; }\nhtml[data-dbk]:not(#z):not(#y) :is(.wk-money, .wk-wins):focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }\n/* an iPhone's own day and time boxes won't shrink below their natural width unless told to: side by side in Work's\n   forms they ran over each other and off the pop-up (the designer, Oct 20). Same fix as Today's time boxes. */\nhtml[data-dbk]:not(#z):not(#y) .wrc-input:is([type=\"date\"], [type=\"time\"]) { -webkit-appearance: none !important; appearance: none !important; display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; min-height: 46px; }\nhtml[data-dbk] .wrc-input:is([type=\"date\"], [type=\"time\"])::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }\n/* the one filled button in a pop-up */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-fbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 8px 22px; border-radius: 6px; font-family: var(--dbk-caps); font-size: 15px; letter-spacing: .05em; line-height: 1.2; background: #2f3a2c; color: #f3eee4; border: 1px solid #2f3a2c; white-space: nowrap; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-fbtn { background: #8fc98a; color: #0c1118; border-color: #8fc98a; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-fbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }\nhtml[data-dbk] .wk-del { display: flex; justify-content: center; }\nhtml[data-dbk] .wk-tx { display: flex; flex-direction: column; }\nhtml[data-dbk] .wk-tx-row { display: flex; justify-content: space-between; align-items: baseline; gap: 14px; padding: 11px 0; border-top: 1px solid rgba(var(--wrc-ink-rgb, 47,58,44), .14); text-align: left; }\nhtml[data-dbk] .wk-tx-row:first-child { border-top: 0; }\nhtml[data-dbk] .wk-tx-l { display: flex; flex-direction: column; min-width: 0; }\nhtml[data-dbk] .wk-tx-n { font-size: 1.02rem; }\nhtml[data-dbk] .wk-tx-d { font-style: italic; font-size: .88rem; opacity: .65; }\nhtml[data-dbk] .wk-tx-a { flex: none; font-variant-numeric: tabular-nums; }\nhtml[data-dbk] .wk-tx-note { text-align: center; font-style: italic; opacity: .7; font-size: .92rem; margin: 14px 0 0; }\n/* Personal / Work: a two-way switch, on Today's forms and Work's */\nhtml[data-dbk] .dbk-space { display: flex; flex-direction: column; align-items: center; gap: 6px; margin: 4px 0 2px; }\nhtml[data-dbk] .dbk-space[hidden] { display: none !important; }\nhtml[data-dbk] .dbk-space-sw { display: inline-flex; padding: 3px; border: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), .3); border-radius: 999px; }\nhtml[data-dbk=\"p2\"] .dbk-space-sw { border-color: rgba(230,234,239,.28); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-space-sw button { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 18px; border-radius: 999px; font-family: var(--dbk-caps); font-size: 14.5px; letter-spacing: .04em; color: inherit; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-space-sw button.on { background: #2f3a2c; color: #f3eee4; opacity: 1; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-space-sw button.on { background: #8fc98a; color: #0c1118; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-space-sw button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk] .dbk-space-note { margin: 0; font-style: italic; font-size: .9rem; opacity: .7; text-align: center; }\nhtml[data-dbk] .dbk-space-note[hidden] { display: none; }\n/* the small Work tag on Today's calendar, right after the name */\nhtml[data-dbk] .hc-tt { display: inline; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y) .hc-tt .dbk-wtag { display: inline-block; vertical-align: 2px; margin-left: 7px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-tt > :is(.hc-title, .hc-rem-name) { display: inline !important; }\nhtml[data-dbk] .dbk-wtag { flex: none; align-self: center; margin-left: 8px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 3px; font-family: var(--dbk-caps); font-size: 11.5px; letter-spacing: .05em; line-height: 1.3; color: var(--lh-secondary, #9b5a62); }\nhtml[data-dbk=\"p2\"] .dbk-wtag { color: #8fc98a; }\n/* rows and lines that are buttons keep the page's reading font, not the button caps */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.wk-ev, .wk-money, .wk-wins) :is(.wt-what, .wt-what em, .wk-money-n, .wk-money-s, .wk-wins-l) { font-family: var(--dbk-serif, 'Lora'), Georgia, serif !important; text-transform: none !important; font-variant: normal !important; letter-spacing: 0 !important; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y):not(#x):not(#w) :is(.wk-money-n) { font-family: 'Playfair Display', Georgia, serif !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wk-ev .wt-when { font-family: var(--dbk-caps) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(input, textarea).wk3-in { border: 0 !important; border-bottom: 0 !important; box-shadow: none !important; background: transparent !important; border-radius: 0 !important; }\n/* end Work overview */\n/* ═══ Inbox, rebuilt (Oct 18): Tag then Send to, each a small menu right under its button; a one-tap\n   suggestion on each note; edit and delete as icons; opens without a flash ═══ */\nhtml[data-dbk] #inboxModal { --ibx-ink: var(--dbk-green); --ibx-rgb: var(--dbk-green-rgb); --ibx-bg: var(--dbk-cream); --ibx-accent: var(--lh-secondary, #a94f61); }\nhtml[data-dbk=\"p2\"] #inboxModal { --ibx-ink: #e6eaef; --ibx-rgb: 230,234,239; --ibx-bg: #0d1116; --ibx-accent: #e79aa9; }\n/* the veil and the box fade in together (no blurred empty frame first); from another page it's simply there */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxOverlay.visible { animation: dbkFadeIn .16s ease-out; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxOverlay.visible #inboxModal { animation: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxOverlay.dbk-now, html[data-dbk]:not(#z):not(#y):not(#x) #inboxOverlay.dbk-now * { animation: none !important; transition: none !important; }\n/* header: Clear all is a small outline button, not an underlined word */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-clear-btn { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--dbk-caps); font-size: 12px; letter-spacing: .05em; text-decoration: none !important; opacity: 1; color: var(--ibx-ink); border: 1px solid rgba(var(--ibx-rgb), .3); border-radius: 999px; padding: 4px 12px; line-height: 1.3; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-clear-btn:hover { border-color: rgba(var(--ibx-rgb), .55); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-clear-btn:focus-visible { outline: 2px solid var(--ibx-accent); outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-header-actions { gap: 10px !important; }\n/* add a note: one box and a + (the only filled button here); search sits under it once there are enough notes */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-capture-row { display: flex !important; gap: 8px !important; align-items: center !important; padding: 12px 20px !important; border-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-capture-send { flex: none !important; width: 42px !important; height: 42px !important; padding: 0 !important; border-radius: 9px !important; font-size: 22px !important; line-height: 1 !important; display: grid !important; place-items: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxModal .inbox-search-row { padding: 12px 20px 16px !important; border-top: 0 !important; flex: none !important; }   /* no line above: the last note already has one */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxSearchInput { width: 100% !important; max-width: none !important; text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxSearchInput::placeholder { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxSearchInput::-webkit-search-cancel-button { -webkit-appearance: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-capture-input { text-align: left !important; min-width: 0; }   /* shrinks on a 320 phone: the + ran past the card's edge (Oct 23 audit) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .inbox-capture-input::placeholder { text-align: left !important; }\n/* tag filter: small outline chips, centered */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-tagbar { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 4px 20px 12px !important; border-bottom: 1px solid rgba(var(--ibx-rgb), .12); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-chip { all: unset; box-sizing: border-box; cursor: pointer; font-family: var(--dbk-serif); font-size: 14px; color: var(--ibx-ink); border: 1px solid rgba(var(--ibx-rgb), .25); border-radius: 999px; padding: 4px 12px; line-height: 1.35; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-chip[aria-pressed=\"true\"] { border-color: var(--ibx-ink); background: rgba(var(--ibx-rgb), .08); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-chip-n { font-size: 12px; opacity: .6; margin-left: 3px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-chip:focus-visible { outline: 2px solid var(--ibx-accent); outline-offset: 2px; }\n/* a note: words and time on the left, the one-tap suggestion on the right */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-item { display: flex; flex-wrap: wrap; align-items: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-item > .inbox-item-row1 { flex: 1 1 0; min-width: 0; padding: 14px 12px 14px 20px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-item.open > .inbox-item-row1 { padding-right: 20px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-item > .inbox-item-row2 { flex: 0 0 100%; padding: 0 20px 14px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick { all: unset; box-sizing: border-box; flex: none; margin-right: 16px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 46%; font-family: var(--dbk-serif); font-size: 13.5px; line-height: 1.2; color: var(--ibx-ink); border: 1px solid rgba(var(--ibx-rgb), .3); border-radius: 999px; padding: 6px 11px; min-height: 32px; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick .ibx-arrow { flex: none; opacity: .7; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick:hover { border-color: rgba(var(--ibx-rgb), .55); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick:active { background: rgba(var(--ibx-rgb), .07); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-quick:focus-visible { outline: 2px solid var(--ibx-accent); outline-offset: 2px; }\n/* the open note's actions: Tag, Send to, then edit and delete as icons */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-dd { position: relative; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-btn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-family: var(--dbk-caps); font-size: 13px; letter-spacing: .05em; color: var(--ibx-ink); border: 1px solid rgba(var(--ibx-rgb), .32); border-radius: 999px; padding: 7px 14px; min-height: 36px; white-space: nowrap; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-btn:hover { border-color: rgba(var(--ibx-rgb), .6); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-btn[aria-expanded=\"true\"] { border-color: var(--ibx-ink); background: rgba(var(--ibx-rgb), .07); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-caret { opacity: .7; transition: transform .18s ease; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-btn[aria-expanded=\"true\"] .ibx-caret { transform: rotate(180deg); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-icon { all: unset; box-sizing: border-box; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; color: rgba(var(--ibx-rgb), .7); -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-icon:hover { color: var(--ibx-ink); background: rgba(var(--ibx-rgb), .06); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-icon.del:hover { color: var(--ibx-accent); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.ibx-btn, .ibx-icon):focus-visible { outline: 2px solid var(--ibx-accent); outline-offset: 2px; }\n/* the menu: a small card right under its button (above it near the bottom), never a wall of options */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-menu { position: absolute; z-index: 20; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); min-width: 224px; max-width: min(280px, calc(calc(100 * var(--dbk-vw, 1vw)) - 48px)); background: var(--ibx-bg); color: var(--ibx-ink); border: 1px solid rgba(var(--ibx-rgb), .18); border-radius: 10px; box-shadow: 0 10px 28px rgba(0,0,0,.16), 0 2px 6px rgba(0,0,0,.08); padding: 5px 0; text-align: left; animation: dbkSendIn .14s ease; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-menu.up { top: auto; bottom: calc(100% + 6px); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .ibx-menu { box-shadow: 0 10px 28px rgba(0,0,0,.55); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi { all: unset; box-sizing: border-box; display: flex; width: 100%; align-items: baseline; justify-content: space-between; gap: 12px; cursor: pointer; padding: 8px 16px; min-height: 38px; font-family: var(--dbk-serif) !important; font-variant: normal !important; text-transform: none !important; letter-spacing: 0 !important; font-size: 16px; line-height: 1.35; color: var(--ibx-ink); -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi:hover, html[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi:focus-visible { background: rgba(var(--ibx-rgb), .07); outline: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi.sug { font-weight: 500; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi-note { font-family: var(--dbk-serif) !important; font-style: italic; font-size: 13px; text-transform: none !important; letter-spacing: 0 !important; opacity: .6; white-space: nowrap; font-weight: 400; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-mi.on { font-weight: 500; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-untag { color: var(--ibx-accent); border-top: 1px solid rgba(var(--ibx-rgb), .12); margin-top: 4px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-menu-h { text-align: center; font-family: var(--dbk-caps); font-size: 12px; letter-spacing: .06em; opacity: .6; padding: 8px 16px 3px; margin-top: 4px; border-top: 1px solid rgba(var(--ibx-rgb), .12); }\n/* the open note's tint stays, and its menu sits above the notes below it */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-item.menu-open { position: relative; z-index: 3; }\n\n/* the Work tag sits under the time (or under \"Reminder\"), so long names never wrap around it */\nhtml[data-dbk]:not(#z):not(#y) .hc-t .dbk-wtag, html[data-dbk]:not(#z):not(#y) .hc-rem-l .dbk-wtag { display: block; width: max-content; margin: 5px 0 0; align-self: auto; }\n\n/* ===== Pop-ups, lighter and smaller (feedback: \"not take up the whole screen, more subtle\") =====\n   - one soft see-through backdrop for every pop-up (was four different darknesses, most blurred hard)\n   - every pop-up starts below the top bar, so the menu stays in view, and stops above the capture bar\n   - a pop-up is as tall as what's in it, up to about 70% of a phone screen (80% for the few big tools:\n     trip planner, Tonight's plan, recipes); longer content scrolls inside it, with no scrollbar shown\n   --dbk-navb is the top bar's bottom edge, set by daybook-theme.js (0 while the keyboard is up, so\n   a form then gets all the room above the keyboard). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) {\n  --dbk-pop-top: calc(var(--dbk-vvt, 0px) + max(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + 14px, var(--dbk-navb, 0px) + 12px));\n  --dbk-pop-veil: rgba(28,34,26,0.24); --dbk-pop-blur: blur(10px) saturate(0.85);   /* the designer, Oct 19: blur behind every pop-up, calmer */\n  --dbk-popcap: calc(70 * var(--dbk-vh, 1vh)); --dbk-popcap-big: calc(80 * var(--dbk-vh, 1vh));\n}\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) { --dbk-pop-veil: rgba(4,6,9,0.42); }\n@media (min-width: 769px) {\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w) { --dbk-popcap: min(calc(76 * var(--dbk-vh, 1vh)), 680px); --dbk-popcap-big: min(calc(84 * var(--dbk-vh, 1vh)), 780px); }\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(#dayModalOverlay, .edit-reminder-overlay, #addReminderOverlay, #editReminderOverlay, #reminderModalOverlay, .rt-overlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #resourceFormOverlay, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, #seasonal-modal-overlay, .tp-overlay, .tp-pop-overlay, .wrc-overlay, .mprj-scrim, #rlPop, .fin-sheet-overlay, .dbk-infopop, .dbk-confirm, #journal-day-popup) {\n  background: var(--dbk-pop-veil) !important;\n  backdrop-filter: var(--dbk-pop-blur) !important; -webkit-backdrop-filter: var(--dbk-pop-blur) !important;\n  padding-top: var(--dbk-pop-top) !important;\n  padding-bottom: calc(var(--dbk-kbh, 0px) + var(--dbk-capspace, 80px)) !important;\n  box-sizing: border-box !important;\n}\n/* the cards themselves: as tall as their content, capped, scrolling inside when longer */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, #inboxModal, .habits-modal, :is(#addEventModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, .modal-overlay) > .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .picker-filter-box, .skipped-answer-box, .seasonal-modal, .tp-pop, .wrc-sheet, .mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .dbk-infocard, .dbk-catcard, .dbk-confirm-card, #journal-day-popup > div, #resourceForm.event-form) {\n  max-height: min(calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - var(--dbk-kbh, 0px) - var(--dbk-capspace, 80px) - 8px), var(--dbk-popcap)) !important;\n  overflow-y: auto !important; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;\n  scrollbar-width: none !important;\n  box-shadow: 0 14px 44px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.08) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.tp-sheet, .mprj-pop.mcp-pop, #add-recipe-modal > .modal) {\n  max-height: min(calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - var(--dbk-kbh, 0px) - var(--dbk-capspace, 80px) - 8px), var(--dbk-popcap-big)) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, #inboxModal, .habits-modal, .modal, .dream-form > form, .detail-popup-box, .tp-pop, .tp-sheet, .wrc-sheet, .mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .dbk-infocard, .dbk-catcard, .dbk-confirm-card)::-webkit-scrollbar { display: none !important; width: 0 !important; }\n\n/* the capture bar stays put when a pop-up opens or you type somewhere (sliding it away made the page jump);\n   pop-ups stop above it instead (--dbk-capspace) */\n\n/* Today's calendar: a swipe slides the new week or month in from the side it came from */\n@keyframes hcInL { from { transform: translateX(28px); opacity: .35; } to { transform: none; opacity: 1; } }\n@keyframes hcInR { from { transform: translateX(-28px); opacity: .35; } to { transform: none; opacity: 1; } }\nhtml[data-dbk] #hmWeek { touch-action: pan-y; }\nhtml[data-dbk] #hmWeek .hc-grid.hc-in-l { animation: hcInL .2s ease-out; }\nhtml[data-dbk] #hmWeek .hc-grid.hc-in-r { animation: hcInR .2s ease-out; }\n@media (prefers-reduced-motion: reduce) { html[data-dbk] #hmWeek .hc-grid.hc-in-l, html[data-dbk] #hmWeek .hc-grid.hc-in-r { animation: none; } }\n/* Today's Three: the words are tappable to edit; the box ticks */\nhtml[data-dbk] .hm-thing .thing-text:not(.empty) { cursor: text; }\n/* Edit event (from Today's calendar): laid out like New Event. Centered small labels, the day, More options,\n   and outline buttons for Delete event and Cancel next to the one filled Save. */\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing .hc-ed-l { display: block !important; text-align: center !important; font-family: var(--dbk-caps) !important; font-size: 13px !important; letter-spacing: 0.06em !important; text-transform: uppercase !important; color: var(--bx-ink, currentColor) !important; opacity: 0.7 !important; margin: 0 0 6px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing #dayModalEventTitle { margin-bottom: 14px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing .hc-ed-times { gap: 10px !important; margin-bottom: 14px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay .hc-ed-morerow { display: flex; justify-content: center; margin: 0 0 14px; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay .hc-ed-morerow[hidden], #dayModalOverlay #dbkEvMoreBox[hidden] { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing .dbk-space { margin: 0 0 14px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing .day-modal-form-actions { display: flex !important; flex-wrap: wrap !important; justify-content: center !important; align-items: center !important; gap: 10px !important; margin-top: 4px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dayModalOverlay :is(.hc-ed-btn, .day-modal-form-actions .cancel-contact-btn.hc-ed-btn) { all: unset; box-sizing: border-box; cursor: pointer; flex: none !important; width: auto !important; padding: 7px 16px !important; border-radius: 4px !important; border: 1px solid color-mix(in srgb, var(--bx-ink, #2f3a2c) 45%, transparent) !important; background: transparent !important; color: var(--bx-ink, #2f3a2c) !important; opacity: 1 !important; text-decoration: none !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; line-height: 1.2 !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dayModalOverlay .day-modal-form-actions .cancel-contact-btn.hc-ed-btn { order: 2 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dayModalOverlay .day-modal-form-actions .btn { order: 3 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dayModalOverlay .hc-ed-btn.hc-ed-del { order: 1 !important; color: var(--bx-danger, #9b4a5a) !important; border-color: color-mix(in srgb, var(--bx-danger, #9b4a5a) 55%, transparent) !important; }\n#dayModalOverlay:not(.hc-editing) #dbkEvDel { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dayModalOverlay :is(.hc-ed-btn):focus-visible { outline: 2px solid var(--lh-secondary, #b0596b) !important; outline-offset: 3px !important; }\nhtml[data-dbk]:not(#z):not(#y) #dayModalOverlay.hc-editing #dayModalForm { margin-top: 0 !important; padding-top: 4px !important; }\n/* Habits \"This week\": the note under the first day's ticks */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-row + .dbk-wk-empty { margin-top: 14px; }\n\n/* Depth (the designer picked option C): every section is its own rounded card, with a little room between them */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) body { background: #e4ded0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) body { background: #030508 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hm-band, .dbk-sec, .schedule-up-next.dbk-upnext) {\n  margin: 12px 10px !important; width: auto !important; max-width: none;\n  border-radius: 16px !important; border: 1px solid rgba(30, 38, 28, 0.10) !important;\n  box-shadow: 0 1px 2px rgba(30, 38, 28, 0.05), 0 6px 18px -8px rgba(30, 38, 28, 0.22) !important;\n  overflow: hidden;\n}\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) :is(.hm-band, .dbk-sec) { border-color: rgba(255, 255, 255, 0.10) !important; box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.6) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.dbk-infocard, .modal-content, .habits-modal, .event-form, [role=\"dialog\"]) {\n  box-shadow: 0 20px 50px -14px rgba(0, 0, 0, 0.38) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.rl-row, .mpr-card, .rl-pick) {\n  border: 1px solid rgba(30, 38, 28, 0.10) !important;\n  box-shadow: 0 1px 2px rgba(30, 38, 28, 0.05), 0 6px 16px -8px rgba(30, 38, 28, 0.25) !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .rl-pick { border-radius: 16px !important; }\n@media (min-width: 900px) {\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hm-band, .dbk-sec, .schedule-up-next.dbk-upnext) { max-width: 960px !important; margin: 14px auto !important; }\n}\n/* cards: the same 10px from the screen edge on every page (some pages already have side padding) */\n@media (max-width: 899px) {\n  html:is([data-dbk-page=\"person1-hub\"], [data-dbk-page=\"person2-hub\"], [data-dbk-page=\"meal-plan\"]):not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(.hm-band, .dbk-sec) { margin-left: 0 !important; margin-right: 0 !important; }\n  html[data-dbk-page=\"our-dreams\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(.hm-band, .dbk-sec) { margin-left: -2px !important; margin-right: -2px !important; }\n}\n/* a section that only holds another section isn't a card itself (no card inside a card) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-sec:has(.dbk-sec) { background: transparent !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; max-width: none !important; border-radius: 0 !important; overflow: visible !important; }\n/* one container with the background, never a box inside a card */\n/* Lists home and the recipe book: the tiles / recipe cards are the cards, the section around them isn't */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(.dbk-sec:has(#sectionTiles), #recipes-view.dbk-sec) { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding-top: 6px !important; padding-left: 0 !important; padding-right: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .landing-tile { border: 1px solid rgba(30, 38, 28, 0.10) !important; box-shadow: 0 1px 2px rgba(30, 38, 28, 0.05), 0 6px 16px -8px rgba(30, 38, 28, 0.25) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .landing-tile { border-color: rgba(255, 255, 255, 0.10) !important; box-shadow: 0 8px 22px -10px rgba(0, 0, 0, 0.6) !important; }\n/* Meals: the week's menu sits straight on its section */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #mprPlan .mpr-card { background: transparent !important; border: 0 !important; box-shadow: none !important; border-radius: 0 !important; padding: 0 !important; }\n/* Grocery: \"40 things from this week's plan · Add them\" is a plain line, not a dashed box */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .mprg-plan { border: 0 !important; border-bottom: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), 0.18) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; padding-left: 0 !important; padding-right: 0 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .mprg-plan { border-bottom-color: rgba(230, 234, 239, 0.16) !important; }\n/* Money: calendar days aren't little boxes; today keeps its ring */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .fin-cal button { background: transparent !important; }\n/* Habits: \"Not this month\" is a small button */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .dbk-chal-link { min-height: 30px !important; padding: 4px 12px !important; font-size: 13px !important; border-radius: 5px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #sectionTiles { margin-left: auto !important; margin-right: auto !important; }\n/* Each page's top band is a full-width strip, not a card, to break up the cards now and then\n   (Today's greeting, Habits' Up next, Meals' Tonight and Journal header, Money's month, Work's business name) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.hm-band.hm-pink:has(.hm-greet, #hmGreeting, h1), .hm-band.hm-pink:first-child, #scheduleUpNext, #mprHero, .mprj-top, .fin-hero, .wt-band.wt-a) {\n  width: calc(100 * var(--dbk-vw, 1vw)) !important; max-width: none !important;\n  margin: 0 calc(50% - calc(50 * var(--dbk-vw, 1vw))) 12px !important;\n  border: 0 !important; border-radius: 0 !important; box-shadow: none !important;\n}\nhtml[data-dbk]:not(#z) body { overflow-x: hidden; }\n/* Work: the lists use the card's width (up to 520px) instead of shrinking to their shortest line */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wt-band .wt-list { width: 100% !important; max-width: 520px !important; margin-left: auto !important; margin-right: auto !important; box-sizing: border-box; }\n/* desktop cards: content up to 600px wide, centered (the old full-width bands sized their side padding\n   from the whole screen, which squeezed content into a narrow column once they became cards) */\n@media (min-width: 900px) {\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(.hm-band, .dbk-sec):not(.hm-pink:first-child, #scheduleUpNext, #mprHero, .mprj-top, .fin-hero, .wt-a, .dbk-sec:has(.dbk-sec), .dbk-sec:has(#sectionTiles), #recipes-view) { padding-left: max(32px, calc((min(960px, 100%) - 600px) / 2)) !important; padding-right: max(32px, calc((min(960px, 100%) - 600px) / 2)) !important; }\n}\n/* Today: the calendar card clears the capture bar at the bottom, with a little background showing in between\n   (the other pages already leave room for the bar) */\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w):not(#v) body { padding-bottom: calc(var(--dbk-capbar-h, 58px) + 8px + env(safe-area-inset-bottom, 0px)) !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) body { padding-bottom: 8px !important; }\n/* messages (\"Captured.\", \"Saved\", Undo) sit just above the capture bar, never on top of it or its buttons */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(#toastContainer, .toast-container, .lh-toast-wrap, .dbk-notice) { bottom: calc(var(--dbk-capbar-h, 58px) + 18px + env(safe-area-inset-bottom, 0px)) !important; top: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-toast-wrap { padding-bottom: 0 !important; }\n\n/* Today's Three: the edit box looks like the line it replaces and wraps onto two lines */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm .thing-edit-input { -webkit-appearance: none; appearance: none; display: block; flex: 1; min-width: 0; width: 100%; resize: none; overflow: hidden; font-family: inherit; line-height: 1.35; white-space: pre-wrap; word-break: break-word; background: none !important; border: 0 !important; border-bottom: 1px solid currentColor !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 0 2px 4px !important; margin: 0 !important; }\n/* Today's calendar card: \"Add to today · All reminders\" sits a little lower under the list, and the card\n   ends with the same 32px as the other cards (the old 78px was room for the capture bar from before cards) */\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x) .hc-add { margin-top: 24px !important; }\n/* Meals: the day's totals, small — one quiet line, or slim bars against the goals */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum { margin: 26px auto 0; max-width: 340px; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum .mpr-lbl { text-align: center; margin-bottom: 6px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum-line { margin: 0; font-style: italic; font-size: 1rem; opacity: .8; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum-row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 5px 0; text-align: left; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum-nm { font-size: .9rem; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum .mpr-track { display: block; height: 5px; margin: 0; width: 100%; max-width: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum-v { font-size: .95rem; white-space: nowrap; font-variant-numeric: lining-nums tabular-nums; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprPlan .mpr-sum-v small { opacity: .6; font-size: .85em; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .dbk-sx-row button[data-goals].dbk-sx-obtn { align-self: center !important; flex: none !important; height: auto !important; min-height: 34px !important; padding: 6px 14px !important; white-space: nowrap; }\n/* Habits: Add a step — the time box keeps its size (an empty time box on an iPhone otherwise shrinks to a sliver) */\n\n/* trip planner: dates on one line, length on the next; tap either to change the dates (no underline) */\nhtml[data-dbk]:not(#z):not(#y) .tp-meta { text-decoration: none !important; }\nhtml[data-dbk]:not(#z):not(#y) .tp-meta .tp-meta-l { display: block; line-height: 1.35; }\n/* everywhere: wrapped titles and short centered lines break evenly (never one word alone on the last line),\n   and longer text avoids a single-word last line */\nhtml[data-dbk] :is(h1, h2, h3, h4, h5, .section-title, [class*=\"-title\"], [class*=\"-meta\"], [class*=\"-sub\"], [class*=\"-lbl\"], [class*=\"-hint\"], [class*=\"-note\"], [class*=\"-empty\"], .tp-meta-l, .rl-pick-nm, .rl-pick-only, .rl-pick-none, .rl-tile-nm, .rl-tile-next, .mpr-sum-line, .toast, .dbk-confirm-card p) { text-wrap: balance; }\nhtml[data-dbk] :is(p, li, .rl-nm, .rl-meta, .hc-title, .thing-text) { text-wrap: pretty; }\n/* ===== Settings > Look: colors and fonts ===== */\nhtml[data-dbk] .dbk-look { display: flex; flex-direction: column; gap: 6px; }\nhtml[data-dbk] .dbk-look-prev { position: relative; border-radius: 14px; overflow: hidden; padding: 0 0 12px; border: 1px solid rgba(var(--dbk-green-rgb), 0.14); }\nhtml[data-dbk=\"p2\"] .dbk-look-prev { border-color: rgba(230,234,239,0.14); }\nhtml[data-dbk] .dbk-look-bar { text-align: center; font-size: 13px; letter-spacing: .08em; padding: 8px 0; }\nhtml[data-dbk] .dbk-look-card { margin: 10px 12px 0; border-radius: 10px; padding: 12px 14px; text-align: center; }\nhtml[data-dbk] .dbk-look-t { font-size: 22px; font-style: italic; line-height: 1.2; }\nhtml[data-dbk] .dbk-look-l { font-size: 12px; letter-spacing: .1em; margin-top: 6px; }\nhtml[data-dbk] .dbk-look-b { font-size: 15px; margin-top: 2px; }\nhtml[data-dbk] .dbk-look-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 8px 12px 0; }\nhtml[data-dbk] .dbk-look-strip span { height: 22px; border-radius: 8px; }\nhtml[data-dbk] .dbk-look-gl { text-align: center; font-family: var(--dbk-caps); letter-spacing: .1em; font-size: 14px; opacity: .8; margin-top: 14px; }\nhtml[data-dbk] .dbk-look-sws { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 6px; margin-top: 4px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-sw { all: unset; box-sizing: border-box; position: relative; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 6px 2px; border-radius: 10px; }\nhtml[data-dbk] .dbk-look-dot { width: 42px; height: 42px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }\nhtml[data-dbk] .dbk-look-nm { font-size: 13.5px; }\nhtml[data-dbk] .dbk-look-sw[aria-checked=\"true\"] .dbk-look-dot { box-shadow: 0 0 0 2px var(--dbk-paper, #fff), 0 0 0 4px currentColor; }\nhtml[data-dbk] .dbk-look-sw[aria-checked=\"true\"] .dbk-look-nm { text-decoration: underline; text-underline-offset: 4px; }\nhtml[data-dbk] .dbk-look-sw:focus-visible, html[data-dbk] .dbk-look-font:focus-visible, html[data-dbk] .dbk-look-own:focus-within { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk] .dbk-look-pick { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; border: 0; padding: 0; }\nhtml[data-dbk] .dbk-look-fonts { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 4px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-font { all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 12px; min-height: 36px; display: inline-flex; align-items: center; border: 1px solid rgba(var(--dbk-green-rgb), 0.3); border-radius: 8px; font-size: 17px; line-height: 1.1; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .dbk-look-font { border-color: rgba(230,234,239,0.3); }\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-font.is-body { font-size: 15px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-font[aria-checked=\"true\"] { border: 2px solid currentColor; padding: 5px 11px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look :is(.dbk-look-font, .dbk-look-nm, .dbk-look-t, .dbk-look-b, .dbk-look-sw) { text-transform: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look .dbk-look-own { display: flex !important; flex-direction: column !important; align-items: center !important; gap: 5px !important; margin: 0 !important; padding: 6px 2px !important; font: inherit !important; letter-spacing: 0 !important; text-decoration: none !important; border: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look .dbk-look-own .dbk-look-dot { display: block !important; width: 42px !important; height: 42px !important; flex: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look input.dbk-look-pick { position: absolute !important; inset: 0 !important; width: 100% !important; height: 100% !important; min-height: 0 !important; opacity: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; -webkit-appearance: none; appearance: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-look [style*=\"--ff\"] { font-family: var(--ff) !important; font-variant: normal !important; font-feature-settings: normal !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-card:has(.dbk-look) .dbk-setx-saved { display: none !important; }\n\n/* Settings pop-ups: anything marked hidden stays hidden (the notification \"At\" rows showed even when Off) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .dbk-setx-in :is([hidden], .setting-row[hidden]) { display: none !important; }\n/* Settings: Backup's button and Remove password are outline buttons (one filled button per pop-up, no underlined words) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in :is(.btn.btn-secondary, .dbk-pw-remove) { all: unset; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; width: auto !important; min-height: 40px; padding: 8px 18px !important; margin: 4px auto 0 !important; border: 1px solid currentColor !important; border-radius: 6px !important; background: transparent !important; color: inherit !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: .05em !important; text-decoration: none !important; cursor: pointer; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in .dbk-pw-remove { color: var(--lh-secondary, #9b5a62) !important; }\n/* Settings > Password: the buttons keep their words on one line, centered; stacked on a phone, side by side on a computer */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in #passwordForm > div:has(> button) { display: flex !important; flex-direction: column !important; align-items: center !important; justify-content: center !important; gap: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in #passwordForm > div:has(> button) > button { white-space: nowrap !important; width: auto !important; margin: 0 !important; }\n@media (min-width: 601px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in #passwordForm > div:has(> button) { flex-direction: row !important; } }\n/* ===== Today audit ===== */\n/* Today's Three: an empty line says what to do */\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x) .hm-thing .thing-text.empty::before { content: 'Tap to add'; }\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w) .hm-thing .thing-text.empty { text-align: left !important; justify-self: stretch !important; padding-right: 0 !important; }\n/* Reminders: the add and edit forms keep the extras under More options */\nhtml[data-dbk] :is(#addReminderOverlay, #editReminderOverlay) .modal-body:not(.dbk-more-open) .dbk-more { display: none !important; }\n/* Today's pop-ups: small outline buttons instead of underlined words (New Event's Cancel and More options,\n   Add a reminder, the reminder forms' Cancel / More options / Delete) */\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w) :is(#addEventModalOverlay #dbkEventMore, #addEventModalOverlay .form-actions .cancel-btn, #addReminderOverlay .form-actions .cancel-btn, .dbk-rem-more, #reminderFormToggle, #editReminderOverlay .dbk-rem-del .hm-link) {\n  all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; flex: none !important; width: auto !important; min-height: 40px; padding: 7px 16px !important; margin: 0 auto; border-radius: 4px !important; border: 1px solid color-mix(in srgb, currentColor 45%, transparent) !important; background: transparent !important; color: var(--dbk-green, #2f3a2c) !important; text-decoration: none !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: 0.03em !important; line-height: 1.2 !important; text-align: center !important; white-space: nowrap; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w) :is(#addEventModalOverlay #dbkEventMore, #addEventModalOverlay .form-actions .cancel-btn, #addReminderOverlay .form-actions .cancel-btn, .dbk-rem-more, #reminderFormToggle, #editReminderOverlay .dbk-rem-del .hm-link) { color: #e6eaef !important; }\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w) :is(#addEventModalOverlay #dbkEventMore, .dbk-rem-more) { display: flex; margin: 4px auto 14px; }\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w) #editReminderOverlay .dbk-rem-del { text-align: center; margin-top: 12px; }\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x):not(#w):not(#v) #editReminderOverlay .dbk-rem-del .hm-link { color: var(--lh-secondary, #9b4a5a) !important; }\nhtml[data-dbk][data-dbk-page=\"index\"]:not(#z):not(#y):not(#x) :is(#addEventModalOverlay, #addReminderOverlay) .form-actions { display: flex !important; justify-content: center !important; align-items: center !important; gap: 10px !important; }\n/* All reminders: the round tick sits at the end of each row */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #reminderModalList .reminder-list-row { display: flex !important; align-items: center !important; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #reminderModalList .reminder-list-row .reminder-list-title { flex: 1; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #reminderModalList :is(.dbk-rl-done, .dbk-rl-del) { flex: none; }\n\n/* trip planner: + Add a place to stay is an outline button; Budget / Notes labels centered */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-linkbtn.tp-obtn { border: 1px solid currentColor !important; border-radius: 6px !important; padding: 7px 16px !important; min-height: 38px; text-decoration: none !important; display: inline-flex !important; align-items: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .tp-field .tp-label { display: block; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop .tp-linkbtn { border: 1px solid currentColor !important; border-radius: 6px !important; padding: 7px 16px !important; min-height: 38px; text-decoration: none !important; display: inline-flex !important; align-items: center; }\n/* Look picker: swatches centered however many there are */\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-sws { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 18px; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-look-sws > .dbk-look-sw { width: 88px; }\n/* the setup guide's 'Make it yours' step sits on dark green: the picker's words and outlines are light there */\nhtml:not(#z):not(#y):not(#x) #htwiz-look :is(.dbk-look-gl, .dbk-look-nm, .dbk-look-font) { color: rgba(243, 238, 228, 0.92) !important; }\nhtml:not(#z):not(#y):not(#x) #htwiz-look .dbk-look-font { border-color: rgba(243, 238, 228, 0.35) !important; }\nhtml:not(#z):not(#y):not(#x) #htwiz-look .dbk-look-font[aria-checked=\"true\"] { border-color: rgba(243, 238, 228, 0.95) !important; box-shadow: inset 0 0 0 1px rgba(243, 238, 228, 0.95) !important; }\nhtml:not(#z):not(#y):not(#x) #htwiz-look .dbk-look-sw[aria-checked=\"true\"] .dbk-look-dot { box-shadow: 0 0 0 2px #2f3a2c, 0 0 0 4px rgba(243, 238, 228, 0.95) !important; }\n/* the setup guide is dark: the font dropdowns and text sizes read in light ink there too (they were dark on dark) */\nhtml:not(#z):not(#y):not(#x) #htwiz-look :is(.dbk-look-ddl, .dbk-look-ddb, .dbk-look-ddo, .dbk-look-tsb) { color: rgba(243, 238, 228, 0.92) !important; }\nhtml:not(#z):not(#y):not(#x) #htwiz-look :is(.dbk-look-ddb, .dbk-look-ddm, .dbk-look-tsb) { border-color: rgba(243, 238, 228, 0.35) !important; }\nhtml:not(#z):not(#y):not(#x) #htwiz-look .dbk-look-ddo[aria-selected=\"true\"] { background: rgba(243, 238, 228, 0.12) !important; }\n/* the greeting fits on one line on a phone where it can, and otherwise breaks evenly (never one word alone) */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .hm-greet { font-size: min(2.1rem, calc(7.4 * var(--dbk-vw, 1vw))) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-greet { text-wrap: balance; }\n/* Lists pick box: the filters fit on one row on a phone (short labels), wrapping only on very narrow screens */\n/* desktop: Meals' Plan cards are as wide as every other page's (960px, not 900px) */\n@media (min-width: 900px) { html[data-dbk][data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x) #plan-view.dual-mode { max-width: 960px !important; } }\n/* Habits: no underlined words as buttons — Add a category, Add a resource, Delete category, Delete this step,\n   and the habit editor's Reset today / Shuffle the board / Cancel are small outline buttons */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(button.dbk-res-all, #resourceCategories .dbk-link, .dbk-habit-more .dbk-link, .habits-cancel-btn, .rt-delete) {\n  all: unset; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; width: auto !important; min-height: 36px; padding: 6px 16px !important; margin: 0 !important;\n  border: 1px solid currentColor !important; border-radius: 6px !important; background: transparent !important; color: var(--dbk-green) !important;\n  font-family: var(--dbk-caps) !important; font-size: 14px !important; letter-spacing: .05em !important; text-decoration: none !important; white-space: nowrap; cursor: pointer; box-shadow: none !important;\n}\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(button.dbk-res-all, #resourceCategories .dbk-link, .dbk-habit-more .dbk-link, .habits-cancel-btn, .rt-delete) { color: #e6eaef !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(#resourceCategories .dbk-link.dbk-danger, .rt-delete) { color: var(--lh-secondary, #9b5a62) !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(button.dbk-res-all, #resourceCategories .dbk-link, .dbk-habit-more .dbk-link, .habits-cancel-btn, .rt-delete):focus-visible { outline: 2px solid currentColor !important; outline-offset: 3px; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #resourceCategories .dbk-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 10px; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) .dbk-habit-more { gap: 10px !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) .dbk-res-more { margin-top: 14px; text-align: center; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .dbk-habit-more .dbk-link { font-size: 13px !important; padding: 5px 12px !important; min-height: 32px; }\n/* side by side while they fit (390 and up); on a 320 phone they ran past the pop-up's sides, so they wrap there (Oct 26 audit) */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) .dbk-habit-more { flex-wrap: wrap !important; }\n/* Work's Three: long items wrap onto a second line instead of being cut off */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) textarea.wk3-in { display: block; resize: none; overflow: hidden; white-space: pre-wrap; word-break: break-word; font-family: inherit; min-height: 1.6em; }\n/* Work: no underlined words as buttons — Home base's \"+ Tagline / + EIN …\" chips and the pop-ups' Cancel are outline buttons */\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .wrb-chips button { border: 1px solid currentColor !important; border-radius: 6px !important; padding: 6px 12px !important; min-height: 34px !important; opacity: 1 !important; text-decoration: none !important; display: inline-flex !important; align-items: center; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x) .wrb-chips { gap: 8px !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.ai-actions .wr-btn-secondary, .wr-btn-sm.wr-btn-secondary) {\n  all: unset; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px !important;\n  border: 1px solid currentColor !important; border-radius: 6px !important; background: transparent !important; color: var(--dbk-green) !important;\n  font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: .05em !important; text-decoration: none !important; cursor: pointer; white-space: nowrap;\n}\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.ai-actions .wr-btn-secondary, .wr-btn-sm.wr-btn-secondary) { color: #e6eaef !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .wb-lessbtn .wrc-link { all: unset; box-sizing: border-box; display: inline-flex !important; align-items: center; justify-content: center; min-height: 40px; padding: 8px 18px !important; border: 1px solid currentColor !important; border-radius: 6px !important; font-family: var(--dbk-caps) !important; font-size: 15px !important; letter-spacing: .05em !important; text-decoration: none !important; cursor: pointer; color: inherit; }\n/* Work pop-ups: centered labels; choice chips show their state by color (no stray checkbox over the words) */\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x) :is(.ai-panel, .wrc-sheet, .wb-sheet) .wr-label { text-align: center !important; display: block; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x) .multi-select-grid { justify-content: center !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x) .multi-select-option input { display: none !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w) .multi-select-option { color: var(--dbk-green) !important; border-color: rgba(var(--dbk-green-rgb, 47,58,44), .35) !important; font-size: 14px !important; padding: 6px 14px !important; }\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w) .multi-select-option.checked { background: var(--dbk-fill, var(--dbk-green)) !important; color: var(--dbk-cream, #f3eee4) !important; border-color: var(--dbk-fill, var(--dbk-green)) !important; font-weight: 400 !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w) .multi-select-option { color: #e6eaef !important; border-color: rgba(230,234,239,.3) !important; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w) .multi-select-option.checked { background: #8fc98a !important; color: #06080b !important; border-color: #8fc98a !important; }\n/* the \"+ Tagline / + EIN\" chips: small */\nhtml[data-dbk][data-dbk-page=\"workroom\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .wrb-chips button { box-sizing: border-box !important; min-height: 32px !important; height: auto !important; padding: 4px 11px !important; font-size: 13px !important; line-height: 1.2 !important; }\n\n/* pop-ups: no Cancel that does exactly what the × does (it closes without saving) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) :is(#addEventModalOverlay .cancel-btn[onclick^=\"calendarHideAddForm\"], #dayModalOverlay.hc-editing .cancel-contact-btn, #addReminderOverlay .cancel-btn[onclick^=\"closeAddReminderPopup\"], .habits-cancel-btn, .dbk-cat-cancel, .wk-acts .dbk-obtn[data-x]) { display: none !important; }\n/* Lists edit form: its × sits in the corner like every other pop-up's */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #edit-form .rl-edit-x { top: 8px !important; right: 8px !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .habits-cancel-btn { display: none !important; }\n/* Back Burner: a small round up arrow moves an item up into Today's Three (dims while the Three is full) */\nhtml[data-dbk]:not(#z):not(#y) :is(.dbk-later-up, .dbk-later-cal) { all: unset; box-sizing: border-box; cursor: pointer; flex: none; width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(var(--dbk-green-rgb),0.35); display: grid; place-items: center; color: var(--dbk-green); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) :is(.dbk-later-up, .dbk-later-cal) { color: #e6eaef; border-color: rgba(230,234,239,.35); }\nhtml[data-dbk]:not(#z):not(#y) :is(.dbk-later-up, .dbk-later-cal):focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y) .three-full .dbk-later-up { opacity: .35; }\n\n/* Habits: today's Up next step has a small outline Done button under it */\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done { all: unset; box-sizing: border-box; cursor: pointer; margin-top: 10px; padding: 5px 18px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .1em; color: var(--dbk-green); opacity: .85; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done { color: #e6eaef; }\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done[hidden] { display: inline-block; visibility: hidden; pointer-events: none; }  /* keeps its space: ticking the last step never moves the page */\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done:active { opacity: 1; background: rgba(var(--dbk-green-rgb), .12); }\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* the Undo inside a Habits message */\nhtml[data-dbk]:not(#z):not(#y) .lh-toast-undo { all: unset; cursor: pointer; margin-left: 8px; padding: 2px 10px; border: 1px solid currentColor; border-radius: 5px; font-size: .9em; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-later-item label span { text-align: left; }\n\n/* Look: the preview stays pinned at the top while you scroll the choices; fonts are two small dropdowns */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-prev { position: sticky; top: -22px; z-index: 3; box-shadow: 0 6px 14px -10px rgba(0,0,0,.35); }\nhtml[data-dbk] .dbk-look-dd { display: grid; grid-template-columns: 1fr; justify-items: center; gap: 6px; margin-top: 14px; }\nhtml[data-dbk] .dbk-look-ddl { font-family: var(--dbk-caps); letter-spacing: .1em; font-size: 14px; opacity: .8; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-ddb { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 200px; max-width: 100%; min-height: 42px; padding: 8px 14px; border: 1px solid currentColor; border-radius: 8px; font-size: 18px; line-height: 1.1; }\nhtml[data-dbk] .dbk-look-dd.is-open .dbk-look-ddb svg { transform: rotate(180deg); }\nhtml[data-dbk] .dbk-look-ddm { position: fixed; z-index: 40; box-sizing: border-box; width: min(calc(100vw - 48px), 280px); max-height: 220px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; border: 1px solid rgba(var(--dbk-green-rgb), .25); border-radius: 10px; padding: 4px; box-shadow: 0 10px 28px rgba(0,0,0,.18); }   /* floats under its button (placed by dbk-look.js), nothing below moves */\nhtml[data-dbk=\"p2\"] .dbk-look-ddm { border-color: rgba(230,234,239,.22); }\nhtml[data-dbk] .dbk-look-ddm::-webkit-scrollbar { display: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-ddo { all: unset; box-sizing: border-box; cursor: pointer; display: block; width: 100%; padding: 9px 12px; border-radius: 6px; font-size: 18px; line-height: 1.15; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-ddo[aria-selected=\"true\"] { background: rgba(var(--dbk-green-rgb), .1); outline: 1px solid currentColor; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-look-ddo[aria-selected=\"true\"] { background: rgba(230,234,239,.1); }\nhtml[data-dbk] .dbk-look-ddb:focus-visible, html[data-dbk] .dbk-look-ddo:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look :is(.dbk-look-ddb, .dbk-look-ddo) { text-transform: none !important; }\n\n/* Weather: the Rain map button, and the map itself (near full screen on a phone) */\nhtml[data-dbk]:not(#z):not(#y) .dbk-wx-mapbtn { all: unset; box-sizing: border-box; cursor: pointer; display: flex; align-items: center; gap: 7px; width: max-content; margin: 12px auto 0; padding: 6px 16px; border: 1px solid currentColor; border-radius: 999px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .08em; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk] .dbk-wx-mapbtn svg { width: 17px; height: 17px; flex: none; }\nhtml[data-dbk] .dbk-wx-mapbtn:active { background: rgba(var(--info-ink), .08); }\nhtml[data-dbk] .dbk-wx-mapbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-radar-pop { align-items: center !important; padding: calc(12px + env(safe-area-inset-top, 0px)) 12px calc(12px + env(safe-area-inset-bottom, 0px)) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-radar { max-width: 440px; max-height: none !important; overflow: visible !important; padding: 18px 16px 12px; display: flex; flex-direction: column; }\nhtml[data-dbk] .dbk-radar-map { position: relative; height: min(calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - 150px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)), 600px); min-height: 260px; margin-top: 12px; border-radius: 10px; overflow: hidden; background: #e8e6e1; touch-action: none; }\nhtml[data-dbk=\"p2\"] .dbk-radar-map { background: #1b1f24; }\nhtml[data-dbk] .dbk-radar-msg { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 20px; text-align: center; font-family: var(--dbk-serif); font-size: 16px; color: #555; text-wrap: balance; }\nhtml[data-dbk=\"p2\"] .dbk-radar-msg { color: #c9cdd2; }\nhtml[data-dbk] .dbk-radar-msg[hidden] { display: none; }\nhtml[data-dbk] .dbk-radar-bar { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 40px; margin-top: 10px; font-family: var(--dbk-serif); font-size: 16px; font-variant-numeric: tabular-nums; text-align: center; text-wrap: balance; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-radar-play { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; flex: none; border: 1px solid currentColor; border-radius: 50%; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-radar-play[hidden] { display: none; }\nhtml[data-dbk] .dbk-radar-play svg { width: 18px; height: 18px; }\nhtml[data-dbk] .dbk-radar-play:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n\n/* Meals: dimmed text stays readable on every color (opacity alone fades too far on mid-tone colors) */\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-slot, html[data-dbk]:not(#z):not(#y) #mprJournal .mprj-slot { opacity: 0.82; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-empty { opacity: 0.74; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-plus { opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprGroc :is(.mprg-x, .mprg-add button) { color: inherit !important; opacity: 0.78; }\nhtml[data-dbk]:not(#z):not(#y) #mprGroc .done .mprg-nm { opacity: 0.72; }\nhtml[data-dbk]:not(#z):not(#y) :is(#mprGroc .mprg-sub, #mprGroc .mprg-empty, #mprJournal .mprj-sub) { opacity: 0.8; }\nhtml[data-dbk]:not(#z):not(#y) #mprGroc .mprg-sec { opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y) #mprJournal .mprj-off { opacity: 0.55; }\n/* Recipes: \"Add a recipe\" is an outline button in its own color, readable in light and dark looks */\nhtml[data-dbk]:not(#z):not(#y):not(#x) button.gen-btn[onclick=\"openAddRecipeModal()\"] { background: none !important; border: 1px solid currentColor !important; border-radius: 999px !important; color: var(--dbk-green) !important; text-decoration: none !important; padding: 6px 14px !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) button.gen-btn[onclick=\"openAddRecipeModal()\"] { color: #e6eaef !important; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-lbl, html[data-dbk]:not(#z):not(#y) #mprJournal .mprj-l { opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y) #mprJournal .mprj-blank .mprj-nm { opacity: 0.74; }\nhtml[data-dbk]:not(#z):not(#y) #mprJournal .mprj-rate { opacity: 0.8; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-open .mpr-nm { opacity: 0.74; }\nhtml[data-dbk]:not(#z):not(#y) #mprPlan .mpr-wk button[aria-label] { opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y) #mprJournal .mprj-addnote { opacity: 1; }\n/* Meal Settings: the Household choices line up on the left, one per row */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-view div:has(> #settings-share-two-wrap) { flex-direction: column !important; align-items: flex-start !important; gap: 12px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-view div:has(> #settings-share-two-wrap) > label { justify-content: flex-start !important; text-align: left !important; margin: 0 !important; }\n/* Journal: no \"Add a note\" button under every day; one small note icon sits by the date instead */\nhtml[data-dbk]:not(#z):not(#y) #mprJournal .mprj-hrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprJournal .mprj-noteicon { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 28px; margin: -6px -6px -4px 0; color: inherit; opacity: 0.8; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #mprJournal .mprj-noteicon:focus-visible { outline: 2px solid currentColor; outline-offset: 1px; border-radius: 6px; }\n/* Grocery: the \"Add to the list\" hint is readable on bright colors */\nhtml[data-dbk]:not(#z):not(#y) #mprGroc input::placeholder { color: currentColor !important; opacity: 0.68 !important; }\n/* Meal Settings > Nutrition rings: the hint is readable, the choices sit centered under their centered label, and an off choice is still easy to read */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-tracked-nutrients > div:first-child { opacity: 0.85 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-tracked-nutrients > div:nth-child(2) { opacity: 0.78 !important; text-wrap: balance; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-tracked-nutrients div[style*=\"flex-wrap\"] { justify-content: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-tracked-nutrients button[data-nutrient] { color: inherit !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-tracked-nutrients button[data-nutrient]:not([style*=\"font-weight:700\"]) { opacity: 0.75; }\n/* Meal Settings: typed text in a box starts on the left, like every other box */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-view :is(input.settings-input, select.settings-input) { text-align: left !important; text-align-last: left; }\n/* Meal Settings > Customize: the switches are round like the other switches, and \"off\" is easy to see on any color */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-toggles label > span { border-radius: 999px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-toggles label > input:not(:checked) + span { background: transparent !important; box-shadow: inset 0 0 0 1.5px currentColor !important; opacity: 0.7; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-toggles label > input:not(:checked) + span + span { background: currentColor !important; opacity: 0.7; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #settings-toggles > div:not([style*=\"justify-content\"]) { opacity: 0.85 !important; text-wrap: balance; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) #settings-toggles label > input:checked + span + span { background: #0c1118 !important; }\n/* What's in Season: one container in the look's own colors (no white panel inside a dark pop-up), chips outlined and readable */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal :is(.seasonal-card, .seasonal-header, .seasonal-modal-header, .seasonal-modal-body, .seasonal-modal-footer, .seasonal-footer) { background: transparent !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal .seasonal-card { border: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal :is(.seasonal-modal-header, .seasonal-header) { border-bottom: 1px solid rgba(var(--lh-text-rgb), 0.14) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal .seasonal-pill { background: transparent !important; color: inherit !important; border: 1px solid currentColor !important; opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal .seasonal-pill.seasonal-added { opacity: 1; background: rgba(var(--lh-text-rgb), 0.14) !important; font-weight: 600 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal :is(.seasonal-header *, .seasonal-produce *) { color: inherit; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal :is(.seasonal-banner, .seasonal-body, .seasonal-spotlight, .seasonal-transitions, .seasonal-group, .seasonal-row) { background: transparent !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal .seasonal-group-label { color: inherit !important; opacity: 0.8 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .seasonal-modal :is(.seasonal-nav-prev, .seasonal-nav-next) { color: inherit !important; opacity: 0.8 !important; }\n/* Grocery: a ticked thing slides down and away, and \"In the cart\" lights up so you see where it went */\n@keyframes mprgFlash { 0% { background: rgba(var(--lh-text-rgb), 0.16); } 100% { background: transparent; } }\nhtml[data-dbk] #mprGroc .mprg-cart summary.mprg-flash { animation: mprgFlash 1.4s ease-out; border-radius: 6px; }\n/* Today: ticked groceries go to the Meals list's \"In the cart\"; a quiet line shows how many are there */\nhtml[data-dbk]:not(#z):not(#y) #groceryList .grocery-cart-link { display: block; margin: 10px 0 2px; padding: 6px 0; font-family: var(--dbk-caps); letter-spacing: 0.06em; font-size: 0.86rem; color: inherit; opacity: 0.85; text-decoration: none; text-align: left; }\n/* Readable in every color: the Inbox count is dark on the light badge in dark looks (white on light pink was hard to read),\n   and the event form's \"All day\" label is as strong as the other small labels */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .capture-inbox-badge { color: #0c1118 !important; }\nhtml[data-dbk]:not(#z):not(#y) .allday-label { color: rgba(var(--lh-text-rgb),0.75) !important; }\n/* Look: the colors made from your own pick; tap one to remove it, tap again to bring it back */\nhtml[data-dbk] .dbk-look-pal { display: flex; justify-content: center; gap: 14px; margin: 14px 0 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-pc { all: unset; box-sizing: border-box; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 5px; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-pc[disabled] { cursor: default; }\nhtml[data-dbk] .dbk-look-pd { position: relative; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; box-shadow: 0 0 0 1px color-mix(in srgb, currentColor 40%, transparent); }\nhtml[data-dbk] .dbk-look-pd svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; position: absolute; top: -4px; right: -4px; padding: 2px; border-radius: 50%; background: var(--dbk-cream, #f5f0e6); box-shadow: 0 0 0 1px rgba(0,0,0,.18); box-sizing: content-box; }\nhtml[data-dbk=\"p2\"] .dbk-look-pd svg { background: #121c2b; box-shadow: 0 0 0 1px rgba(230,234,239,.3); }\nhtml[data-dbk] .dbk-look-pc.is-off .dbk-look-pd { opacity: .3; }\nhtml[data-dbk] .dbk-look-pc.is-off .dbk-look-pd svg { opacity: 1; }\nhtml[data-dbk] .dbk-look-pn { font-family: var(--dbk-caps); font-size: 12px; letter-spacing: .06em; opacity: .8; }\nhtml[data-dbk] .dbk-look-pc.is-off .dbk-look-pn { opacity: .5; }\nhtml[data-dbk] .dbk-look-pc:focus-visible .dbk-look-pd { outline: 2px solid currentColor; outline-offset: 3px; }\n\n/* rain map: the street map underneath is softened so the rain stands out; dark looks get a dark version */\n.dbk-rm-base { filter: saturate(.55) brightness(1.03); }\n.dbk-rm-base.is-dark { filter: invert(1) hue-rotate(180deg) saturate(.5) brightness(.8) contrast(.92); }\n/* Habits: the Resources arrows read on every color */\nhtml[data-dbk]:not(#z):not(#y) .resource-arrow { color: rgba(var(--dbk-green-rgb, 47,58,44), .75) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .resource-arrow { color: rgba(230,234,239,.75) !important; }\n/* Habits pop-ups: the boxes you type in line up on the left like the rest of the pop-up */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(#rtSheet .rt-in-title, #newHabitInput) { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(#rtSheet .rt-in-title, #newHabitInput)::placeholder { text-align: left !important; }\n/* Habits: a ticked step stays readable on a dark card in any color */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) .rt-row.is-done :is(.rt-what, .rt-notes) { color: rgba(var(--dbk-green-rgb),0.8) !important; }\n\n/* Inbox menus: a tall one scrolls inside itself (no visible scrollbar) instead of moving the list behind it */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-menu { overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .ibx-menu::-webkit-scrollbar { display: none; }\n\n/* Inbox: the header, Add and the tags stay put at the top, search stays at the bottom, and only the notes scroll */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxModal { display: flex !important; flex-direction: column !important; overflow: hidden !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxModal > :not(#inboxBody) { flex: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxModal .inbox-modal-header { position: static !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxBody { flex: 1 1 auto !important; min-height: 0 !important; overflow-y: auto !important; overscroll-behavior: contain; scrollbar-width: none; position: relative; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxBody::-webkit-scrollbar { display: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxBody { background: inherit !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-tagbar { position: sticky; top: 0; z-index: 5; background: inherit !important; }\n\n/* Habits: nothing below the challenge moves when it's ticked or swapped: the line under it keeps the button's height */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) .dbk-chal-links { min-height: 34px; align-items: center; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) .dbk-chal-text { display: flex; align-items: center; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) .dbk-chal-row { position: relative; align-items: center; }\n\n/* Add / edit a step: the time box sits right after \"Time\" on the left, lined up with the day buttons;\n   Delete fits its words and only shows for a step that already exists */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-delete { width: fit-content !important; align-self: center !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-delete[hidden] { display: none !important; }\n\n/* Habits › This week › History: the last 90 days, one small grid per habit (a column is a week) */\nhtml[data-dbk] .dbk-wk-more { display: flex; justify-content: center; margin-top: 16px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-hist { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 34px; padding: 5px 16px; border: 1px solid currentColor; border-radius: 6px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .05em; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wk-hist:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-histcard { width: min(440px, calc(100 * var(--dbk-vw, 1vw) - 24px)) !important; max-width: 440px !important; scrollbar-width: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-histcard::-webkit-scrollbar { display: none; }\nhtml[data-dbk] .dbk-hist-empty { text-align: center; font-style: italic; opacity: .75; margin: 18px 0 6px; }\nhtml[data-dbk] .dbk-hist-list { margin-top: 10px; }\nhtml[data-dbk] .dbk-hist-row { border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); }\nhtml[data-dbk] .dbk-hist-row.is-gone { opacity: .7; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-hist-top { all: unset; box-sizing: border-box; cursor: pointer; display: grid; grid-template-columns: 1fr; gap: 3px; width: 100%; padding: 12px 2px; text-align: left; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk] .dbk-hist-top:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk] .dbk-hist-nm { font-family: var(--dbk-serif); font-size: 17px; line-height: 1.25; }\nhtml[data-dbk] .dbk-hist-st { font-size: 14px; opacity: .78; }\nhtml[data-dbk] .dbk-hist-weeks { display: grid; grid-template-columns: repeat(13, 1fr); gap: 4px; margin-top: 7px; }\nhtml[data-dbk] .dbk-hist-weeks i { display: block; height: 8px; border-radius: 3px; }\nhtml[data-dbk] .dbk-hist-weeks i.is-w { background: color-mix(in srgb, currentColor var(--f), transparent); }\nhtml[data-dbk] .dbk-hist-weeks i.is-x { background: color-mix(in srgb, currentColor 6%, transparent); }\nhtml[data-dbk] .dbk-hist-ends { display: flex; justify-content: space-between; margin-top: 8px; padding: 0 2px; font-size: 12px; opacity: .6; }\nhtml[data-dbk] .dbk-hist-days { padding: 2px 2px 14px; }\nhtml[data-dbk] .dbk-hist-key { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; opacity: .8; }\nhtml[data-dbk] .dbk-hist-key span { display: inline-flex; align-items: center; gap: 6px; }\nhtml[data-dbk] .dbk-hist-key i, html[data-dbk] .dbk-hist-grid i { display: block; width: 9px; height: 9px; border-radius: 2px; box-sizing: border-box; }\nhtml[data-dbk] :is(.dbk-hist-key, .dbk-hist-grid) i.is-d { background: currentColor; }\nhtml[data-dbk] :is(.dbk-hist-key, .dbk-hist-grid) i.is-m, html[data-dbk] .dbk-hist-grid i.is-p { border: 1px solid color-mix(in srgb, currentColor 55%, transparent); }\nhtml[data-dbk] :is(.dbk-hist-key, .dbk-hist-grid) i.is-o { background: color-mix(in srgb, currentColor 12%, transparent); }\nhtml[data-dbk] .dbk-hist-grid i.is-f { visibility: hidden; }\nhtml[data-dbk] .dbk-hist-grid { display: grid; grid-template-rows: repeat(7, 9px); grid-auto-flow: column; grid-auto-columns: 1fr; gap: 3px 4px; }\nhtml[data-dbk] .dbk-hist-grid i { width: 100%; }\n/* Look: text size, five A's from small to large */\nhtml[data-dbk] .dbk-look-ts { display: flex; justify-content: center; align-items: flex-end; gap: 8px; margin-top: 6px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-tsb { all: unset; box-sizing: border-box; cursor: pointer; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); border-radius: 8px; font-family: var(--dbk-serif); line-height: 1; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-tsb[aria-checked=\"true\"] { border-color: currentColor; box-shadow: inset 0 0 0 1px currentColor; }\nhtml[data-dbk] .dbk-look-tsb:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n\n/* Accessibility: a visible focus ring for keyboard users everywhere, and calmer motion for people who ask their phone for it */\nhtml[data-dbk] :focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n@media (prefers-reduced-motion: reduce) {\n  html[data-dbk] *, html[data-dbk] *::before, html[data-dbk] *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }\n}\n\n/* bingo squares never split a word: long words shrink a little instead */\nhtml[data-dbk]:not(#z):not(#y) .bingo-cell { overflow-wrap: normal !important; word-break: normal !important; hyphens: manual !important; }\n\n/* Work pop-ups: moving to another view inside an open pop-up swaps the content without fading in again,\n   and a \"‹ Posted\"-style button in the header goes back where you came from */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.wb-sheet, .wrc-sheet).wb-swap { animation: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wb-back { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; min-height: 36px; padding: 0 10px 0 4px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .05em; color: inherit; opacity: .85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wb-back:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wrc-sheet > .wb-back { position: absolute; left: 14px; top: 14px; z-index: 3; }   /* scrolls away with the content, never floats over it */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wrc-overlay.wb-keeptop { justify-content: flex-start !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wrc-overlay.wb-keeptop::before, html[data-dbk]:not(#z):not(#y):not(#x) .wrc-overlay.wb-keeptop::after { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wrc-overlay.wb-keeptop > .wrc-sheet { margin-top: 0 !important; margin-bottom: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wb-sheet:has(.wb-back) .wb-pop-title, html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wrc-sheet:has(#wrcBack) .wrc-titlein { margin-top: 30px !important; }\n\n/* \"Need an idea?\": two real buttons (outline + one filled), never underlined words */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wb-pfoot { display: flex !important; justify-content: center !important; gap: 10px !important; flex-wrap: wrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wb-pbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 0 18px; border: 1px solid currentColor; border-radius: 6px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .06em; color: inherit; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wb-pbtn.wb-psolid { background: var(--dbk-fill, var(--dbk-green)); border-color: var(--dbk-fill, var(--dbk-green)); color: var(--dbk-cream); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .wb-pbtn.wb-psolid { background: #8fc98a; border-color: #8fc98a; color: #0c1118; }\nhtml[data-dbk] .wb-pbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n\n/* The capture bar sits a hair higher, the same on every page (phone and desktop), still fixed at the bottom */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.dbk-capbar-global, .capture-sticky-bar) { padding-bottom: calc(12px + var(--dbk-safe-bottom, env(safe-area-inset-bottom, 0px))) !important; }\n\n/* Inbox menus: always open downward, drawn above the notes list so nothing clips them */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-menu.is-fixed { position: fixed !important; transform: none !important; bottom: auto !important; right: auto !important; z-index: 100001 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.dbk-capbar-global, .capture-sticky-bar) .capture-bar-send { min-height: 0 !important; height: 34px !important; }   /* same size on every page (Lists made it taller) */\n/* Meals › Recipes search in dark looks: a faint fill of its own from the start, so the \"never a black text box\" fix\n   has nothing to change after the view appears (it used to switch color a moment after opening Recipes) */\nhtml[data-dbk=\"p2\"][data-dbk-page=\"meal-plan\"]:not(#z) .rb-search { background: rgba(255,255,255,.12) !important; border-radius: 6px 6px 0 0 !important; }\n\n/* History rows read as plain text (not small capitals) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hist-top :is(.dbk-hist-nm, .dbk-hist-st) { text-transform: none !important; font-variant: normal !important; letter-spacing: 0 !important; font-family: var(--dbk-serif) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hist-top .dbk-hist-st { font-size: 14px !important; }\n\n/* The month's challenge: the whole section is centered, the tick box sits at the start of the centered text */\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) .dbk-chal-row { display: block !important; text-align: center !important; max-width: 30rem; margin: 0 auto; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) .dbk-chal-row .dbk-chal-box { display: inline-block !important; vertical-align: -3px; margin: 0 10px 0 0 !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) .dbk-chal-row .dbk-chal-text { display: inline !important; text-align: center !important; }\nhtml[data-dbk][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge :is(.dbk-chal, .dbk-chal-links, .dbk-chal-note) { text-align: center !important; justify-content: center !important; align-items: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hist-top, html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hist-top * { color: inherit !important; }\n\n/* moon pop-up: the day's note, then a line for the sign the moon is in */\n/* About: the copyright line, as small as it can comfortably be */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-about.dbk-copy { font-size: 12px !important; opacity: .6 !important; margin-top: 14px !important; }\n/* Look: the color choices sit in one row (Stone, Midnight, 2timelines, Your own) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-look-sws { flex-wrap: nowrap !important; justify-content: space-evenly !important; gap: 10px 4px !important; }\n\n/* Habits Up next: centered top to bottom too. With no Done button (tomorrow's step), an equal space above\n   balances the space the button keeps below, so the strip never changes height and the text sits in the middle */\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext .un-done { height: 32px; line-height: 20px; }\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext:not(.un-can)::before, html[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) #scheduleUpNext:not(.un-can)::after { content: ''; display: block; height: 19px; flex: none; }\nhtml[data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x):not(#w) #scheduleUpNext:not(.un-can) .un-done { display: none !important; }\n\n/* Edit Habits: one scroll for the whole pop-up (the list no longer scrolls on its own and traps the scroll) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .habits-modal :is(#habitsList, .habits-list) { overflow: visible !important; max-height: none !important; height: auto !important; }\n\n/* Text boxes: no highlight ring when you click in (the blinking cursor is enough) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(input, textarea, select):focus, html[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(input, textarea, select):focus-visible { outline: none !important; box-shadow: none !important; }\n\n/* No fake bold: the fonts only come in regular (and some in medium), so text asked to be bolder got thickened by\n   the browser and looked smudgy (Lists tiles, Habits resource names, Copied!). That text is regular now, and the\n   browser never thickens a font on its own anywhere in the app */\nhtml[data-dbk]:not(#z):not(#y):not(#x) body.rl :is(.rl-tile-nm, .rl-tile-cnt, .rl-tile-next, .rl-tile-next em) { font-weight: 400 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.resource-name, .copy-toast) { font-weight: 400 !important; }\nhtml[data-dbk] * { font-synthesis-weight: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) body.rl :is(.rl-tile-next, .rl-tile-nm, .rl-tile-cnt) { text-wrap: balance; }\n\n/* Inbox: Tag, Send to, edit and delete sit on the left, lined up with the note's text */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .ibx-acts { justify-content: flex-start !important; }\n/* Typing is always left-aligned: the cursor and what you type start at the left of every text box */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(input:not([type]), input[type=\"text\"], input[type=\"search\"], input[type=\"email\"], input[type=\"url\"], input[type=\"tel\"], input[type=\"password\"], input[type=\"number\"], textarea) { text-align: left !important; text-align-last: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(input, textarea)::placeholder { text-align: left !important; text-align-last: left !important; }\n\n/* Pop-up headings sit on the pop-up itself with a thin line under them (like Reminders), never on a dark strip */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.section-modal-header, .modal-header, .inbox-modal-header, .seasonal-modal-header) { background: transparent !important; color: inherit !important; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.section-modal-header, .modal-header, .inbox-modal-header, .seasonal-modal-header) :is(h1, h2, h3, h4, span, button, a, [class*=\"title\"], [class*=\"close\"], .section-modal-back) { color: inherit !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .modal-header .portion-tag { border-color: color-mix(in srgb, currentColor 40%, transparent) !important; color: inherit !important; }\n\n/* Desktop: a reminder's \"3 days overdue\" and an event's Work tag sit to the right of the item, on the same line */\n@media (min-width: 769px) {\n  html[data-dbk]:not(#z):not(#y):not(#x) .hc-rem-main { display: flex !important; align-items: baseline; gap: 12px; flex-wrap: wrap; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .hc-rem-main .hc-rem-when { margin: 0 !important; display: inline !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .hc-ev { grid-template-columns: 78px auto minmax(0,1fr) !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .hc-ev .hc-t { display: contents !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x) .hc-ev .hc-title { order: 1; }\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hc-ev .hc-t .dbk-wtag { order: 2; display: inline-block !important; justify-self: start; align-self: center; margin: 0 0 0 4px !important; }\n}\n/* Weather only where the US National Weather Service covers the household's location (see daybook-theme.js) */\nhtml.dbk-no-wx #weatherWidget, html.dbk-no-wx .dbk-wx-chip, html.dbk-wx-wait #weatherWidget { display: none !important; }\n\n/* Edit reminder: Delete and Save side by side (Delete outline, Save the one filled button) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #editReminderOverlay .form-actions { display: flex !important; flex-direction: row !important; flex-wrap: nowrap !important; justify-content: center !important; align-items: stretch !important; gap: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #editReminderOverlay .form-actions > * { flex: none !important; width: auto !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(#editReminderOverlay, #addEventModalOverlay) .dbk-rem-delbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; padding: 7px 16px; border-radius: 4px; border: 1px solid color-mix(in srgb, var(--bx-danger, #9b4a5a) 55%, transparent); background: transparent; color: var(--bx-danger, #9b4a5a); font-family: var(--dbk-caps); font-size: 15px; letter-spacing: 0.03em; line-height: 1.2; text-align: center; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) :is(#editReminderOverlay, #addEventModalOverlay) .dbk-rem-delbtn { color: #e79aa9; border-color: rgba(231,154,169,.55); }\nhtml[data-dbk] :is(#editReminderOverlay, #addEventModalOverlay) .dbk-rem-delbtn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* Habits step: Delete this step (outline) and Save (filled) side by side */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .rt-sheet .rt-actions { display: flex; flex-wrap: nowrap; justify-content: center; align-items: center; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .rt-sheet .rt-actions .rt-save { padding: 9px 28px !important; }\n\n/* dark looks: ticked bingo squares keep the same readable label as the others, not tiny capitals */\nhtml[data-dbk=\"p2\"][data-dbk-page$=\"-hub\"]:not(#z):not(#y):not(#x) :is(.bingo-cell.completed, .bingo-cell.in-bingo) { font-family: var(--dbk-serif) !important; font-size: 17px !important; text-transform: none !important; font-variant: normal !important; letter-spacing: 0 !important; }\n\n/* every pop-up: the page behind it blurred under a soft shade of the look's darkest color (tagged by popScrims in daybook-theme.js).\n   Same shade and blur as the pop-ups listed under \"Pop-ups, lighter and smaller\". Dark looks use a near-black\n   that the look system turns into its own deepest shade (2timelines: dark brown, not red). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) [data-dbk-scrim] { -webkit-backdrop-filter: var(--dbk-pop-blur) !important; backdrop-filter: var(--dbk-pop-blur) !important; background-color: var(--dbk-pop-veil) !important; }\n\n/* the page name at the top is centered on its own: the little arrow sits beside it without pushing it over */\n/* (the arrow stays inside the button: the menu row hides anything past the button's edge, which cut half the arrow\n   off on an iPhone; the same room on both sides keeps the name centered) */\nhtml[data-dbk]:not(#z):not(#y) nav.top-nav .dbk-title-btn { position: relative; gap: 0 !important; padding: 0 18px !important; }\nhtml[data-dbk]:not(#z):not(#y) nav.top-nav .dbk-title-chev { position: absolute; left: calc(100% - 11px); top: 50%; margin-top: -4px; }\n\n/* pop-up titles centered on the pop-up itself, not on the space left beside the x */\nhtml[data-dbk]:not(#z):not(#y) :is(.modal-header, .day-modal-header, .reminder-modal-header, .habits-modal-header, .seasonal-modal-header, .section-modal-header) :is(h2, h3, .meta) { padding-left: 0 !important; padding-right: 0 !important; }\n/* the recipe: no line between the nutrition and the serving size */\nhtml[data-dbk]:not(#z):not(#y) #modal .portions-row { border-top: 0 !important; }\n\n/* typing in any text box is always left-aligned (the design rule), whatever older rules above say */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(input[type=\"text\"], input[type=\"search\"], input[type=\"email\"], input[type=\"url\"], input[type=\"tel\"], input[type=\"password\"], input:not([type]), textarea) { text-align: left !important; text-align-last: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(input[type=\"text\"], input[type=\"search\"], input[type=\"email\"], input[type=\"url\"], input[type=\"tel\"], input[type=\"password\"], input:not([type]), textarea)::placeholder { text-align: left !important; }\n\n/* Weather pop-up (the designer, Oct 19):\n   - the temperature is centered on its number; the degree sign sits beside it without pushing it over\n   - an official statement opens inside the pop-up's own scroll (no scroll box of its own that traps the scroll),\n     and the whole statement is centered: icon, name, until when, and the text\n   - the Rain map button a little smaller */\nhtml[data-dbk]:not(#z):not(#y) .dbk-wx-num { position: relative; display: inline-block; }\nhtml[data-dbk]:not(#z):not(#y) .dbk-wx-deg { position: absolute; left: 100%; top: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-alt { max-height: none !important; overflow: visible !important; padding: 0 4px 12px !important; text-align: center !important; text-wrap: pretty; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-al summary { flex-direction: column; justify-content: center; gap: 4px; padding: 12px 2px; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-al summary span { flex: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-mapbtn { gap: 6px; margin-top: 10px; padding: 4px 12px; font-size: 13px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-mapbtn svg { width: 15px; height: 15px; }\n/* weather: Change location is an outline button, not an underlined word */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-wxB .dbk-info-link { display: block; width: max-content; margin: 18px auto 0; padding: 6px 14px !important; border: 1px solid currentColor !important; border-radius: 6px; text-decoration: none !important; font-size: 14px; }\n\n/* Back Burner: tap the words to change them */\nhtml[data-dbk]:not(#z):not(#y) .dbk-later-item:not(.done) label span { cursor: text; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-edit { all: unset; box-sizing: border-box; flex: 1; min-width: 0; padding: 2px 0; font: inherit; color: inherit; text-align: left; border-bottom: 1px solid currentColor; caret-color: currentColor; }\n/* Tonight's plan with nothing planned: Plan dinner is the pop-up's one button, so it's filled */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .mcp-pop .mcp-planit .mcp-done { background: #2f3a2c; color: #f3eee4; border-color: #2f3a2c; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .mcp-pop .mcp-planit .mcp-done { background: #8fc98a; color: #06080b; border-color: #8fc98a; }\n/* Today's calendar on a computer: the day the arrow keys are on gets a ring around its number (the browser's own\n   box around the whole cell is not used) */\nhtml[data-dbk-page=\"index\"]:not(#z):not(#y):not(#x) .hc-day:focus-visible { outline: none; }\nhtml[data-dbk-page=\"index\"]:not(#z):not(#y):not(#x) .hc-day:focus-visible .hc-n { outline: 2px solid currentColor; outline-offset: 3px; }   /* the number's own color, which the readability check keeps readable on every card */\n/* ═══════════ POP-UPS: ONE LAYOUT EVERYWHERE (the designer, Oct 19) ═══════════\n   Every pop-up in the app follows the same few rules, so a fix is made once, here:\n   - the title centered, with a short line right under its words (see POP-UP TITLES below)\n   - small labels and section headings centered, all in the same small capitals, the same size and spacing\n     (18px above, 6px down to their field), in the text's own color\n   - text boxes: a soft filled box, a little lighter than the pop-up, full width, typing on the left, no focus ring\n   - a checkbox sits 12px from its words\n   - groups of choices (pills, stars, the meal types) are centered\n   - buttons: one filled, the rest outline (rules further up)\n   Pop-up boxes this covers: */\nhtml[data-dbk] { --pop-lab-size: 14px; --pop-lab-gap: 18px; --pop-lab-to-field: 6px; }\n/* labels and section headings */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .wrc-sheet, .dbk-infocard, .dbk-catcard, .rt-sheet, .habits-modal, .edit-reminder-modal, .reminder-modal, .day-modal, #addEventModalOverlay .modal, #goals-modal .modal, #add-recipe-modal .modal, #add-snack-modal .modal, #meal-picker-modal .modal, #modal .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .tp-pop, #resourceForm, .ai-panel)\n  :is(.rf-lab, .mjr-lab, .fin-label, .wrc-label, .wb-label:not(.wb-stat .wb-label), .setting-label-inline, .biz-field-label, .tp-label, .rl-lbl, .mpr-lbl, .dbk-jd-label, .rf-macros label > span, .dbk-sx-gl, .dbk-loc-lab,\n      label:not(:has(input, select, textarea)):not(.rf-serve label):not(.checkbox-label):not(.allday-label):not([class*=\"toggle\"]):not([class*=\"switch\"]):not([class*=\"chip\"]):not([class*=\"day\"]),\n      #modal .modal-section > h4):not(:empty) {\n  display: block !important; text-align: center !important; text-transform: none !important;\n  font-family: var(--dbk-caps, serif) !important; font-size: var(--pop-lab-size) !important; font-weight: 400 !important; font-style: normal !important;\n  letter-spacing: 0.06em !important; line-height: 1.3 !important; color: inherit !important; opacity: 0.82 !important;\n  margin: var(--pop-lab-gap) 0 var(--pop-lab-to-field) !important; padding: 0 !important; border: 0 !important; background: none !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.dbk-infocard, .fin-sheet, .wrc-sheet, .mprj-pop) :is(.setting-label-inline, .fin-label, .wrc-label, .wb-label, .rf-lab, .mjr-lab, label):empty { display: none !important; }\n/* text boxes */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .wrc-sheet, .dbk-infocard, .dbk-catcard, .rt-sheet, .habits-modal, .edit-reminder-modal, .reminder-modal, .day-modal, #addEventModalOverlay .modal, #goals-modal .modal, #add-recipe-modal .modal, #add-snack-modal .modal, #meal-picker-modal .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .tp-pop, #resourceForm, .ai-panel)\n  :is(input[type=\"text\"]:not(.wrc-titlein):not(.habit-item input):not(.wb-stats input), input[type=\"email\"], input[type=\"tel\"], input[type=\"url\"], input[type=\"number\"]:not(.wb-stats input), input[type=\"password\"], input[type=\"time\"], input[type=\"date\"], input:not([type]):not(.wrc-titlein):not(.habit-item input):not(.wb-stats input), textarea:not(.wrc-titlein)) {\n  background: rgba(255,255,255,0.55) !important; border: 1px solid rgba(47,58,44,0.22) !important; border-radius: 6px !important;\n  text-align: left !important; outline: none !important; box-shadow: none !important; box-sizing: border-box !important;\n}\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .wrc-sheet, .dbk-infocard, .dbk-catcard, .rt-sheet, .habits-modal, .edit-reminder-modal, .reminder-modal, .day-modal, #addEventModalOverlay .modal, #goals-modal .modal, #add-recipe-modal .modal, #add-snack-modal .modal, #meal-picker-modal .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .tp-pop, #resourceForm, .ai-panel)\n  :is(input[type=\"text\"]:not(.wrc-titlein):not(.habit-item input):not(.wb-stats input), input[type=\"email\"], input[type=\"tel\"], input[type=\"url\"], input[type=\"number\"]:not(.wb-stats input), input[type=\"password\"], input[type=\"time\"], input[type=\"date\"], input:not([type]):not(.wrc-titlein):not(.habit-item input):not(.wb-stats input), textarea:not(.wrc-titlein)) {\n  background: rgba(255,255,255,0.06) !important; border-color: rgba(230,234,239,0.22) !important;\n}\n/* boxes that used to be a bare underline get the same inside room as the others */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.rt-sheet, #rlPopBox, .rl-pop-box, #goals-modal .modal, .habits-modal) :is(input[type=\"text\"], input[type=\"number\"], input[type=\"time\"], input:not([type]), textarea):not(.habit-item input) { padding: 9px 12px !important; }\n/* a checkbox sits 12px from its words */\n/* (a tick that is hidden stays hidden: this rule made Money's \"Remind me 30 days before\" show on monthly bills, Oct 24) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.mprj-pop, .fin-sheet, .wrc-sheet, .dbk-infocard, .edit-reminder-modal, .reminder-modal, #addEventModalOverlay .modal, #add-recipe-modal .modal, .dream-form > form, .tp-pop) :is(label, .checkbox-label):has(> input[type=\"checkbox\"]):not([class*=\"toggle\"]):not([class*=\"switch\"]):not([hidden]) { display: flex !important; align-items: center !important; gap: 12px !important; }\n/* ...and lines up with the first line of its words, not the middle of all of them (Kasey, Oct 22: Money's \"Hide from\n   totals\" has a small line under it, and the box sat between the two). The label's line height is measured where the\n   label is (--dbk-tick-lh, registered below so 1lh is the label's, not the box's) and the box is moved down by half of\n   what that line has over the box's own height, so a one-line tick looks exactly as before. */\n@property --dbk-tick-lh { syntax: '<length>'; inherits: true; initial-value: 0px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.mprj-pop, .fin-sheet, .wrc-sheet, .dbk-infocard, .edit-reminder-modal, .reminder-modal, #addEventModalOverlay .modal, #add-recipe-modal .modal, .dream-form > form, .tp-pop) :is(label, .checkbox-label):has(> input[type=\"checkbox\"]):not([class*=\"toggle\"]):not([class*=\"switch\"]):not([class*=\"chip\"]) { align-items: flex-start !important; --dbk-tick-lh: 1lh; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.mprj-pop, .fin-sheet, .wrc-sheet, .dbk-infocard, .edit-reminder-modal, .reminder-modal, #addEventModalOverlay .modal, #add-recipe-modal .modal, .dream-form > form, .tp-pop) :is(label, .checkbox-label):not([class*=\"toggle\"]):not([class*=\"switch\"]):not([class*=\"chip\"]) > input[type=\"checkbox\"] { align-self: flex-start !important; margin-top: calc((var(--dbk-tick-lh) - 18px) / 2) !important; margin-bottom: 0 !important; }\n/* groups of choices and star ratings: centered */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.rf-types, .rf-serve, .rf-scope-btns, .mjr-chips, .mprj-pick, .rl-starpick, .fin-chiprow, .tried-stars, .tried-modal-stars, .wrc-sheet .wrc-chiprow, .wrc-sheet .wrc-chips) { justify-content: center !important; margin-left: 0 !important; margin-right: 0 !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.mprj-pop, #rlPopBox, .rl-pop-box) { text-align: center !important; }\n/* the title of a rating or journal pop-up: centered, thin line under it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) #mprjPop .mprj-when, html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(#rlPopBox, .rl-pop-box) .rl-pop-h { padding-bottom: 12px !important; margin-bottom: 4px !important; border-bottom: 1px solid rgba(47,58,44,0.16) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) #mprjPop .mprj-when, html[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(#rlPopBox, .rl-pop-box) .rl-pop-h { border-bottom-color: rgba(230,234,239,0.16) !important; }\n\n/* No underlined words as buttons (the design rule): the little text links on Today and its pop-ups are small outline\n   buttons instead, in the text's own color, side by side with an even gap (the dots between them go) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hm-link { display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box; min-height: 30px; padding: 4px 12px; border: 1px solid currentColor; border-radius: 999px; text-decoration: none !important; font-size: 0.9rem; line-height: 1.2; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hm-link:hover { opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hm-center, .hc-add, .dbk-season-foot) { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hm-center, .hc-add, .dbk-season-foot) > .hm-sep { display: none; }\n\n/* Softer boxes everywhere (the designer, Oct 19: \"all of the drop down menus & stuff more curved, like the reminder's date\n   box\"): every text box, drop-down, date and time picker gets the same 10px curve, and the date box is as tall as\n   the boxes beside it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(select, textarea, input:not([type]), input[type=\"text\"], input[type=\"search\"], input[type=\"email\"], input[type=\"url\"], input[type=\"tel\"], input[type=\"number\"], input[type=\"password\"], input[type=\"date\"], input[type=\"time\"], input[type=\"datetime-local\"], input[type=\"month\"], .hh-dp-trigger, .dbk-dd-btn) { border-radius: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hh-dp-trigger { min-height: 42px; box-sizing: border-box; }\n\n/* Trip planner: a day's ⋯ menu is a tidy column of small outline buttons, all the same width, with even room\n   between them (they were tall, uneven and almost touching); side by side on a computer. The title gets the\n   pop-up's thin line, and the last stop of a day has no line under it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-pop .tp-menu { display: grid !important; grid-template-columns: 1fr; justify-content: center; gap: 10px !important; margin: 4px auto 2px; width: max-content; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-pop .tp-menu .tp-linkbtn { display: inline-flex !important; align-items: center; justify-content: center; box-sizing: border-box; min-width: 170px; min-height: 36px !important; padding: 6px 16px !important; border: 1px solid currentColor !important; border-radius: 999px !important; font-size: 15px !important; line-height: 1.2; text-decoration: none !important; opacity: 1; }\n/* two side by side on a phone too (the designer: never stacked when they fit); an odd one out sits centered under them */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-menu { grid-template-columns: repeat(2, 1fr); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-menu .tp-linkbtn:last-child:nth-child(odd) { grid-column: 1 / -1; justify-self: center; width: calc(50% - 5px); }\n@media (max-width: 699px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-menu .tp-linkbtn { min-width: 0 !important; } }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop .tp-pop-h { padding-bottom: 12px !important; margin-bottom: 14px; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .tp-stop:not(:has(~ .tp-stop)) { border-bottom: 0 !important; }   /* the day's last stop */\n/* the moon pop-up's three facts: side by side, each label right under its value */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-moon-trio { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 0 28px; margin: 16px 0 2px; padding-top: 14px; border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent); text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-moon-trio b { display: block; font-weight: 400; font-family: var(--dbk-serif); font-size: 18px; line-height: 1.3; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-moon-trio small { display: block; margin-top: 2px; font-family: var(--dbk-caps); font-size: 13px; letter-spacing: 0.05em; opacity: 0.75; }\n\n/* ═══════════ Weather pop-up in cards (the designer, Oct 19): easy to skim ═══════════\n   One soft card per part (official statements, right now, the next 24 hours, today), each with its heading\n   centered on top; nothing boxed inside a card. Two places switch with the pills under the title. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-infocard.dbk-wxB { max-width: 440px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-card { margin: 12px 0 0; padding: 14px 14px 16px; border-radius: 12px; background: rgba(var(--info-ink), 0.06); text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-h { margin: 0 0 8px; padding: 0; font-family: var(--dbk-caps, serif); font-size: var(--pop-lab-size, 14px); font-weight: 400; letter-spacing: 0.06em; line-height: 1.3; color: inherit; opacity: 0.82; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-big { margin-top: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-info-sub { margin-top: 6px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-rain { margin-top: 8px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-mapbtn { margin-top: 12px; }\n/* the next hours: a row you can slide sideways inside its card (no lines above and below, the card frames it) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-hours { margin: 0 -6px; padding: 4px 0 0; border: 0; scroll-snap-type: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-hours > div { scroll-snap-align: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-trio { margin-top: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-sun { justify-content: center; gap: 28px; margin-top: 14px; flex-wrap: wrap; }\n/* official statements: one card, each statement a centered row that opens in place */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-als { padding-top: 4px; padding-bottom: 4px; border: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-al { border: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-al + .dbk-wx-al { border-top: 1px solid rgba(var(--info-ink), 0.14); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-al summary { padding: 10px 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-alt { padding: 0 2px 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-wait { margin: 4px 0; font-family: var(--dbk-serif); font-style: italic; font-size: 16px; text-wrap: balance; }\n/* two places: small pills under the title */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-locs { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px 0 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-loc { all: unset; box-sizing: border-box; cursor: pointer; padding: 5px 14px; border-radius: 999px; border: 1px solid currentColor; font-family: var(--dbk-serif); font-size: 15px; line-height: 1.3; max-width: 100%; text-align: center; opacity: 0.7; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-loc[aria-selected=\"true\"] { opacity: 1; border-width: 2px; padding: 4px 13px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-loc:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* the buttons at the end: outline, fitting their words; side by side (a second line only when they don't fit) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-acts { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-btn { all: unset; box-sizing: border-box; cursor: pointer; padding: 6px 14px; border: 1px solid currentColor; border-radius: 6px; font-family: var(--dbk-caps, serif); font-size: 14px; letter-spacing: 0.04em; line-height: 1.3; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wxB .dbk-wx-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* a sideways row inside a pop-up never holds on to an up-and-down scroll: only that direction is kept in it */\nhtml.dbk-pop-open[data-dbk]:not(#z):not(#y):not(#x) .dbk-wx-hours { overscroll-behavior-y: auto; overscroll-behavior-x: contain; }\n\n/* Edit event's start and end times on an iPhone (the designer, Oct 19: the end box ran off the pop-up's edge). Safari draws\n   a time box at its own width unless told not to: the same rules the New Event form uses, so both boxes share the\n   row evenly, an empty one keeps its height, and typing sits on the left like every other box */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dayModalOverlay .hc-ed-times { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dayModalForm input[type=\"time\"] { -webkit-appearance: none !important; appearance: none !important; display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; min-height: 44px; }\nhtml[data-dbk] #dayModalForm input[type=\"time\"]::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }\n\n/* weather statements (the designer, Oct 19): no warning sign on Today's button; in the pop-up it sits beside the statement's\n   name, not above it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wx-al summary b > svg { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; margin-right: 7px; flex: none; color: #b4483c; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-wx-al summary b > svg { color: #e79aa9; }\n\n/* ═══════════ POP-UP TITLES: a short line right under the words (the designer, Oct 19) ═══════════\n   \"an underline under the title... not a line that takes up the full width of the pop-up, just right under the title\".\n   No pop-up draws a line across itself under the title any more; the title itself gets a thin line under it, as wide\n   as its longest line (one line even when the title takes two). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.modal-header, .reminder-modal-header, .habits-modal-header, .section-modal-header, .inbox-modal-header, .inbox-header-top, .seasonal-modal-header, .seasonal-header, .day-modal-header, .dbk-setx-h, #mprjPop .mprj-when, .rl-pop-h, .tp-pop-h) { border-bottom: 0 !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.modal-header :is(.modal-title, h2, h3), .reminder-modal-title, .habits-modal-title, .inbox-modal-title, #dayModalTitle, .day-modal-header :is(h2, h3), .section-modal-title, .seasonal-modal-title, .tried-modal-title, .dbk-setx-h, .dbk-info-title, .detail-popup-title, .fin-sheet > h3:first-of-type, .wb-pop-title, #mprjPopT, #mprjPop .mprj-when, .rl-pop-h, .tp-pop-h > span, .dream-form form > h3) {\n  display: block !important; width: fit-content !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important;\n  padding-bottom: 6px !important; border-bottom: 0 !important; text-decoration: none !important; box-sizing: border-box !important;\n}\n/* titles that kept room for the x as padding: the line hugs the words; the title stays clear of the x by width instead */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.detail-popup-title, .dbk-setx-h, .wb-pop-title, .dbk-info-title, .rl-pop-h, .fin-sheet > h3:first-of-type) { padding-left: 0 !important; padding-right: 0 !important; max-width: calc(100% - 76px) !important; }\n/* the weather pop-up's two buttons fit side by side on a phone (the designer: no buttons stacked on top of each other) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-wxB .dbk-wx-acts { gap: 8px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-wxB .dbk-wx-btn { padding: 5px 12px; font-size: 13px; letter-spacing: 0.03em; }\n\n/* Changing words in place (Back Burner items, Today's Three, Work's Three): no visible box at all, just the cursor in\n   the words (the designer, Oct 19). The softer-boxes rule above rounded the old underline into a box shape. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) :is(.dbk-later-edit, .hm .thing-edit-input, [data-threein]) { border: 0 !important; border-radius: 0 !important; background: none !important; box-shadow: none !important; outline: none !important; -webkit-appearance: none !important; appearance: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .dbk-later-edit { padding: 0 !important; margin: 0 !important; line-height: inherit !important; }\n\n/* Trip planner, calmer (the designer, Oct 19: \"feels like a lot\"): the day's name is the way to rename it (it reads as text,\n   not a button); naming and moving a day live in its ⋯ menu, in two small groups */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 .tp-dh-t { all: unset; box-sizing: border-box; cursor: pointer; display: block; font-family: var(--dbk-serif, 'Playfair Display'), Georgia, serif; font-size: 20px; line-height: 1.25; color: inherit !important; -webkit-text-fill-color: currentColor; text-align: center; }\nhtml[data-dbk=\"p1\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 .tp-dh-t { font-family: 'Playfair Display', Georgia, serif; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 .tp-dh-t:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 4px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-pop .tp-menu-l { text-align: center; margin: 2px 0 8px; opacity: .8; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-pop .tp-menu + .tp-menu-l { margin-top: 18px; }\n/* the day's name and the trip's dates read as quiet words, not small capitals */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 .tp-dh-t { font-variant: normal !important; text-transform: none !important; letter-spacing: normal !important; font-family: var(--dbk-serif, 'Lora'), Georgia, serif !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-meta, html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-meta .tp-meta-l { font-family: var(--dbk-serif, 'Lora'), Georgia, serif !important; font-variant: normal !important; text-transform: none !important; letter-spacing: normal !important; font-size: 15px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 .tp-dh-t { width: 100% !important; text-align: center !important; justify-content: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-dayhead2 { margin: 10px 0 12px !important; }   /* room above and below the day, so the stops start clearly under it */\n\n/* Habits > Resources: fewer buttons (the designer, Oct 19). An open category has a + (add a resource) and a bin (delete the\n   category, with Undo) in its header, next to the arrow; closed ones show just the name and the arrow */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .resource-header { display: flex !important; align-items: center !important; gap: 4px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .resource-header .resource-name { flex: 1 1 auto; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .resource-header .resource-arrow { position: static !important; margin-left: 6px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-res-ico { all: unset; box-sizing: border-box; cursor: pointer; display: none; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; color: inherit; flex: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .resource-category.active > .resource-header .dbk-res-ico { display: inline-flex; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-res-ico:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-res-ico svg { display: block; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-res-del { color: var(--bx-danger, #a5485a); }\n\n/* Meals: one spot in the menu; its sections are one quiet row of tabs at the top of the page (the designer, Oct 19) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs { display: flex; gap: 2px; justify-content: center; max-width: 440px; margin: 14px auto 4px; padding: 3px; box-sizing: border-box; border: 1px solid rgba(47,58,44,.28); border-radius: 999px; width: calc(100% - 32px); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs { border-color: rgba(230,234,239,.28); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs button { all: unset; box-sizing: border-box; cursor: pointer; flex: 1 1 0; min-width: 0; text-align: center; padding: 7px 6px; border-radius: 999px; font-family: var(--dbk-caps); font-size: 14px; letter-spacing: .03em; white-space: nowrap; color: inherit; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs button.on { background: #2f3a2c; color: #f3eee4; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs button.on { background: #8fc98a; color: #0c1118; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs button:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkMealTabs ~ #plan-view .mpr-plan { margin-top: 10px !important; }   /* the plan used to tuck up under the top bar; it sits under the tabs now */\n\n/* Settings > Recently removed: a plain list, each row its kind, its name and when, with a put-back icon */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-empty { margin: 14px 0 4px; text-align: center; font-family: var(--dbk-serif); font-size: 16px; opacity: .85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent); text-align: left; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-t { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-k { font-family: var(--dbk-caps); font-size: 12.5px; letter-spacing: .05em; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-n { font-family: var(--dbk-serif); font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-n em { font-size: 14px; opacity: .75; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-w { font-family: var(--dbk-serif); font-style: italic; font-size: 13.5px; opacity: .72; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-put { all: unset; box-sizing: border-box; cursor: pointer; flex: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 50%; border: 1px solid color-mix(in srgb, currentColor 40%, transparent); color: inherit; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-rr-put:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n\n/* ═══════════ ACCOUNT (sign-in screen, Settings > Account, Remove partner; dbk-account.js, household.js) ═══════════\n   The sign-in screen gets Create account; its buttons fit their words (Sign in filled, the two quiet choices\n   outline and side by side), the password box has a show/hide eye, and the note under the title says who the\n   first account is. Settings > Account: everything centered, forms use the shared pop-up labels and boxes. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-btn { display: block; width: auto; min-width: 9em; margin: 4px auto 0; padding: 12px 28px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box > p#loginSubtitle { margin-bottom: 14px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .dbk-acc-note { margin: 0 0 18px; font-size: 0.92em; line-height: 1.45; text-wrap: balance; color: inherit; opacity: 0.85; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin #loginForgot { margin: 18px 0 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin #loginResetSent { text-wrap: balance; line-height: 1.45; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin #loginError { text-wrap: balance; line-height: 1.45; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-acts { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-ol { all: unset; box-sizing: border-box; cursor: pointer; padding: 7px 14px; border: 1px solid currentColor; border-radius: 10px; font-family: inherit; font-size: 0.92rem; line-height: 1.25; text-align: center; color: inherit; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-ol:focus-visible, html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-eye:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\n/* a show/hide eye inside a password box */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-pw { position: relative; display: block; width: 100%; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-pw > input { width: 100% !important; padding-right: 46px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-eye { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; color: inherit; opacity: 0.7; border-radius: 8px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-password-box .dbk-acc-pw { margin-bottom: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-password-box .dbk-acc-pw > input { margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-password-box .dbk-acc-eye { top: 50%; }\n/* Settings > Account */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc { text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-p { margin: 4px 0 0; line-height: 1.5; text-wrap: balance; overflow-wrap: anywhere; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-p b { font-weight: 600; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-row { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; margin: 16px 0 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-row .btn { margin: 0 !important; width: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc input { display: block; width: 100%; padding: 10px 12px; font-size: 16px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-msg { margin: 12px 0 0; min-height: 0; line-height: 1.45; text-wrap: balance; color: var(--bx-danger, #a5485a); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-msg { color: #e79aa9; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-msg.good { color: inherit; font-style: italic; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-msg:empty { display: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-small { margin: 16px 0 0; font-size: 0.88rem; font-style: italic; opacity: 0.8; line-height: 1.45; text-wrap: balance; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-acc-wait { font-style: italic; }\n/* Settings > Household: Remove (partner), an outline button under the status */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #sec-household .dbk-hh-remove { display: flex; justify-content: center; margin-top: 4px; }\n/* on a phone the sign-in box keeps less inside room, so its two outline buttons sit side by side */\n@media (max-width: 520px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box { width: calc(100% - 32px) !important; padding: 36px 14px !important; box-sizing: border-box; } }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .dbk-acc-ol { font-size: 0.86rem; padding: 7px 11px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .dbk-acc-acts { gap: 8px; }\n/* Settings > Account buttons: one size, filled or outline, so a pair side by side lines up (beats the Settings\n   outline-button rule above, which centers each one on its own line) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-setx-in .dbk-acc .dbk-acc-row .btn { display: inline-flex !important; align-items: center !important; justify-content: center !important; box-sizing: border-box !important; height: 40px !important; min-height: 0 !important; width: auto !important; margin: 0 !important; padding: 0 10px !important; font-size: 14px !important; line-height: 1.2 !important; border: 1px solid currentColor !important; border-radius: 6px !important; white-space: nowrap !important; flex: 0 0 auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-setx-in .dbk-acc .dbk-acc-row .btn:not(.btn-secondary) { border-color: transparent !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-setx-in .dbk-acc .dbk-acc-row .btn.dbk-acc-danger { color: var(--lh-secondary, #9b5a62) !important; }\n/* the sign-in box takes the look's own colors, like the app lock (in dark looks it stayed cream with light text) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box { background: rgba(var(--dbk-green-rgb, 47,58,44), 0.04) !important; color: var(--dbk-green, #2f3a2c) !important; border: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), 0.35) !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box :is(h1, p, .lh-password-error) { color: inherit !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box p#loginSubtitle { opacity: 0.8; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-input { background: rgba(var(--dbk-green-rgb, 47,58,44), 0.05) !important; border: 1px solid rgba(var(--dbk-green-rgb, 47,58,44), 0.45) !important; color: inherit !important; text-align: left !important; text-align-last: left !important; outline: none !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-input::placeholder { color: inherit; opacity: 0.6; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-btn { background: var(--dbk-green, #2f3a2c) !important; color: var(--dbk-paper, #f4efe6) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-setx-in .dbk-acc .dbk-acc-row { gap: 10px 8px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc-signin .lh-password-box { padding: 44px 26px; box-sizing: border-box; }\n/* ═══════════ WHAT'S IN SEASON: SHARED POP-UP LAYOUT (icons fix, Oct 20) ═══════════\n   The season pop-up follows POP-UPS: ONE LAYOUT EVERYWHERE: Fruits / Vegetables / Herbs use the shared small-caps\n   label (same tokens: 18px above, 6px down to the pills) and the pills are centered under them. The empty bottom\n   strip is gone: the \"on your grocery list\" line and Done only take room once something has been added. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-group-label {\n  display: block !important; text-align: center !important; text-transform: none !important;\n  font-family: var(--dbk-caps, serif) !important; font-size: var(--pop-lab-size) !important; font-weight: 400 !important; font-style: normal !important;\n  letter-spacing: 0.06em !important; line-height: 1.3 !important; color: inherit !important; opacity: 0.82 !important;\n  margin: var(--pop-lab-gap) 0 var(--pop-lab-to-field) !important; padding: 0 !important; border: 0 !important; background: none !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-group { margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-produce { justify-content: center !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-body { padding-top: 0 !important; padding-bottom: 24px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-card { margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .seasonal-footer:empty { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .seasonal-modal .dbk-season-foot:has(> #dbkSeasonNote:empty):has(> #dbkSeasonDone[hidden]) { display: none !important; }\n/* ===== Today fixes (Oct 20): Back Burner ticks only on its box; calendar events tick off for the day =====\n   Back Burner rows: the box is its own 40px target (label.dbk-later-tick), the words beside it (.dbk-later-words)\n   open the in-place edit: the words themselves become editable (.dbk-later-live), so nothing moves when it opens. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-item label.dbk-later-tick { flex: none; width: 40px; height: 40px; margin: 0 -9px 0 -11px; padding: 0; gap: 0; display: grid; place-items: center; cursor: pointer; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-item label.dbk-later-tick input { width: 18px; height: 18px; margin: 0; cursor: pointer; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-words { flex: 1; min-width: 0; display: flex; align-items: center; padding: 12px 0; font-family: var(--dbk-serif); font-size: 1.05rem; line-height: 1.35; color: var(--dbk-green); text-align: left; cursor: text; outline: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-words:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; border-radius: 4px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-item.done .dbk-later-words { cursor: default; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-text { display: block; min-width: 0; overflow-wrap: anywhere; text-align: left; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .dbk-later-words { color: #e6eaef; }\n/* while changing an item, only the cursor shows: no box, no focus ring */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-later-live { outline: none !important; box-shadow: none !important; background: none !important; caret-color: currentColor; cursor: text; -webkit-user-select: text; user-select: text; }\n\n/* Calendar events on Today (and the day pop-up): a round tick on the right, the same one the reminder line has.\n   Ticked = a check inside the ring and the name struck through. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-evw { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; column-gap: 6px; border-bottom: 1px solid rgba(var(--dbk-green-rgb),0.18); }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) .hc-evw { border-bottom-color: rgba(230,234,239,0.16); }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-evw > .hc-ev { border-bottom: 0 !important; min-width: 0; }\n/* struck through, not faded: a fade dropped the words under the 4.5:1 reading standard in Stone and Midnight */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hc-evw.is-done .hc-title { text-decoration: line-through; }\n/* a ticked event: the ring with a check inside, both in the tick's own ink (the accent, or whatever color the\n   readability check gives it), so it shows on any card (a filled accent circle vanished on 2timelines' lilac).\n   Kept below the readability check's strength so its fix still wins. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hc-ev-ck, .wk-tick[data-evdone]).is-ticked { color: var(--dbk-icon-on) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hc-ev-ck, .wk-tick[data-evdone]).is-ticked::before { background: transparent; border-color: currentColor; border-width: 1.5px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.hc-ev-ck, .wk-tick[data-evdone]).is-ticked::after { border-color: currentColor; opacity: 1; }\n/* the day pop-up: the tick sits at the right of each event, level with its name; the rest keeps its column */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .day-modal-event:has(.hc-ev-ck) { position: relative !important; padding-right: 46px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .day-modal-event .hc-ev-ck { position: absolute !important; right: 0; top: 12px; margin: -6px -4px 0 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .day-modal-event.is-done .day-modal-event-title { text-decoration: line-through; }\n/* Work overview: today's work events tick off too (same tick, same saved tick as Today) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk-row > .wk-ev { flex: 1; min-width: 0; width: auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wk-row.wk-evdone .wt-what { text-decoration: line-through; }\n/* an event's link: the same small link button as a reminder's, between the event and its tick (Today's calendar and Work) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-evw.hc-evw-lk { grid-template-columns: minmax(0,1fr) auto auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-evw.hc-evw-lk.hc-evw-nock { grid-template-columns: minmax(0,1fr) auto; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hc-evw > .dbk-remlink { align-self: center; margin: -8px 2px -8px -4px; }   /* lined up with the reminder line's link above it */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk-row > .dbk-remlink { align-self: center; margin: -8px -2px -8px 0; }\n/* ═══════════ TEXT BOXES HAVE ROOM TO BREATHE (the designer, Oct 20) ═══════════\n   \"add a little space before sleep... make sure every textbox like that has a little space to breath\". Every filled\n   text box in a pop-up (the list in POP-UPS: ONE LAYOUT EVERYWHERE above) keeps 14px inside on the left and right,\n   the room Today's forms already had, so words and hints never start against the box's edge (New category's box had\n   2px: it used to be a bare underline). Search boxes that carry a magnifier on the left keep their own room. Typing\n   stays on the left. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .wrc-sheet, .dbk-infocard, .dbk-catcard, .rt-sheet, .habits-modal, .edit-reminder-modal, .reminder-modal, .day-modal, #addEventModalOverlay .modal, #goals-modal .modal, #add-recipe-modal .modal, #add-snack-modal .modal, #meal-picker-modal .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .tp-pop, #resourceForm, .ai-panel)\n  :is(input[type=\"text\"], input[type=\"email\"], input[type=\"tel\"], input[type=\"url\"], input[type=\"number\"], input[type=\"password\"], input:not([type]), textarea):not(.wrc-titlein):not(.habit-item input):not(.wb-stats input):not([class*=\"search\"]):not(.mjr-in) { padding-left: 14px !important; padding-right: 14px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .wrc-sheet, .dbk-infocard, .dbk-catcard, .rt-sheet, .habits-modal, .edit-reminder-modal, .reminder-modal, .day-modal, #addEventModalOverlay .modal, #goals-modal .modal, #add-recipe-modal .modal, #add-snack-modal .modal, #meal-picker-modal .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .tp-pop, #resourceForm, .ai-panel)\n  :is(input[type=\"time\"], input[type=\"date\"], select) { padding-left: 14px !important; }\n/* New category's box: the same height as the other boxes now that it has room inside */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) .dbk-catcard #dbkCatName { padding-top: 10px !important; padding-bottom: 10px !important; }\n/* the Inbox's search box: the same room as the rest */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #inboxModal .inbox-search { padding-left: 14px !important; padding-right: 14px !important; }\n\n/* ═══════════ TODAY'S FORMS SIT UP UNDER THEIR TITLE (the designer, Oct 20) ═══════════\n   \"the add reminder pop up, move title & everything else up a bit. too much space between that & the line under the\n   title. same with new event.\" Add / edit reminder, New event and Edit event had about 40px between the title's line and\n   the first label (the header's bottom padding, the body's top padding and the label's own 18px, all added up); now\n   just the label's 18px, like the other pop-ups, and the title sits a little higher. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(#addReminderOverlay, #editReminderOverlay) .edit-reminder-modal > .modal-header,\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #addEventModalOverlay .modal > .modal-header { padding-top: 8px !important; padding-bottom: 0 !important; margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(#addReminderOverlay, #editReminderOverlay) .edit-reminder-modal > .modal-body,\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #addEventModalOverlay .modal > .modal-body { padding-top: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalOverlay .day-modal { padding-top: 8px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalOverlay .day-modal-header { padding-bottom: 0 !important; margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalForm { padding-top: 0 !important; }\n\n/* ═══════════ THE TODAY MARK A HAIR BIGGER (the designer, Oct 20: \"make the today icon a hair bigger\") ═══════════\n   The little calendar at the top left (one tap back to Today) drew smaller than the gear across from it; 15% bigger,\n   still centered in the bar, nothing else moves */\nhtml[data-dbk]:not(#z):not(#y) #dbkHomeBtn svg { width: 23px; height: 23px; }\n\n/* ═══════════ \"ARE YOU SURE?\" ON TOP, WITH TWO REAL BUTTONS (Oct 20) ═══════════\n   Layers, lowest to highest: the page's pop-ups (30000s; the weather, moon, getting-started and other small\n   .dbk-infopop cards were at 99999-100000, above the \"are you sure?\" box, which then opened hidden behind them),\n   menus and date pickers opened from a pop-up (39000), the \"are you sure?\" box (40000), then the Undo message and\n   other short messages (2147483000). */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-infopop { z-index: 30090 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-infopop.dbk-radar-pop { z-index: 30095 !important; }   /* the rain map opens from the weather card */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #inboxBody .ibx-menu.is-fixed { z-index: 39000 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-pagepop { z-index: 39000 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-confirm, .lh-confirm-overlay) { z-index: 40000 !important; }\n/* \"Keep it\" was underlined words (the designer: no underlined words as buttons): an outline button beside the filled one,\n   side by side, the same size */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.dbk-confirm .dbk-confirm-act, .lh-confirm-overlay .lh-confirm-btns) { display: grid !important; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 12px !important; width: fit-content; max-width: 100%; margin-left: auto !important; margin-right: auto !important; }   /* both buttons as wide as the wider one */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-confirm .dbk-confirm-act button,\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-confirm-overlay .lh-confirm-btns button { box-sizing: border-box !important; width: 100% !important; max-width: none !important; min-width: 104px !important; min-height: 42px !important; padding: 9px 18px !important; border-radius: 6px !important; text-align: center !important; justify-content: center; display: inline-flex !important; align-items: center !important; line-height: 1.2 !important; text-decoration: none !important; opacity: 1 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-confirm .dbk-confirm-no,\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-confirm-overlay .lh-confirm-cancel { background: none !important; color: inherit !important; border: 1px solid currentColor !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-confirm .dbk-confirm-yes { border: 1px solid transparent !important; }\n/* the other \"are you sure?\" box (lhConfirm, from the older pages) wears the same colors as this one: in Midnight it\n   was a cream box with pale words on it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-confirm-overlay .lh-confirm-box { background: #f3eee4 !important; color: #2f3a2c !important; border-color: transparent !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .lh-confirm-overlay .lh-confirm-box { background: #10151c !important; color: #e6eaef !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .lh-confirm-overlay .lh-confirm-msg { color: inherit !important; }\n\n/* ═══════════ EVENT FORMS: EVEN SPACING (Oct 20) ═══════════\n   Edit event had 32-42px above \"Day\" and the times (each field's own bottom margin plus its row's margin plus the\n   label's 18px); New event had 34px above the times. Now every label is the shared 18px above, 6px down to its box,\n   and every box (title, day, start, end, the date button, the drop-down) is the same 44px tall, so the start and end\n   times line up with the rest. Location, Link and Notes (no labels in Edit event) start 18px under the times and sit\n   10px apart. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalForm :is(#dayModalEventTitle, #dbkEvDate, #dayModalEventTime, #dayModalEventEndTime, #dbkEvDateWrap, .hc-ed-times) { margin-top: 0 !important; margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalForm .hc-ed-l { margin: var(--pop-lab-gap, 18px) 0 var(--pop-lab-to-field, 6px) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #dayModalForm :is(#dayModalEventTitle, #dbkEvDate, #dayModalEventTime, #dayModalEventEndTime, #dayModalEventLocation, #dayModalEventUrl) { height: 44px !important; min-height: 44px !important; box-sizing: border-box !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #addEventModalOverlay .allday-row { margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #addEventModalOverlay :is(#calendarEventTitle, #calendarEventTime, #calendarEventEndTime, #calendarEventLocation, #calendarEventUrl, #calendarRepeatMode, .hh-dp-trigger) { height: 44px !important; min-height: 44px !important; box-sizing: border-box !important; }\n\n/* MEALS TABS IN THE HOME-SCREEN APP (n-money2, Oct 20): the top bar is taller there (14px gap under the clock; \"A SLIMMER MENU BAR\" at the end)\n   and the tabs touched it; they keep the same 14px gap under the bar as in the browser */\nhtml.dbk-standalone.dbk-has-hero[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkMealTabs { margin-top: 18px; }\n@media (display-mode: standalone) { html.dbk-has-hero[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkMealTabs { margin-top: 18px; } }\n\n/* ═══════════ Habits > routine step pop-up (habits2 fix, Oct 20; the designer: \"it's missing a title lol\") ═══════════\n   \"Add a step\" / \"Edit step\" now has the shared pop-up title (.dbk-info-title: centered, short line under the words)\n   and follows POP-UPS: ONE LAYOUT EVERYWHERE: a centered small-caps label over each field (What, Time, Days, Notes),\n   full-width soft boxes with the typing on the left, and Delete (outline) beside Save (filled), the same size. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet { gap: 0 !important; max-width: 440px !important; padding-top: 22px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-title { margin: 0 auto 4px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-in-time { width: 100% !important; min-width: 0 !important; max-width: 100% !important; align-self: stretch !important; display: block !important; -webkit-appearance: none !important; appearance: none !important; min-height: 44px !important; text-align: left !important; }\nhtml[data-dbk] .rt-sheet .rt-in-time::-webkit-date-and-time-value { text-align: left; margin: 0; min-height: 1.2em; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-days { margin: 0; flex-wrap: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .rt-sheet .rt-actions { margin-top: 22px !important; }\nhtml[data-dbk][data-dbk-page]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .rt-sheet .rt-actions > :is(.rt-save, .rt-delete) { box-sizing: border-box !important; min-width: 112px !important; min-height: 42px !important; padding: 8px 22px !important; font-family: var(--dbk-caps) !important; font-size: 16px !important; letter-spacing: 0.06em !important; line-height: 1.2 !important; border-radius: 6px !important; text-decoration: none !important; }\nhtml[data-dbk][data-dbk-page]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .rt-sheet .rt-actions > .rt-delete { background: none !important; border: 1px solid currentColor !important; }\n\n/* ═══════════ buildfix: confirm pop-ups' words break evenly (no one word alone on the last line) ═══════════ */\nhtml[data-dbk] :is(.lh-confirm-msg, .dbk-confirm-msg) { text-wrap: balance; }\n\n/* ═══ KEYBOARD UP (inbox fix, Oct 20): with the on-screen keyboard open, every pop-up fits in the part of the screen\n   still showing above it, so nothing being typed is hidden. daybook-theme.js (popViewport) sets html.dbk-kb and the\n   visible height/top (--dbk-vvh, --dbk-vvt) and the keyboard's height (--dbk-kbh), reading the app shell's visible\n   area too, since a page in the shell never sees the iPhone keyboard on its own. ═══ */\nhtml[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(#dayModalOverlay, .edit-reminder-overlay, #addReminderOverlay, #editReminderOverlay, #reminderModalOverlay, .rt-overlay, #rtSheet, #addContactModal, #inboxOverlay, #habitsModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, #addEventModalOverlay, #resourceFormOverlay, .dream-form, #detailPopup, #triedModal, #pickerFilterModal, #skippedAnswerModal, #seasonal-modal-overlay, .tp-overlay, .tp-pop-overlay, .wrc-overlay, .mprj-scrim, #rlPop, .fin-sheet-overlay, .dbk-infopop, .dbk-confirm, #journal-day-popup) { padding-bottom: calc(var(--dbk-kbh, 0px) + 14px) !important; }\nhtml[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, #inboxModal, .habits-modal, :is(#addEventModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, .modal-overlay) > .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .picker-filter-box, .skipped-answer-box, .seasonal-modal, .tp-pop, .wrc-sheet, .mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .dbk-infocard, .dbk-catcard, .dbk-confirm-card, #journal-day-popup > div, #resourceForm.event-form) { max-height: calc(var(--dbk-vvh, 100vh) - var(--dbk-pop-top) + var(--dbk-vvt, 0px) - 22px) !important; }\n\n/* ═══ INBOX: SAME SIZE ALWAYS (the designer, Oct 20): the Inbox is one comfortable height however many notes it holds, so the\n   Tag and Send to menus always have room to open downward. A menu is lifted onto the Inbox's full-screen layer\n   (dashboard.js inboxPlaceMenu) so nothing in the pop-up can clip or cover it, and it scrolls inside itself when long. ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) { --dbk-ibx-h: calc(62 * var(--dbk-vh, 1vh)); }\n/* it sits at the top of the free space (under the top bar) rather than in the middle, leaving the room below it for the menus */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #inboxOverlay::before { flex: 0 0 0 !important; }\n@media (min-width: 769px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) { --dbk-ibx-h: min(calc(70 * var(--dbk-vh, 1vh)), 580px); } }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #inboxModal { height: min(calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - var(--dbk-kbh, 0px) - var(--dbk-capspace, 80px) - 8px), var(--dbk-ibx-h)) !important; }\nhtml[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) #inboxModal { height: calc(var(--dbk-vvh, 100vh) - var(--dbk-pop-top) + var(--dbk-vvt, 0px) - 16px) !important; }\nhtml[data-dbk] body > .ibx-menu.is-port { --ibx-ink: var(--dbk-green); --ibx-rgb: var(--dbk-green-rgb); --ibx-bg: var(--dbk-cream); --ibx-accent: var(--lh-secondary, #a94f61); }\nhtml[data-dbk=\"p2\"] body > .ibx-menu.is-port { --ibx-ink: #e6eaef; --ibx-rgb: 230,234,239; --ibx-bg: #0d1116; --ibx-accent: #e79aa9; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) body > .ibx-menu.is-port { position: fixed !important; transform: none !important; bottom: auto !important; right: auto !important; margin: 0 !important; z-index: 2147483100 !important; }   /* above the Undo message while it's open */\n\n/* ═══ WEATHER STATEMENT: TWO LINES (the designer, Oct 20): the open/close arrow sits right after \"until ...\" instead of on a line of its own ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-wx-al summary small { white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-wx-al summary small .dbk-wx-chev { display: inline-block; width: 16px; height: 16px; vertical-align: -3px; margin-left: 6px; }\n\n/* ═══ SWEEP-LOOK (Oct 20): Today's greeting and the Three's numbers, in every font ═══\n   - Desktop: index.html's own wide-screen rule made \"Good morning,\" a block of its own, so the name always fell to a\n     second line alone (\"Good morning, / Ben\"). Both parts are inline; the fit in daybook-theme.js keeps it on one line\n     and, if a long name truly doesn't fit, it wraps in balanced lines.\n   - The numbers column (i. ii. iii.) is as wide as the widest number in the chosen font (--dbk-3n, measured by\n     daybook-theme.js), never narrower than before: Typewriter's \"iii.\" is 45px and ran into the box. Same for Work's Three. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .hm-greet .home-greeting { display: inline !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hm-thing { grid-template-columns: max(38px, var(--dbk-3n, 0px)) 30px minmax(0,1fr) 40px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .wk3-n { width: max(30px, var(--dbk-w3n, 0px)); white-space: nowrap; }\n\n/* ═══ SWEEP-LOOK (Oct 20): lines break evenly everywhere (the designer: never one word alone on a last line) ═══\n   The browser's \"pretty\" line breaking moves a word down when the last line would hold only one. Titles that\n   already ask for balanced lines keep that. Inherited, so it reaches every page and pop-up. */\nhtml[data-dbk] body { text-wrap-style: pretty; }\n\n/* ═══ SWEEP-LOOK (Oct 20): pop-ups that missed the shared layout ═══\n   Found by the overnight sweep of every pop-up (phone, short phone, desktop; five looks; both people).\n   - Getting started cards: the line under the title ran across the whole card, and on a phone Skip / Next were\n     stacked on top of each other. Now the title has its short line (as every pop-up) and the buttons sit side by side.\n   - Work's small pop-ups (Add Offer, Hashtag Set, ...): title with its short line; its labels and boxes follow the\n     shared layout (added to the list above); Save and Cancel the same size.\n   - Meals: \"Tonight's plan\" and the open-night picker get the title line; the picker's search box gets inside room.\n   - Work: \"Need an idea?\", \"Start it\" and the other small word-links were underlined words; now small outline buttons. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wl-heads { border-bottom: 0 !important; padding-bottom: 0 !important; margin-left: 0 !important; margin-right: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-wl-acts { flex-direction: row !important; flex-wrap: wrap; gap: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-wl-acts :is(.dbk-obtn, .dbk-fbtn) { min-width: 104px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) :is(.ai-panel-title, #mcpT, #mpkT) {\n  display: block !important; width: fit-content !important; max-width: calc(100% - 76px) !important; margin-left: auto !important; margin-right: auto !important; text-align: center !important;\n  padding: 0 0 6px !important; border-bottom: 0 !important; text-decoration: none !important; box-sizing: border-box !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .ai-panel-title + :is(.form-row, .ai-panel-subtitle) { margin-top: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .ai-actions { display: flex !important; flex-wrap: wrap; justify-content: center !important; align-items: stretch !important; gap: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .ai-actions > .wr-btn { box-sizing: border-box !important; min-height: 40px !important; min-width: 96px !important; padding: 8px 18px !important; margin: 0 !important; font-size: 14px !important; line-height: 1.2 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) .mpk-pop .mpk-q { padding-left: 14px !important; padding-right: 14px !important; box-sizing: border-box !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .wrc-link { all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 30px; padding: 4px 12px; border: 1px solid currentColor; border-radius: 999px; cursor: pointer; font-family: var(--dbk-caps); font-size: 13.5px; letter-spacing: 0.04em; line-height: 1.2; white-space: nowrap; text-decoration: none !important; color: var(--wrc-ink, inherit); }\n\n/* ═══ SWEEP-LOOK (Oct 20): the trip planner's small word-links (\"Move to ideas · Delete\", \"+ Add ...\") were\n   underlined words; now small outline buttons side by side (the designer: outline buttons or icons, never underlined words).\n   The dot between them goes. The \"‹ Back\" link at the top keeps its arrow look. ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-linkbtn:not(.tp-back .tp-linkbtn):not(.tp-menu .tp-linkbtn) { box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; min-height: 34px; padding: 5px 14px !important; border: 1px solid currentColor !important; border-radius: 999px !important; text-decoration: none !important; opacity: 1 !important; white-space: nowrap; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-more { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-more .tp-dot { display: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-dup-label { position: absolute !important; width: 1px !important; height: 1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; margin: 0 !important; padding: 0 !important; white-space: nowrap !important; }   /* still read out to screen readers */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .tp-menu .tp-linkbtn { text-decoration: none !important; }   /* a menu's rows, like the page menu */\n/* ═══ SAVE AND DELETE: THE SAME SIZE (sweep-fix, Oct 20; the designer: \"Save and Delete side by side, same size\") ═══\n   Edit event was \"Delete event\" 146px beside a 72px Save; Edit reminder and the Work event the same. Each row\n   with a Save and a Delete is a grid of equal columns, so both buttons are as wide as the wider one, side by side,\n   centered. A new pop-up with Save and Delete adds its button row here (or gives the row the class dbk-pair). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.dbk-pair, #dayModalOverlay.hc-editing .day-modal-form-actions, #editReminderOverlay .form-actions, .wk-acts, .rt-sheet .rt-actions, .fin-sheet .fin-actrow) { display: grid !important; grid-auto-flow: column !important; grid-auto-columns: 1fr !important; gap: 12px !important; width: fit-content !important; max-width: 100% !important; margin-left: auto !important; margin-right: auto !important; justify-content: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.dbk-pair, #dayModalOverlay.hc-editing .day-modal-form-actions, #editReminderOverlay .form-actions, .wk-acts, .rt-sheet .rt-actions, .fin-sheet .fin-actrow) > button { box-sizing: border-box !important; width: 100% !important; min-width: 0; max-width: none !important; margin: 0 !important; justify-content: center !important; text-align: center !important; white-space: nowrap; }\n\n/* ═══ SWEEP-LOOK (Oct 20): Lists cards on a phone ═══\n   The round tick sits in the card's top-right corner and the whole name column kept 26px clear for it, so in the\n   two-column phone grid names broke after almost every word (\"Tomorrow, / and / Tomorrow, / and\"). Only the\n   first line now makes room for the tick; the lines under it use the card's full width. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) body.rl .dreams-tab .rl-row .rl-main { padding-right: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) body.rl .dreams-tab .rl-row .rl-nm::before { content: ''; float: right; width: 26px; height: 1.1em; }\n\n/* ═══ SWEEP-LOOK (Oct 20): Add Quick Snack's title looked like no other pop-up (small capitals on a tinted strip):\n   now the same title as every pop-up, on the pop-up itself ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #add-snack-modal .modal-header { background: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) #snack-modal-title {\n  font-family: var(--dbk-script) !important; font-style: italic !important; font-weight: 400 !important; font-size: 27px !important;\n  line-height: 1.15 !important; letter-spacing: 0 !important; text-transform: none !important; text-align: center !important; color: inherit !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x) #snack-modal-title { font-family: var(--dbk-caps) !important; font-style: normal !important; font-size: 23px !important; letter-spacing: 0.04em !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): Notifications' quiet hours: \"09:00 PM\" was cut to \"09:00 PV\" in its 130px box. The two\n   time boxes share the row evenly with a little less inside room, so the whole time shows on a phone. ═══ */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .dbk-nt-quiet { max-width: 330px !important; gap: 8px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .dbk-nt-quiet input { flex: 1 1 0 !important; min-width: 0 !important; max-width: 150px !important; padding-left: 10px !important; padding-right: 8px !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): Home Base (tap the business name on Work) ═══\n   Each part (About, Offers, Links, ...) was its own outlined box inside the pop-up (a box inside a card), and on a\n   computer the pop-up was 760px wide. The parts now sit on the pop-up itself, divided by a thin line, and the pop-up\n   is the usual width (about 440px, as on a phone). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .wb-home .wbx { border: 0 !important; border-radius: 0 !important; padding: 4px 0 6px !important; margin: 0 !important; background: none !important; box-shadow: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .wb-home .wbx + .wbx { border-top: 1px solid rgba(var(--wrc-ink-rgb), 0.16) !important; margin-top: 14px !important; padding-top: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .wrc-sheet.wb-home { max-width: 460px !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): empty tick boxes that could hardly be seen ═══\n   The monthly challenge's box, the grocery list's boxes, Work's Three and a content piece's step rings were drawn at\n   half strength; in Midnight they nearly vanished (about 2 to 1). Their edge is now strong enough to see (3 to 1 or\n   more) in every look. Ticked boxes are unchanged. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.dbk-chal-row:not(.is-done) .dbk-chal-box, #mprGroc .mprg-box:not(.on), .wk3-box:not(.on), .wb-step:not(.done) .wb-circ) { border-color: color-mix(in srgb, currentColor 88%, transparent) !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): readable small marks ═══\n   - Money's calendar faded a whole past day, so a bill's name on its colored tag fell under 3 to 1 (\"Rent\").\n     The day's number and amounts still fade; the bill tag stays readable.\n   - A recipe card's heart (not a favorite yet) was almost invisible (about 1.1 to 1); it now shows softly at 3 to 1. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) .fin-cal .past { opacity: 1 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .fin-cal .past > :not(.bill) { opacity: .6; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x) #rb-grid .rb-card-fav { opacity: 1 !important; }\nhtml[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x) #rb-grid .rb-card-fav:not(.favorited) { color: rgba(var(--lh-text-rgb), 0.62) !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): short names on two or three lines break evenly ═══\n   \"pretty\" (above) leaves two-line names alone, so a bingo square read \"Sew for 30 / minutes\" and a list card\n   \"Science museum after-dark / night\". Short names in squares, cards and rows are balanced instead. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.bingo-cell, .hm-thing [id^=\"thing-text\"], .hc-title, .hc-rem-name, .rl-nm, .rl-meta, .rt-what, .wt-what, .wk-tx-n, .wb-name, .wb-pname, .mprg-nm, .mprj-nm, .rb-card-name, .fin-row > span, .dbk-sx-nm, .inbox-item-text, .reminder-list-row span, .wbx-v) { text-wrap: balance; }\n/* Edit event's Delete: its outline could hardly be seen (1.6 to 1) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) #dbkEvDel { border-color: color-mix(in srgb, currentColor 70%, transparent) !important; }\n\n/* ═══ SWEEP-LOOK (Oct 20): 6px from a label to its box, as everywhere ═══\n   In Settings' pop-ups and Money's forms the row already keeps a 6px gap between label and box, and the shared label\n   rule added its own 6px under the label: 12px. The label's own space goes; the row's 6px stays. Also: short\n   pop-up paragraphs (Household's status line) break evenly. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n) :is(.dbk-infocard .setting-row > .setting-label-inline, .fin-sheet .fin-field > .fin-label) { margin-bottom: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x) :is(.dbk-hh-status, .dbk-infocard .dbk-setx-sub, .fin-sheet p, .wrc-sheet p) { text-wrap: balance; }\n\n/* ═══ SWEEP-LOOK (Oct 20): a trip's \"Trip plan · 4 days, 7 stops planned\" was a bar across the whole pop-up; it fits its\n   words like every button (still the one filled button, first, on a line of its own when the others don't fit) ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) :is(#detailActions, .detail-popup-actions) .icon-btn.tp-open { flex: 0 1 auto !important; width: auto !important; max-width: 100%; padding-left: 18px !important; padding-right: 18px !important; text-wrap: balance; }\n/* the trip / list item title ran under the × on a phone (Midnight's wider capitals): it keeps clear of the × */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) .detail-popup-title { max-width: calc(100% - 76px) !important; }\n/* the trip stop form: \"Time\" sat beside its box on the left and the Move to day pills were left-aligned. The label goes\n   above its box, centered like every pop-up label, and the pills are centered (as every choice group). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-inline { display: block !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-inline .tp-input { width: 100% !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-pop .tp-kinds { display: flex; flex-wrap: wrap; justify-content: center !important; gap: 8px; }\n\n/* ===== POLISH3: Meals > Recipes > Snacks, Quick Snacks (Kasey: title hard left, Add snack hard right) =====\n   The heading is centered like every section heading; \"+ Add snack\" is the small outline button, centered under the list. */\nhtml[data-dbk] #snack-bank-section .dbk-snack-h { text-align: center !important; padding: 0 !important; margin: 0 0 10px !important; }\nhtml[data-dbk] #snack-bank-section .dbk-snack-add { display: flex; justify-content: center; margin-top: 12px; }\nhtml[data-dbk] #snack-bank-section .dbk-snack-add .dbk-obtn { color: var(--dbk-green, var(--lh-accent)); }\nhtml[data-dbk] #snack-bank-section .snack-item { background: rgba(var(--lh-text-rgb, 47,58,44), .04) !important; border: 1px solid rgba(var(--lh-text-rgb, 47,58,44), .14) !important; border-radius: 6px; padding: 10px 12px; margin-bottom: 6px; }\n\n/* ===== POLISH3: Settings > Look font lists (Kasey: \"the font drop down menu is cut off a little bit\") =====\n   dbk-look.js now stops the open list at a whole name; this small arrow sits at its bottom while more names are below. */\nhtml[data-dbk] .dbk-look-ddm .dbk-look-ddmore { position: sticky; bottom: -4px; display: flex; justify-content: center; align-items: center; height: 20px; margin: 0 -4px -4px; background: inherit; pointer-events: none; border-radius: 0 0 10px 10px; }\nhtml[data-dbk] .dbk-look-ddm .dbk-look-ddmore svg { opacity: .75; }\nhtml[data-dbk] .dbk-look-ddm.is-end .dbk-look-ddmore { visibility: hidden; }\n\n/* ===== POLISH3: Settings pop-ups, even spacing (Kasey: \"still obvious spacing issues\") =====\n   Measured in every Settings pop-up (390 and 1280): text boxes were 300px inside a 314px column (7px in from every\n   other row), Names had 32px under its last box, Password's labels sat 30px under the box above (18px everywhere\n   else), Money's line hugged the title and Backup's button hugged its text. */\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in .setting-row > :is(input, select) { max-width: none !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in .setting-row { margin-bottom: 12px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in .setting-row:not(:has(~ .setting-row:not([hidden]))) { margin-bottom: 0 !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-h + .dbk-setx-in > .section-body > .setting-row:first-child:has(> label.dbk-dup-label) { margin-top: 8px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordForm .setting-row { margin-bottom: 0 !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordStatus p { margin: 6px 0 0 !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordForm > div:has(> button) { margin-top: 18px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in .dbk-autosave:not(:has(:is(button, span):not(.save-flash):not([hidden]):not([style*=\"none\"]))) { display: none !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-h + .dbk-setx-in > .dbk-hp-p:first-child { margin-top: 12px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in p.dbk-about + div:has(> .btn) { margin-top: 14px !important; }\n/* Settings > Meals: \"Set goals\" is the small outline button (it was the size of a pop-up's main button) */\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-sx-row button[data-goals].dbk-sx-obtn { box-sizing: border-box !important; min-height: 34px !important; padding: 4px 14px !important; font-size: .82rem !important; letter-spacing: .05em !important; line-height: 1.2 !important; }\n/* Settings > Meals: \"Always in the pantry\" is a field label, so it is centered like every pop-up label; typing stays left */\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-ms label.dbk-ms-pantry { text-align: center !important; gap: 6px; margin-top: 18px !important; font-family: var(--font-title-caps) !important; letter-spacing: .08em !important; font-size: .78rem !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-ms label.dbk-ms-pantry > input { font-size: 16px !important; letter-spacing: 0 !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-ms label.dbk-ms-pantry .dbk-sx-meta { text-align: center !important; }\n/* Settings > Questions: grouped rows that open to their answer */\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q { border-top: 1px solid rgba(47,58,44,.13); }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"settings\"] .dbk-hp-q { border-top-color: rgba(230,234,239,.12); }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q > summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; font-size: 1rem; text-align: left; -webkit-tap-highlight-color: transparent; }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q > summary::-webkit-details-marker { display: none; }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q > summary .dbk-setx-chev { flex: none; transition: transform .15s; }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-q[open] > summary .dbk-setx-chev { transform: rotate(90deg); }\nhtml[data-dbk-page=\"settings\"] .dbk-hp-a { padding: 0 0 12px; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-hp-a .dbk-hp-p { margin: 0 0 8px; font-size: .94rem; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-hp-a .dbk-hp-p:last-child { margin-bottom: 0; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-hp .dbk-sx-gl { margin: 22px 0 6px; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x) .dbk-hp .dbk-sx-gl:first-child { margin-top: 6px; }\n@media (prefers-reduced-motion: reduce) { html[data-dbk-page=\"settings\"] .dbk-hp-q > summary .dbk-setx-chev { transition: none; } }\n/* the Location pop-up (dbk-places.js, opened from Today and from Settings) has the same frame as every Settings pop-up:\n   no border, the same paper, corners, inside room and width, the x in the same spot, 16px from the title to the box */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay { padding-left: 16px !important; padding-right: 16px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay .edit-reminder-modal { position: relative !important; max-width: 440px !important; background: #f3eee4 !important; color: #2f3a2c !important; border: 0 !important; border-radius: 14px !important; padding: 22px 22px 18px !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay .edit-reminder-modal { background: #121925 !important; color: #e6eaef !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay .modal-header { position: static !important; display: block !important; padding: 0 26px !important; margin: 0 0 16px !important; border: 0 !important; border-radius: 0 !important; background: none !important; text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay .modal-close { position: absolute !important; top: 18px !important; right: 6px !important; width: 40px !important; height: 40px !important; margin: 0 !important; padding: 0 !important; display: flex !important; align-items: center !important; justify-content: center !important; font-size: 22px !important; line-height: 22px !important; color: inherit !important; opacity: .72 !important; background: none !important; border: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r) #locationSetupOverlay .modal-body { padding: 0 !important; }\n\n/* ===== POLISH3: Settings > Look, the pinned preview =====\n   Scrolling, the \"Colors\" label slid under the preview and showed half cut along its bottom edge. The pinned preview now\n   carries a 22px band of the pop-up’s own paper under it, so what scrolls up goes out of\n   sight cleanly with room under the preview, never half-hidden right at its edge. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-infocard .dbk-look-prev { box-shadow: 0 22px 0 0 #f3eee4 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w) .dbk-infocard .dbk-look-prev { box-shadow: 0 22px 0 0 #121925 !important; }\n/* the first-run setup's Look step: the list's \"more below\" arrow in the same cream as the font names there */\nhtml:not(#z):not(#y):not(#x):not(#w) #htwiz-look .dbk-look-ddm .dbk-look-ddmore { color: rgba(243, 238, 228, 0.92) !important; }\n/* the same in the first-run setup's Look step (its page is #2f3a2c, ht-wizard-overlay); the preview gets a little more\n   room under it there so the band never covers the \"Colors\" label before you scroll */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) #htwiz-look .dbk-look-prev { margin-bottom: 14px !important; box-shadow: 0 20px 0 0 #2f3a2c !important; }\n\n/* ═══ LOOK: FONTS AS A SWIPE ROW (the designer, Oct 20: the font drop-downs looked bad and spilled off the pop-up).\n   Each font is a pill written in its own face, in one row you swipe sideways; the chosen one is outlined and tinted.\n   The row fades at its edges so it's clear there is more to swipe. Nothing opens or floats. ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look-dd { display: block !important; width: 100%; margin-top: 18px !important; text-align: center; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look-dd .dbk-look-ddl { display: block; margin-bottom: 6px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-look-fr { display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; overflow-y: hidden; overscroll-behavior-x: contain; scrollbar-width: none; scroll-snap-type: x proximity; padding: 4px 16px 6px; margin: 0 -8px; touch-action: pan-x pan-y; -webkit-mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); mask-image: linear-gradient(to right, transparent 0, #000 18px, #000 calc(100% - 18px), transparent 100%); }\nhtml[data-dbk] .dbk-look-fr::-webkit-scrollbar { display: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-look-fc { all: unset; box-sizing: border-box; flex: none; scroll-snap-align: center; cursor: pointer; font-family: var(--ff) !important; font-size: 18px; line-height: 1.1; padding: 9px 16px; border-radius: 999px; border: 1px solid color-mix(in srgb, currentColor 35%, transparent); white-space: nowrap; text-transform: none !important; letter-spacing: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-look-fc[aria-checked=\"true\"] { border: 1.5px solid currentColor; background: color-mix(in srgb, currentColor 10%, transparent); }\nhtml[data-dbk] .dbk-look-fc:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }\nhtml:not(#z):not(#y):not(#x):not(#w) #htwiz-look .dbk-look-fc { color: rgba(243, 238, 228, 0.92) !important; border-color: rgba(243, 238, 228, 0.35) !important; }\nhtml:not(#z):not(#y):not(#x):not(#w) #htwiz-look .dbk-look-fc[aria-checked=\"true\"] { border-color: rgba(243, 238, 228, 0.9) !important; background: rgba(243, 238, 228, 0.12) !important; }\n/* the font rows are as wide as the pop-up, never as wide as all their fonts (so they scroll instead of overflowing) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-look-dd { width: 100% !important; max-width: 100% !important; min-width: 0 !important; justify-self: stretch !important; align-self: stretch !important; contain: inline-size; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-look-fr { width: calc(100% + 16px) !important; max-width: calc(100% + 16px) !important; min-width: 0 !important; box-sizing: border-box !important; }\n/* NOTIFY-STATUS (Oct 20, Kasey: \"said yes, nothing happened. Can't tell if it worked\"): Settings > Notifications says\n   where this phone stands at the top of the pop-up (on / off / blocked / Home Screen first), with the next step and\n   its buttons right under it. Centered like every pop-up heading; the old note and links at the bottom are gone. */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-status { text-align: center; margin: 2px 0 26px; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-head { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; margin: 0 auto; max-width: 340px; font-size: 1.05rem; font-weight: 600; line-height: 1.35; text-wrap: balance; color: inherit; text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-head:empty { display: none; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-ic { flex: 0 0 auto; display: inline-flex; width: 30px; height: 30px; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-ic svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-status[data-state=\"on\"] .dbk-nt-ic svg path { stroke-width: 2.2; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-detail { margin: 8px auto 0 !important; max-width: 340px; font-size: .92rem; line-height: 1.45; opacity: .85; text-align: center !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-line { display: block; text-wrap: balance; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-line + .dbk-nt-line { margin-top: 4px; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-status #ntActs { display: flex; justify-content: center !important; flex-wrap: wrap; gap: 10px; margin: 14px auto 0 !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-status #ntActs[hidden] { display: none !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-status #ntActs button { width: auto !important; margin: 0 !important; white-space: nowrap; }\n/* ═══════════ DOWNLOAD MY THINGS / LEAVE THIS HOUSEHOLD (sharing, Oct 20; public/dbk-mine.js) ═══════════\n   Settings > Account > Download my things, and Settings > Household > Leave this household. They sit inside the\n   Account box's own layout (.dbk-acc: centered words, buttons side by side); the one checkbox sits 12px from its words. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .dbk-acc .dbk-mine-chk { display: flex !important; width: fit-content; max-width: 100%; align-items: center; gap: 12px; margin: 16px auto 0 !important; text-align: left !important; line-height: 1.4; cursor: pointer; font: inherit !important; font-size: 0.95rem !important; letter-spacing: normal !important; text-transform: none !important; font-variant: normal !important; opacity: 1 !important; }\n/* Settings sections set their words left (\".section-body :is(p, ...)\"); this block keeps the Account box's centered\n   words (the section's body moves into the pop-up, so no #sec-household here) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .dbk-hh-leave :is(p, .dbk-acc-p, .dbk-acc-small, .dbk-acc-msg) { text-align: center !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-mine-chk input { width: 18px !important; height: 18px; margin: 0; flex: none; padding: 0; accent-color: currentColor; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-acc .dbk-mine-dl { margin: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-hh-leave { margin-top: 18px; }\n\n/* Settings > Sharing: the switches end with a thin line, then the centered notes start 18px below it (the designer, Oct 20) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-sh-sep { border-top: 1px solid color-mix(in srgb, currentColor 22%, transparent); margin: 18px 0 0; height: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-sh-sep + :is(.dbk-sx-note, .dbk-sx-gl) { margin-top: 18px !important; }\n\n/* ── Settings > App code (the app lock became a 4-6 number code, Oct 20): notes and the error line centered, the\n   error keeps its room so nothing moves when it shows, and Save / Remove sit side by side on a phone too ── */\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordStatus p.dbk-code-note { margin: 0 0 6px !important; text-align: center !important; text-wrap: balance; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordForm p.dbk-code-err { min-height: 1.4em; margin: 10px 0 0 !important; text-align: center !important; font-size: .88rem; color: inherit; text-wrap: balance; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordForm > .dbk-code-acts { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; justify-content: center !important; gap: 10px !important; margin-top: 12px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m) .dbk-setx-in #passwordForm input.dbk-code-in { letter-spacing: .3em; }\n/* ═══ TRIP PLANNER POP-UPS WITH THE KEYBOARD UP (the designer, Oct 20): when there's little room above the keyboard the\n   small trip pop-ups (Place to stay, a stop, dates) scroll as one piece; their boxes keep their size instead of being squeezed ═══ */\nhtml[data-dbk] .tp-pop > * { flex-shrink: 0 !important; }\n/* the trip plan itself with the keyboard up: it fits what's left above the keyboard like every other pop-up (\"KEYBOARD UP\"\n   above); its own height rule took the keyboard off twice, leaving a strip about 80px tall */\nhtml[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-overlay > .tp-sheet { max-height: calc(var(--dbk-vvh, 100vh) - var(--dbk-pop-top) + var(--dbk-vvt, 0px) - 22px) !important; }\n/* the trip's text boxes grow by themselves: no resize grip in their corner */\nhtml[data-dbk] :is(.tp-sheet, .tp-pop) textarea { resize: none !important; }\n/* trip pop-ups: Save and Delete (and Move to ideas) side by side on phones too, never stacked (the designer, Oct 19);\n   they wrap only when they truly don't fit */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-actrow { flex-direction: row !important; flex-wrap: wrap !important; align-items: center !important; gap: 12px 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-actrow .tp-more { display: contents !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-actrow .tp-dot { display: none !important; }\n/* \"Move to\" / \"Put it on\" days: one row that swipes sideways like the day pills (a day never sits alone on a second line) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-pop .tp-kinds { flex-wrap: nowrap !important; justify-content: flex-start !important; overflow-x: auto !important; overflow-y: hidden !important; scrollbar-width: none; overscroll-behavior-x: contain; margin: 0 -16px !important; padding: 2px 16px 4px !important; }\nhtml[data-dbk] .tp-pop .tp-kinds::-webkit-scrollbar { display: none; }\nhtml[data-dbk] :is(.tp-pop .tp-kinds, .tp-pop .tp-kinds *) { touch-action: pan-x pan-y !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop .tp-kinds > * { flex: none !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop .tp-kinds > :first-child { margin-left: auto !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop .tp-kinds > :last-child { margin-right: auto !important; }\n\n/* ═══ SOFT EDGES (the designer, Oct 20): a trip pop-up with more to scroll fades softly into its own background at that\n   edge instead of slicing a button or a title in half. daybook-theme.js softEdges() sets data-dbk-more (\"up\", \"down\")\n   and the edges use the pop-up's own background colour (--wrc-paper), so they match in every look. Nothing moves: the edges only show or hide. ═══ */\nhtml[data-dbk] :is(.tp-sheet, .tp-pop)::before, html[data-dbk] :is(.tp-sheet, .tp-pop)::after {\n  content: ''; display: block; position: sticky; left: 0; right: 0; height: 30px; flex: none; pointer-events: none; z-index: 3; visibility: hidden;\n}\nhtml[data-dbk] :is(.tp-sheet, .tp-pop)::before { top: 0; margin-bottom: -30px; background: linear-gradient(to bottom, var(--wrc-paper) 15%, transparent); }\nhtml[data-dbk] :is(.tp-sheet, .tp-pop)::after { bottom: 0; margin-top: -30px; background: linear-gradient(to top, var(--wrc-paper) 15%, transparent); }\n/* the small pop-ups stack their parts with a 10px gap: the edges take no room of their own there either */\nhtml[data-dbk] .tp-pop::before { margin-bottom: -40px; }\nhtml[data-dbk] .tp-pop::after { margin-top: -40px; }\nhtml[data-dbk] [data-dbk-more~=\"up\"]:is(.tp-sheet, .tp-pop)::before, html[data-dbk] [data-dbk-more~=\"down\"]:is(.tp-sheet, .tp-pop)::after { visibility: visible; }\n/* the soft edges sit right at the pop-up's edge (a sticky edge stops at the padding, so it's pulled out by that much) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-sheet::before { top: -22px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-sheet::after { bottom: -26px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop::before { top: -10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop::after { bottom: -18px; }\n/* the trip's big title needs a longer fade at the top to read as \"more above\", not cut */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-sheet::before { height: 56px; margin-bottom: -56px; background: linear-gradient(to bottom, var(--wrc-paper) 30%, transparent); }\n/* a firmer bottom edge, so no sliver of a button shows through it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(.tp-sheet, .tp-pop)::after { height: 40px; background: linear-gradient(to top, var(--wrc-paper) 40%, transparent); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-sheet::after { margin-top: -40px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-pop::after { margin-top: -50px; }\n/* the trip's pinned × stays above the soft top edge */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .tp-head { z-index: 4 !important; }\n/* keyboard up: the trip's × scrolls with its title like every other pop-up's (pinned, it landed on top of the day's\n   menu or the tabs on a short phone); it's pinned again once the keyboard goes down */\nhtml[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w) .tp-head { position: relative !important; top: auto !important; }\n\n/* ═══ TRIP DAY, TIDIED (the designer, Oct 20) ═══\n   The day's heading (Day 1 · name, its date) is left-aligned like the stops under it, with its ⋯ on the right.\n   The day's ⋯ menu: buttons fit their words and sit side by side in one row per group (they wrap only when they\n   truly don't fit), all the same height and style; no stretched grid cells, no button alone in half a row. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-dayhead2 { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-dayhead2 .tp-dh-t { text-align: left !important; justify-content: flex-start !important; padding-right: 44px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) .tp-dayhead2 .tp-dh-d { text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-pop .tp-menu { display: flex !important; flex-direction: row !important; flex-wrap: wrap !important; justify-content: center !important; gap: 10px !important; width: auto !important; margin: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-pop .tp-menu .tp-linkbtn { flex: none !important; width: auto !important; min-width: 0 !important; grid-column: auto !important; white-space: nowrap; padding: 6px 13px !important; min-height: 36px !important; font-size: 14px !important; }\n/* the first small label sits as close under the title as a first box does in the other trip pop-ups */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o):not(#n):not(#m):not(#l):not(#k) .tp-pop .tp-pop-h + .tp-menu-l { margin-top: 0 !important; }\n/* the day's heading starts where the stops start (it had room kept on both sides for centering), and the hint under\n   Add a stop is left-aligned with the rest of the day */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-dayhead2 { padding-left: 2px !important; padding-right: 40px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-dayhead2 .tp-dh-t { padding-right: 0 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-sheet .tp-quick-hint { text-align: left !important; padding-left: 2px !important; }\n/* four buttons in a group sit two and two (never three and one alone), on a phone and on a computer */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) .tp-pop .tp-menu:has(> :nth-child(4)) { max-width: 310px !important; margin-left: auto !important; margin-right: auto !important; }\n\n/* ═══ ROOM AT THE END OF EVERY POP-UP (the designer, Oct 20): a touch of space under the last button before the pop-up\n   ends, never cut off right under it. About 28px everywhere; the click-through test (tools/snap/poke.mjs, endRoom)\n   flags any pop-up with less than 20px. ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.dbk-infocard, .dbk-catcard, .fin-sheet, .mprj-pop, .rt-sheet, .detail-popup-box, .tp-pop, .edit-reminder-modal:not(:has(> .modal-body)), .habits-modal, .dbk-confirm-card, .rl-pop-box, #rlPopBox) { padding-bottom: 28px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.modal, .edit-reminder-modal, .day-modal) > .modal-body:last-child { padding-bottom: 28px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) #locationSetupOverlay .edit-reminder-modal { padding-bottom: 28px !important; }\n/* a Settings card with a \"Saved\" note under its boxes keeps room for the note plus the same space at the end */\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .dbk-setx-card:has(> .dbk-setx-saved):not(:has(.dbk-ms)):not(:has(.dbk-look)) { padding-bottom: 38px !important; }\nhtml[data-dbk][data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .dbk-setx-card > .dbk-setx-saved { bottom: 12px !important; }\n\n/* Journal: rating a meal. No line under the recipe's name; the one line sits under \"Breakfast · day\", above the stars\n   (the designer, Oct 20) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) #mprjPop #mprjPopT:has(+ .mprj-when) { border-bottom: 0 !important; padding-bottom: 0 !important; }\n\n/* ═══ POP-UPS SCROLL, THEY DON'T SQUASH (the designer, Oct 20: \"Add a step won't scroll down, it's cut off\"): a pop-up\n   that stacks its parts in a column let them shrink when the screen was short, so a box (Notes) was squeezed and cut\n   instead of the pop-up scrolling. Every part keeps its size and the pop-up scrolls as one piece. The Inbox keeps its\n   own list that scrolls inside it (it's one fixed height on purpose). poke.mjs \"squashed\" checks this. ═══ */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) :is(.day-modal, .edit-reminder-modal, .reminder-modal, .rt-sheet, .habits-modal, :is(#addEventModalOverlay, #goals-modal, #add-recipe-modal, #add-snack-modal, #meal-picker-modal, #modal, #hh-confirm-modal, .modal-overlay) > .modal, .dream-form > form, .detail-popup-box, .tried-modal-box, .picker-filter-box, .skipped-answer-box, .seasonal-modal, .tp-pop, .wrc-sheet, .mprj-pop, #rlPopBox, .rl-pop-box, .fin-sheet, .dbk-infocard, .dbk-catcard, .dbk-confirm-card, #journal-day-popup > div, #resourceForm.event-form, .modal-body, .tp-sheet) > * { flex-shrink: 0 !important; }\n/* the bottom Close a long pop-up gets on a short screen has the same room under it as every pop-up's end */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) :is(.modal, .edit-reminder-modal, .day-modal) > .dbk-endclose:last-child { padding-bottom: 28px !important; }\n\n/* the Inbox on a phone: about 62% of the phone's whole screen, so it's the same big size in Safari (where the browser's\n   bars take some of the screen) as in the home-screen app; it still never runs past what's visible (the designer, Oct 20) */\n@media (max-width: 768px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) { --dbk-ibx-h: calc(0.62 * var(--dbk-scrh, calc(100 * var(--dbk-vh, 1vh)))); } }\n@media (max-width: 768px) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t) #inboxModal { height: min(calc(var(--dbk-vvh, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - var(--dbk-kbh, 0px) - var(--dbk-capbar-h, 58px) - var(--dbk-safe-bottom, env(safe-area-inset-bottom, 0px)) - 26px), var(--dbk-ibx-h)) !important; max-height: none !important; } }\n\n/* ═══ INBOX ON A PHONE: SIZED TO WHAT CAN BE SEEN (the designer, Oct 20) ═══\n   From under the top bar down to just above the capture bar (--dbk-ibx-bot, measured in popViewport), never taller\n   than about 62% of the phone's screen. With the keyboard up it reaches down to the keyboard. Before, the keyboard's\n   height was taken off twice: the Inbox shrank to nothing while typing, and in Safari it showed only two notes. */\n@media (max-width: 768px) {\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) #inboxModal { height: min(calc(var(--dbk-ibx-bot, calc(100 * var(--dbk-vh, 1dvh))) - var(--dbk-pop-top) - 26px), var(--dbk-ibx-h)) !important; max-height: none !important; }\n  html[data-dbk].dbk-kb:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) #inboxModal { height: min(max(200px, calc(var(--dbk-ibx-bot, 100vh) - var(--dbk-pop-top) - 16px)), var(--dbk-ibx-h)) !important; }\n}\n\n/* Today's greeting on two lines (a longer name): \"Good evening,\" then the name on its own line (daybook-theme.js) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .hm-greet.dbk-greet-2 .home-names { display: block !important; }\n\n/* ═══════════ THE × ON EVERY POP-UP: one place, one size (the designer, Oct 21) ═══════════\n   Each pop-up's × sits 10px in from the top and right edges of its card, 40px to tap, the same size everywhere.\n   It belongs to the card, so it scrolls away with the content instead of floating over the text (the trip page's\n   was pinned at the title's height and sat over the stops as they scrolled by). Its row (.wrc-head, .tp-head,\n   .tp-pop-h) no longer holds it in place; the card does. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) :is(.modal-close, .dbk-info-x, .wrc-x, .mprj-x, .fin-x, .tp-x, .rl-x, .habits-modal-close, .tried-x, .seasonal-modal-close, .rt-x, .reminder-modal-close, .detail-popup-close, .day-modal-close, .inbox-modal-close) {\n  position: absolute !important; top: 10px !important; right: 10px !important; left: auto !important; bottom: auto !important;\n  width: 40px !important; height: 40px !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;\n  display: flex !important; align-items: center !important; justify-content: center !important;\n  font-size: 24px !important; line-height: 1 !important; transform: none !important; z-index: 6 !important;\n  /* and the same × to look at: one typeface and weight, the pop-up's own text color */\n  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif !important; font-weight: 300 !important;\n  color: inherit !important; opacity: .8 !important; background: transparent !important; border: 0 !important; box-shadow: none !important; translate: none !important;\n}\n/* the rows that held a × (and moved it) leave it to the card; the trip page's card holds its own */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) :is(.wrc-head, .tp-head, .tp-pop-h, .reminder-modal-header, .modal-header, .inbox-header-top) { position: static !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) :is(.tp-sheet, .tp-pop) { position: relative !important; }\n/* TITLES CLEAR OF THE × (Kasey, Oct 22: \"some of the x's ... super close to text or overlapping\"). The × takes the\n   card's last 50px; a title keeps at least 58px from both edges of its card (8px of air beside the ×), the same on\n   the left so it stays centered, and a long one wraps evenly onto two lines. The earlier \"room for the x\" rule in\n   POP-UP TITLES lost to the title rule above it (its :is() holds ids, so it always won) and titles ran under the ×.\n   Room per title = 58px less how far its row already sits in from the card's edge. */\n/* titles whose row starts about 18-22px in from the card's edge (info cards, Settings, Money, Work, Lists, Inbox, Meals journal) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) :is(.dbk-info-title, .dbk-setx-h, .wb-pop-title, .fin-sheet > h3:first-of-type, .inbox-modal-title, .detail-popup-title, .rl-pop-h, .tp-pop-h > span, .tried-modal-title, .dream-form form > h3, #mprjPopT, #mcpT, #mpkT, .hwk-title, .ai-panel-title, .tp-sheet .tp-title) {\n  max-width: calc(100% - 80px) !important; padding-left: 0 !important; padding-right: 0 !important; margin-left: auto !important; margin-right: auto !important; text-wrap: balance !important; }\n/* titles in a header row that already sits about 45-57px in (Today's and Meals' older pop-ups) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) :is(.modal-header :is(.modal-title, h2, h3), .reminder-modal-title, #dayModalTitle, .day-modal-header :is(h2, h3), .section-modal-title, .seasonal-modal-title) {\n  max-width: calc(100% - 28px) !important; margin-left: auto !important; margin-right: auto !important; text-wrap: balance !important; }\n/* What's in Season: its title sits in a wrapper with no width of its own, so the line above (100% - 28px of that wrapper)\n   squeezed it to one word per line. The wrapper takes the header's width (Oct 22 audit). */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) .seasonal-modal-header > div:has(> .seasonal-modal-title) { flex: 1 1 auto !important; min-width: 0 !important; }\n/* Edit My Habits: its × sits further in (79px from the card's edge) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) .habits-modal-title { max-width: calc(100% - 48px) !important; margin-left: auto !important; margin-right: auto !important; text-wrap: balance !important; }\n\n/* ═══════════ RECIPES AS A PLAIN LIST (Settings > Meals > Recipes look: List; the designer, Oct 21) ═══════════\n   The notebook cards (lined, a red rule under the name, tilted, filed behind divider tabs) become one plain list:\n   each recipe a row with its name and its time and numbers under it, a thin line between rows, and the group names\n   as the app's usual small centered labels. */\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box { grid-template-columns: minmax(0, 1fr) !important; gap: 0 !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box > .rb-card {\n  background-image: none !important; background-color: transparent !important; transform: none !important; box-shadow: none !important;\n  border: 0 !important; border-bottom: 1px solid rgba(var(--rb-ink-rgb), .14) !important; border-radius: 0 !important; min-height: 0 !important; padding: 12px 36px 12px 4px !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box .rb-card-name { border-bottom: 0 !important; background: none !important; padding: 0 !important; margin: 0 0 2px !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box .rb-meta { line-height: 1.35 !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) #rb-grid.rb-box .rb-card-fav { top: 50% !important; transform: translateY(-50%) !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) .rb-tab { border-bottom: 0 !important; text-align: center; padding: 0 !important; margin: 22px 0 4px !important; line-height: 1.2 !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) .rb-tab:first-child { margin-top: 6px !important; }\nhtml.dbk-rb-plain[data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x):not(#w) .rb-tab span { background: none !important; padding: 0 !important; border: 0 !important; border-radius: 0 !important; font-size: var(--pop-lab-size, 14px) !important; letter-spacing: .06em !important; opacity: .8; }\n\n/* Meals > Plan: half the room it had at the end, above the capture bar (the designer, Oct 21) */\nhtml[data-dbk][data-dbk-page=\"meal-plan\"]:not(#z):not(#y):not(#x) #plan-view { padding-bottom: 0 !important; }\n\n/* TITLES WITHOUT THE LINE (the designer, Oct 21): the short line under a title is for main titles, or where nothing else\n   separates the title from what's under it. A day or date as the title, or a title right on top of a search bar, a\n   switch or a box that draws its own line, goes without it. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) :is(#mpkT, #dayModalTitle, #dbkCatT, .inbox-modal-title, .fin-sheet:has([data-daybody]) > h3, .fin-sheet > h3:has(+ .fin-seg)) {\n  border-bottom: 0 !important; padding-bottom: 0 !important;\n}\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) #dayModalTitle { margin-bottom: 14px !important; }\n/* ...but the day pop-up turned into \"Edit event\" has a main title, so it keeps the line like New Event's */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) #dayModalOverlay.hc-editing #dayModalTitle { padding-bottom: 6px !important; border-bottom: 0 !important; }\n/* and the same room under its Delete / Save as every other pop-up (it had 13px; the rule is about 28) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) #dayModalOverlay.hc-editing .day-modal { padding-bottom: 27px !important; }\n/* the Inbox: no line under its title, and the note count and Clear all sit a little lower (the designer, Oct 21) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .inbox-header-actions { margin-top: 6px !important; }\n\n/* Inbox on a phone: swipe a note left and the trash button slides in at its right, over where the suggestion sits\n   (dashboard.js, the end). The note doesn't move. The trash among a note's buttons is for computers. */\nhtml[data-dbk].dbk-ibx-swipe:not(#z):not(#y):not(#x):not(#w) #inboxBody { overflow-x: hidden !important; }\nhtml[data-dbk].dbk-ibx-swipe:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-item { position: relative; touch-action: pan-y; }\nhtml[data-dbk].dbk-ibx-swipe:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-icon.del { display: none !important; }\nhtml[data-dbk].dbk-ibx-swipe:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-item .ibx-quick { transition: opacity .15s ease; }\nhtml[data-dbk].dbk-ibx-swipe:not(#z):not(#y):not(#x):not(#w) #inboxBody .ibx-item.ibx-swiping .ibx-quick { opacity: 0; pointer-events: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .ibx-swipe-del { all: unset; box-sizing: border-box; cursor: pointer; position: absolute; top: 50%; right: 18px; z-index: 2;\n  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; color: var(--ibx-accent); border: 1px solid currentColor;\n  background: var(--ibx-bg, inherit); will-change: transform, opacity; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .ibx-swipe-del svg { width: 17px; height: 17px; }\n\n/* Inbox: an opened note's Tag, Send to and pencil sit at the right, not straight under the words (the designer, Oct 21) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) #inboxBody .ibx-acts { justify-content: flex-end !important; }\n\n/* ═══ A SLIMMER MENU BAR (Kasey, Oct 21: \"a bit skinnier, so there is more room for page content\") ═══\n   The row is 42px instead of 52px, and in the home-screen app it sits 4px under the clock instead of 14px. Pages that\n   start under it measure it (snapUnder in daybook-theme.js), so they follow on their own; the rest are moved up here. */\nhtml[data-dbk]:not(#z):not(#y):not(#x) nav.top-nav .nav-container,\nhtml[data-dbk]:not(#z):not(#y):not(#x) nav.top-nav .nav-links,\nhtml[data-dbk]:not(#z):not(#y):not(#x) nav.top-nav .nav-link,\nhtml[data-dbk]:not(#z):not(#y):not(#x) nav.top-nav .dbk-title-btn,\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkGear,\nhtml[data-dbk]:not(#z):not(#y):not(#x) #dbkHomeBtn { height: 42px !important; }\nhtml.dbk-has-hero:not(#z):not(#y):not(#x) nav.top-nav { height: auto !important; }\n/* Home-screen app (Kasey, Oct 21: \"top of the menu text is a bit blurry\"): a newer iPhone softly blurs whatever sits\n   just under the clock, and 4px under it the top of the page name fell inside that blur. The row starts 14px under\n   the clock again (as it did before the slimmer bar) and is 40px tall: 54px in all, still 12px less than the old 66px.\n   Smaller text (zoom below 1, dbk-look.js) keeps the 14px on screen: the gap is divided by --dbk-zoom there. */\nhtml.dbk-standalone.dbk-has-hero:not(#z):not(#y):not(#x) nav.top-nav { padding-top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + max(14px, calc(14px / var(--dbk-zoom, 1)))) !important; }\n@media (display-mode: standalone) { html.dbk-has-hero:not(#z):not(#y):not(#x) nav.top-nav { padding-top: calc(var(--dbk-safe-top, env(safe-area-inset-top, 0px)) + max(14px, calc(14px / var(--dbk-zoom, 1)))) !important; } }\nhtml.dbk-standalone[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(nav.top-nav .nav-container, nav.top-nav .nav-links, nav.top-nav .nav-link, nav.top-nav .dbk-title-btn, #dbkGear, #dbkHomeBtn) { height: 40px !important; }\n@media (display-mode: standalone) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w) :is(nav.top-nav .nav-container, nav.top-nav .nav-links, nav.top-nav .nav-link, nav.top-nav .dbk-title-btn, #dbkGear, #dbkHomeBtn) { height: 40px !important; } }\nhtml.dbk-standalone[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-pagepop { top: calc(40px + max(14px, calc(14px / var(--dbk-zoom, 1))) + var(--dbk-safe-top, env(safe-area-inset-top, 0px))) !important; }\n@media (display-mode: standalone) { html[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-pagepop { top: calc(40px + max(14px, calc(14px / var(--dbk-zoom, 1))) + var(--dbk-safe-top, env(safe-area-inset-top, 0px))) !important; } }\nhtml[data-dbk]:not(#z):not(#y):not(#x) .dbk-pagepop { top: calc(42px + var(--dbk-safe-top, env(safe-area-inset-top, 0px))) !important; }\n/* the × focused when a pop-up opens: no focus box until the keyboard is used (dbkQuietFocus in daybook-theme.js) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u) [data-dbk-qf]:focus { outline: none !important; box-shadow: none !important; }\n\n/* ═══ TODAY'S EVENT AND REMINDER FORMS, OPENED OVER THE WORK PAGE (work-spaces.js dbkWorkForm, app.html overlay) ═══\n   Work's \"+ Work event\", \"+ Reminder\" and its rows open Today's own forms. Today's page lies over Work showing only\n   the pop-up (and what it opens: a date picker, an \"are you sure?\"); Work stays underneath, blurred and veiled by its\n   own copy of the pop-up backdrop (dbkUnderVeil), so it looks exactly like a pop-up opened on Work. */\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e), html.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) body { background: transparent !important; background-image: none !important; }\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) body { visibility: hidden !important; }\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) body :not(.dbk-wkform, .dbk-wkform *, .dbk-confirm, .dbk-confirm *, .hh-dp-popover, .hh-dp-popover *, .lh-confirm-overlay, .lh-confirm-overlay *, .dbk-notice, .dbk-notice *) { visibility: hidden !important; }\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) :is(.dbk-wkform, .dbk-confirm, .hh-dp-popover, .lh-confirm-overlay, .dbk-notice) { visibility: visible !important; }\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) .dbk-wkform { background: transparent !important; background-color: transparent !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }\nhtml:not(#a):not(#b):not(#c):not(#d):not(#e) #dbkUnderVeil { position: fixed !important; inset: 0 !important; z-index: 2147483000 !important; background: var(--dbk-pop-veil, rgba(28,34,26,0.24)) !important; -webkit-backdrop-filter: var(--dbk-pop-blur, blur(10px)) !important; backdrop-filter: var(--dbk-pop-blur, blur(10px)) !important; pointer-events: none !important; }\n\n/* WORDS NEVER BREAK IN THE MIDDLE (Kasey, Oct 22: \"Not a subscriptio / n … should never happen no matter what\n   anywhere\"). Lines break only between words, on every page, whatever an older rule said (overflow-wrap: anywhere,\n   word-break: break-all). A word too wide for its box is made a little smaller to fit instead (dbkFitWords, end of\n   daybook-theme.js). Text boxes being typed in are left as they are. */\nhtml[data-dbk] *:not(input):not(textarea), html[data-dbk] *::before, html[data-dbk] *::after { overflow-wrap: normal !important; word-wrap: normal !important; word-break: normal !important; -webkit-hyphens: manual !important; hyphens: manual !important; }\nhtml[data-dbk] :is(.fin-amt, .fin-damt) { white-space: nowrap !important; }\n\n/* WORK > \"NEED AN IDEA?\" (Kasey, Oct 22: \"move the main content up a bit, and probably the title too\"): the title starts\n   6px higher and the idea sits right under the title's line instead of 36px below it */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .wb-sheet.wrc-idea { padding-top: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .wb-sheet.wrc-idea .wrc-head { margin-top: -10px !important; margin-bottom: -28px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .wb-sheet.wrc-idea .wb-pop-body { margin-top: 10px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q) .wb-sheet.wrc-idea .wrc-prompt { padding-top: 6px !important; }\n\n/* POP-UPS ON A COMPUTER (Kasey, Oct 22: a Work content idea \"sits way too low and is too small\" on her laptop).\n   With a mouse or trackpad and a wide screen, pop-ups don't follow the phone's size rules: they start near the top\n   (20px), use all the room down to the capture bar instead of 76% of the screen, and the ones full of content (Work,\n   Money, trips, recipes) are wider. A short pop-up still sits in the middle. Phones and tablets are unchanged. */\n@media (min-width: 900px) and (hover: hover) and (pointer: fine) {\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) {\n    --dbk-pop-top: 20px; --dbk-popcap: 10000px; --dbk-popcap-big: 10000px;\n    /* the Inbox keeps its top and reaches down to just above the capture bar, so more notes show (Kasey, Oct 22) */\n    --dbk-ibx-h: 10000px;\n  }\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) :is(.wrc-sheet:not(.wb-home), .tp-sheet) { width: 100% !important; max-width: 680px !important; }\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) :is(.fin-sheet, #add-recipe-modal > .modal) { width: 100% !important; max-width: 600px !important; }\n  /* Money's pop-ups sat under the menu bar (3000 against its 9999); starting higher, their tops were hidden */\n  html[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p) .fin-sheet-overlay { z-index: 30000 !important; }\n}\n\n/* Edit event is the New event pop-up (Kasey, Oct 22: one form): Delete only while editing, and no \"Date Type\" (an edit\n   changes this one event); one of several dates keeps its date, so its day picker doesn't show */\n#addEventModalOverlay:not(.dbk-ev-editing) #dbkEvDel { display: none !important; }\n#addEventModalOverlay.dbk-ev-editing .form-group:has(> #calendarRepeatMode) { display: none !important; }\n#addEventModalOverlay.dbk-ev-group #singleDateMode > .form-group:has(.hh-datepicker) { display: none !important; }\n/* ...and says which date it is instead (Oct 24): \"Sat, Oct 25 · one of 12 dates\", under a Date label */\n#addEventModalOverlay:not(.dbk-ev-group) #dbkEvOneDate { display: none !important; }\n#addEventModalOverlay #dbkEvOneDate .dbk-ev-onedate-v { text-align: center; font-size: 16px; line-height: 1.35; }\n/* Delete on one of several dates (Kasey, Oct 24): This date | All N dates, in the app's small two-button pop-up */\n.dbk-evdates .dbk-evdates-sub { margin-top: 6px; font-size: 14px; line-height: 1.35; opacity: 0.75; }\n\n/* THE MESSAGE SPOT ON A DARK LOOK (Kasey, Oct 23: \"the undo is very light on my dark screen … it shouldn't be bright\n   white\"): the lightest colour of the look's own palette (its accent; Midnight's green, or the light one made from a\n   person's own colour, which the look's recolour puts in place of these two), with the darkest colour for the words */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v) :is(.dbk-notice, .toast, .toast-container > *) { background: #8fc98a !important; color: #06080b !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-notice :is(.dbk-n-undo, .lh-toast-undo, .toast-undo) { color: #06080b !important; border-color: #06080b !important; background: transparent !important; }\n\n/* 2T, Money and Meals (Kasey, Oct 23): the strip behind the tabs takes the colour of the card right under it when that\n   card is darker than the page, so it doesn't sit light between the dark top bar and a dark card (tabStrip in\n   daybook-theme.js sets --dbk-strip and the reach up to the menu and down to the card) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs.dbk-strip-on { position: relative; isolation: isolate; color: var(--dbk-strip-ink); border-color: color-mix(in srgb, var(--dbk-strip-ink) 35%, transparent); }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-mealtabs.dbk-strip-on::before { content: \"\"; position: absolute; z-index: -1; left: 50%; width: 100vw; transform: translateX(-50%); top: calc(-1px - var(--dbk-strip-up, 14px)); bottom: calc(-1px - var(--dbk-strip-down, 14px)); background: var(--dbk-strip); pointer-events: none; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .dbk-mealtabs.dbk-strip-on button.on { background: var(--dbk-strip-ink) !important; color: var(--dbk-strip) !important; -webkit-text-fill-color: var(--dbk-strip) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) .dbk-mealtabs.dbk-strip-on button:not(.on) { color: var(--dbk-strip-ink) !important; -webkit-text-fill-color: var(--dbk-strip-ink) !important; }\n/* (the readability check sees the page behind the tabs, not the strip drawn under them, and painted the words dark on\n   the dark strip: Budget, Accounts, Bills and Recipes, Grocery, Journal could not be read; design audit, Oct 23) */\n\n/* An event or reminder opened from Work (Kasey, Oct 23: \"there's a flash when I open an event in Work\"): the form shows at\n   once over Work instead of fading in, which let Work's own page show through the form for a moment */\nhtml.dbk-wkover:not(#a):not(#b):not(#c):not(#d):not(#e) :is(.dbk-wkform, .dbk-wkform *) { transition: none !important; animation: none !important; }\n\n/* A bill's reminder says the account it usually comes out of, under its name in All reminders (Kasey, Oct 23);\n   Today's calendar line keeps to the name (tapping it opens Edit reminder, where the line is the description) */\nhtml[data-dbk]:not(#z):not(#y):not(#x) #reminderModalList .dbk-rem-acct { display: block; font-size: 0.82rem; opacity: 0.75; margin-top: 2px; }\n\n/* Resources: a thing's link sits on the right, under its pencil and × (Kasey, Oct 23) */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkResLink .resource-item { display: flex !important; align-items: flex-start; gap: 12px; padding-right: 2px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkResLink .resource-item-content { flex: 1 1 auto; min-width: 0; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkResLink .resource-item-actions { position: static !important; flex: none; display: flex !important; flex-wrap: wrap; justify-content: flex-end; align-items: center; max-width: 46%; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkResLink .resource-item-linkw { flex-basis: 100%; text-align: right !important; margin-top: 2px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkResLink .resource-item-linkw .resource-item-link { display: inline-block; text-align: right !important; font-size: 0.86rem; }\n\n/* Settings > Notifications on an iPhone (Kasey, Oct 23): Safari gives a time box a width of its own, wider than the\n   pop-up, so the \"At\" box ran off the side and the whole pop-up slid sideways. Every time box fits its row, the quiet\n   hours pair shares the row, and Settings' pop-ups never scroll sideways. */\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) input[type=\"time\"] { -webkit-appearance: none !important; appearance: none !important; display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) input[type=\"time\"]::-webkit-date-and-time-value { text-align: center; margin: 0; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-nt-quiet input[type=\"time\"] { flex: 1 1 0 !important; width: auto !important; max-width: 130px !important; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) :is(.dbk-setx-in, .section-body) { overflow-x: hidden; max-width: 100%; }\nhtml[data-dbk-page=\"settings\"]:not(#z):not(#y):not(#x):not(#w):not(#v) .dbk-setx-in { touch-action: pan-y; }\n\n/* Money on Midnight (design audit, Oct 23): its filled buttons (Save, Edit, Connect) and picked choices (Bills |\n   Subscriptions, How often, filters) were near-white, the only bright white blocks in the dark look; every other page\n   fills them with the look's green. Same green and dark words here (a dark own colour recolours it like the rest). */\nhtml[data-dbk=\"p2\"]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s) :is(.fin-btn:not(.ghost), .fin-seg button[aria-pressed=\"true\"], .fin-subtabs button[aria-selected=\"true\"], .fin-fchip[aria-pressed=\"true\"], .fin-kind[aria-pressed=\"true\"]) { background: #8fc98a !important; color: #0c1118 !important; border-color: #8fc98a !important; }\n\n/* No phone- or computer-drawn controls (design audit, Oct 23, after the Notifications time box and the packing list's\n   black tick boxes): every date and time box is the app's own text box (no width of its own, never wider than its row;\n   rules above for particular boxes still decide their width and alignment), and number boxes have no up/down arrows\n   (a Mac drew grey arrows inside Amount, Due on day, Makes … servings; typing and the arrow keys still work). */\nhtml[data-dbk] input:is([type=\"date\"], [type=\"time\"], [type=\"datetime-local\"], [type=\"month\"]) { -webkit-appearance: none; appearance: none; min-width: 0; max-width: 100%; box-sizing: border-box; }\nhtml[data-dbk] input:is([type=\"date\"], [type=\"time\"], [type=\"datetime-local\"], [type=\"month\"])::-webkit-date-and-time-value { min-height: 1.2em; }\nhtml[data-dbk] input[type=\"number\"] { -moz-appearance: textfield; appearance: textfield; }\nhtml[data-dbk] input[type=\"number\"]::-webkit-inner-spin-button, html[data-dbk] input[type=\"number\"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }\n/* Round choices (Settings > What shows > Monthly challenge) drawn like the app's tick boxes, not the phone's own dark\n   circles: a ring when empty, a dot of the main colour when picked */\nhtml[data-dbk]:not(#z):not(#y) input[type=\"radio\"] { -webkit-appearance: none !important; appearance: none !important; width: 18px !important; height: 18px !important; min-width: 18px !important; flex: 0 0 18px !important; margin: 0 !important; padding: 0 !important; border-radius: 50% !important; border: 1.5px solid rgba(var(--dbk-green-rgb), 0.55) !important; background: #fffdf8 !important; display: inline-grid !important; place-content: center; cursor: pointer; vertical-align: middle; }\nhtml[data-dbk]:not(#z):not(#y) input[type=\"radio\"]:checked { border-color: var(--dbk-fill, var(--dbk-green)) !important; background: radial-gradient(circle, var(--dbk-fill, var(--dbk-green)) 0 4.5px, transparent 5px) #fffdf8 !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) input[type=\"radio\"] { border-color: rgba(230,234,239,0.6) !important; background: rgba(230,234,239,0.08) !important; }\nhtml[data-dbk=\"p2\"]:not(#z):not(#y) input[type=\"radio\"]:checked { border-color: #8fc98a !important; background: radial-gradient(circle, #8fc98a 0 4.5px, transparent 5px) rgba(230,234,239,0.08) !important; }\nhtml[data-dbk]:not(#z):not(#y) input[type=\"radio\"]:focus-visible { outline: 2px solid var(--lh-secondary) !important; outline-offset: 2px; }\n\n/* NO LINE UNDER TITLES (Kasey, Oct 25: \"These underlined titles are driving me nuts in like 50% of the app. Get rid of\n   this.\"): no pop-up, sheet or card title has a line under it any more, short or long. The space the line took stays. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v):not(#u):not(#t):not(#s):not(#r):not(#q):not(#p):not(#o) :is(.modal-header :is(.modal-title, h2, h3), .reminder-modal-title, .habits-modal-title, .inbox-modal-title, #dayModalTitle, .day-modal-header :is(h2, h3), .section-modal-title, .seasonal-modal-title, .tried-modal-title, .dbk-setx-h, .dbk-info-title, .detail-popup-title, .fin-sheet > h3:first-of-type, .wb-pop-title, #mprjPopT, #mprjPop .mprj-when, .rl-pop-h, .tp-pop-h > span, .dream-form form > h3, #mprjPop .mprj-when, .rl-pop-h, .tp-pop .tp-pop-h, #dayModalTitle, .dbk-vaultcard .dbk-info-title) {\n  border-bottom: 0 !important; text-decoration: none !important; box-shadow: none !important;\n}\n/* Work, one business at a time (Kasey, Oct 25): a small Switch business under the date, and its pop-up's businesses\n   side by side (onto a second line only when they don't fit), the open one filled */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wt-switch { display: flex; justify-content: center; margin-top: 14px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wt-switch .dbk-obtn { min-height: 34px; padding: 4px 16px; font-size: 14px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .wk-switch-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 10px 0 6px; }\n\n/* THE MONTHLY CHALLENGE, SMALLER (Kasey, Oct 25: \"maybe we make the monthly challenge a little smaller?\"): less room\n   around it, a smaller title and challenge line; the same layout */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge { padding-top: 20px !important; padding-bottom: 20px !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge .dbk-chal { gap: 10px; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge .dbk-chal .dbk-chal-h { font-size: 1.55rem !important; line-height: 1.2 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge :is(.dbk-chal-row, .dbk-chal-text) { font-size: 0.95rem !important; line-height: 1.45 !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) #dbkChallenge .dbk-chal-box { width: 17px; height: 17px; margin-top: 3px; }\n/* New Event: Close sits beside Save Event, the same height, outline (Kasey, Oct 31: \"Save event & close, put side by\n   side\"; it was a line of its own right under Save and she kept tapping it). Edit event ends in Delete | Save like Edit\n   reminder, so no Close there. */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) #addEventModalOverlay .form-actions { align-items: stretch !important; flex-wrap: nowrap !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) #addEventModalOverlay .form-actions .dbk-endclose-btn { order: -1; min-height: 0 !important; padding: 7px 18px !important; border-radius: 4px !important; border-color: color-mix(in srgb, currentColor 45%, transparent) !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w):not(#v) #addEventModalOverlay.dbk-ev-editing .form-actions .dbk-endclose-btn { display: none !important; }\n\n/* WORK ON A DARK LOOK (Kasey, Nov 1, her plum: \"Literally everything is basically black except for the rest of the week\n   section\"). In the dark family the pink, linen, sand and dark bands are near the page's own shade, so on Work only\n   The rest of the week (celadon) showed as a card. On the Work page they take the look's own card colours instead (no\n   new colours: your colour, and its close neighbour for Work's Three and the Next line); the header stays on the page.\n   Only Work: Kasey keeps the dark looks as they are everywhere else. */\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y) .wt-band:is(.dbk-pinkb, .dbk-linenb):not(.wt-a) { background: #121c2b !important; --bandc: #121c2b; }\nhtml[data-dbk=\"p2\"][data-dbk-page=\"workroom\"]:not(#z):not(#y) .wt-band:is(.dbk-sandb, .dbk-darkb) { background: #17263d !important; --bandc: #17263d; }\n\n/* Settings > Submit a ticket (settings.html buildTicket): Account's fields, plus a box to write in */\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-tk textarea { display: block; width: 100%; box-sizing: border-box; padding: 10px 12px; font-size: 16px; line-height: 1.45; min-height: 7.5em; resize: vertical; text-align: left !important; }\nhtml[data-dbk]:not(#z):not(#y):not(#x):not(#w) .dbk-tk .dbk-tk-note { margin: 12px 0 0; font-size: 0.86rem; line-height: 1.45; opacity: 0.75; text-wrap: balance; }\n","dbk-app-fonts.css":"@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: block; src: url(/fonts/dbk-app/lora-50c0af0f.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400; font-display: block; src: url(/fonts/dbk-app/lora-1ace0d36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Lora'; font-style: normal; font-weight: 500; font-display: block; src: url(/fonts/dbk-app/lora-1ace0d36.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Playfair Display'; font-style: italic; font-weight: 400; font-display: block; src: url(/fonts/dbk-app/playfair-display-c025e8cc.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 400; font-display: block; src: url(/fonts/dbk-app/playfair-display-61a96359.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Playfair Display'; font-style: normal; font-weight: 700; font-display: block; src: url(/fonts/dbk-app/playfair-display-61a96359.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Playfair Display SC'; font-style: normal; font-weight: 400; font-display: block; src: url(/fonts/dbk-app/playfair-display-sc-9209be30.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n@font-face { font-family: 'Playfair Display SC'; font-style: normal; font-weight: 700; font-display: block; src: url(/fonts/dbk-app/playfair-display-sc-12498bcd.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }\n"}}