/* Scoped History candidate: keeps the existing shelf design and stage controls. */
.history-navigation[hidden],.history-storage-status[hidden],.history-empty[hidden],.history-recent-empty[hidden]{display:none!important}
.history-navigation{position:fixed;z-index:35;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;gap:6px;padding:6px;border:1px solid #d1e3ec;border-radius:999px;background:#fff;box-shadow:0 6px 30px #13265026;max-width:calc(100% - 32px)}
.history-navigation button{display:flex;align-items:center;justify-content:center;gap:8px;min-height:48px;min-width:110px;padding:10px 18px;border:0;border-radius:999px;background:transparent;color:#25456a;font:inherit;font-weight:700;line-height:1.2}
.history-navigation button[aria-current=page]{background:#0879ce;color:white}
.history-navigation svg{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex-shrink:0}
body.history-browsing{padding-bottom:calc(88px + env(safe-area-inset-bottom))}
.history-navigation button:focus-visible,.activity-history button:focus-visible,.history-recent button:focus-visible{outline:3px solid #0879ce;outline-offset:3px}
.history-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap}.history-heading h1{margin-bottom:0}.history-device-label{background:#e7f6ff;color:#225375;border:1px solid #cbdfeb;padding:8px 14px;border-radius:30px;font-size:14px;font-weight:700}
.history-privacy{max-width:840px;line-height:1.6;font-size:14px;color:#425f76}.history-storage-status{padding:12px 16px;background:#fff2d7;border:1px solid #dec385;border-radius:12px;color:#664b13;font-size:14px;line-height:1.5}
.history-empty{margin:24px 0;padding:32px;border:1px dashed #b9d4e6;border-radius:22px;background:#f2faff;text-align:center}.history-empty>span{font-size:34px;color:#167ca1}.history-empty h2{font-size:24px;margin:12px 0}.history-empty p{max-width:620px;margin:12px auto 20px;line-height:1.6}.history-empty button{min-height:44px}
.history-list{list-style:none;padding:0;margin:20px 0;display:grid;gap:10px}.history-entry{display:flex;align-items:center;gap:14px;padding:17px 20px;border:1px solid #dce8ef;border-radius:16px;background:white;color:#173455;min-width:0}.history-entry-icon{flex-shrink:0;background:#dff2e7;color:#236749;display:grid;place-items:center;width:36px;height:36px;border-radius:50%;font-size:18px}.history-entry-info{flex:1;min-width:0}.history-entry h3{font-size:17px;margin:0;overflow-wrap:anywhere}.history-entry p{margin:4px 0;font-size:14px;line-height:1.4;overflow-wrap:anywhere}.history-entry time{display:block;font-size:13px;color:#526a80;margin-top:5px;line-height:1.5}.history-entry-outcome{font-size:14px;font-weight:700;white-space:nowrap;color:#226650}.history-unsaved{display:block;font-size:12px;font-weight:700;color:#735014;margin-top:4px}.history-manage{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}.history-manage button{min-height:44px}
.history-recent{margin:24px 0 16px;padding:20px;border:1px solid #d6e7f0;border-radius:20px;background:#edf7fc}.history-recent-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.history-recent-heading h2{font-size:22px;margin:0;color:#132650}.history-recent-heading button{min-height:44px}.history-recent-note{font-size:13px;color:#465e78;margin:5px 0 12px}.history-recent-empty{font-size:15px;color:#425f76;line-height:1.5;margin:12px 0 0}.history-recent-list{margin:12px 0 0}.history-recent-list:empty{display:none}
body>footer>span.footer-dedication{display:inline;white-space:nowrap;color:#315571;font-size:12px}
@media(max-width:699px){.history-entry{padding:14px;gap:10px;flex-wrap:wrap}.history-entry-info{flex-basis:calc(100% - 46px)}.history-entry-outcome{margin-left:46px}.history-recent{padding:16px}.history-empty{padding:22px 16px}.history-empty h2{font-size:22px}.history-recent-heading h2{font-size:21px}.history-navigation button{min-width:100px;padding:10px 16px}}
@media(max-width:359px){.history-navigation button{min-width:0;padding:10px 14px}.history-entry-icon{display:none}.history-entry-info{flex-basis:100%}.history-entry-outcome{margin-left:0}}
@media(prefers-reduced-motion:reduce){.history-navigation,.history-entry{scroll-behavior:auto;transition:none}}
/* Finish controls use existing instrument settings; hints wrap instead of widening them. */
.freeplay-finish{display:flex;align-items:flex-start;flex-wrap:wrap;gap:8px 12px;min-width:0;max-width:100%}.freeplay-finish button,#coloringFinish,#aquariumFinish,#creativeFinish{min-height:44px}.freeplay-finish .hint{font-size:12px;line-height:1.5;margin:0;max-width:32em;white-space:normal}.freeplay-finish button:disabled{cursor:default;opacity:.55}

/* Desktop keeps its original page chrome: History is normal-flow navigation. */
body:not(.studio-app) #historyNavigation{display:none!important}
body:not(.studio-app).history-browsing{padding-bottom:0}
.history-back{min-height:44px;margin:0 0 14px}
body.studio-app .history-back{display:none}
