/* Family routines: quiet parent controls, clear child view. */
.tool-field select, .tool-field textarea { color: inherit; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; min-height: 46px; padding: 10px; width: 100%; font: inherit; }
.tool-field select { appearance: none; padding-right: 32px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23b2cbc9' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 10px 6px; background-position: right 12px center; }
.pinned-routines { display: grid; gap: 8px; margin-bottom: 18px; }
.pinned-routines h2 { color: var(--teal); font-weight: 650; }
.shortcut-label { color: var(--teal); margin-left: auto; font-size: .875rem; }
.home-routine-shortcuts { margin-top: 12px; }
.home-routine-shortcuts:empty { display: none; }
.home-routine-shortcuts .pinned-routines { margin-bottom: 0; }
.home-routine-shortcuts h2 { font-size: .875rem; margin: 0; }
.home-routine-shortcuts .routine-list-link { font-size: .9375rem; }
.routine-people { display: flex; justify-content: center; margin: 3px 0 12px; color: var(--teal); font-weight: 650; font-size: 1rem; overflow-wrap: anywhere; text-align: center; }
.routine-progress-track { background: #214552; height: 7px; border-radius: 99px; overflow: hidden; margin: 6px 0; }
.routine-progress-track span { display: block; background: var(--teal); height: 100%; border-radius: inherit; transition: width .3s; }
.routine-progress-copy { text-align: center; font-size: .875rem; color: var(--muted); margin: 8px 0 16px; }
.routine-intro .routine-progress-track { width: 180px; }
.routine-intro .routine-people { margin-top: 14px; }
.player-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.parent-run-menu { position: relative; }
.parent-run-menu summary { min-height: 44px; display: flex; align-items: center; font-size: .875rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.parent-run-menu > div { position: absolute; z-index: 4; right: 0; top: 43px; min-width: 190px; display: grid; padding: 9px; border: 1px solid var(--line); border-radius: 15px; background: var(--bg); box-shadow: 0 10px 35px #0006; gap: 6px; }
.parent-run-menu .secondary { text-align: left; border-radius: 9px; font-size: .9375rem; }
.speaker-button { color: #356264; background: #e7e8d4; padding: 8px 16px; min-height: 44px; border-radius: 99px; margin-top: 14px; font-size: .875rem; }
.routine-player h1 { margin-top: 15px; }
.pause-panel { display: grid; justify-items: center; gap: 18px; padding: 24px 16px; line-height: 1.6; text-align: center; color: var(--muted); }
.toggle-setting { display: flex; gap: 20px; align-items: center; justify-content: space-between; padding: 16px 0; border-bottom: 1px solid #3b5660; }
.toggle-setting span { display: grid; gap: 6px; }
.toggle-setting small { font-size: .875rem; line-height: 1.45; color: var(--muted); }
.toggle-setting input { width: 24px; height: 24px; flex: 0 0 auto; accent-color: var(--teal); }
[data-dialog-status] { color: var(--teal); font-size: .875rem; line-height: 1.5; margin-top: 12px; }
.routine-finished { padding-top: 25px; padding-bottom: 22px; }
.routine-finished .routine-people { color: #356359; }
.routine-finished .sticker-reveal { width: 205px; padding: 15px; }
.routine-finished .tool-description { margin-bottom: 0; line-height: 1.5; }
.routine-finished .sticker-name { font-size: 1.25rem; }
.book-subtitle { color: var(--muted); margin: -6px 0 22px; font-size: 1rem; }
/* Paper, binding and loose-cut sticker edges carry the book metaphor. */
.sticker-album { position: relative; border-radius: 8px 23px 23px 8px; background: #c7996d; padding: 6px 5px 9px 17px; box-shadow: 0 17px 40px #0004, 2px 3px 0 #99714d; }
.album-page { position: relative; color-scheme: light; color: #28464a; background: #fff3dd; background-image: radial-gradient(#d7b58438 .7px, transparent .7px); background-size: 7px 7px; padding: 24px 14px 16px 21px; border-radius: 3px 19px 19px 3px; box-shadow: inset 10px 0 14px -14px #4e3527, 0 3px 0 #e9d5b1, 0 5px 0 #fff0d1; min-height: 420px; }
.album-binding { position: absolute; z-index: 2; top: 68px; bottom: 54px; left: 0; display: flex; flex-direction: column; justify-content: space-between; }
.album-binding i { display: block; width: 25px; height: 13px; border: 4px solid #f5dfbd; border-left-color: #b9a587; border-radius: 99px; box-shadow: 0 2px 2px #573c3740; }
.album-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-bottom: 1px solid #bea27d66; padding-bottom: 13px; font-size: .875rem; font-weight: 750; }
.album-heading span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 500; }
.album-grid { margin: 0; padding: 19px 0 12px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 10px; }
.album-slot { display: grid; gap: 5px; justify-items: center; text-align: center; align-content: start; min-width: 0; }
.album-slot strong { font-size: .9375rem; line-height: 1.3; font-weight: 700; }
.album-slot > span { font-size: .875rem; color: #5b665e; line-height: 1.4; }
.sticker-shape { width: min(100%, 145px); aspect-ratio: 1; position: relative; margin-bottom: 7px; }
.paper-sticker { display: block; width: 100%; height: auto; border-radius: 50%; background: #fffcf5; border: 5px solid #fffcf5; transform: rotate(var(--tilt, -5deg)); filter: drop-shadow(1px 3px 1px #382e2529) drop-shadow(0 7px 6px #382e251c); }
.uncollected .sticker-shape { border: 2px dashed #ac93736e; border-radius: 50%; transform: rotate(var(--tilt)); background: #d5b78c12; }
.uncollected .paper-sticker { opacity: .17; filter: grayscale(1) sepia(.5); border-color: transparent; background: transparent; transform: none; }
.uncollected strong { color: #6e756b; font-weight: 550; }
.album-footer { margin-top: 7px; padding-top: 12px; border-top: 1px solid #bea27d66; text-align: center; color: #6e705f; font-size: .875rem; line-height: 1.5; }
.album-navigation { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.just-placed .paper-sticker { animation: sticker-place .85s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sticker-place { 0% { opacity: 0; transform: translateY(-40px) rotate(-16deg) scale(1.3); filter: drop-shadow(10px 20px 12px #382e2566); } 70% { opacity: 1; transform: rotate(var(--tilt)) scale(.96); } 100% { transform: rotate(var(--tilt)); } }
@media (max-width: 360px) { .album-page { padding-inline: 17px 10px; } .album-grid { gap: 20px 7px; } .album-slot strong { font-size: .875rem; } .player-top .text-button { font-size: .875rem; } }
@media (prefers-reduced-motion: reduce) { .just-placed .paper-sticker { animation: none; } }
.daily-play-link { display: flex; justify-content: center; align-items: center; text-decoration: none; margin: 0 0 18px; color: var(--cream); }

.routine-starters { margin-block: 20px 16px; }
.routine-starters .routines-section-heading { margin-bottom: 10px; }
.routine-starters .routine-templates { margin-top: 14px; }
.routine-paper-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.routine-paper-actions:empty { display: none; }
.routine-paper-actions > * { flex: 1 1 auto; }
.routine-overview-actions .routine-add-lineup { margin-top: 8px; }
.step-editor-order { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.step-editor-order button:disabled { visibility: hidden; }

.home-create-routine { min-height: 44px; flex: 0 0 auto; padding: 8px 13px; text-decoration: none; }
.routine-row-print.secondary { flex: 0 0 auto; min-width: 56px; min-height: 44px; padding: 4px 9px; }
.home-today .routine-row-print.secondary { background: #fff7dd; border-color: #9a835d; color: #203939; }
.lineup-routine-name .lineup-done { display: block; font-weight: 500; }
.home-moment-picture { display: grid; place-items: center; width: 43px; height: 43px; font-size: 1.65rem; }
.routine-paper-actions .tool-primary { width: auto; margin-top: 0; }
.printed-completion { display: grid; gap: 14px; }
.printed-completion p { margin: 0; }

.kids-world .tool-page { padding-bottom: 24px; }
.kids-world .tool-page h1 { margin-block: 14px 20px; font-size: clamp(2.2rem, 9vw, 3.2rem); }
.kids-world .tool-page h2 { font-size: 1.25rem; }
.kids-pair-device {
  display: flex; align-items: center; width: fit-content; max-width: 100%; gap: 10px;
  min-height: 52px; padding: 6px 14px 6px 9px; margin: 0 0 18px;
  color: var(--cream); background: #173740; border: 1px solid #537478;
  border-radius: 14px; text-decoration: none;
}
.kids-pair-device:hover { background: #204952; border-color: var(--teal); }
.kids-pair-icon { display: grid; place-items: center; width: 30px; height: 34px; flex: none; color: var(--teal); }
.kids-pair-icon svg { width: 20px; height: 20px; }
.kids-pair-copy { display: grid; gap: 2px; line-height: 1.3; }
.kids-pair-copy strong { font-size: .9375rem; }
.kids-pair-copy small { font-size: .8125rem; color: #b2cbc9; }
.kids-world .kids-packets { display: grid; gap: 9px; padding: 12px 15px 16px; border-radius: 19px; background: #243e4e; }
.kids-packets h2 { margin: 0 0 3px; }
.kids-open-packet { min-height: 54px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.kids-stickers h2 { margin-top: 23px; }
.kids-sticker-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); padding-block: 2px 14px; gap: 10px; }
.kids-sticker-grid > li { display: block; }
.kids-sticker-tile { display: grid; justify-items: center; align-content: start; gap: 8px; height: 100%; padding: 13px 6px 12px; border-radius: 18px; background: #213d49; color: var(--cream); text-decoration: none; }
.kids-sticker-tile .loose-sticker { width: min(100%, 120px); }
.kids-sticker-tile span { color: var(--muted); }
.kids-empty { padding: 18px 15px; text-align: center; border: 1px dashed #647e87; border-radius: 18px; }
.kids-empty span { color: #ffc776; font-size: 2.4rem; }
.kids-empty p { margin: 5px auto 0; max-width: 26ch; }
.kids-empty .kids-routine-link { display: inline-flex; align-items: center; min-height: 44px; margin-top: 10px; text-decoration: none; }
body:has(#parent-tools:not([hidden]) .kids-world) .app-navigation { display: none; }

.packet-gift-note { overflow-wrap: anywhere; color: var(--muted); margin: 0 auto 12px; max-width: 28ch; }
.booklet-routine-list { display: grid; gap: 7px; max-height: min(47vh, 400px); overflow-y: auto; }
.booklet-routine-row { display: flex; align-items: center; gap: 5px; border-bottom: 1px solid var(--line); }
.booklet-routine-row label { display: grid; grid-template-columns: 36px minmax(0, 1fr) 23px; align-items: center; gap: 8px; flex: 1; min-height: 52px; min-width: 0; overflow-wrap: anywhere; padding: 3px; }
.booklet-routine-row label > :is(img, .routine-cover, .routine-emoji) { display: block; width: 36px; height: 36px; border-radius: 8px; }
.booklet-order { display: flex; gap: 3px; }
.booklet-order button { width: 39px; min-height: 44px; padding: 0; }
.booklet-order button:disabled { opacity: .4; }

.world-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.world-farm { --world-image: url('/gp/assets/worlds/farm.webp'); --world-color: #5d8a36; }
.world-water { --world-image: url('/gp/assets/worlds/water.webp'); --world-color: #087a9b; }
.world-jungle { --world-image: url('/gp/assets/worlds/jungle.webp'); --world-color: #276442; }
.world-tile { display: grid; align-content: end; justify-items: center; gap: 4px; min-height: 112px; padding: 8px 3px; border-radius: 13px; color: white; text-align: center; text-decoration: none; background: linear-gradient(transparent 10%, #10231ce8), var(--world-image) center / cover, var(--world-color); }
.world-tile span { font-size: 1.5rem; }
.world-tile strong { font-size: .875rem; }
.sticker-world-board { position: relative; overflow: hidden; aspect-ratio: 2 / 1; min-height: 172px; border-radius: 16px; background: var(--world-image) right center / cover no-repeat, var(--world-color); }
.sticker-world-board.world-water, .sticker-world-board.world-jungle { background-position: center; }
.world-piece { position: absolute; display: grid; place-items: center; width: clamp(46px, 17%, 86px); aspect-ratio: 1; padding: 0; border: 0; border-radius: 16px; background: transparent; transform: translate(-50%, -50%) scale(var(--piece-size, 1)); cursor: grab; touch-action: none; user-select: none; -webkit-touch-callout: none; }
.world-piece[aria-pressed="true"] { z-index: 1; outline: 2px solid white; outline-offset: 2px; }
.world-piece.moving { z-index: 1; cursor: grabbing; }
.world-sticker-art { display: block; width: 100%; height: auto; pointer-events: none; filter: drop-shadow(0 3px 3px #0006); }
.world-controls { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.world-controls button { min-height: 44px; }
.world-controls button:disabled { opacity: .45; }
.world-tray { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 7px; }
.world-tray button { display: grid; gap: 3px; justify-items: center; align-content: start; padding: 4px; border-radius: 11px; }
.world-tray .world-sticker-art { width: min(100%, 50px); }
.world-tray button span:last-child { font-size: .75rem; }
.booklet-routine-row label small { display: block; font-size: .75rem; color: var(--muted); }
.booklet-edit { margin-bottom: 8px; }

.routine-choose-activities { border-style: solid; margin: 8px 0 12px; font-weight: 750; }
.activity-picker-dialog[open] {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
  width: min(600px, calc(100% - 18px));
  height: min(684px, calc(100dvh - 22px));
  max-height: calc(100dvh - 22px);
  padding: 12px 13px 10px;
  overflow: hidden;
}
.activity-picker-dialog .picker-header { position: static; padding: 0 0 8px; }
.activity-picker-tools { display: grid; gap: 6px; min-width: 0; }
.activity-picker-tools > input {
  width: 100%; min-height: 44px; padding: 8px 11px;
  color: var(--cream); background: var(--bg); border: 1px solid var(--line); border-radius: 11px;
  font-size: 1rem;
}
.activity-filters { display: flex; gap: 6px; min-width: 0; padding-block: 3px 6px; overflow-x: auto; }
.activity-filters button { flex: 0 0 auto; min-height: 44px; padding: 5px 11px; font-size: .875rem; white-space: nowrap; }
.activity-filters button[aria-pressed="true"] { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.activity-add-custom.secondary { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 49px; margin: 0 0 3px; padding: 6px 13px; color: var(--cream); border-color: #81b7a9; background: #214840; font-size: 1rem; font-weight: 750; }
.activity-add-custom span { font-size: 1.35rem; line-height: 1; }
.activity-add-custom:disabled { opacity: .42; }
.activity-checklist { min-width: 0; overflow: auto; overscroll-behavior: contain; padding: 0 3px 12px; }
.activity-choice-group { margin-top: 10px; }
.activity-choice-group h3 { margin: 0 0 7px; font-size: .94rem; }
.activity-choice-group > div { display: grid; gap: 5px; }
.activity-choice {
  display: grid; grid-template-columns: 44px minmax(0, 1fr) 24px; gap: 10px; align-items: center;
  min-height: 53px; padding: 4px 9px 4px 5px; border: 1px solid var(--line); border-radius: 11px;
  background: var(--bg); cursor: pointer;
}
.activity-choice:has(input:checked) { background: #25514c; border-color: #80bfb0; }
.activity-choice:has(input:disabled) { opacity: .52; }
.activity-art > :is(img, .routine-emoji) { width: 44px; height: 44px; object-fit: contain; border-radius: 8px; }
.activity-art > img { background: #fff8e9; }
.activity-art > .routine-emoji { display: grid; place-items: center; font-size: 1.65rem; }
.activity-choice > span { overflow-wrap: anywhere; }
.activity-choice input { width: 21px; height: 21px; accent-color: var(--teal); cursor: pointer; }
.activity-picker-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 9px; border-top: 1px solid var(--line); }
.activity-picker-footer button { min-height: 44px; padding: 6px 11px; }
.activity-picker-footer button:disabled { opacity: .5; }
.activity-count { font-size: .875rem; font-weight: 700; }
.activity-picker-dialog [data-dialog-status]:empty { display: none; }
@media (min-width: 700px) {
  .activity-choice-group > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.activity-art { display: block; width: 44px; height: 44px; }
.draft-cancel { display: inline-flex; align-items: center; min-height: 44px; }

.home-routine-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; margin-top: 12px; }
.home-print-booklet.secondary { min-height: 45px; padding: 8px 13px; font-weight: 800; }
.home-sticker-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 5px; margin: 8px 0 16px; padding: 5px; border: 1px solid #48686a; border-radius: 17px; background: #1c353f; }
.home-sticker-actions > :is(button, a) { display: flex; align-items: center; justify-content: center; min-width: 0; min-height: 54px; gap: 7px; padding: 7px 9px; border: 0; border-radius: 12px; text-align: left; text-decoration: none; }
.home-sticker-actions > .home-give-sticker { background: #f5b69d; color: #392735; }
.home-sticker-actions > .home-give-sticker:hover { background: #ffc9ae; }
.home-sticker-actions > .home-kids-link { color: #fff1d4; }
.home-sticker-actions > .home-kids-link:hover { background: #2b5055; }
.home-sticker-actions > :is(a, button):focus-visible { outline: 3px solid #ffe8b6; outline-offset: 2px; }
.home-award-star { flex: none; font-size: 1.2rem; line-height: 1; }
.home-world-star { width: 23px; height: 23px; flex: none; object-fit: contain; }
.home-sticker-label { display: grid; justify-items: start; gap: 2px; }
.home-sticker-actions strong { font-size: .95rem; line-height: 1.2; }
.home-packets-ready { padding: 2px 6px; border-radius: 10px; background: #fff1bd; color: #3e3623; font: 750 .72rem/1.2 system-ui, sans-serif; }
.award-sticker-options { display: grid; gap: 7px; }
.award-sticker-options p { margin: 0 0 3px; }
.award-sticker-options .award-routine-choice { display: flex; align-items: center; gap: 10px; min-height: 49px; padding: 6px 12px; text-align: left; }
.award-routine-art { display: grid; flex: none; place-items: center; width: 32px; height: 32px; }
.award-routine-art > :is(img, .routine-cover, .routine-emoji) { width: 100%; height: 100%; object-fit: contain; }
.award-sticker-options details[open] > .award-sticker-options { margin-top: 6px; }
.award-sticker-options .award-other { justify-self: center; min-height: 44px; margin-top: 3px; }
.print-write-in[hidden] { display: none; }
.words-guide .word-choices { display: grid; grid-template-columns: 1fr; gap: 6px; }
.words-guide .word-choice { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 12px; font-weight: 700; }
.words-guide [data-tool="word"][aria-expanded="true"] { background: var(--teal); color: var(--ink); border-color: var(--teal); }
.words-guide .word-choice[aria-expanded="true"] span { transform: rotate(90deg); }
.words-guide .words-search { margin-block: 20px 10px; }
.words-pinned { margin: 10px 0 18px; padding: 9px 12px 12px; border-radius: 17px; background: #263b50; }
.words-pinned h2 { margin-top: 0; }
.words-pinned > div { display: flex; flex-wrap: wrap; gap: 6px; }
.words-pinned button, .word-pin { min-height: 44px; padding: 6px 12px; font-size: .88rem; }
.words-guide .words-answer { margin: 0 0 8px; padding: 13px 15px; border: 1px solid #71928a; border-radius: 14px; background: #23413f; }
.words-guide .words-card { margin: 0 0 12px; font-size: clamp(1.15rem, 5vw, 1.42rem); line-height: 1.42; }
.print-write-in { min-height: 48px; }
.print-write-in small { display: block; margin-top: 3px; font-weight: 400; color: var(--muted); }

.world-stage { position: relative; }
.world-controls { flex-wrap: wrap; }
.world-controls button { min-height: 44px; padding: 6px 11px; }
.world-drawer[hidden] { display: none; }
.world-drawer .tool-description { margin-top: 10px; }
.world-editor { display: flex; align-items: center; gap: 6px; margin: 6px 0; padding: 4px 8px; border-radius: 14px; background: #102c39; }
.world-editor strong { flex: 1; }
.world-editor button { min-width: 44px; min-height: 44px; padding: 0; font-size: 1.5rem; }
.world-editor button:disabled { opacity: .45; }
.world-editor[hidden], .world-editor button[hidden] { display: none; }
.world-editor .world-remove { color: #ffd2cb; }
body:has(#parent-tools:not([hidden]) .world-play.is-expanded) { overflow: hidden; }
.world-play.is-expanded { position: fixed; inset: 0; z-index: 1000; height: 100dvh; background: #071d29; }
.world-play.is-expanded .world-stage { width: 100%; height: 100%; display: flex; flex-direction: column; overflow: hidden; isolation: isolate; }
.world-play.is-expanded .sticker-world-board { flex: 1 1 auto; min-height: 0; width: 100%; border-radius: 0; aspect-ratio: auto; background-position: center; }
.world-play.is-expanded .world-controls { order: -1; margin: 0; padding: max(6px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 6px max(8px, env(safe-area-inset-left)); justify-content: start; }
.world-play.is-expanded .world-editor { position: absolute; z-index: 3; right: 0; bottom: 0; left: 0; margin: 0; border-radius: 0; padding-bottom: max(4px, env(safe-area-inset-bottom)); }
.world-play.is-expanded .world-drawer { position: absolute; z-index: 2; right: 0; bottom: 0; left: 0; max-height: 40%; overflow: auto; overscroll-behavior: contain; padding: 8px 12px max(8px, env(safe-area-inset-bottom)); background: #102c39f5; }
.world-play.is-expanded:has(.world-editor:not([hidden])) .world-drawer { bottom: 52px; }
@media (orientation: landscape) and (max-height: 600px) {
  .world-play.is-expanded .world-drawer { left: auto; top: 56px; width: 170px; max-height: none; }
  .world-play.is-expanded .world-tray { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.routine-detail-heading { display: flex; align-items: center; gap: 12px; margin: 12px 0 16px; }
.routine-detail-heading h1 { flex: 1; min-width: 0; margin: 0; overflow-wrap: anywhere; }
.routine-rename { display: grid; place-items: center; width: 46px; height: 46px; flex: none; padding: 0; border: 1px solid var(--line); border-radius: 12px; }
.routine-rename svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.routine-rename[hidden] { display: none; }
.routine-detail-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 20px; }
.routine-detail-actions button { min-height: 48px; margin: 0; }
.shared-routine-intro { display: grid; gap: 12px; margin-block: 12px 18px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.shared-routine-intro p { margin: 0; line-height: 1.45; }
.shared-routine-intro .shared-routine-label { color: var(--muted); font-size: .9rem; font-weight: 750; }
.shared-routine-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.shared-routine-intro button { min-height: 44px; }
.routine-step-toolbar { display: flex; align-items: center; gap: 10px; justify-content: space-between; margin: 0 0 8px; }
.routine-step-toolbar h2 { margin: 0; font-size: 1.12rem; }
.routine-step-toolbar button { width: auto; min-height: 44px; margin: 0; padding: 6px 10px; }
.routine-detail-footer { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.routine-detail-footer:empty { display: none; }
.routine-play-options { margin: 14px auto; width: fit-content; }
.routine-play-options summary { min-height: 44px; padding: 10px; cursor: pointer; }
.routine-play-options .celebration-choice { margin: 4px auto 10px; }

.memory-emoji-choice { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 10px; margin: 6px 0 12px; }
.memory-emoji-choice [data-custom-preview] { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--panel); font-size: 1.55rem; }
.memory-emoji-choice .emoji-browser { margin: 0; }
.memory-emoji-choice summary { min-height: 46px; align-content: center; }
.memory-emoji-choice:has(details[open]) details { grid-column: 1 / -1; }

.routine-template-note { margin: 0 0 12px; color: var(--muted); line-height: 1.4; }

.routine-detail-heading { gap: 6px; margin-block: 4px 12px; }
.routine-share { display: grid; place-items: center; width: 44px; height: 46px; flex: none; padding: 0; border-radius: 12px; border: 1px solid var(--line); }
.routine-share svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.routine-detail .routine-overview .routine-row { color: #263f3b; background: #f8e3b7; border-color: #d3b683; }
.routine-detail .routine-row :is(.routine-grip, .step-timer-edit, .remove-inline) { color: #38534b; }
.routine-detail .routine-row .routine-grip { width: 100%; }
.routine-detail .routine-row.dragging { box-shadow: 0 8px 25px #00131aa0; }
.routine-row:is(.drop-before, .drop-after)::after { content: ""; position: absolute; left: 4px; right: 4px; height: 3px; border-radius: 3px; background: var(--teal); }
.routine-row.drop-before::after { top: -5px; }
.routine-row.drop-after::after { bottom: -5px; }
.activity-add-custom.secondary { width: auto; justify-self: center; justify-content: center; padding-inline: 17px; background: #f1b4a1; color: #272337; border-color: #f1b4a1; }
.routine-browser-print { display: none; }
@media print {
  body:has(> .routine-browser-print) > :not(.routine-browser-print) { display: none !important; }
  html:has(.routine-browser-print), body:has(.routine-browser-print) { margin: 0; padding: 0; min-height: 0; background: white; overflow: visible !important; }
  .routine-browser-print { display: block; }
  .routine-browser-print img { display: block; width: 100%; height: auto; break-inside: avoid; break-after: page; }
  .routine-browser-print img:last-child { break-after: auto; }
}

.routine-paper-dialog {
  --paper-gutter: clamp(14px, 4vw, 24px);
  width: min(100% - 20px, 508px);
  max-height: calc(100dvh - 20px);
  margin: auto;
  padding: var(--paper-gutter) var(--paper-gutter) 0;
  border: 1px solid #efd7ac;
  border-radius: 26px;
  background: var(--paper);
  color: var(--paper-ink);
  color-scheme: light;
  box-shadow: 0 18px 42px #0004;
  overscroll-behavior: contain;
}
.routine-paper-dialog .picker-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  row-gap: 12px;
  margin-bottom: 13px;
}
.routine-paper-dialog .picker-header h2 {
  grid-column: 1 / -1;
  grid-row: 2;
  font: 700 clamp(1.65rem, 7.1vw, 2.4rem)/1.08 Georgia, serif;
  letter-spacing: -.04em;
  text-wrap: balance;
}
.routine-paper-dialog .picker-header h2:focus { outline: none; }
.routine-paper-dialog .picker-header button { grid-column: 3; grid-row: 1; justify-self: end; }
.routine-paper-dialog :is(a, button, input, select, summary):focus-visible,
.print-orientation-choices label:has(input:focus-visible) { outline: 3px solid #2f7360; outline-offset: 2px; }
.routine-paper-dialog :is(.primary, .secondary) { min-height: 48px; border-radius: 12px; padding-inline: 11px; }
.routine-paper-dialog .primary { background: var(--leaf); color: #fff9ec; }
.routine-paper-dialog .primary:hover { background: #24483f; }
.routine-paper-dialog .secondary { color: var(--paper-ink); background: #fffdf7; border-color: #b1b9a5; }
.routine-paper-dialog .secondary:hover { background: #e9edde; }
.routine-paper-dialog :is(.primary, .secondary):is(:disabled, [aria-disabled="true"]) { opacity: .55; cursor: default; }
.routine-paper-dialog .text-button { min-height: 44px; padding-inline: 7px; color: #2e594b; font-weight: 750; }
.routine-paper-dialog .text-button:hover { color: #24483f; }
.routine-paper-dialog .tool-field { margin: 0; font-size: .875rem; }
.routine-paper-dialog .tool-field :is(input, select) { width: 100%; min-height: 46px; background-color: #fffdf7; border-color: #b4aa94; color: var(--paper-ink); font-size: 1rem; }
.routine-paper-dialog .tool-field input::placeholder { color: #686c60; }
.routine-paper-dialog .tool-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='m1 1 4 4 4-4' fill='none' stroke='%23243d35' stroke-width='1.5'/%3E%3C/svg%3E");
}
.paper-disclosure { border-top: 1px solid var(--paper-line); }
.paper-disclosure summary { min-height: 44px; padding: 11px 2px; color: #2e594b; font-size: .9rem; font-weight: 750; cursor: pointer; }
.paper-disclosure[open] { padding-bottom: 10px; }
.step-editor-footer, .routine-print-actions {
  position: sticky;
  z-index: 2;
  bottom: 0;
  display: grid;
  margin-inline: calc(-1 * var(--paper-gutter));
  padding: 10px var(--paper-gutter) max(9px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--paper-line);
  background: var(--paper);
}
.routine-paper-dialog:has(.tool-field input:focus) :is(.step-editor-footer, .routine-print-actions) { position: static; }

.custom-activity-dialog { margin: 10px auto auto; }
.custom-activity-dialog form { display: grid; gap: 14px; }
.custom-activity-dialog .custom-step-preview {
  margin: 0;
  min-height: 62px;
  gap: 12px;
  padding: 8px 13px;
  border: 1px solid #ead2aa;
  background: #faebcf;
}
.custom-activity-dialog .custom-step-preview small { display: block; margin-bottom: 2px; color: var(--paper-muted); font-size: .8rem; }
.custom-activity-dialog .custom-step-preview > span { font-size: clamp(1.6rem, 8vw, 2.3rem); }
.step-visual-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.step-visual-picker legend { margin-bottom: 6px; padding: 0; font-size: .9rem; font-weight: 750; }
.step-visual-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-bottom: 12px; padding: 3px; border: 1px solid var(--paper-line); border-radius: 12px; background: #f2e9d8; }
.routine-paper-dialog .step-visual-switch .secondary { min-height: 44px; background: transparent; border-color: transparent; border-radius: 9px; }
.routine-paper-dialog .step-visual-switch .secondary[aria-pressed="true"] { background: #e1eddf; border-color: #709281; }
.custom-activity-dialog .emoji-suggestions { flex-wrap: wrap; margin: 0 0 10px; gap: 6px; }
.custom-activity-dialog .emoji-browser { margin: 0; padding-top: 0; border-color: var(--paper-line); }
.custom-activity-dialog .emoji-filters { margin: 1px 0 6px; }
.custom-activity-dialog :is(.emoji-suggestions button, .emoji-bank button, .step-pick) { min-width: 44px; min-height: 44px; border: 1px solid var(--paper-line); border-radius: 10px; background: #fffdf7; color: var(--paper-ink); }
.custom-activity-dialog :is(.emoji-suggestions button, .emoji-bank button, .step-pick):hover { border-color: #709281; }
.custom-activity-dialog .emoji-bank, .custom-activity-dialog .step-pick-grid { max-height: min(220px, 35dvh); overflow: auto; }
.custom-activity-dialog .step-pick-grid { margin-top: 7px; padding: 3px; }
.custom-activity-dialog .step-pick { min-height: 88px; }
.custom-activity-dialog [aria-pressed="true"]:is([data-emoji], [data-tool="step-picture"]) { background: #e1eddf; box-shadow: inset 0 0 0 1px #709281; border-color: #709281; }
.custom-activity-dialog .step-emoji-count { color: var(--paper-muted); }
.custom-activity-dialog .step-emoji-count button { min-height: 44px; padding: 5px 8px; border-color: #9fb3a3; background: #e1eddf; }
.step-editor-footer { gap: 6px; }
.step-editor-footer [data-dialog-status] { margin: 0; color: #883c34; }
.step-editor-footer [data-dialog-status]:empty { display: none; }


.home-little-helpers { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 58px; margin-block: 12px; padding: 11px 15px; border: 1px solid #786995; border-radius: 16px; background: #302940; }
.home-little-helpers h2 { margin: 0; font-size: 1rem; }
.home-little-helpers span { color: #e2d8ef; font-size: .82rem; white-space: nowrap; }

.routine-save-notice { position: fixed; z-index: 100; bottom: calc(80px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); padding: 11px 19px; border: 1px solid #b8e0c9; border-radius: 24px; background: #d9f0e1; color: #18392e; box-shadow: 0 5px 22px #00131aa0; font-weight: 750; white-space: nowrap; pointer-events: none; }
.step-emoji-count { margin: 0 0 7px; color: var(--muted); font-size: .9rem; }
.routine-detail .routine-row .routine-emoji-pair, .activity-art > .routine-emoji-pair, .routine-next .routine-emoji-pair { font-size: 1rem; white-space: nowrap; }
.routine-player .routine-emoji-pair, .routine-intro .routine-emoji-pair { font-size: 4.25rem; white-space: nowrap; }
.step-emoji-count { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.step-emoji-count button { min-height: 44px; padding: 4px 8px; }

.preferences-dialog { padding: clamp(16px, 4vw, 24px); }
.preferences-dialog .picker-header { margin-bottom: 16px; }
.preferences-dialog .picker-header h2 { font-size: clamp(1.65rem, 5vw, 2rem); letter-spacing: -.035em; }
.preferences-dialog .picker-header button { min-width: 60px; }
.settings-section + .settings-section { margin-top: 18px; }
.settings-section h3 { margin: 0 0 7px 4px; color: var(--muted); font-size: .875rem; font-weight: 700; }
.settings-group { border: 1px solid #3b5660; border-radius: 16px; background: #18363e; }
.settings-row, .setting-switch { display: flex; width: 100%; min-height: 60px; padding: 12px 14px; align-items: center; justify-content: space-between; gap: 14px; color: var(--cream); text-align: left; }
.settings-row { border-radius: inherit; background: transparent; text-decoration: none; }
.settings-row > span:last-child { font-size: 1.5rem; color: var(--teal); }
.settings-row:hover { background: #23454c; }
.settings-row small, .setting-switch small { display: block; margin-top: 3px; color: var(--muted); font-size: .875rem; font-weight: 400; line-height: 1.35; overflow-wrap: anywhere; }
.setting-switch { cursor: pointer; }
.setting-switch + .setting-switch, [data-voice-options] { border-top: 1px solid #3b5660; }
.setting-switch input { appearance: none; width: 42px; height: 24px; flex: none; margin: 0; border: 1px solid #6f9596; border-radius: 99px; background: #0e2733; cursor: pointer; }
.setting-switch input::before { content: ''; display: block; width: 16px; height: 16px; margin: 3px; border-radius: 50%; background: var(--muted); }
.setting-switch input:checked { background: var(--teal); border-color: var(--teal); }
.setting-switch input:checked::before { transform: translateX(18px); background: var(--bg); }
@media (forced-colors: active) { .setting-switch input { appearance: auto; } .setting-switch input::before { display: none; } }
.settings-voice { display: flex; flex-wrap: wrap; align-items: end; padding: 2px 14px 14px; gap: 8px; }
.settings-voice .tool-field { flex: 1 1 120px; margin: 0; }
.preferences-dialog [data-dialog-status]:empty { display: none; }

.routine-print-dialog { width: min(100% - 20px, 574px); }
.routine-print-dialog .picker-header { margin-bottom: 5px; }
.print-heading-detail { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin-bottom: 14px; }
.print-heading-detail p { margin: 0; color: var(--paper-muted); font-size: 1rem; font-weight: 650; overflow-wrap: anywhere; }
.print-saved { flex: none; padding: 4px 10px; border-radius: 999px; background: #e1eddf; color: #2e594b; font-size: .82rem; font-weight: 750; }
.print-preview { overflow: hidden; border: 1px solid var(--paper-line); border-radius: 15px; background: #eee9dd; }
.print-preview-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 3px 8px; padding: 9px 12px; background: #fdfaf0; border-bottom: 1px solid var(--paper-line); }
.print-preview-heading h3 { margin: 0; font-size: .92rem; }
.routine-print-status { color: var(--paper-muted); font-size: .82rem; }
.routine-print-sheets { display: grid; justify-items: center; gap: 12px; max-height: min(425px, 46dvh); min-height: 120px; overflow: auto; padding: 12px; }
.routine-print-sheets canvas { display: block; width: 100%; height: auto; background: white; border-radius: 3px; box-shadow: 0 2px 8px #4f43272c; }
.routine-print-sheets canvas.tall-print-page { width: min(100%, 280px); }
.routine-print-sheets[aria-busy="true"] canvas { opacity: .65; }
.print-settings { margin: 8px 0 0; border-top: 0; }
.print-settings[open] { display: grid; gap: 10px; padding-bottom: 14px; }
.print-settings[open] > summary { border-bottom: 1px solid var(--paper-line); }
.print-settings > p { margin: 0; color: var(--paper-muted); font-size: .875rem; line-height: 1.45; }
.routine-print-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 12px; }
.routine-print-label > span { color: var(--paper-muted); font-weight: 400; }
.print-write-in { border: 0; padding: 2px 0; font-size: .9rem; font-weight: 700; }
.print-write-in small { color: var(--paper-muted); font-weight: 400; }
.print-write-in input { accent-color: var(--leaf); }
.print-orientation { min-width: 0; margin: 0; padding: 0; border: 0; }
.print-orientation legend { margin: 0 0 6px; padding: 0; font-size: .875rem; font-weight: 725; }
.print-orientation-choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3px; padding: 2px; border: 1px solid #b4aa94; border-radius: 10px; background: #fffdf7; }
.print-orientation-choices label { position: relative; display: grid; place-items: center; border-radius: 7px; min-height: 44px; padding-inline: 5px; cursor: pointer; font-size: .875rem; font-weight: 700; }
.print-orientation-choices input { position: absolute; opacity: 0; pointer-events: none; }
.print-orientation-choices label:has(input:checked) { background: #e1eddf; color: var(--paper-ink); }
.print-main-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.print-main-actions a { display: grid; place-items: center; }
.print-main-actions a, .print-file-actions a { text-decoration: none; }
.print-file-actions { display: flex; justify-content: center; flex-wrap: wrap; column-gap: 12px; }
.print-file-actions :is(a, button) { display: inline-flex; align-items: center; font-size: .875rem; }
@media (max-width: 460px) { .routine-print-options { grid-template-columns: 1fr; } }

.sticker-print-entry { margin: 0 0 12px; }
.sticker-print-picker { margin: 0; padding: 0; border: 0; min-width: 0; }
.sticker-print-picker legend { margin-bottom: 10px; font-weight: 750; }
.sticker-print-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(87px, 1fr)); gap: 7px; }
.sticker-print-grid label { display: grid; grid-template-rows: auto 54px auto; justify-items: center; gap: 5px; padding: 8px 5px; border: 1px solid #c9ceba; border-radius: 12px; background: #fffdf7; text-align: center; font-size: .8rem; cursor: pointer; }
.sticker-print-grid label:has(:checked) { background: #e4eedc; border-color: #547a62; }
.sticker-print-grid input { justify-self: end; margin: 0; width: 18px; height: 18px; accent-color: #315c48; }
.sticker-print-grid :is(.sticker-sprite, img) { width: 54px; height: 54px; object-fit: contain; }
.sticker-print-status { margin: 8px 0; }
.sticker-print-status:empty { display: none; }
.sticker-print-result p { margin: 8px 0 0; color: var(--paper-muted); font-size: .85rem; }
.sticker-print-result img { width: 100%; border: 1px solid var(--paper-line); border-radius: 8px; }
.setup-finish-actions .setup-use-device { min-height: 44px; border-color: #b1b9a5; color: var(--paper-ink); background: #fffdf7; }
