/* Reading owns a fluid viewport layout, independent of the library page grid. */
body[data-view="read"] .shell.reading-shell{height:100dvh;min-height:0;padding:16px max(22px,env(safe-area-inset-right)) max(10px,env(safe-area-inset-bottom)) max(22px,env(safe-area-inset-left));overflow:hidden}
body[data-view="read"] .frame.reading-frame{display:flex;flex-direction:column;gap:8px;width:100%;max-width:none;height:100%;margin:0;min-height:0}
body[data-view="read"] .reading-frame>.reader{flex:1 1 0;width:100%;max-width:none;min-width:0;min-height:0;height:auto;margin:0;align-self:stretch}
body[data-view="read"] .reading-frame>.syncstatus{flex:none;margin:0;padding:0}
body[data-view="read"] .reading-frame .storybook{width:100%;max-width:none;justify-self:stretch}
@media(max-width:740px){body[data-view="read"] .shell.reading-shell{padding:10px max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}}
/* A focused daily quest, with a persistent paint-and-stamp palette. */
body .routine-chart{width:100%;max-width:1060px;padding:28px 32px!important;border:1px solid #f5e4b6aa;border-radius:28px;background:linear-gradient(145deg,#fffaf0,#f4ecfa);box-shadow:0 15px 40px #21123126}
.routine-chart-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:18px 0 24px}.routine-eyebrow{font-size:10px;font-weight:800;letter-spacing:.18em;color:#956b9e}
body .routine-chart-heading h1{margin:6px 0 8px;font-size:clamp(29px,4vw,42px);line-height:1.12;letter-spacing:-.035em}.routine-chart-heading p{font-size:14px;color:#8a7193;margin:0}.routine-heading-seal{display:grid;place-items:center;width:68px;height:68px;border:1px solid #d7b7e5;border-radius:22px;background:linear-gradient(140deg,#f6e3fb,#e4d6f3);color:#8b59a5;rotate:8deg}.routine-heading-seal .ui-icon{width:35px;height:35px}
body .routine-chart .routine-reading-link{font-size:12px;min-height:36px;padding:7px 12px;box-shadow:none;background:#fff9ef;border:1px solid #dbc6e3;border-radius:11px}
body .routine-chart .routine-calendar{gap:8px;padding:6px;background:#e8dded80;border:1px solid #e2d3e9;border-radius:18px}
body .routine-chart .routine-calendar button{position:relative;display:flex;align-items:center;justify-content:center;gap:4px;min-height:50px;padding:10px 4px;border:1px solid transparent;border-radius:12px;background:transparent;font-size:13px;color:#84688e;transition:background .2s,transform .2s;box-shadow:none}
body .routine-chart .routine-calendar button strong{font-size:13px;font-weight:700}
body .routine-chart .routine-calendar button[aria-pressed="true"]{background:#654080;color:#fff5df;border-color:#82589d;box-shadow:0 3px 10px #65408025}
body .routine-chart .routine-calendar button:hover{transform:translateY(-2px);border-color:#c7afd3}
body .routine-chart .routine-calendar button.routine-day-complete:not([aria-pressed="true"]){background:#def0e5;color:#37714e}
body .routine-chart .routine-day-state{font-size:0;gap:0}.routine-chart .routine-day-state .ui-icon{width:12px;height:12px}
.routine-daily-progress{display:flex;align-items:center;gap:20px;margin:20px 2px;color:#6d527a}.routine-daily-progress strong{font-size:12px;white-space:nowrap}.routine-progress-track{display:block;flex:1;height:6px;border-radius:8px;background:#e4d5ed;overflow:hidden}.routine-progress-track i{display:block;height:100%;background:linear-gradient(90deg,#9661b0,#c190ce);border-radius:inherit;transition:width .4s ease}
body .routine-chart #routine-status{min-height:18px;margin:8px 0;font-size:12px}body .routine-chart #routine-status:empty{min-height:0;margin:0}
body .routine-chart .routine-task-list{display:grid;grid-template-columns:minmax(0,1fr);gap:12px;padding:4px 0 16px;scroll-margin-top:150px;width:100%;max-width:520px;margin:0 auto}
body .routine-chart .routine-task{min-width:0;margin:0;padding:14px;border:1px solid #e2d4e9;border-radius:20px;background:#fffcf9;box-shadow:0 3px 12px #70528a06;transition:border-color .2s,box-shadow .2s}
body .routine-chart .routine-task:hover{border-color:#c5a3d5;box-shadow:0 5px 16px #70528a12}
body .routine-chart .routine-task-main{display:grid;grid-template-columns:68px minmax(0,1fr) 64px;align-items:center;gap:12px}
body .routine-chart .routine-task-main>.task-graphic{width:68px;height:68px}
body .routine-chart .routine-task-main h2{min-width:0;font-size:17px;line-height:1.3;font-weight:700;color:#50305f;overflow-wrap:anywhere}
body .routine-chart .routine-bonus-label{display:block;width:fit-content;margin:6px 0 0;padding:3px 6px;font-size:8px;line-height:1.2;letter-spacing:.08em;text-transform:uppercase;background:#f2e5cf;color:#9b773b;border-radius:5px}
body .routine-chart .routine-sticker-button{display:grid;place-items:center;width:64px;height:64px;min-height:64px;margin:0;padding:6px;border:1px solid #d1b9df;border-radius:17px;box-shadow:none;color:#9671ac;transition:transform .18s,border-color .2s}
body .routine-chart .routine-sticker-button.sticker-ready{background:linear-gradient(140deg,#f6edfc,#eee3f6)!important;border:1.5px dashed #cbb2de}
body .routine-chart .routine-sticker-button:not(:disabled):hover{transform:scale(1.07);border-color:#8f5aae}
body .routine-chart .routine-sticker-button:not(:disabled):active{transform:scale(.92)}
body .routine-chart .routine-sticker-button .routine-art{width:50px;height:50px}
.stamp-target{display:grid;place-items:center;gap:4px}.stamp-target .ui-icon{width:22px;height:22px}.stamp-target small{font-size:8px;line-height:1.1}.stamp-saving{font-size:9px}.sticker-pending{opacity:.65}
body .routine-chart .routine-stamp-dock{position:sticky;bottom:max(12px,env(safe-area-inset-bottom));z-index:30;max-width:660px;margin:4px auto 24px;padding:14px 18px 12px;border:1px solid #e5c6f45c;border-radius:24px;background:linear-gradient(130deg,#35213ff5,#5d3c72f5);color:#fff5df;box-shadow:0 12px 35px #28123540,inset 0 1px #fff3;backdrop-filter:blur(20px);-webkit-backdrop-filter:blur(20px);transition:opacity .2s,translate .2s}
body .routine-chart .routine-stamp-dock:not(.palette-in-view){opacity:0;pointer-events:none;visibility:hidden}
.stamp-dock-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:11px}.stamp-dock-heading strong{font-size:12px}.stamp-dock-heading>span{font-size:10px;color:#d9c0e3}
.stamp-dock-shapes{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:8px}
body .routine-chart .stamp-dock-shapes button{display:grid;place-items:center;min-width:0;width:100%;height:56px;min-height:56px;margin:0;padding:5px;border:2px solid #ffffff25;border-radius:14px;box-shadow:none;transition:transform .2s,outline-color .2s;cursor:pointer}
body .routine-chart .stamp-dock-shapes button[aria-pressed="true"]{outline:2px solid #ffe0a0;outline-offset:3px;border-color:#fff7d4;transform:translateY(-3px)}
body .routine-chart .stamp-dock-shapes button:hover{transform:translateY(-3px)}
.stamp-dock-shapes .routine-art{width:43px;height:43px}
body .routine-chart .stamp-dock-shapes .stamp-eraser{background:#ffffff12;color:#e8d6ee;gap:0}.stamp-eraser .ui-icon{width:23px;height:23px}.stamp-eraser small{font-size:8px}
.stamp-dock-colors{display:flex;align-items:center;justify-content:center;gap:4px;margin-top:10px}
body .routine-chart .stamp-dock-colors button{position:relative;display:grid;place-items:center;width:35px;height:32px;min-height:32px;margin:0;padding:0;border:0;background:transparent;box-shadow:none}
.stamp-dock-colors button:before{content:'';display:block;width:17px;height:17px;border-radius:50%;background:var(--swatch);border:1px solid #ffffff66}.stamp-dock-colors button[aria-pressed="true"]:before{outline:2px solid #ffe1a0;outline-offset:3px}
body .routine-chart .routine-prize{display:grid;grid-template-columns:180px minmax(0,1fr);gap:8px 24px;align-items:center;padding:24px;margin:16px 0 24px;background:linear-gradient(120deg,#f9eed7,#efdef5);border-color:#e3cba4}
body .routine-chart .routine-prize>img{grid-column:1;grid-row:1/6;width:180px;height:180px;object-fit:contain;background:#fff9;border-radius:20px}
body .routine-chart .routine-prize h2{font-size:11px;letter-spacing:.1em;text-transform:uppercase;color:#94739e;margin:0}.routine-prize h3{margin:0;font-size:23px;line-height:1.25}.routine-prize p{margin:0;font-size:12px;line-height:1.5}
body .routine-chart .routine-week-nav{gap:12px;justify-content:space-between;margin:20px 0 0}.routine-week-nav>.back{font-size:11px;min-height:40px;padding:8px 12px;box-shadow:none}.routine-week-nav>strong{font-size:12px;color:#997da2}
@media(prefers-reduced-motion:no-preference){.sticker-ready:not(:disabled) .stamp-target>.ui-icon{animation:stamp-invite 2.8s ease-in-out 3}.routine-chart .sticker-just-placed .routine-art{animation:stamp-pop .4s cubic-bezier(.2,1.6,.4,1)}@keyframes stamp-invite{0%,65%,100%{scale:1;opacity:.65}80%{scale:1.18;opacity:1}}@keyframes stamp-pop{0%{scale:.6;rotate:-12deg}70%{scale:1.12;rotate:3deg}100%{scale:1;rotate:0deg}}}
@media(max-width:740px){body .routine-chart{padding:20px 16px!important;border-radius:24px}body .routine-chart .routine-task-list{grid-template-columns:minmax(0,1fr);gap:10px}body .routine-chart .routine-task-main{grid-template-columns:64px minmax(0,1fr) 60px;gap:12px}body .routine-chart .routine-task-main>.task-graphic{width:64px;height:64px}body .routine-chart .routine-task-main h2{font-size:17px}body .routine-chart .routine-sticker-button{width:60px;height:60px;min-height:60px}.routine-heading-seal{width:52px;height:52px;border-radius:17px}.routine-heading-seal .ui-icon{width:28px;height:28px}.routine-chart-heading{margin-bottom:20px}.routine-chart-heading p{font-size:12px}body .routine-chart .routine-calendar{gap:3px;padding:4px}body .routine-chart .routine-calendar button{min-height:44px;padding:8px 1px}body .routine-chart .routine-calendar button strong{font-size:11px}.routine-daily-progress{gap:12px}.routine-daily-progress strong{font-size:11px}body .routine-chart .routine-stamp-dock{padding:12px 9px 9px;border-radius:20px;bottom:max(8px,env(safe-area-inset-bottom));margin-inline:-7px}.stamp-dock-heading{padding:0 4px;margin-bottom:12px}.stamp-dock-heading strong{font-size:10px}.stamp-dock-heading>span{display:none}.stamp-dock-shapes{gap:4px}body .routine-chart .stamp-dock-shapes button{height:44px;min-height:44px;border-radius:11px;padding:3px}.stamp-dock-shapes .routine-art{width:32px;height:32px}.stamp-eraser small{font-size:7px}.stamp-dock-colors{gap:0;margin-top:7px}body .routine-chart .stamp-dock-colors button{height:30px;min-height:30px;width:30px}body .routine-chart .routine-prize{grid-template-columns:110px minmax(0,1fr);padding:16px;gap:8px 14px}body .routine-chart .routine-prize>img{width:110px;height:110px}.routine-prize h3{font-size:18px}body .routine-chart .routine-week-nav strong{width:auto;order:0}.routine-week-nav>.back{font-size:10px;padding:8px}}
@media(prefers-reduced-motion:reduce){.routine-chart *{animation:none!important;transition:none!important}}

.stamp-dock-error{font-size:11px;color:#ffd3c3;margin:0 0 10px;line-height:1.4}
@media(max-width:740px){.stamp-dock-shapes{grid-template-columns:none;grid-auto-flow:column;grid-auto-columns:44px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;padding:12px 8px 8px;gap:8px}.stamp-dock-shapes::-webkit-scrollbar{display:none}.stamp-dock-colors{gap:0}body .routine-chart .stamp-dock-colors button{width:28px}}

/* Reward images always lead, in both routine and reading quests. */
body .routine-chart .routine-prize>:not(img){grid-column:2;min-width:0}
body .routine-chart .routine-prize:not(:has(img)){grid-template-columns:minmax(0,1fr)}
body .routine-chart .routine-prize:not(:has(img))>*{grid-column:1}
body .routine-chart .routine-stamp-dock{max-width:560px}





body .reward-manager .parent-reward-current{border-radius:22px;border:1px solid #e3cba4;background:linear-gradient(120deg,#fff8e9,#f7eefb);box-shadow:0 4px 16px #70528a0c}
body .reward-manager .parent-reward-summary>.reward-picture{width:112px;height:112px;flex-basis:112px;border-radius:18px;border:1px solid #e5d5dc;background:#fff9}
body .reward-manager .parent-reward-summary h2{line-height:1.3;overflow-wrap:anywhere}
@media(max-width:740px){body .routine-chart .routine-task-list{max-width:520px}body .reward-manager .parent-reward-summary>.reward-picture{width:88px;height:88px;flex-basis:88px}}
@media(max-width:380px){body .routine-chart .routine-prize{grid-template-columns:88px minmax(0,1fr);gap:8px 12px}body .routine-chart .routine-prize>img{width:88px;height:100px}}

@media(max-width:740px){body .reward-manager .parent-reward-summary{display:grid;grid-template-columns:88px minmax(0,1fr);gap:10px 14px;align-items:center}body .reward-manager .parent-reward-summary>.reward-picture{grid-column:1;grid-row:1/3}body .reward-manager .parent-reward-summary>div:not(.reward-picture){grid-column:2;min-width:0}body .reward-manager .parent-reward-summary>.back{grid-column:2;justify-self:start}body .reward-manager .parent-reward-summary h2{-webkit-line-clamp:unset;display:block;overflow:visible}}

/* Child rewards use the same uncluttered weekday language as routines. */
body .rewards-page .reward-heading{margin:20px 0 24px;display:block}
body .rewards-page .reward-daily-goal{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin:12px 0 16px;font:700 clamp(27px,4vw,40px)/1.1 Georgia,serif;color:#59336f}
.reward-daily-goal strong{font:700 clamp(50px,7vw,72px)/1 Georgia,serif;letter-spacing:-.05em}.reward-daily-goal span{font-size:inherit}
body .rewards-page .reward-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;margin:24px 0;padding:6px;border:1px solid #e2d3e9;border-radius:18px;background:#e8dded80;list-style:none}
body .rewards-page .reward-day{display:grid;place-items:center;gap:12px;padding:14px 4px;border:1px solid transparent;border-radius:12px;box-shadow:none;background:transparent;min-width:0}
body .rewards-page .reward-day>span{font-size:13px;color:#84688e}.rewards-page .reward-day.sticker-today{background:#f7f0fb;outline:1px solid #b38ac8;outline-offset:0}.rewards-page .reward-day.sticker-earned{background:#e4f0e6}
body .rewards-page .reward-sticker{width:38px;height:40px;min-height:40px}.rewards-page .reward-sticker>.ui-icon{width:30px;height:30px}.reward-earned-copy{font-size:15px;margin:14px 0 0}
@media(max-width:600px){body .rewards-page .reward-daily-goal{gap:9px;font-size:26px}.reward-daily-goal strong{font-size:50px}body .rewards-page .reward-week{gap:3px;padding:4px}body .rewards-page .reward-day{padding:11px 1px;gap:8px}body .rewards-page .reward-day>span{font-size:10px}body .rewards-page .reward-sticker{width:27px;height:32px;min-height:32px}.rewards-page .reward-sticker>.ui-icon{width:25px;height:25px}}

/* Contain and center placed artwork within the button's padded content box. */
body .routine-chart .routine-sticker-button{box-sizing:border-box;min-width:0;grid-template-columns:minmax(0,1fr)}
body .routine-chart .routine-sticker-button>.routine-art{box-sizing:border-box;place-self:center;min-width:0;width:100%;height:auto;aspect-ratio:1;max-width:50px;max-height:50px;margin:0}
