/* Chorezi standalone application surface. Intentionally independent of the active WP theme. */
html,
body.chorezi-standalone {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    background: #eaf5ff !important;
}

body.chorezi-standalone {
    min-height: 100vh !important;
    min-height: 100dvh !important;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body.chorezi-standalone #wpadminbar,
body.chorezi-standalone .site-header,
body.chorezi-standalone .site-footer,
body.chorezi-standalone header.site-header,
body.chorezi-standalone footer.site-footer {
    display: none !important;
}

.chorezi-app-shell,
.chorezi-app-shell *,
.chorezi-private,
.chorezi-private * {
    box-sizing: border-box;
}

.chorezi-app-shell {
    position: relative;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    width: 100vw !important;
    max-width: none !important;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    font-family: Inter, ui-rounded, "Arial Rounded MT Bold", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    color: #16325b;
    background: linear-gradient(#eaf7ff, #f9fbff);
    font-size: 18px;
    line-height: 1.35;
}

.chorezi-app-shell button,
.chorezi-app-shell input,
.chorezi-app-shell select,
.chorezi-app-shell textarea {
    font: inherit;
}

.chorezi-app-shell button {
    cursor: pointer;
}

.chorezi-topbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: clamp(16px, 2vw, 36px);
    width: 100%;
    padding: max(14px, env(safe-area-inset-top)) max(22px, env(safe-area-inset-right)) 14px max(22px, env(safe-area-inset-left));
    background: #17345f;
    color: #fff;
}

.chorezi-topbar .brand {
    flex: 0 0 auto;
    font-size: clamp(30px, 2.25vw, 42px);
    font-weight: 900;
    line-height: .85;
    letter-spacing: -.03em;
}

.chorezi-topbar .brand span { color: #ffd34d; }

.chorezi-topbar .brand small {
    display: block;
    margin-top: 7px;
    font-size: clamp(10px, .8vw, 13px);
    font-weight: 600;
    line-height: 1.2;
    opacity: .85;
    letter-spacing: 0;
}

.chorezi-topbar nav {
    display: flex;
    gap: 10px;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
}

.chorezi-topbar button {
    min-height: 56px;
    padding: 14px clamp(15px, 1.35vw, 24px);
    border: 0 !important;
    border-radius: 16px;
    background: #294c78;
    color: #fff;
    box-shadow: none !important;
    font-size: clamp(14px, 1vw, 17px);
    font-weight: 800;
    line-height: 1.1;
    white-space: nowrap;
    touch-action: manipulation;
    appearance: none;
}

.chorezi-topbar button.active { background: #fff; color: #17345f; }
.chorezi-topbar button.muted { opacity: .52; cursor: default; }

.chorezi-greeting {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(500px, 1.1fr);
    gap: clamp(16px, 1.5vw, 26px);
    width: 100%;
    padding: clamp(18px, 1.7vw, 28px) clamp(22px, 2.1vw, 38px);
    background: linear-gradient(90deg, #d9f1ff, #f5fbff);
}

.chorezi-greeting > div:first-child {
    align-self: center;
}

.chorezi-greeting small {
    font-weight: 800;
    letter-spacing: .02em;
}

.chorezi-greeting h1 {
    margin: 3px 0 2px !important;
    color: #16325b !important;
    font-family: inherit !important;
    font-size: clamp(38px, 3.4vw, 62px) !important;
    font-weight: 900 !important;
    line-height: .98 !important;
    letter-spacing: -.035em;
}

.chorezi-greeting p {
    margin: 0 !important;
    color: #16325b !important;
    font-size: clamp(18px, 1.4vw, 25px) !important;
    line-height: 1.25 !important;
}

.chorezi-greeting .events {
    min-width: 0;
    min-height: 112px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 17px 20px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(20,64,110,.08);
}

.chorezi-app-shell[data-view=today] .chorezi-greeting-tomorrow,
.chorezi-app-shell[data-view=tomorrow] .chorezi-greeting-today { display: none; }

.chorezi-child-grid {
    flex: 1 0 auto;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
    gap: clamp(12px, 1.1vw, 20px);
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: clamp(12px, 1.1vw, 20px) clamp(14px, 1.3vw, 24px) clamp(16px, 1.3vw, 24px) !important;
}

.chorezi-child {
    display: flex;
    flex-direction: column;
    min-width: 0;
    width: 100%;
    margin: 0 !important;
    padding: clamp(13px, 1vw, 18px);
    border: 3px solid color-mix(in srgb, var(--accent) 35%, white);
    border-radius: 24px;
    background: color-mix(in srgb, var(--accent) 17%, white);
    box-shadow: none;
}

.child-head {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
}

.child-head img,
.child-avatar {
    flex: 0 0 auto;
    width: clamp(68px, 5vw, 88px);
    height: clamp(68px, 5vw, 88px);
    border: 4px solid #fff;
    border-radius: 50%;
    object-fit: cover;
}

.child-avatar {
    display: grid;
    place-items: center;
    background: #fff;
    font-size: clamp(31px, 2.4vw, 42px);
}

.child-name-block { min-width: 0; }

.child-head h2 {
    margin: 0 !important;
    color: #16325b !important;
    font-family: inherit !important;
    font-size: clamp(29px, 2.15vw, 40px) !important;
    font-weight: 900 !important;
    line-height: 1 !important;
    letter-spacing: -.025em;
}

.child-stats {
    display: flex;
    gap: 9px;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 5px;
}

.child-head strong { font-size: clamp(21px, 1.5vw, 29px); }

.child-stats .streak {
    padding: 5px 8px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    font-size: clamp(11px, .75vw, 14px);
    font-weight: 800;
}

.child-age {
    vertical-align: middle;
    font-size: 14px;
    font-weight: 800;
    opacity: .55;
}

.chorezi-progress { margin: 12px 0 5px; }
.chorezi-progress > span { display: flex; justify-content: flex-end; color: #526980; font-size: 12px; font-weight: 800; }
.chorezi-progress > div { height: 9px; overflow: hidden; margin-top: 5px; border-radius: 99px; background: rgba(255,255,255,.78); }
.chorezi-progress i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg,#37bd67,#7bdc93); transition: width .25s; }
.chorezi-app-shell[data-view=today] .tomorrow-progress,
.chorezi-app-shell[data-view=tomorrow] .today-progress { display: none; }

.chorezi-view-panel { display: none; min-width: 0; }
.chorezi-app-shell[data-view=today] [data-panel=today],
.chorezi-app-shell[data-view=tomorrow] [data-panel=tomorrow] { display: block; }

.routine-block { margin-top: 12px; }

.routine-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 7px;
}

.routine-title h3 {
    margin: 0 !important;
    color: #16325b !important;
    font-family: inherit !important;
    font-size: clamp(15px, 1vw, 19px) !important;
    font-weight: 900 !important;
    line-height: 1.15 !important;
    text-transform: uppercase;
}

.routine-title > span {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    background: #fff4b9;
    color: #725700;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.task-list { display: flex; flex-direction: column; gap: 7px; }

.task-row {
    width: 100% !important;
    min-height: 54px;
    display: grid !important;
    grid-template-columns: 32px 40px minmax(0,1fr) auto;
    align-items: center;
    gap: 8px;
    margin: 0 !important;
    padding: 9px 10px !important;
    border: 0 !important;
    border-radius: 14px !important;
    background: rgba(255,255,255,.94) !important;
    color: #16325b !important;
    box-shadow: none !important;
    text-align: left !important;
    text-decoration: none !important;
    font-family: inherit !important;
    font-size: clamp(15px, .95vw, 18px) !important;
    line-height: 1.15 !important;
    touch-action: manipulation;
    appearance: none;
    transition: transform .12s, opacity .12s, box-shadow .12s;
}

.task-row:active { transform: scale(.99); }
.task-row.saving { opacity: .55; }
.task-row .check { width: 28px; height: 28px; border: 2px solid #8296ad; border-radius: 8px; background: #fff; }
.task-row .icon { font-size: 27px; line-height: 1; }
.task-row .task-title { min-width: 0; overflow: hidden; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.task-row em { padding: 5px 8px; border-radius: 999px; background: #eef4ff; font-size: 11px; font-style: normal; font-weight: 700; white-space: nowrap; }
.task-row.done .check { border-color: #2fba63; background: #2fba63; }
.task-row.done .check::after { content: '✓'; display: grid; place-items: center; color: #fff; font-weight: 900; }
.task-row.done { opacity: .66; }

.child-empty {
    margin-top: 14px;
    padding: 22px 12px;
    border-radius: 15px;
    background: rgba(255,255,255,.7);
    color: #61758b;
    text-align: center;
    font-size: 14px;
}

.chorezi-footer {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin: 0 !important;
    padding: 14px max(24px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
    border-top: 1px solid #dfe9f3;
    background: #fff;
    font-size: 14px;
    font-weight: 700;
}

.empty-state {
    grid-column: 1/-1;
    align-self: center;
    padding: 50px;
    border-radius: 20px;
    background: #fff;
    text-align: center;
}

.chorezi-private {
    display: grid;
    place-items: center;
    width: 100vw;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0 !important;
    padding: 30px;
    background: linear-gradient(#eaf7ff,#f9fbff);
    font-family: Inter, system-ui, sans-serif;
    text-align: center;
}

.chorezi-private > * { max-width: 560px; }

.chorezi-toast {
    position: fixed;
    z-index: 99999;
    left: 50%;
    bottom: 72px;
    transform: translate(-50%,25px);
    padding: 12px 20px;
    border-radius: 999px;
    background: #17345f;
    color: #fff;
    box-shadow: 0 8px 30px rgba(0,0,0,.2);
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transition: .2s;
}
.chorezi-toast.show { opacity: 1; transform: translate(-50%,0); }

.events-heading { font-size: 16px; }
.chorezi-app-shell[data-view=today] .tomorrow-events-heading,
.chorezi-app-shell[data-view=tomorrow] .today-events-heading { display: none; }

.family-events-panel {
    display: none;
    grid-template-columns: repeat(3,minmax(0,1fr));
    gap: 8px;
    margin-top: 10px;
}

.chorezi-app-shell[data-view=today] [data-events-panel=today],
.chorezi-app-shell[data-view=tomorrow] [data-events-panel=tomorrow] { display: grid; }

.family-event-child {
    min-width: 0;
    padding: 9px;
    border-radius: 14px;
    background: color-mix(in srgb,var(--accent) 18%,white);
}
.family-event-child > b { font-size: 13px; }
.event-rotator { position: relative; min-height: 35px; margin-top: 4px; overflow: hidden; }
.event-slide { display: none; grid-template-columns: 26px minmax(0,1fr) auto; align-items: center; gap: 5px; font-size: 13px; font-weight: 800; animation: eventIn .35s ease; }
.event-slide.active { display: grid; }
.event-slide i { font-style: normal; font-size: 19px; }
.event-slide time { font-size: 11px; opacity: .75; }
.event-rotator small { display: block; margin-top: 2px; font-size: 9px; opacity: .55; }
.no-events { grid-column: 1/-1; font-size: 13px; opacity: .65; }

@keyframes eventIn { from { opacity:0; transform:translateY(6px) } to { opacity:1; transform:none } }

/* 3 columns remain on common landscape tablets; cards collapse only when needed. */
@media (max-width: 899px) {
    .chorezi-child-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
    .chorezi-greeting { grid-template-columns: 1fr; }
    .family-events-panel { grid-template-columns: repeat(3,minmax(0,1fr)); }
}

@media (max-width: 680px) {
    .chorezi-topbar { align-items: stretch; flex-direction: column; }
    .chorezi-topbar nav { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
    .chorezi-topbar button { min-height: 50px; white-space: normal; }
    .chorezi-child-grid { grid-template-columns: 1fr; }
    .family-events-panel { grid-template-columns: 1fr; }
    .event-rotator small { display: none; }
    .task-row { grid-template-columns: 32px 38px minmax(0,1fr); }
    .task-row em { display: none; }
    .chorezi-footer { gap: 12px; align-items: center; flex-direction: column; text-align: center; }
}

@media (max-width: 430px) {
    .chorezi-greeting { padding: 16px; }
    .chorezi-child-grid { padding: 10px !important; }
    .chorezi-child { border-radius: 20px; }
}

/* v0.3.2 playful touchscreen layer */
.chorezi-app-shell {
    background:
        radial-gradient(circle at 8% 24%, rgba(255,255,255,.95) 0 20px, transparent 21px),
        radial-gradient(circle at 12% 24%, rgba(255,255,255,.8) 0 14px, transparent 15px),
        radial-gradient(circle at 92% 20%, rgba(255,255,255,.9) 0 18px, transparent 19px),
        linear-gradient(180deg,#e8f8ff 0%,#f8fbff 44%,#f7fbf8 100%);
}

.chorezi-topbar {
    position: relative;
    z-index: 20;
    box-shadow: 0 7px 0 rgba(16,44,83,.08), 0 14px 34px rgba(20,56,100,.12);
}

.chorezi-topbar::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -9px;
    height: 18px;
    background: radial-gradient(24px 13px at 24px -1px,#17345f 98%,transparent 100%) 0 0/48px 18px repeat-x;
    pointer-events: none;
}

.chorezi-topbar button:not(:disabled) {
    min-width: 112px;
    min-height: 62px;
    border: 2px solid rgba(255,255,255,.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.12), 0 5px 0 rgba(8,27,51,.20), 0 8px 18px rgba(0,0,0,.08) !important;
    transition: transform .12s cubic-bezier(.2,.8,.2,1), box-shadow .12s, background .16s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.chorezi-topbar button:not(:disabled):active,
.chorezi-topbar button.is-pressed:not(:disabled) {
    transform: translateY(3px) scale(.985);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1), 0 2px 0 rgba(8,27,51,.18) !important;
}
.chorezi-topbar button.active {
    box-shadow: 0 5px 0 #c9d8e9, 0 9px 20px rgba(0,0,0,.11) !important;
}
.chorezi-sound-toggle { min-width: 96px !important; }

.chorezi-greeting {
    position: relative;
    overflow: hidden;
    padding-top: clamp(26px,2.2vw,38px);
}
.chorezi-greeting::before,
.chorezi-greeting::after {
    content: '★';
    position: absolute;
    color: rgba(255,200,60,.32);
    font-size: 34px;
    transform: rotate(-14deg);
    pointer-events: none;
}
.chorezi-greeting::before { left: 43%; top: 18px; }
.chorezi-greeting::after { right: 2.5%; bottom: 8px; font-size: 22px; color: rgba(74,178,255,.26); }

.chorezi-greeting .events {
    border: 2px solid rgba(112,164,211,.14);
    box-shadow: 0 8px 0 rgba(77,129,172,.07), 0 16px 32px rgba(20,64,110,.09);
}

.chorezi-child {
    position: relative;
    overflow: visible;
    border-width: 4px;
    border-radius: 30px;
    background:
        radial-gradient(circle at 90% 7%, color-mix(in srgb,var(--accent) 24%,white) 0 34px, transparent 35px),
        color-mix(in srgb,var(--accent) 14%,white);
    box-shadow: 0 8px 0 color-mix(in srgb,var(--accent) 18%,#c5d9e7), 0 15px 25px rgba(43,80,110,.09);
    transition: transform .25s cubic-bezier(.2,.8,.2,1), box-shadow .25s;
}

.chorezi-child::after {
    content: '✦';
    position: absolute;
    right: 14px;
    top: 12px;
    color: color-mix(in srgb,var(--accent) 72%,#f6b900);
    font-size: 25px;
    opacity: .8;
    transform: rotate(13deg);
}

.child-head img,
.child-avatar {
    box-shadow: 0 5px 0 color-mix(in srgb,var(--accent) 22%,#d7e5ef), 0 8px 18px rgba(20,65,102,.14);
}

.child-stats > strong {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 5px 9px 5px 7px;
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    box-shadow: 0 2px 0 rgba(54,81,104,.08);
    transform-origin: center;
}
.points-pop { animation: pointsPop .62s cubic-bezier(.18,.9,.28,1.4); }
@keyframes pointsPop { 0%{transform:scale(1)} 35%{transform:scale(1.28) rotate(-4deg)} 70%{transform:scale(.96) rotate(2deg)} 100%{transform:scale(1)} }

.chorezi-progress > div {
    height: 13px;
    border: 2px solid rgba(255,255,255,.8);
    box-shadow: inset 0 1px 3px rgba(0,0,0,.08);
}
.chorezi-progress i {
    position: relative;
    background: linear-gradient(90deg,#33bd67,#70dc8b,#b5ed75);
    box-shadow: 0 0 10px rgba(64,201,109,.28);
}
.chorezi-progress i::after {
    content: '';
    position: absolute;
    inset: 2px 5px auto 5px;
    height: 3px;
    border-radius: 99px;
    background: rgba(255,255,255,.48);
}

.routine-title h3 { letter-spacing: .025em; }
.routine-title > span {
    border: 1px solid rgba(211,166,20,.12);
    box-shadow: 0 2px 0 rgba(160,125,0,.08);
}

.task-list { gap: 9px; }
.task-row {
    min-height: 66px;
    grid-template-columns: 35px 48px minmax(0,1fr) auto;
    padding: 9px 12px !important;
    border: 2px solid rgba(71,113,151,.09) !important;
    border-bottom-width: 4px !important;
    box-shadow: 0 4px 0 rgba(42,82,117,.08), 0 7px 16px rgba(40,76,108,.06) !important;
    transition: transform .13s cubic-bezier(.2,.8,.2,1), opacity .12s, box-shadow .13s, background .18s !important;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}
.task-row:hover { background: rgba(255,255,255,.98) !important; }
.task-row:active,
.task-row.is-pressed {
    transform: translateY(3px) scale(.985) !important;
    box-shadow: 0 1px 0 rgba(42,82,117,.08), 0 3px 7px rgba(40,76,108,.04) !important;
}
.task-row .check {
    width: 31px;
    height: 31px;
    border-width: 3px;
    border-radius: 10px;
    transition: transform .2s cubic-bezier(.2,.9,.2,1.5), background .15s, border-color .15s;
}
.task-row .icon-tile {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: color-mix(in srgb,var(--accent) 15%,#eef6ff);
    border: 2px solid rgba(255,255,255,.9);
    box-shadow: 0 2px 0 rgba(51,88,122,.08);
    font-size: 26px;
    transition: transform .18s cubic-bezier(.2,.9,.2,1.4);
}
.task-row.done {
    opacity: .72;
    background: color-mix(in srgb,#eaffef 70%,white) !important;
    border-color: rgba(47,186,99,.16) !important;
}
.task-row.done .check { transform: scale(1.06) rotate(-4deg); box-shadow: 0 0 0 5px rgba(47,186,99,.10); }
.task-row.done .icon-tile { transform: scale(.92) rotate(-3deg); }
.task-row.done .task-title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(43,93,65,.35); }
.task-row.saving { opacity: .56; pointer-events: none; }

.family-event-child {
    border: 2px solid rgba(255,255,255,.75);
    box-shadow: 0 3px 0 color-mix(in srgb,var(--accent) 12%,#d9e6ee);
}
.event-slide i {
    display: grid;
    place-items: center;
    width: 27px;
    height: 27px;
    border-radius: 9px;
    background: rgba(255,255,255,.72);
}

.chorezi-footer {
    position: relative;
    overflow: hidden;
    min-height: 58px;
    background: linear-gradient(180deg,#ffffff,#f3f9f2);
}
.chorezi-footer::before {
    content: '🌳   ✦   🌿      ★       🌱   ✦     🌳';
    position: absolute;
    right: 18px;
    bottom: -5px;
    opacity: .16;
    font-size: 30px;
    letter-spacing: 18px;
    pointer-events: none;
}

.chorezi-fx-layer {
    position: fixed;
    inset: 0;
    z-index: 99990;
    overflow: hidden;
    pointer-events: none;
}
.chorezi-ambient-spark {
    position: absolute;
    color: rgba(255,194,32,.28);
    font-size: clamp(10px,1vw,18px);
    animation: ambientSpark 8s ease-in-out infinite;
    will-change: transform,opacity;
}
.chorezi-ambient-spark:nth-child(3n+2){color:rgba(73,164,255,.22)}
.chorezi-ambient-spark:nth-child(3n){color:rgba(65,192,115,.20)}
@keyframes ambientSpark {
    0%,100% { transform:translate3d(0,0,0) rotate(0) scale(.8); opacity:.18; }
    45% { transform:translate3d(12px,-16px,0) rotate(80deg) scale(1.2); opacity:.72; }
    70% { transform:translate3d(-6px,-7px,0) rotate(145deg) scale(.95); opacity:.4; }
}

.chorezi-spark-burst {
    position: fixed;
    z-index: 2;
    color: #ffc928;
    font-size: 19px;
    font-style: normal;
    text-shadow: 0 2px 0 rgba(118,80,0,.08);
    transform: translate(-50%,-50%);
    animation: sparkBurst .8s cubic-bezier(.15,.7,.2,1) forwards;
}
.chorezi-spark-burst:nth-of-type(3n+2){color:#51a8ff}
.chorezi-spark-burst:nth-of-type(3n){color:#59cf7b}
@keyframes sparkBurst {
    0%{opacity:0;transform:translate(-50%,-50%) scale(.4) rotate(0)}
    15%{opacity:1}
    100%{opacity:0;transform:translate(calc(-50% + var(--tx)),calc(-50% + var(--ty))) scale(1.15) rotate(var(--rot))}
}

.chorezi-confetti {
    position: fixed;
    z-index: 4;
    color: #ffd02f;
    font-size: 18px;
    line-height: 1;
    transform: translate(-50%,-50%);
    animation: choreziConfetti 1.55s cubic-bezier(.15,.65,.2,1) forwards;
}
.chorezi-confetti:nth-of-type(5n+2){color:#ff6f8f}
.chorezi-confetti:nth-of-type(5n+3){color:#4facff}
.chorezi-confetti:nth-of-type(5n+4){color:#5ed27e}
.chorezi-confetti:nth-of-type(5n){color:#a877ff}
@keyframes choreziConfetti {
    0% { opacity:0; transform:translate(-50%,-50%) scale(.45) rotate(0); }
    12% { opacity:1; }
    100% { opacity:0; transform:translate(calc(-50% + var(--drift)),calc(-50% + var(--fall))) scale(1) rotate(var(--spin)); }
}

.chorezi-celebration {
    position: fixed;
    z-index: 99995;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .16s, visibility .16s;
    background: radial-gradient(circle,rgba(255,255,255,.18),transparent 44%);
}
.chorezi-celebration.show { opacity:1; visibility:visible; }
.celebration-badge {
    min-width: min(520px,82vw);
    padding: 26px 34px;
    border: 5px solid #fff;
    border-radius: 34px;
    background: linear-gradient(135deg,#ffdf5f,#ffb94b);
    box-shadow: 0 10px 0 #db8f27,0 22px 55px rgba(26,55,80,.28);
    color:#17345f;
    text-align:center;
    transform:scale(.6) rotate(-3deg);
    opacity:0;
}
.chorezi-celebration.show .celebration-badge { animation: celebrationPop 2.05s cubic-bezier(.18,.85,.22,1) both; }
.celebration-star { display:block; margin:-6px auto 2px; color:#fff; font-size:58px; line-height:1; text-shadow:0 4px 0 rgba(180,119,20,.22); }
.celebration-badge strong { display:block; font-size:clamp(30px,4vw,58px); line-height:1; letter-spacing:-.04em; }
.celebration-badge small { display:block; margin-top:8px; font-size:clamp(16px,1.6vw,24px); font-weight:900; }
@keyframes celebrationPop {
    0%{opacity:0;transform:scale(.55) rotate(-7deg)}
    12%{opacity:1;transform:scale(1.08) rotate(2deg)}
    20%{transform:scale(.98) rotate(-1deg)}
    78%{opacity:1;transform:scale(1) rotate(0)}
    100%{opacity:0;transform:scale(1.05) translateY(-16px)}
}

.perfect-pop { animation: perfectCard .95s cubic-bezier(.17,.84,.3,1.3); }
@keyframes perfectCard {
    0%,100%{transform:scale(1)}
    26%{transform:scale(1.025) rotate(-.4deg);box-shadow:0 10px 0 color-mix(in srgb,var(--accent) 26%,#c5d9e7),0 22px 46px rgba(43,80,110,.17)}
    58%{transform:scale(.995) rotate(.25deg)}
}

@media (hover:hover) and (pointer:fine) {
    .task-row:hover { transform:translateY(-2px); box-shadow:0 6px 0 rgba(42,82,117,.08),0 11px 20px rgba(40,76,108,.08) !important; }
    .chorezi-topbar button:not(:disabled):hover { transform:translateY(-1px); }
}

@media (max-width: 680px) {
    .task-row { min-height:64px; grid-template-columns:35px 46px minmax(0,1fr); }
    .chorezi-topbar button:not(:disabled){min-height:58px;min-width:0;}
    .chorezi-sound-toggle { grid-column: span 2; }
}

@media (prefers-reduced-motion: reduce) {
    .chorezi-ambient-spark,.chorezi-spark-burst,.chorezi-confetti { display:none !important; }
    .task-row,.chorezi-child,.chorezi-topbar button,.chorezi-progress i { transition:none !important; }
    .points-pop,.perfect-pop,.chorezi-celebration.show .celebration-badge { animation:none !important; }
    .chorezi-celebration.show .celebration-badge { opacity:1; transform:none; }
}

/* v0.3.4 clock, weather, chores, rewards and point celebrations */
.chorezi-clock{flex:0 0 auto;min-width:112px;padding:7px 12px;border-radius:16px;background:rgba(255,255,255,.1);text-align:center;box-shadow:inset 0 0 0 1px rgba(255,255,255,.1)}
.chorezi-clock strong{display:block;font-size:clamp(20px,1.65vw,29px);line-height:1;font-weight:950;letter-spacing:-.04em;font-variant-numeric:tabular-nums}.chorezi-clock small{display:block;margin-top:4px;font-size:10px;font-weight:800;opacity:.8;letter-spacing:.06em;text-transform:uppercase}.chorezi-secondary-clock{display:flex;align-items:baseline;justify-content:center;gap:6px;margin-top:6px;padding-top:5px;border-top:1px solid rgba(255,255,255,.17);white-space:nowrap}.chorezi-secondary-clock b{font-size:11px;font-weight:900;font-variant-numeric:tabular-nums}.chorezi-secondary-clock em{font-size:9px;font-style:normal;font-weight:800;opacity:.72;text-transform:uppercase;letter-spacing:.04em}
.chorezi-greeting{grid-template-columns:minmax(220px,.65fr) minmax(420px,1.15fr) minmax(290px,.8fr);align-items:stretch}
.chorezi-weather{min-width:0;padding:14px 16px;border:2px solid rgba(112,164,211,.14);border-radius:22px;background:#fff;box-shadow:0 8px 0 rgba(77,129,172,.07),0 16px 32px rgba(20,64,110,.09)}
.weather-location{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#536d86}.weather-now{display:flex;align-items:center;gap:10px;margin-top:4px}.weather-big-icon{font-size:42px;line-height:1}.weather-now strong{display:block;font-size:34px;line-height:1;color:#17345f}.weather-now small{display:block;font-size:12px;color:#57718a}.weather-detail{display:flex;gap:8px;flex-wrap:wrap;margin-top:8px}.weather-detail span{padding:4px 7px;border-radius:999px;background:#edf7ff;font-size:10px;font-weight:750;color:#49637c}.weather-days{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}.weather-days>div{padding:7px 8px;border-radius:12px;background:#f7f9fd}.weather-days small,.weather-days b,.weather-days em{display:block}.weather-days small{font-size:9px;text-transform:uppercase;letter-spacing:.05em;color:#71849a}.weather-days b{font-size:12px}.weather-days em{font-size:9px;font-style:normal;color:#71849a}.weather-unavailable{display:grid;place-items:center;min-height:85px;color:#667b91;font-size:13px}
.chorezi-greeting-chores,.chorezi-greeting-rewards{display:none}.chorezi-app-shell[data-view=chores] .chorezi-greeting-today,.chorezi-app-shell[data-view=chores] .chorezi-greeting-tomorrow,.chorezi-app-shell[data-view=rewards] .chorezi-greeting-today,.chorezi-app-shell[data-view=rewards] .chorezi-greeting-tomorrow{display:none}.chorezi-app-shell[data-view=chores] .chorezi-greeting-chores{display:block}.chorezi-app-shell[data-view=rewards] .chorezi-greeting-rewards{display:block}
.chorezi-app-shell[data-view=chores] .events,.chorezi-app-shell[data-view=rewards] .events{opacity:.5}.chorezi-app-shell[data-view=chores] .events-heading,.chorezi-app-shell[data-view=rewards] .events-heading,.chorezi-app-shell[data-view=chores] .family-events-panel,.chorezi-app-shell[data-view=rewards] .family-events-panel{display:none!important}.chorezi-app-shell[data-view=chores] .events::after{content:'⭐ Earn points by helping out';display:grid;place-items:center;height:100%;font-weight:900;color:#43617d}.chorezi-app-shell[data-view=rewards] .events::after{content:'🎁 Choose a reward to request';display:grid;place-items:center;height:100%;font-weight:900;color:#43617d}
.chorezi-app-shell[data-view=chores] .today-progress,.chorezi-app-shell[data-view=chores] .tomorrow-progress,.chorezi-app-shell[data-view=rewards] .today-progress,.chorezi-app-shell[data-view=rewards] .tomorrow-progress{display:none!important}
.chorezi-app-shell[data-view=chores] [data-panel=chores],.chorezi-app-shell[data-view=rewards] [data-panel=rewards]{display:block}
.chore-row{width:100%;min-height:64px;display:grid;grid-template-columns:34px 48px minmax(0,1fr) auto;align-items:center;gap:9px;padding:9px 11px;border:0;border-radius:16px;background:#fff;color:#17345f;text-align:left;box-shadow:0 5px 0 rgba(42,82,117,.08),0 10px 18px rgba(40,76,108,.06);touch-action:manipulation;transition:transform .12s,opacity .12s}.chore-row .check{width:30px;height:30px;border:2px solid #8096ab;border-radius:9px;background:#fff}.chore-row .icon{font-size:29px}.chore-row .task-title{font-weight:900}.chore-row em{padding:7px 10px;border-radius:999px;background:#fff3b3;color:#725600;font-size:12px;font-style:normal;font-weight:900}.chore-row.done{opacity:.58}.chore-row.done .check{display:grid;place-items:center;border-color:#2fba63;background:#2fba63}.chore-row.done .check::after{content:'✓';color:#fff;font-weight:950}.chore-row:active{transform:translateY(3px) scale(.985)}
.reward-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.reward-card{min-height:145px;padding:14px 10px;border:0;border-radius:20px;background:linear-gradient(160deg,#fff,#f8fbff);color:#17345f;box-shadow:0 6px 0 color-mix(in srgb,var(--accent) 16%,#ccdce8),0 12px 22px rgba(36,71,100,.08);touch-action:manipulation;transition:transform .12s,opacity .12s}.reward-card .reward-icon{display:block;font-size:42px}.reward-card strong,.reward-card em,.reward-card small{display:block}.reward-card strong{margin-top:5px;font-size:14px;line-height:1.15}.reward-card em{margin-top:7px;font-size:18px;font-style:normal;font-weight:950;color:#b77c00}.reward-card small{margin-top:4px;font-size:9px;font-weight:800;color:#6b7d91}.reward-card:active{transform:translateY(3px) scale(.98)}.reward-card.cant-afford{opacity:.52}.reward-card.requested{animation:rewardBounce .55s cubic-bezier(.2,.9,.25,1.3)}@keyframes rewardBounce{0%,100%{transform:none}40%{transform:scale(1.06) rotate(-1deg)}}
.chorezi-point-pop{position:fixed;z-index:99998;pointer-events:none;transform:translate(-50%,-50%) scale(.55);opacity:0;padding:12px 18px;border:4px solid #fff;border-radius:22px;background:linear-gradient(135deg,#ffe76d,#ffbd49);color:#17345f;box-shadow:0 9px 0 #d99a30,0 15px 32px rgba(23,52,95,.18);text-align:center}.chorezi-point-pop strong{display:block;font-size:30px;line-height:1;font-weight:950}.chorezi-point-pop span{display:block;margin-top:3px;font-size:11px;font-weight:900}.chorezi-point-pop.show{animation:pointEarned 1.18s cubic-bezier(.18,.86,.24,1) forwards}@keyframes pointEarned{0%{opacity:0;transform:translate(-50%,-30%) scale(.45) rotate(-5deg)}15%{opacity:1;transform:translate(-50%,-50%) scale(1.12) rotate(2deg)}30%,75%{opacity:1;transform:translate(-50%,-55%) scale(1)}100%{opacity:0;transform:translate(-50%,-105%) scale(.9)}}

@media(max-width:1200px){.chorezi-greeting{grid-template-columns:minmax(200px,.7fr) minmax(380px,1.15fr)}.chorezi-weather{grid-column:1/-1;display:grid;grid-template-columns:1.2fr auto 1.5fr 1.2fr;align-items:center;gap:12px}.weather-now,.weather-detail,.weather-days{margin-top:0}.weather-days{grid-template-columns:1fr 1fr}}
@media(max-width:899px){.chorezi-topbar{flex-wrap:wrap}.chorezi-clock{margin-left:auto}.chorezi-greeting{grid-template-columns:1fr}.chorezi-weather{grid-column:auto;display:block}.weather-now,.weather-detail,.weather-days{margin-top:8px}}
@media(max-width:680px){.chorezi-clock{position:absolute;right:14px;top:14px}.chorezi-topbar{position:relative}.chorezi-topbar .brand{padding-right:165px}.reward-grid{grid-template-columns:1fr 1fr}.chore-row{grid-template-columns:34px 44px minmax(0,1fr)}.chore-row em{display:none}}
@media(prefers-reduced-motion:reduce){.chorezi-point-pop.show,.reward-card.requested{animation:none!important}.chorezi-point-pop.show{opacity:1;transform:translate(-50%,-50%)}}

/* v0.4.0 child records, history and bedtime */
.child-record-trigger{display:inline;padding:0;border:0;background:transparent;color:inherit;font:inherit;font-weight:inherit;line-height:inherit;letter-spacing:inherit;text-align:left;cursor:pointer;-webkit-tap-highlight-color:transparent}.child-record-trigger:active{transform:scale(.96)}.child-record-trigger:focus-visible{outline:3px solid color-mix(in srgb,var(--accent) 70%,#225);outline-offset:3px;border-radius:8px}

.chorezi-greeting-history{display:none}.chorezi-app-shell[data-view=history] .chorezi-greeting-today,.chorezi-app-shell[data-view=history] .chorezi-greeting-tomorrow,.chorezi-app-shell[data-view=history] .chorezi-greeting-chores,.chorezi-app-shell[data-view=history] .chorezi-greeting-rewards{display:none}.chorezi-app-shell[data-view=history] .chorezi-greeting-history{display:block}.chorezi-app-shell[data-view=history] .events{opacity:.55}.chorezi-app-shell[data-view=history] .events-heading,.chorezi-app-shell[data-view=history] .family-events-panel{display:none!important}.chorezi-app-shell[data-view=history] .events::after{content:'🏆 Tap a child to open their full record';display:grid;place-items:center;height:100%;font-weight:900;color:#43617d;text-align:center;padding:10px}
.chorezi-history-view{display:none;width:100%;padding:clamp(14px,1.5vw,26px);background:linear-gradient(180deg,#f7fbff,#f8fbf6)}.chorezi-app-shell[data-view=history] .chorezi-child-grid{display:none}.chorezi-app-shell[data-view=history] .chorezi-history-view{display:block}
.history-intro{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:16px;padding:18px 22px;border-radius:24px;background:#fff;box-shadow:0 7px 0 rgba(34,73,105,.07),0 14px 28px rgba(34,73,105,.07)}.history-intro>div:first-child{display:grid;grid-template-columns:auto 1fr;column-gap:13px;align-items:center}.history-intro>div:first-child>span{grid-row:1/3;font-size:46px}.history-intro h2{margin:0!important;color:#17345f!important;font-size:clamp(24px,2.2vw,38px)!important;line-height:1!important}.history-intro p{margin:4px 0 0!important;color:#657b90!important}.history-key{display:flex;gap:12px;flex-wrap:wrap;font-size:12px;font-weight:800}.history-key span{display:flex;align-items:center;gap:5px}.history-key i{width:12px;height:12px;border-radius:4px;background:#68acd8}.history-key .key-perfect{background:#58ca76}
.history-family-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:clamp(12px,1.25vw,22px)}.history-child-card{min-width:0;padding:20px;border:4px solid color-mix(in srgb,var(--accent) 38%,white);border-radius:28px;background:color-mix(in srgb,var(--accent) 14%,white);color:#17345f;box-shadow:0 8px 0 color-mix(in srgb,var(--accent) 18%,#c5d9e7),0 14px 24px rgba(43,80,110,.08);text-align:left;touch-action:manipulation;transition:transform .13s,box-shadow .13s}.history-child-card:active{transform:translateY(4px) scale(.985);box-shadow:0 3px 0 color-mix(in srgb,var(--accent) 18%,#c5d9e7)}.history-child-head{display:flex;justify-content:space-between;align-items:center;gap:10px}.history-child-head strong{font-size:clamp(24px,2.2vw,38px);font-weight:950}.history-child-head span{padding:6px 9px;border-radius:999px;background:#fff;font-size:11px;font-weight:900}.history-big-number{margin:16px 0 10px}.history-big-number b{font-size:clamp(48px,5vw,82px);line-height:.85;font-weight:950;letter-spacing:-.06em}.history-big-number em{font-size:24px;font-style:normal;font-weight:950}.history-big-number small{display:block;margin-top:7px;font-size:11px;font-weight:850;text-transform:uppercase;letter-spacing:.06em;opacity:.62}.history-bars{height:168px;display:grid;grid-template-columns:repeat(7,minmax(0,1fr));align-items:end;gap:7px;padding-top:12px}.history-bar-wrap{height:100%;display:grid;grid-template-rows:1fr auto auto;align-items:end;text-align:center;min-width:0}.history-bar{align-self:end;width:100%;max-width:36px;height:var(--value);min-height:4px;margin:0 auto;border-radius:10px 10px 5px 5px;background:linear-gradient(#75bce7,#438ac1);box-shadow:inset 0 2px 0 rgba(255,255,255,.45);transform:scaleY(0);transform-origin:bottom;transition:transform .65s cubic-bezier(.2,.9,.25,1.2)}.history-bar.perfect{background:linear-gradient(#8ee69b,#46be69);box-shadow:0 0 18px rgba(69,190,105,.22),inset 0 2px 0 rgba(255,255,255,.5)}.history-animate .history-bar{transform:scaleY(1)}.history-bar-wrap small{margin-top:6px;font-size:10px;font-weight:900}.history-bar-wrap b{font-size:9px;opacity:.58}.history-card-footer{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px}.history-card-footer span{padding:6px 8px;border-radius:10px;background:rgba(255,255,255,.8);font-size:10px;font-weight:900}.history-card-footer span:last-child{margin-left:auto;background:#17345f;color:#fff}

.child-record-modal{position:fixed;z-index:100020;inset:0;display:none;align-items:center;justify-content:center;padding:22px}.child-record-modal.open{display:flex}.child-record-backdrop{position:absolute;inset:0;background:rgba(12,32,56,.65);backdrop-filter:blur(8px)}.child-record-sheet{position:relative;width:min(1000px,94vw);max-height:90vh;overflow:auto;padding:26px;border:5px solid color-mix(in srgb,var(--accent) 42%,white);border-radius:34px;background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 12%,white),#fff 55%);box-shadow:0 30px 80px rgba(5,25,50,.35);animation:recordIn .28s cubic-bezier(.2,.9,.25,1.2)}@keyframes recordIn{from{opacity:0;transform:translateY(25px) scale(.94)}to{opacity:1;transform:none}}.record-close{position:absolute;right:18px;top:18px;width:54px;height:54px;border:0;border-radius:50%;background:#17345f;color:#fff;font-size:32px;font-weight:900;box-shadow:0 4px 0 #0c2444;z-index:2}.record-profile-head{display:flex;align-items:center;gap:17px;padding-right:60px}.record-profile-head img,.record-avatar{width:92px;height:92px;border:5px solid #fff;border-radius:50%;object-fit:cover;box-shadow:0 6px 0 color-mix(in srgb,var(--accent) 20%,#d9e4eb)}.record-avatar{display:grid;place-items:center;background:#fff;font-size:44px}.record-profile-head small{font-size:10px;font-weight:900;letter-spacing:.1em;opacity:.6}.record-profile-head h2{margin:2px 0 4px!important;color:#17345f!important;font-size:clamp(34px,4vw,56px)!important;line-height:1!important}.record-profile-head p{margin:0!important;font-weight:850;color:#526a82}.record-stat-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin:22px 0}.record-stat-grid>div{padding:17px;border-radius:20px;background:#fff;text-align:center;box-shadow:0 4px 0 rgba(31,73,111,.07)}.record-stat-grid strong{display:block;font-size:36px;font-weight:950;color:#17345f}.record-stat-grid span{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.05em;color:#6a7f93}.record-graph-panel,.record-ledger{padding:18px;border-radius:22px;background:#fff;box-shadow:0 5px 0 rgba(31,73,111,.06);margin-top:14px}.record-graph-panel h3,.record-ledger h3{margin:0 0 12px!important;color:#17345f!important}.record-bars{height:210px;display:grid;grid-template-columns:repeat(14,minmax(12px,1fr));align-items:end;gap:7px}.record-bar-wrap{height:100%;display:grid;grid-template-rows:1fr auto;align-items:end;text-align:center}.record-bar{align-self:end;width:100%;max-width:38px;height:var(--value);min-height:3px;margin:auto;border-radius:9px 9px 4px 4px;background:linear-gradient(#79bfe7,#4389be);transform:scaleY(0);transform-origin:bottom;transition:transform .7s cubic-bezier(.2,.9,.25,1.2)}.child-record-modal.open .record-bar{transform:scaleY(1)}.record-bar.perfect{background:linear-gradient(#8de49a,#43bd68);box-shadow:0 0 14px rgba(66,188,104,.22)}.record-bar-wrap small{margin-top:7px;font-size:9px;font-weight:800;color:#667b8f}.record-ledger-list{display:flex;flex-direction:column}.record-ledger-list>div{display:flex;justify-content:space-between;gap:14px;padding:10px 4px;border-bottom:1px solid #eef2f6;font-weight:800}.record-ledger-list small{display:block;margin-top:2px;font-size:9px;color:#8291a0}.record-ledger-list strong{white-space:nowrap}.record-ledger-list .positive{color:#19924b}.record-ledger-list .negative{color:#c54747}

/* Bedtime mode and alarm */
.chorezi-app-shell.bedtime-mode{background:radial-gradient(circle at 10% 10%,rgba(111,135,209,.12),transparent 30%),linear-gradient(180deg,#091a35,#12294d 58%,#0d2341);color:#e9f1ff}.chorezi-app-shell.bedtime-mode .chorezi-topbar{background:#08172d;box-shadow:0 7px 0 rgba(0,0,0,.14),0 14px 34px rgba(0,0,0,.22)}.chorezi-app-shell.bedtime-mode .chorezi-greeting{background:linear-gradient(90deg,#102949,#17365c);color:#e9f1ff}.chorezi-app-shell.bedtime-mode .chorezi-greeting h1,.chorezi-app-shell.bedtime-mode .chorezi-greeting p,.chorezi-app-shell.bedtime-mode .chorezi-greeting small{color:#eef5ff!important}.chorezi-app-shell.bedtime-mode .chorezi-weather,.chorezi-app-shell.bedtime-mode .events{background:#142e50;color:#eaf2ff;border-color:rgba(255,255,255,.08)}.chorezi-app-shell.bedtime-mode .weather-now strong{color:#fff}.chorezi-app-shell.bedtime-mode .weather-now small,.chorezi-app-shell.bedtime-mode .weather-location,.chorezi-app-shell.bedtime-mode .weather-days small,.chorezi-app-shell.bedtime-mode .weather-days em{color:#b7cae2}.chorezi-app-shell.bedtime-mode .weather-detail span,.chorezi-app-shell.bedtime-mode .weather-days>div{background:#0e2441;color:#dceaff}.chorezi-app-shell.bedtime-mode .chorezi-child{filter:saturate(.72) brightness(.86)}.chorezi-app-shell.bedtime-mode .chorezi-footer{background:#091b32;color:#cad9ec;border-color:#1d3855}
.bedtime-overlay{position:fixed;z-index:100050;inset:0;display:none;place-items:center;padding:24px;background:radial-gradient(circle at 50% 15%,#213f72 0,#0c2140 48%,#061427 100%);color:#fff;overflow:hidden}.bedtime-overlay.show{display:grid}.bedtime-stars{position:absolute;inset:8% 6% auto;text-align:center;font-size:clamp(18px,2.2vw,35px);letter-spacing:clamp(14px,5vw,80px);color:#ffe889;opacity:.72;animation:bedStars 5s ease-in-out infinite}@keyframes bedStars{50%{opacity:.35;transform:translateY(8px)}}.bedtime-card{position:relative;width:min(650px,90vw);padding:32px;border:3px solid rgba(255,255,255,.16);border-radius:36px;background:linear-gradient(160deg,rgba(31,61,103,.96),rgba(12,34,63,.96));box-shadow:0 30px 80px rgba(0,0,0,.35);text-align:center}.bedtime-moon{display:block;font-size:76px;filter:drop-shadow(0 8px 15px rgba(0,0,0,.24));animation:moonFloat 3.8s ease-in-out infinite}@keyframes moonFloat{50%{transform:translateY(-7px) rotate(-4deg)}}.bedtime-card>small{display:block;margin-top:8px;font-size:10px;font-weight:900;letter-spacing:.16em;color:#a9c6ee}.bedtime-card h2{margin:7px 0 7px!important;color:#fff!important;font-size:clamp(34px,4.2vw,58px)!important;line-height:1!important}.bedtime-card p{margin:0 auto!important;max-width:480px;color:#c7d8ed!important;font-size:17px!important}.bedtime-time{display:inline-flex;align-items:center;gap:12px;margin:22px auto;padding:10px 15px;border-radius:16px;background:rgba(255,255,255,.08)}.bedtime-time span{font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.08em;color:#a9c6ee}.bedtime-time strong{font-size:28px}.bedtime-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.bedtime-actions button{min-height:56px;padding:13px 18px;border:2px solid rgba(255,255,255,.12);border-radius:17px;background:#1b3b67;color:#fff;font-weight:900;box-shadow:0 4px 0 #071a32}.bedtime-actions button.primary{background:#6c8ee2;box-shadow:0 4px 0 #3b5eac}.bedtime-actions button:active{transform:translateY(3px);box-shadow:0 1px 0 #071a32}

@media(max-width:1050px){.history-family-grid{grid-template-columns:1fr}.history-child-card{display:grid;grid-template-columns:.75fr 1.25fr;column-gap:20px}.history-child-head,.history-big-number,.history-card-footer{grid-column:1}.history-bars{grid-column:2;grid-row:1/4}.record-bars{gap:4px}}
@media(max-width:680px){.history-intro{align-items:flex-start;flex-direction:column}.history-child-card{display:block}.history-bars{height:145px}.record-stat-grid{grid-template-columns:1fr 1fr}.record-stat-grid>div:last-child{grid-column:1/-1}.record-bars{height:170px;gap:3px}.record-bar-wrap small{font-size:8px}.child-record-sheet{padding:18px;border-radius:24px}.record-profile-head img,.record-avatar{width:72px;height:72px}.record-close{width:46px;height:46px}.bedtime-card{padding:24px 16px}.bedtime-actions{display:grid}.bedtime-actions button{width:100%}}
@media(prefers-reduced-motion:reduce){.history-bar,.record-bar{transform:scaleY(1)!important;transition:none!important}.bedtime-stars,.bedtime-moon{animation:none!important}.child-record-sheet{animation:none!important}}

/* v0.4.1 kiosk sizing: the document never scrolls; individual app panels do. */
html,body.chorezi-standalone{height:100%!important;max-height:100%!important;overflow:hidden!important;overscroll-behavior:none}
body.chorezi-standalone{position:relative}
.chorezi-app-shell{height:100vh;height:100dvh;min-height:0!important;max-height:100vh;max-height:100dvh;overflow:hidden!important}
.chorezi-topbar{padding-top:max(8px,env(safe-area-inset-top));padding-bottom:8px;gap:12px}
.chorezi-topbar .brand{font-size:clamp(26px,1.8vw,36px)}
.chorezi-topbar button:not(:disabled){min-height:52px;padding:10px clamp(11px,1vw,18px)}
.chorezi-greeting{flex:0 0 auto;grid-template-columns:minmax(190px,.58fr) minmax(390px,1.1fr) minmax(265px,.72fr);gap:12px;padding:12px 18px 13px}
.chorezi-greeting h1{font-size:clamp(30px,2.55vw,48px)!important}
.chorezi-greeting p{font-size:clamp(14px,1.05vw,19px)!important}
.chorezi-greeting .events{min-height:92px;padding:10px 14px;border-radius:18px}
.chorezi-weather{padding:9px 12px;border-radius:18px}
.weather-now{margin-top:2px}.weather-big-icon{font-size:34px}.weather-now strong{font-size:29px}.weather-detail{margin-top:5px}.weather-days{margin-top:5px}.weather-days>div{padding:5px 7px}
.weather-content[hidden],.weather-unavailable[hidden]{display:none!important}.weather-unavailable strong,.weather-unavailable small{display:block}.weather-unavailable small{margin-top:5px;text-align:center;line-height:1.25}
.chorezi-child-grid{flex:1 1 auto;min-height:0;overflow:hidden;align-items:stretch;padding:10px 12px 9px!important;gap:11px}
.chorezi-child{min-height:0;overflow:hidden;padding:11px 12px 10px;border-radius:26px;background:linear-gradient(155deg,color-mix(in srgb,var(--accent) 32%,white),color-mix(in srgb,var(--accent) 18%,white) 48%,white 115%)}
.child-head img,.child-avatar{width:clamp(58px,4.3vw,76px);height:clamp(58px,4.3vw,76px)}
.child-head h2{font-size:clamp(25px,1.75vw,34px)!important}.child-head strong{font-size:clamp(17px,1.15vw,23px)}
.chorezi-progress{margin:7px 0 3px}.chorezi-progress>div{height:10px}.chorezi-progress>span{font-size:10px}
.chorezi-view-panel{min-height:0;scrollbar-width:thin;scrollbar-color:color-mix(in srgb,var(--accent) 50%,#a7bfd1) rgba(255,255,255,.35);overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 3px 8px 0}
.chorezi-app-shell[data-view=today] [data-panel=today],.chorezi-app-shell[data-view=tomorrow] [data-panel=tomorrow],.chorezi-app-shell[data-view=chores] [data-panel=chores],.chorezi-app-shell[data-view=rewards] [data-panel=rewards]{display:block;flex:1 1 auto;overflow-y:auto}
.routine-block{margin-top:8px}.routine-title{margin-bottom:5px}.routine-title h3{font-size:clamp(13px,.82vw,16px)!important}.routine-title>span{padding:3px 6px;font-size:9px}
.task-list{gap:6px}.task-row{min-height:51px!important;grid-template-columns:29px 38px minmax(0,1fr) auto!important;padding:6px 8px!important;border-bottom-width:3px!important;border-radius:13px!important;font-size:clamp(13px,.82vw,16px)!important}.task-row .check{width:27px;height:27px}.task-row .icon-tile{width:36px;height:36px;border-radius:10px;font-size:22px}.task-row em{padding:4px 6px;font-size:9px}
.chore-row{min-height:54px;padding:7px 9px}.reward-card{min-height:122px;padding:10px 8px}.reward-card .reward-icon{font-size:34px}
.chorezi-footer{flex:0 0 38px;min-height:38px!important;padding:6px max(18px,env(safe-area-inset-right)) max(6px,env(safe-area-inset-bottom)) max(18px,env(safe-area-inset-left));font-size:11px}
.chorezi-history-view{flex:1 1 auto;min-height:0;overflow-y:auto;padding:12px 16px}.chorezi-app-shell[data-view=history] .chorezi-history-view{display:block}

/* General reminder alarm */
.reminder-overlay{position:fixed;z-index:100045;inset:0;display:none;place-items:center;padding:24px;background:rgba(20,52,91,.72);backdrop-filter:blur(10px);color:#17345f}.reminder-overlay.show{display:grid}.reminder-card{width:min(610px,90vw);padding:30px;border:5px solid #fff;border-radius:34px;background:linear-gradient(150deg,#fff7c7,#eaf6ff 65%,#fff);box-shadow:0 12px 0 rgba(15,52,88,.18),0 30px 80px rgba(8,32,59,.35);text-align:center;animation:reminderPop .34s cubic-bezier(.2,.9,.25,1.2)}@keyframes reminderPop{from{opacity:0;transform:scale(.82) translateY(18px)}to{opacity:1;transform:none}}.reminder-icon{display:block;font-size:78px;line-height:1;animation:reminderBounce 1.5s ease-in-out infinite}@keyframes reminderBounce{50%{transform:translateY(-7px) rotate(-4deg)}}.reminder-card>small{display:block;margin-top:8px;font-size:10px;font-weight:950;letter-spacing:.14em;color:#66809a}.reminder-card h2{margin:6px 0!important;color:#17345f!important;font-size:clamp(38px,4.4vw,62px)!important;line-height:1!important}.reminder-card p{margin:0!important;color:#526b83!important;font-size:18px!important;font-weight:750}.reminder-time{display:inline-flex;align-items:center;gap:12px;margin:20px auto 22px;padding:9px 14px;border-radius:16px;background:#fff}.reminder-time span{font-size:10px;font-weight:900;text-transform:uppercase;letter-spacing:.08em}.reminder-time strong{font-size:28px}.reminder-actions{display:flex;justify-content:center;gap:10px;flex-wrap:wrap}.reminder-actions button{min-height:58px;padding:13px 19px;border:0;border-radius:17px;background:#dcecff;color:#17345f;font-weight:950;box-shadow:0 4px 0 #afcce5}.reminder-actions button.primary{background:#ffd84d;box-shadow:0 4px 0 #d3a92b}.reminder-actions button:active{transform:translateY(3px);box-shadow:0 1px 0 #afcce5}

@media(max-width:1200px){.chorezi-greeting{grid-template-columns:minmax(180px,.6fr) minmax(350px,1.1fr) minmax(245px,.72fr)}.chorezi-weather{grid-column:auto;display:block}.weather-days{grid-template-columns:1fr 1fr}}
@media(max-width:899px){.chorezi-app-shell{height:100dvh;overflow:hidden}.chorezi-topbar{flex-direction:row;flex-wrap:wrap}.chorezi-topbar nav{order:3;width:100%;grid-template-columns:repeat(3,minmax(0,1fr))}.chorezi-greeting{grid-template-columns:1fr 1fr;padding:10px}.chorezi-weather{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;gap:8px}.chorezi-child-grid{overflow-y:auto;grid-template-columns:1fr}.chorezi-child{min-height:540px}.chorezi-footer{display:none}.chorezi-history-view{overflow-y:auto}.reminder-actions{display:grid;grid-template-columns:1fr}.reminder-actions button{width:100%}}
@media(prefers-reduced-motion:reduce){.reminder-card,.reminder-icon{animation:none!important}}

/* v0.4.3 Conduct tab */
.chorezi-greeting-conduct{display:none}
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-today,
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-tomorrow,
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-chores,
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-rewards,
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-history{display:none}
.chorezi-app-shell[data-view=conduct] .chorezi-greeting-conduct{display:block}
.chorezi-app-shell[data-view=conduct] .events{opacity:.55}
.chorezi-app-shell[data-view=conduct] .events-heading,
.chorezi-app-shell[data-view=conduct] .family-events-panel{display:none!important}
.chorezi-app-shell[data-view=conduct] .events::after{content:'⚖️ Parent conduct adjustment';display:grid;place-items:center;height:100%;font-weight:900;color:#43617d;text-align:center;padding:10px}
.chorezi-app-shell[data-view=conduct] .today-progress,
.chorezi-app-shell[data-view=conduct] .tomorrow-progress{display:none!important}
.chorezi-app-shell[data-view=conduct] [data-panel=conduct]{display:block;flex:1 1 auto;overflow-y:auto}
.conduct-block{display:grid;gap:10px}
.conduct-section h4{margin:4px 0 8px;font-size:14px;text-transform:uppercase;letter-spacing:.05em;color:#5b6d80}
.conduct-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.conduct-card{position:relative;display:grid;grid-template-columns:36px 1fr auto;grid-template-rows:auto auto;align-items:center;gap:2px 8px;min-height:70px;padding:10px 12px;border:2px solid transparent;border-radius:16px;text-align:left;background:#fff;color:#17345f;font-weight:800;box-shadow:0 3px 0 rgba(23,52,95,.1);touch-action:manipulation;transition:transform .12s ease,box-shadow .12s ease,border-color .12s ease}
.conduct-card>span{grid-row:1/3;font-size:26px;text-align:center}.conduct-card strong{font-size:14px;line-height:1.12}.conduct-card em{font-style:normal;font-size:14px;font-weight:900}.conduct-card small{grid-column:2/4;font-size:10px;color:#74859a}
.conduct-card.positive{background:#f0fff4;border-color:#b9e9c7}.conduct-card.positive em{color:#19884a}
.conduct-card.negative{background:#fff3f3;border-color:#f0bcbc}.conduct-card.negative em{color:#c23b3b}
.conduct-card.armed{transform:translateY(2px);box-shadow:0 1px 0 rgba(23,52,95,.1);border-color:#17345f}.conduct-card.armed small{color:#17345f;font-weight:900}.conduct-card.saving{opacity:.6;pointer-events:none}
@media(max-width:1250px){.conduct-grid{grid-template-columns:1fr}.conduct-card{min-height:62px}}

.chorezi-point-pop.negative{background:linear-gradient(135deg,#ffd1d1,#ff8f8f);box-shadow:0 9px 0 #cb5f5f,0 15px 32px rgba(92,18,18,.22);color:#6e1f1f}
/* v0.4.4 points integrity clarity */
.child-stats .today-earned{display:inline-flex;align-items:center;gap:3px;padding:7px 11px;border-radius:999px;background:rgba(255,255,255,.72);box-shadow:0 3px 0 rgba(33,66,101,.08);font-size:12px;font-weight:950;color:#3f617c;white-space:nowrap}.child-stats .today-earned b{color:#238848;font-size:14px}@media(max-width:1150px){.child-stats .today-earned{padding:5px 8px;font-size:10px}.child-stats .today-earned b{font-size:12px}}

/* v0.4.5 secondary clock + today activity */
.today-record{border:2px solid color-mix(in srgb,var(--accent) 30%,#dbe5ef);background:color-mix(in srgb,var(--accent) 8%,#fff)}
.record-ledger-list .conduct-entry{background:linear-gradient(90deg,#fff8e6,#fff);border-left:4px solid #f0ad2f}
.record-ledger-list .new-activity{animation:choreziActivityIn .85s cubic-bezier(.2,.9,.25,1.15)}
@keyframes choreziActivityIn{0%{transform:translateX(18px) scale(.97);opacity:0}55%{transform:translateX(-3px) scale(1.015);opacity:1}100%{transform:none;opacity:1}}
@media(max-width:680px){.chorezi-clock{min-width:128px}.chorezi-secondary-clock{gap:4px}.chorezi-secondary-clock b{font-size:10px}.chorezi-secondary-clock em{font-size:8px}}

/* v0.4.6 birthday countdown + animated tabby companion */
.child-name-block h2{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.birthday-countdown{display:inline-flex;align-items:center;min-height:24px;padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.82);color:#7a4d00;font-size:10px;font-weight:950;line-height:1;white-space:nowrap;box-shadow:0 2px 0 rgba(23,52,95,.08)}
.chorezi-cat-companion{position:fixed;z-index:10020;right:max(14px,env(safe-area-inset-right));bottom:max(44px,calc(env(safe-area-inset-bottom) + 38px));width:142px;pointer-events:none;filter:drop-shadow(0 12px 20px rgba(22,50,91,.2))}
.cat-character{display:block;width:128px;height:128px;margin-left:auto;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important;cursor:pointer;pointer-events:auto;touch-action:manipulation;transform-origin:50% 95%}
.cat-svg{display:block;width:100%;height:100%;overflow:visible}
.cat-speech{position:absolute;right:86px;bottom:96px;width:190px;padding:10px 12px;border:3px solid #fff;border-radius:18px 18px 5px 18px;background:#fff8d6;color:#17345f;font-size:12px;font-weight:900;line-height:1.25;text-align:center;box-shadow:0 7px 18px rgba(23,52,95,.16);opacity:0;transform:translateY(8px) scale(.96);transition:opacity .18s ease,transform .18s ease;pointer-events:none}
.cat-speech::after{content:'';position:absolute;right:-10px;bottom:12px;border:10px solid transparent;border-left-color:#fff}
.chorezi-cat-companion.speaking .cat-speech{opacity:1;transform:none}
.cat-tail{transform-origin:139px 121px;animation:catTail 2.2s ease-in-out infinite}
.cat-eyes{transform-origin:center;animation:catBlink 5.6s infinite}
.cat-happy-eyes,.cat-sad-eyes,.cat-mouth-sad,.cat-heart,.cat-star{opacity:0}
.cat-body,.cat-head{transform-origin:center}
@keyframes catTail{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(11deg)}}
@keyframes catBlink{0%,45%,48%,100%{transform:scaleY(1)}46%,47%{transform:scaleY(.08)}}
.chorezi-cat-companion[data-mood=happy] .cat-eyes,.chorezi-cat-companion[data-mood=celebrate] .cat-eyes,.chorezi-cat-companion[data-mood=reward] .cat-eyes{opacity:0}
.chorezi-cat-companion[data-mood=happy] .cat-happy-eyes,.chorezi-cat-companion[data-mood=celebrate] .cat-happy-eyes,.chorezi-cat-companion[data-mood=reward] .cat-happy-eyes{opacity:1}
.chorezi-cat-companion[data-mood=sad] .cat-eyes,.chorezi-cat-companion[data-mood=sad] .cat-mouth-happy{opacity:0}
.chorezi-cat-companion[data-mood=sad] .cat-sad-eyes,.chorezi-cat-companion[data-mood=sad] .cat-mouth-sad{opacity:1}
.chorezi-cat-companion[data-mood=reward] .cat-heart,.chorezi-cat-companion[data-mood=happy] .cat-heart{opacity:1;animation:catHeart 1s ease-in-out infinite}
.chorezi-cat-companion[data-mood=celebrate] .cat-star{opacity:1;animation:catStar .75s ease-in-out infinite alternate}
.chorezi-cat-companion[data-mood=happy] .cat-character{animation:catBounce .55s cubic-bezier(.2,.85,.3,1.25)}
.chorezi-cat-companion[data-mood=reward] .cat-character{animation:catPurr .38s ease-in-out 3}
.chorezi-cat-companion[data-mood=sad] .cat-character{animation:catDroop .42s ease both}
.chorezi-cat-companion[data-mood=celebrate] .cat-character{animation:catDance .42s ease-in-out 5}
@keyframes catBounce{0%{transform:scale(1)}45%{transform:translateY(-15px) scale(1.06,.95)}75%{transform:translateY(2px) scale(.98,1.03)}100%{transform:none}}
@keyframes catPurr{0%,100%{transform:translateX(0) rotate(0)}25%{transform:translateX(-2px) rotate(-2deg)}75%{transform:translateX(2px) rotate(2deg)}}
@keyframes catDroop{0%{transform:none}100%{transform:translateY(6px) rotate(-3deg) scale(.96)}}
@keyframes catDance{0%,100%{transform:translateY(0) rotate(-5deg)}50%{transform:translateY(-11px) rotate(7deg) scale(1.05)}}
@keyframes catHeart{0%,100%{transform:scale(.75);opacity:.45}50%{transform:scale(1.15);opacity:1}}
@keyframes catStar{from{transform:rotate(-12deg) scale(.8)}to{transform:rotate(12deg) scale(1.18)}}
.chorezi-app-shell.bedtime-mode .chorezi-cat-companion{filter:drop-shadow(0 8px 18px rgba(0,0,0,.35));opacity:.9}
.chorezi-app-shell.bedtime-mode .cat-speech{background:#fff4c7;color:#24385c}
@media(max-width:1200px){.chorezi-cat-companion{width:118px}.cat-character{width:108px;height:108px}.cat-speech{right:72px;bottom:82px;width:165px;font-size:11px}}
@media(max-width:899px){.chorezi-cat-companion{right:8px;bottom:8px;width:102px}.cat-character{width:96px;height:96px}.cat-speech{right:64px;bottom:72px;width:150px;font-size:10px}}
@media(prefers-reduced-motion:reduce){.cat-tail,.cat-eyes,.cat-character,.cat-heart,.cat-star{animation:none!important}.cat-speech{transition:none}}


/* v0.4.7 comprehensive bedtime/night contrast pass */
.chorezi-app-shell.bedtime-mode {
    color:#edf5ff;
}

/* Child panels become genuinely dark instead of applying a brightness filter to light cards. */
.chorezi-app-shell.bedtime-mode .chorezi-child {
    filter:none !important;
    color:#eef5ff;
    border-color:color-mix(in srgb,var(--accent) 34%,#3c5575) !important;
    background:
        radial-gradient(circle at 90% 7%,color-mix(in srgb,var(--accent) 16%,#172943) 0 34px,transparent 35px),
        linear-gradient(155deg,color-mix(in srgb,var(--accent) 14%,#142640),#0d1c31 62%,#0a1729 100%) !important;
    box-shadow:0 7px 0 rgba(0,0,0,.24),0 15px 30px rgba(0,0,0,.24) !important;
}
.chorezi-app-shell.bedtime-mode .chorezi-child::after {
    color:color-mix(in srgb,var(--accent) 58%,#ffd866);
    opacity:.7;
}
.chorezi-app-shell.bedtime-mode .child-head h2,
.chorezi-app-shell.bedtime-mode .child-head h2 button,
.chorezi-app-shell.bedtime-mode .child-name-button,
.chorezi-app-shell.bedtime-mode .child-head strong,
.chorezi-app-shell.bedtime-mode .task-title,
.chorezi-app-shell.bedtime-mode .routine-title h3 {
    color:#f4f8ff !important;
}
.chorezi-app-shell.bedtime-mode .child-age { color:#c5d3e5 !important; }
.chorezi-app-shell.bedtime-mode .child-head img,
.chorezi-app-shell.bedtime-mode .child-avatar {
    border-color:#324963;
    box-shadow:0 4px 0 #071422,0 8px 18px rgba(0,0,0,.32);
}

/* Stats and badges. */
.chorezi-app-shell.bedtime-mode .child-stats > strong,
.chorezi-app-shell.bedtime-mode .child-stats .streak,
.chorezi-app-shell.bedtime-mode .child-stats .today-earned {
    background:#172a43 !important;
    color:#eaf2ff !important;
    box-shadow:0 2px 0 rgba(0,0,0,.3) !important;
    border:1px solid rgba(255,255,255,.07);
}
.chorezi-app-shell.bedtime-mode .child-stats .today-earned b { color:#81e7a5 !important; }
.chorezi-app-shell.bedtime-mode .birthday-countdown {
    background:#322a19 !important;
    color:#ffe399 !important;
    border:1px solid #5a4a25;
    box-shadow:0 2px 0 rgba(0,0,0,.28);
}
.chorezi-app-shell.bedtime-mode .chorezi-progress > span { color:#c5d5e8 !important; }
.chorezi-app-shell.bedtime-mode .chorezi-progress > div {
    border-color:#32465e !important;
    background:#071526 !important;
    box-shadow:inset 0 2px 5px rgba(0,0,0,.38) !important;
}
.chorezi-app-shell.bedtime-mode .chorezi-progress i {
    background:linear-gradient(90deg,#2f9e5b,#5acb7a,#9fd86a) !important;
    box-shadow:0 0 10px rgba(73,201,112,.19) !important;
}

/* Routine labels / bonus pills. */
.chorezi-app-shell.bedtime-mode .routine-title { color:#eaf2ff; }
.chorezi-app-shell.bedtime-mode .routine-title > span {
    background:#342d19 !important;
    color:#ffe59b !important;
    border-color:#554820 !important;
    box-shadow:0 2px 0 rgba(0,0,0,.28) !important;
}

/* Routine task rows: dark surface, high-contrast text. */
.chorezi-app-shell.bedtime-mode .task-row {
    background:#14263e !important;
    color:#f1f6ff !important;
    border-color:#29415f !important;
    box-shadow:0 3px 0 #071321,0 7px 14px rgba(0,0,0,.18) !important;
}
.chorezi-app-shell.bedtime-mode .task-row:hover { background:#19304e !important; }
.chorezi-app-shell.bedtime-mode .task-row .check {
    border-color:#7f97b5 !important;
    background:#09192b !important;
}
.chorezi-app-shell.bedtime-mode .task-row .icon-tile {
    background:color-mix(in srgb,var(--accent) 18%,#172f4d) !important;
    border-color:#365171 !important;
    box-shadow:0 2px 0 rgba(0,0,0,.25) !important;
}
.chorezi-app-shell.bedtime-mode .task-row em {
    background:#2d2a3e !important;
    color:#ffe18b !important;
    border:1px solid #49445e;
}
.chorezi-app-shell.bedtime-mode .task-row.done {
    opacity:.82 !important;
    background:#173328 !important;
    color:#d8f2e1 !important;
    border-color:#315b49 !important;
}
.chorezi-app-shell.bedtime-mode .task-row.done .check {
    border-color:#47c576 !important;
    background:#2f9f5d !important;
}
.chorezi-app-shell.bedtime-mode .task-row.done .task-title {
    color:#c8e5d2 !important;
    text-decoration-color:#6aa882 !important;
}
.chorezi-app-shell.bedtime-mode .task-row.done .icon-tile {
    background:#1d3d32 !important;
    border-color:#37634f !important;
}
.chorezi-app-shell.bedtime-mode .child-empty {
    background:#12243b !important;
    color:#c8d6e7 !important;
    border-color:#29415f !important;
}

/* Chores tab. */
.chorezi-app-shell.bedtime-mode .chore-row {
    background:#14263e !important;
    color:#f1f6ff !important;
    box-shadow:0 3px 0 #071321,0 7px 14px rgba(0,0,0,.18) !important;
}
.chorezi-app-shell.bedtime-mode .chore-row .check { background:#09192b;border-color:#7f97b5; }
.chorezi-app-shell.bedtime-mode .chore-row em { background:#342d19;color:#ffe49a; }
.chorezi-app-shell.bedtime-mode .chore-row.done { opacity:.74; }

/* Rewards tab. */
.chorezi-app-shell.bedtime-mode .reward-card {
    background:#14263e !important;
    color:#f1f6ff !important;
    border-color:#29415f !important;
    box-shadow:0 3px 0 #071321,0 7px 14px rgba(0,0,0,.18) !important;
}
.chorezi-app-shell.bedtime-mode .reward-card strong,
.chorezi-app-shell.bedtime-mode .reward-card b { color:#f5f8ff !important; }
.chorezi-app-shell.bedtime-mode .reward-card small { color:#c1d0e2 !important; }

/* Conduct tab. */
.chorezi-app-shell.bedtime-mode .conduct-section h4 { color:#c4d3e5 !important; }
.chorezi-app-shell.bedtime-mode .conduct-card {
    background:#14263e !important;
    color:#f1f6ff !important;
    border-color:#29415f !important;
    box-shadow:0 3px 0 #071321 !important;
}
.chorezi-app-shell.bedtime-mode .conduct-card small { color:#bdcde0 !important; }
.chorezi-app-shell.bedtime-mode .conduct-card.positive {
    background:#153427 !important;
    border-color:#2f6548 !important;
}
.chorezi-app-shell.bedtime-mode .conduct-card.positive em { color:#7de3a5 !important; }
.chorezi-app-shell.bedtime-mode .conduct-card.negative {
    background:#3a2027 !important;
    border-color:#70404a !important;
}
.chorezi-app-shell.bedtime-mode .conduct-card.negative em { color:#ff9fa8 !important; }

/* Events / weather text contrast in the night header. */
.chorezi-app-shell.bedtime-mode .events-heading,
.chorezi-app-shell.bedtime-mode .family-event-child,
.chorezi-app-shell.bedtime-mode .event-slide,
.chorezi-app-shell.bedtime-mode .event-slide strong,
.chorezi-app-shell.bedtime-mode .event-slide small { color:#edf5ff !important; }
.chorezi-app-shell.bedtime-mode .family-event-child {
    background:#102641 !important;
    border-color:#2b4666 !important;
    box-shadow:0 3px 0 rgba(0,0,0,.24) !important;
}
.chorezi-app-shell.bedtime-mode .event-slide i { background:#203b5d !important; }
.chorezi-app-shell.bedtime-mode .weather-days b { color:#eef5ff !important; }
.chorezi-app-shell.bedtime-mode .weather-unavailable { color:#c1d1e4 !important; }

/* The Today/Chores/Rewards/Conduct helper text should not stay slate-grey in night mode. */
.chorezi-app-shell.bedtime-mode[data-view=chores] .events::after,
.chorezi-app-shell.bedtime-mode[data-view=rewards] .events::after,
.chorezi-app-shell.bedtime-mode[data-view=conduct] .events::after { color:#d7e5f5 !important; }

/* Keep modal/history surfaces legible if opened at bedtime. */
.chorezi-app-shell.bedtime-mode .child-record-sheet,
.chorezi-app-shell.bedtime-mode .history-child-card,
.chorezi-app-shell.bedtime-mode .record-stat-grid > div,
.chorezi-app-shell.bedtime-mode .today-record {
    background:#11243a !important;
    color:#eef5ff !important;
    border-color:#2b4564 !important;
}
.chorezi-app-shell.bedtime-mode .child-record-sheet h2,
.chorezi-app-shell.bedtime-mode .child-record-sheet h3,
.chorezi-app-shell.bedtime-mode .history-child-card h3 { color:#f5f8ff !important; }
.chorezi-app-shell.bedtime-mode .record-ledger-list > div,
.chorezi-app-shell.bedtime-mode .record-ledger-list .conduct-entry {
    background:#162b45 !important;
    color:#eaf2ff !important;
    border-color:#344d6c !important;
}

/* Avoid bright white hover flashes in night mode. */
@media (hover:hover) and (pointer:fine) {
    .chorezi-app-shell.bedtime-mode .task-row:hover { background:#1b3352 !important; }
    .chorezi-app-shell.bedtime-mode .chore-row:hover,
    .chorezi-app-shell.bedtime-mode .reward-card:hover,
    .chorezi-app-shell.bedtime-mode .conduct-card:hover { filter:brightness(1.08); }
}

/* v0.4.8 reactive Tamagotchi-style tabby companion */
.cat-accessory{opacity:0;pointer-events:none;transform-box:fill-box;transform-origin:center;transition:opacity .16s ease,transform .18s ease}
.cat-prop-bubble{position:absolute;z-index:3;right:-2px;top:6px;display:grid;place-items:center;width:46px;height:46px;border:3px solid rgba(255,255,255,.95);border-radius:50%;background:#fff8d6;font-size:25px;line-height:1;box-shadow:0 7px 16px rgba(23,52,95,.16);opacity:0;transform:scale(.4) rotate(-12deg);pointer-events:none}
.cat-prop-bubble.show{opacity:1;animation:catPropPop .48s cubic-bezier(.2,.9,.2,1.25) both}
@keyframes catPropPop{0%{opacity:0;transform:scale(.35) rotate(-16deg)}65%{opacity:1;transform:scale(1.16) rotate(6deg)}100%{opacity:1;transform:scale(1) rotate(0)}}

.chorezi-cat-companion[data-action=keyboard] .cat-keyboard,
.chorezi-cat-companion[data-action=mask] .cat-mask,
.chorezi-cat-companion[data-action=brush] .cat-toothbrush,
.chorezi-cat-companion[data-action=book] .cat-book,
.chorezi-cat-companion[data-action=letter] .cat-letter,
.chorezi-cat-companion[data-action=wet] .cat-water{opacity:1}
.chorezi-cat-companion[data-action=keyboard] .cat-keyboard{animation:catKeyboardPop .35s cubic-bezier(.2,.9,.25,1.2) both}
.chorezi-cat-companion[data-action=keyboard] .cat-key-paw.paw-left{animation:catKeyLeft .26s ease-in-out infinite alternate}
.chorezi-cat-companion[data-action=keyboard] .cat-key-paw.paw-right{animation:catKeyRight .26s .13s ease-in-out infinite alternate}
.chorezi-cat-companion[data-action=keyboard] .cat-head{animation:catKeyboardNod .52s ease-in-out infinite}
@keyframes catKeyboardPop{from{opacity:0;transform:translateY(18px) scale(.7)}to{opacity:1;transform:none}}
@keyframes catKeyLeft{from{transform:translateY(-5px)}to{transform:translateY(5px)}}
@keyframes catKeyRight{from{transform:translateY(5px)}to{transform:translateY(-5px)}}
@keyframes catKeyboardNod{0%,100%{transform:rotate(-2deg)}50%{transform:rotate(3deg) translateY(2px)}}

.chorezi-cat-companion[data-action=wet] .cat-body,.chorezi-cat-companion[data-action=wet] .cat-head{filter:saturate(.72) brightness(.92)}
.chorezi-cat-companion[data-action=wet] .cat-character{animation:catShakeDry .5s ease-in-out 5}
.chorezi-cat-companion[data-action=wet] .cat-water .d1{animation:catDrop 1s ease-in infinite}
.chorezi-cat-companion[data-action=wet] .cat-water .d2{animation:catDrop 1.15s .18s ease-in infinite}
.chorezi-cat-companion[data-action=wet] .cat-water .d3{animation:catDrop .9s .36s ease-in infinite}
@keyframes catShakeDry{0%,100%{transform:rotate(0)}25%{transform:rotate(-4deg) translateX(-2px)}75%{transform:rotate(4deg) translateX(2px)}}
@keyframes catDrop{0%{transform:translateY(-7px);opacity:.15}30%{opacity:1}100%{transform:translateY(15px);opacity:0}}

.chorezi-cat-companion[data-action=brush] .cat-brush-arm{transform-origin:119px 111px;animation:catBrush 0.34s ease-in-out infinite alternate}
.chorezi-cat-companion[data-action=brush] .cat-tooth-spark{animation:catToothSpark .6s ease-in-out infinite alternate}
@keyframes catBrush{from{transform:rotate(-8deg)}to{transform:rotate(13deg)}}
@keyframes catToothSpark{from{opacity:.25;transform:scale(.7)}to{opacity:1;transform:scale(1.25)}}

.chorezi-cat-companion[data-action=mask] .cat-mask{animation:catMaskOn .42s cubic-bezier(.2,.9,.2,1.2) both}
@keyframes catMaskOn{from{transform:translateY(12px) scale(.65);opacity:0}to{transform:none;opacity:1}}

.chorezi-cat-companion[data-action=book] .cat-book{animation:catBookBob .85s ease-in-out infinite alternate}
.chorezi-cat-companion[data-action=book] .cat-head{animation:catReadNod 1.2s ease-in-out infinite}
@keyframes catBookBob{from{transform:translateY(2px) rotate(-1deg)}to{transform:translateY(-2px) rotate(1deg)}}
@keyframes catReadNod{0%,100%{transform:rotate(1deg)}50%{transform:rotate(-4deg) translateY(2px)}}

.chorezi-cat-companion[data-action=letter] .cat-letter{animation:catLetterPop .35s ease-out both}
.chorezi-cat-companion[data-action=letter] .cat-pencil{transform-origin:119px 142px;animation:catWrite .25s ease-in-out infinite alternate}
@keyframes catLetterPop{from{opacity:0;transform:translateY(12px) scale(.75)}to{opacity:1;transform:none}}
@keyframes catWrite{from{transform:translate(-2px,-1px) rotate(-4deg)}to{transform:translate(4px,2px) rotate(5deg)}}

.chorezi-cat-companion[data-action=tantrum] .cat-character{animation:catTantrum .18s linear 14}
.chorezi-cat-companion[data-action=sleepy] .cat-character{animation:catSleepy 1s ease-in-out 4}
.chorezi-cat-companion[data-action=exercise] .cat-character{animation:catExercise .45s ease-in-out 7}
.chorezi-cat-companion[data-action=kart] .cat-character{animation:catKart .28s ease-in-out 10}
.chorezi-cat-companion[data-action=fruit] .cat-character{animation:catFruit .38s ease-in-out 8}
.chorezi-cat-companion[data-action=peace] .cat-heart{opacity:1;animation:catHeart .7s ease-in-out infinite}
.chorezi-cat-companion[data-action=food] .cat-mouth-happy{animation:catNom .28s ease-in-out infinite alternate}
@keyframes catTantrum{0%,100%{transform:translateX(0) rotate(0)}25%{transform:translateX(-5px) rotate(-4deg)}75%{transform:translateX(5px) rotate(4deg)}}
@keyframes catSleepy{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(7px) rotate(-5deg)}}
@keyframes catExercise{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-14px) scale(.96,1.05)}}
@keyframes catKart{0%,100%{transform:translateX(0) rotate(-4deg)}50%{transform:translateX(-12px) rotate(5deg)}}
@keyframes catFruit{0%,100%{transform:rotate(-5deg) translateY(0)}50%{transform:rotate(7deg) translateY(-9px)}}
@keyframes catNom{from{transform:scaleY(.8)}to{transform:scaleY(1.15)}}

/* The whole companion occasionally races after a toy across the lower edge of the screen. */
.chorezi-cat-companion.chasing{animation:catChaseRun 4.55s cubic-bezier(.35,.05,.2,1) both;filter:drop-shadow(0 10px 18px rgba(22,50,91,.24))}
.chorezi-cat-companion.chasing .cat-speech,.chorezi-cat-companion.chasing .cat-prop-bubble{opacity:0!important}
.chorezi-cat-companion.chasing .cat-character{animation:catChaseBounce .2s ease-in-out infinite alternate!important}
.cat-chase-toy{position:fixed;z-index:10018;right:5vw;bottom:max(65px,calc(env(safe-area-inset-bottom) + 58px));font-size:31px;line-height:1;pointer-events:none;filter:drop-shadow(0 5px 5px rgba(0,0,0,.16));animation:catToyRun 4.4s linear both}
@keyframes catChaseRun{0%{transform:translateX(0) rotate(0)}12%{transform:translateX(-8vw) rotate(-4deg)}46%{transform:translateX(-63vw) rotate(-5deg)}62%{transform:translateX(-51vw) rotate(4deg)}78%{transform:translateX(-28vw) rotate(-3deg)}100%{transform:translateX(0) rotate(0)}}
@keyframes catToyRun{0%{transform:translateX(0) rotate(0)}42%{transform:translateX(-70vw) rotate(-360deg)}61%{transform:translateX(-57vw) rotate(-480deg)}100%{transform:translateX(-12vw) rotate(-720deg)}}
@keyframes catChaseBounce{from{transform:translateY(0) scaleX(1)}to{transform:translateY(-7px) scaleX(1.03)}}

.chorezi-app-shell.bedtime-mode .cat-prop-bubble{background:#263a56;color:#f4f7fb;border-color:#59718f;box-shadow:0 6px 16px rgba(0,0,0,.34)}
@media(max-width:899px){.cat-chase-toy{font-size:25px;bottom:52px}}
@media(prefers-reduced-motion:reduce){.cat-accessory,.cat-key-paw,.cat-brush-arm,.cat-tooth-spark,.cat-pencil,.cat-water .drop,.cat-head,.cat-prop-bubble,.chorezi-cat-companion.chasing,.cat-chase-toy{animation:none!important;transition:none!important}.cat-chase-toy{display:none!important}}
