:root {
    --paper: #f6f5f0;
    --surface: #fffefb;
    --ink: #202525;
    --muted: #747873;
    --line: #dedfd8;
    --coral: #df6f7d;
    --coral-soft: #f6d7dc;
    --mint: #75aa98;
    --mint-soft: #d8ebe2;
    --lavender: #8878aa;
    --lavender-soft: #e4ddef;
    --sky: #6c9ab3;
    --sky-soft: #d6e7ee;
    --sun: #e4b455;
    --sun-soft: #f7e8bc;
    --shadow: 0 26px 80px rgba(39, 45, 42, 0.16);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-content-h: 64px;
    --header-h: calc(var(--header-content-h) + var(--safe-top));
    --nav-h: 76px;
    --ease-out: cubic-bezier(.2, .78, .22, 1);
    --game-outline: #303735;
    --game-outline-soft: rgba(48, 55, 53, .18);
    --game-shadow: 0 5px 0 rgba(48, 55, 53, .14);
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

[hidden] {
    display: none !important;
}

html,
body {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    display: grid;
    place-items: center;
    background: #dce3df;
    color: var(--ink);
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    font-size: 15px;
    line-height: 1.45;
    overscroll-behavior: none;
    touch-action: manipulation;
}

button {
    user-select: none;
    -webkit-user-select: none;
    touch-action: manipulation;
}

button,
input,
textarea {
    color: inherit;
    font: inherit;
}

button {
    border: 0;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(108, 154, 179, .28);
    outline-offset: 2px;
}

.app-shell {
    position: relative;
    width: min(520px, 100%);
    height: min(900px, calc(100vh - 32px));
    height: min(900px, calc(100dvh - 32px));
    overflow: hidden;
    isolation: isolate;
    background: var(--paper);
    border: 1px solid rgba(32, 37, 37, .12);
    border-radius: 28px;
    box-shadow: var(--shadow);
}

.app-grain {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: .42;
    background-image:
        linear-gradient(rgba(32, 37, 37, .022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(32, 37, 37, .016) 1px, transparent 1px);
    background-size: 22px 22px;
    mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

.app-header {
    position: absolute;
    inset: 0 0 auto;
    z-index: 20;
    height: var(--header-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--safe-top) 18px 0;
    background: rgba(246, 245, 240, .86);
    border-bottom: 1px solid rgba(32, 37, 37, .07);
    backdrop-filter: blur(18px);
    transition: transform 240ms var(--ease-out), background 240ms ease;
}

.wordmark {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0;
    background: transparent;
    font-weight: 800;
    font-size: 18px;
    cursor: pointer;
}

.wordmark-icon {
    width: 30px;
    height: 34px;
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--ink);
}

.doncs-mark {
    display: block;
    width: 100%;
    height: 100%;
    background: currentColor;
    -webkit-mask: url('/images/doncs-logo-mark.png') center / contain no-repeat;
    mask: url('/images/doncs-logo-mark.png') center / contain no-repeat;
}

.header-spacer {
    flex: 1;
}

.icon-button,
.avatar-button {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: var(--surface);
    cursor: pointer;
    transition: transform 140ms ease, background 140ms ease;
}

.icon-button:active,
.avatar-button:active,
.bottom-nav button:active,
.primary-action:active,
.secondary-action:active,
.tool-card:active {
    transform: scale(.96);
}

.icon-button i {
    font-size: 21px;
}

.back-button {
    margin-right: 2px;
}

.avatar-button {
    overflow: hidden;
    padding: 2px;
    border-color: #d5c8bc;
    background: #f3e8dc;
}

.avatar-art {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background-color: #efe9e2;
    background-position: center 43%;
    background-repeat: no-repeat;
    background-size: cover;
}

.avatar-art[data-avatar-art="brachiosaurus"] { background-image: url('/images/doncs/avatars/brachiosaurus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="triceratops"] { background-image: url('/images/doncs/avatars/triceratops.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="tyrannosaurus"] { background-image: url('/images/doncs/avatars/tyrannosaurus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="stegosaurus"] { background-image: url('/images/doncs/avatars/stegosaurus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="ankylosaurus"] { background-image: url('/images/doncs/avatars/ankylosaurus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="parasaurolophus"] { background-image: url('/images/doncs/avatars/parasaurolophus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="spinosaurus"] { background-image: url('/images/doncs/avatars/spinosaurus.webp?v=20260831-dinosaurs'); }
.avatar-art[data-avatar-art="velociraptor"] { background-image: url('/images/doncs/avatars/velociraptor.webp?v=20260831-dinosaurs'); }

.scroll-progress {
    position: absolute;
    z-index: 25;
    top: calc(var(--header-h) - 2px);
    left: 0;
    right: 0;
    height: 2px;
    overflow: hidden;
    pointer-events: none;
}

.scroll-progress span {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--coral);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 80ms linear;
}

.app-stage {
    position: absolute;
    inset: var(--header-h) 0 0;
    overflow: hidden;
}

.app-shell.nav-visible .app-stage {
    bottom: calc(var(--nav-h) + var(--safe-bottom));
}

.app-shell.immersive .app-header {
    transform: translateY(-105%);
}

.app-shell.immersive .app-stage {
    top: 0;
}

.app-shell.auth-mode .app-header {
    transform: translateY(-105%);
}

.app-shell.auth-mode .app-stage {
    top: 0;
}

.screen {
    position: absolute;
    inset: 0;
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(0, 1fr);
    overflow: hidden;
    background: transparent;
    opacity: 0;
    transform: translateX(42px) scale(.985);
    pointer-events: none;
}

.screen.is-active {
    opacity: 1;
    transform: translateX(0) scale(1);
    pointer-events: auto;
    animation: screen-in 360ms var(--ease-out) both;
}

.screen.is-leaving {
    animation: screen-out 220ms ease both;
}

@keyframes screen-in {
    from { opacity: 0; transform: translateX(34px) scale(.988); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes screen-out {
    to { opacity: 0; transform: translateX(-24px) scale(.99); }
}

.screen-content,
.onboarding-step {
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    padding: 26px 24px calc(34px + env(safe-area-inset-bottom));
}

.screen-content::-webkit-scrollbar,
.onboarding-step::-webkit-scrollbar {
    display: none;
}

.screen-content.fixed-content {
    overflow: hidden;
}

.screen.has-nav .screen-content {
    padding-bottom: 28px;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 8px;
    color: var(--coral);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.eyebrow i {
    font-size: 15px;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 11px;
    font-size: clamp(27px, 7.6vw, 36px);
    line-height: 1.08;
    letter-spacing: 0;
}

h2 {
    letter-spacing: 0;
}

.lead {
    margin-bottom: 16px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
}

.paint-illustration {
    position: relative;
    width: 100%;
    height: 178px;
    display: grid;
    place-items: center;
    margin: 0 0 24px;
    overflow: hidden;
    border-radius: 8px;
    color: #fff;
    clip-path: polygon(1% 13%, 11% 5%, 29% 9%, 43% 2%, 62% 8%, 78% 3%, 98% 12%, 96% 48%, 100% 82%, 82% 94%, 62% 90%, 47% 98%, 29% 91%, 5% 96%, 2% 61%);
}

.paint-illustration > i {
    position: relative;
    z-index: 2;
    font-size: 88px;
    filter: drop-shadow(0 8px 18px rgba(32, 37, 37, .14));
}

.paint-illustration.compact {
    width: 154px;
    height: 105px;
    margin-bottom: 18px;
}

.paint-illustration.compact > i {
    font-size: 54px;
}

.paint-illustration.tiny {
    float: right;
    width: 108px;
    height: 76px;
    margin: 0 0 4px 14px;
}

.paint-illustration.tiny > i {
    font-size: 42px;
}

.paint-coral { background: var(--coral); }
.paint-mint { background: var(--mint); }
.paint-sky { background: var(--sky); }
.paint-lavender { background: var(--lavender); }

.paint-stroke {
    position: absolute;
    width: 64%;
    height: 16px;
    border-radius: 50%;
    border-top: 3px solid rgba(255, 255, 255, .4);
    transform: rotate(-7deg);
}

.stroke-one { top: 28px; left: 11%; }
.stroke-two { right: 6%; bottom: 26px; transform: rotate(8deg); }

.field-label,
.gender-picker legend,
.avatar-picker legend {
    display: block;
    margin-bottom: 9px;
    font-size: 12px;
    font-weight: 700;
}

.app-input {
    width: 100%;
    height: 54px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .9);
    font-size: 16px;
}

.app-input:focus {
    border-color: var(--sky);
}

.gender-picker {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0 0;
    padding: 0;
    border: 0;
}

.gender-picker legend {
    grid-column: 1 / -1;
}

.gender-picker button {
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .86);
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.gender-picker button i {
    font-size: 18px;
}

.gender-picker button.is-selected {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
    box-shadow: 0 5px 14px rgba(32, 37, 37, .14);
}

.avatar-picker {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin: 14px 0 18px;
    padding: 0;
    border: 0;
}

.avatar-picker legend {
    grid-column: 1 / -1;
}

.avatar-option {
    aspect-ratio: 1;
    min-width: 0;
    display: grid;
    place-items: center;
    padding: 3px;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: 8px;
    background: var(--surface);
    cursor: pointer;
    transition: transform 160ms var(--ease-out), border-color 160ms ease;
}

.avatar-option .avatar-art {
    border-radius: 5px;
    transition: transform 180ms var(--ease-out);
}

.avatar-option:active .avatar-art {
    transform: scale(.84) rotate(-6deg);
}

.avatar-option.is-selected {
    border-color: var(--ink);
    box-shadow: 0 0 0 3px rgba(32, 37, 37, .08);
}

.auth-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: calc(30px + var(--safe-top));
}

.auth-theme-toggle {
    position: absolute;
    z-index: 4;
    top: calc(var(--safe-top) + 16px);
    right: 20px;
    width: 44px;
    height: 44px;
    background: rgba(255, 254, 251, .9);
    box-shadow: 0 8px 22px rgba(32, 37, 37, .08);
    backdrop-filter: blur(14px);
}

.auth-brand {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 0 0 24px;
    color: var(--ink);
    font-size: clamp(38px, 11vw, 52px);
    font-weight: 800;
    line-height: 1;
}

.auth-brand .doncs-mark {
    width: 50px;
    height: 58px;
    flex: 0 0 auto;
}

.auth-content > .auth-brand,
.auth-content > h1,
.auth-content > .lead {
    justify-content: center;
    text-align: center;
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    margin: 12px 0 14px;
    padding: 4px;
    border-radius: 8px;
    background: #e9e9e4;
}

.auth-tabs button {
    min-height: 42px;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.auth-tabs button.is-selected {
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 3px 10px rgba(32, 37, 37, .08);
}

.auth-form {
    display: grid;
    gap: 10px;
}

.auth-form label > span {
    display: block;
    margin: 0 0 6px 2px;
    font-size: 10px;
    font-weight: 700;
}

.auth-form .primary-action {
    margin-top: 4px;
}

.auth-error {
    margin: 0;
    padding: 9px 10px;
    border-radius: 6px;
    background: #f9ded7;
    color: #934634;
    font-size: 9px;
    font-weight: 700;
}

.auth-private {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 9px;
}

.spin {
    animation: spin 900ms linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.onboarding-count {
    margin-bottom: 14px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-align: right;
    text-transform: uppercase;
}

.onboarding-paint {
    width: 132px;
    height: 90px;
    float: right;
    margin: 0 0 8px 14px;
}

.onboarding-paint > i {
    font-size: 49px;
}

.personal-question {
    margin-top: 20px;
}

.personal-question > span {
    display: block;
    margin-bottom: 9px;
    font-size: 11px;
    font-weight: 700;
}

.personal-options {
    display: grid;
    gap: 8px;
}

.personal-options button {
    min-height: 62px;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .76);
    text-align: left;
    cursor: pointer;
}

.personal-options button i {
    font-size: 23px;
    color: var(--coral);
}

.personal-options button strong {
    font-size: 11px;
}

.personal-options button.is-selected {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
}

.personal-options button.is-selected i { color: var(--sun); }

.compact-options {
    grid-template-columns: repeat(3, 1fr);
}

.compact-options button {
    min-width: 0;
    min-height: 76px;
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 4px;
    padding: 7px 4px;
    text-align: center;
}

.compact-options button strong { font-size: 9px; }

.support-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 22px 0 18px;
}

.support-grid button {
    min-height: 92px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 7px;
    padding: 10px 7px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .78);
    color: var(--muted);
    cursor: pointer;
}

.support-grid button i { font-size: 27px; }
.support-grid button span { font-size: 10px; font-weight: 700; }
.support-grid button.is-selected { border-color: var(--sky); background: var(--sky-soft); color: #3f758d; }

.pet-intro {
    display: grid;
    grid-template-columns: 72px 1fr;
    align-items: center;
    gap: 13px;
    margin: 0 0 14px;
    padding: 10px;
    border: 1px solid #bfd6cc;
    border-radius: 8px;
    background: var(--mint-soft);
}

.pet-intro > .avatar-art {
    width: 68px;
    height: 68px;
    border: 3px solid rgba(255, 255, 255, .8);
    border-radius: 50%;
}

.pet-intro small,
.pet-intro strong { display: block; }
.pet-intro small { color: #477b69; font-size: 8px; text-transform: uppercase; }
.pet-intro strong { margin-top: 2px; font-size: 15px; }
.pet-intro p { margin: 3px 0 0; color: #5e746c; font-size: 9px; }

.primary-action,
.secondary-action {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.primary-action {
    width: 100%;
    padding: 0 20px;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 10px 24px rgba(32, 37, 37, .17);
}

.primary-action:hover {
    filter: brightness(1.08);
}

.primary-action i,
.secondary-action i {
    font-size: 21px;
}

.secondary-action {
    width: 56px;
    padding: 0;
    border: 1px solid var(--line);
    background: var(--surface);
}

.text-action {
    width: 100%;
    padding: 15px 8px 4px;
    background: transparent;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.onboarding-screen {
    display: block;
}

.onboarding-step {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(30px);
    pointer-events: none;
}

.onboarding-step.is-active {
    opacity: 1;
    transform: none;
    pointer-events: auto;
    animation: screen-in 360ms var(--ease-out) both;
}

.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.onboarding-progress {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 11px;
    margin-bottom: 30px;
}

.onboarding-progress > span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
}

.onboarding-progress > div {
    height: 4px;
    overflow: hidden;
    border-radius: 4px;
    background: var(--line);
}

.onboarding-progress i {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--coral);
    transition: width 260ms var(--ease-out);
}

[data-onboarding-step="1"] .onboarding-progress i { width: 12.5%; }
[data-onboarding-step="2"] .onboarding-progress i { width: 25%; }
[data-onboarding-step="3"] .onboarding-progress i { width: 37.5%; }
[data-onboarding-step="4"] .onboarding-progress i { width: 50%; }
[data-onboarding-step="5"] .onboarding-progress i { width: 62.5%; }
[data-onboarding-step="6"] .onboarding-progress i { width: 75%; }
[data-onboarding-step="7"] .onboarding-progress i { width: 87.5%; }
[data-onboarding-step="8"] .onboarding-progress i { width: 100%; }

.onboarding-visual {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    margin: 6px 0 24px;
    border-radius: 8px;
    clip-path: polygon(8% 10%, 42% 1%, 91% 9%, 100% 49%, 88% 94%, 45% 100%, 4% 87%, 0 39%);
}

.onboarding-visual > i { font-size: 35px; }
.onboarding-visual.brand { background: var(--coral); color: #fff; }
.onboarding-visual.brand .doncs-mark { width: 34px; height: 40px; }

.onboarding-step > h1 {
    max-width: 410px;
    margin-bottom: 8px;
    font-size: 30px;
    line-height: 1.12;
}

.onboarding-step > .lead {
    max-width: 390px;
    margin-bottom: 24px;
}

.onboarding-answer { margin-top: 12px; }

.onboarding-actions {
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 22px;
}

.onboarding-actions .primary-action {
    width: auto;
    flex: 1 1 auto;
}

.onboarding-actions.single .primary-action { width: 100%; }

.onboarding-choice-grid {
    margin-top: 8px;
}

.onboarding-choice-grid button {
    min-height: 92px;
    flex-direction: column;
    gap: 8px;
}

.onboarding-choice-grid button i { font-size: 28px; }
.onboarding-choice-grid button strong { font-size: 12px; }

.onboarding-options {
    gap: 10px;
    margin-top: 6px;
}

.onboarding-options button {
    min-height: 72px;
    grid-template-columns: 38px minmax(0, 1fr);
}

.onboarding-options button strong {
    font-size: 12px;
    line-height: 1.4;
}

.onboarding-question-list { margin-bottom: 0; }

.question-choice {
    width: 100%;
    background: transparent;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.question-choice > strong {
    padding-right: 6px;
    font-size: 11px;
    line-height: 1.35;
}

.question-choice[aria-checked="true"] .switch { background: var(--mint); }
.question-choice[aria-checked="true"] .switch span { transform: translateX(18px); }

.onboarding-step .support-grid {
    margin-top: 4px;
    margin-bottom: 0;
}

.onboarding-step .support-grid button {
    min-height: 102px;
    padding-inline: 10px;
}

.onboarding-step .support-grid button span {
    line-height: 1.35;
}

.step-dots {
    display: flex;
    gap: 6px;
    margin: 0 0 28px;
}

.step-dots span {
    width: 22px;
    height: 4px;
    border-radius: 9px;
    background: #d6d7d1;
}

.step-dots span.active {
    width: 42px;
    background: var(--ink);
}

.question-list {
    margin: 8px 0 26px;
    border-top: 1px solid var(--line);
}

.question-row {
    min-height: 74px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--line);
}

.question-icon,
.recommendation > span,
.pattern-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.question-icon i {
    font-size: 20px;
}

.lavender { background: var(--lavender-soft); color: #65547f; }
.coral { background: var(--coral-soft); color: #a94f3c; }
.sky { background: var(--sky-soft); color: #3f758d; }
.mint { background: var(--mint-soft); color: #477b69; }
.sun { background: var(--sun-soft); color: #7a5a1c; }

.question-row strong,
.question-row small,
.recommendation strong,
.recommendation small {
    display: block;
}

.question-row strong {
    font-size: 13px;
}

.question-row small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 11px;
}

.switch {
    position: relative;
    width: 46px;
    height: 28px;
    border-radius: 99px;
    background: #d9dad5;
    cursor: pointer;
    transition: background 180ms ease;
}

.switch span {
    position: absolute;
    top: 4px;
    left: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(32, 37, 37, .18);
    transition: transform 180ms var(--ease-out);
}

.switch[aria-checked="true"] {
    background: var(--mint);
}

.switch[aria-checked="true"] span {
    transform: translateX(18px);
}

.recommendation-list {
    display: grid;
    gap: 8px;
    margin: 10px 0 24px;
}

.recommendation {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 70px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .72);
}

.recommendation.primary {
    border-color: #d4a99c;
    background: #fce9e3;
}

.recommendation > span {
    background: var(--surface);
}

.recommendation > span i {
    font-size: 22px;
}

.recommendation small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 11px;
}

.rec-star {
    color: var(--coral);
}

.bottom-nav {
    position: absolute;
    z-index: 30;
    inset: auto 0 0;
    height: calc(var(--nav-h) + var(--safe-bottom));
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 7px 12px var(--safe-bottom);
    border-top: 1px solid rgba(32, 37, 37, .1);
    background: rgba(255, 254, 251, .92);
    backdrop-filter: blur(20px);
}

.bottom-nav button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    border-radius: 12px;
    background: transparent;
    color: #8a8d89;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, color 180ms ease;
}

.bottom-nav button i {
    font-size: 23px;
}

.bottom-nav button.active {
    color: var(--ink);
}

.bottom-nav button.active::before {
    content: "";
    position: absolute;
    top: 1px;
    width: 30px;
    height: 3px;
    border-radius: 6px;
    background: var(--coral);
}

.home-screen {
    grid-template-rows: minmax(0, 1fr) auto;
}

.home-screen .screen-content {
    padding-top: 22px;
    padding-bottom: 8px;
    overflow-y: auto;
}

.home-greeting,
.month-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.home-greeting h1 {
    margin: 0;
    font-size: 31px;
}

.streak-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 11px;
    border-radius: 99px;
    background: var(--sun-soft);
    color: #76551e;
    font-size: 11px;
}

.streak-pill i {
    color: #d49424;
    font-size: 17px;
}

.month-toolbar {
    margin: 26px 0 12px;
}

.month-toolbar h2 {
    margin: 0 0 2px;
    font-size: 20px;
}

.month-toolbar p {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
}

.month-actions {
    display: flex;
    gap: 6px;
}

.month-actions .icon-button {
    width: 42px;
    height: 42px;
}

.calendar {
    padding: 10px 11px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .72);
}

.weekdays,
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.weekdays {
    margin-bottom: 5px;
}

.weekdays span {
    display: grid;
    place-items: center;
    height: 26px;
    color: #999b96;
    font-size: 10px;
    font-weight: 800;
}

.calendar-day {
    position: relative;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin: 2px;
    border-radius: 50%;
    background: transparent;
    color: #666a66;
    font-size: 12px;
    cursor: pointer;
    transition: transform 140ms ease;
}

.calendar-day:active {
    transform: scale(.88);
}

.calendar-day.outside {
    opacity: .24;
}

.calendar-day.completed {
    color: #28302d;
    font-weight: 800;
}

.calendar-day.completed::before {
    content: "";
    position: absolute;
    inset: 3px;
    z-index: -1;
    border-radius: 50%;
    background: var(--day-color, var(--mint-soft));
    transform: rotate(var(--day-rotate, 0deg));
    clip-path: polygon(6% 15%, 24% 2%, 82% 7%, 99% 31%, 91% 88%, 67% 99%, 12% 91%, 1% 50%);
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--ink);
    font-weight: 800;
}

.today-insight {
    width: 100%;
    min-height: 60px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    margin-top: 12px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.insight-color {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--sky-soft);
    color: #41758d;
}

.today-insight small,
.today-insight strong {
    display: block;
}

.today-insight small {
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.today-insight strong {
    font-size: 12px;
}

.insight-arrow {
    color: var(--muted);
}

.pet-home-card {
    width: 100%;
    min-height: 68px;
    display: grid;
    grid-template-columns: 50px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 11px;
    margin-top: 12px;
    padding: 8px 10px;
    overflow: hidden;
    border: 1px solid #bfd6cc;
    border-radius: 8px;
    background: var(--mint-soft);
    color: var(--ink);
    text-align: left;
    cursor: pointer;
    transition: transform 150ms var(--ease-out), border-color 180ms ease;
}

.pet-home-card:active {
    transform: scale(.98);
}

.pet-home-avatar {
    width: 48px;
    height: 48px;
    border: 2px solid rgba(255, 255, 255, .86);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(32, 37, 37, .1);
}

.pet-home-card small,
.pet-home-card strong,
.pet-home-card em {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-home-card small {
    color: #477b69;
    font-size: 8px;
    font-weight: 800;
    text-transform: uppercase;
}

.pet-home-card strong {
    margin-top: 2px;
    font-size: 12px;
}

.pet-home-card em {
    margin-top: 2px;
    color: #688178;
    font-size: 9px;
    font-style: normal;
}

.pet-home-card > i {
    font-size: 20px;
    color: #477b69;
}

.home-cta {
    padding: 10px 18px;
}

.checkin-action {
    min-height: 68px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    justify-content: initial;
    gap: 12px;
    padding: 8px 14px;
    text-align: left;
}

.checkin-action > span:first-child {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--coral);
}

.checkin-action strong,
.checkin-action small {
    display: block;
}

.checkin-action strong {
    font-size: 13px;
}

.checkin-action small {
    margin-top: 2px;
    color: rgba(255, 255, 255, .66);
    font-size: 10px;
    font-weight: 500;
}

.pet-screen {
    grid-template-rows: minmax(0, 1fr);
}

.pet-content {
    display: flex;
    flex-direction: column;
    padding-bottom: calc(var(--nav-h) + 18px + env(safe-area-inset-bottom));
}

.pet-content > h1 {
    margin-bottom: 5px;
}

.pet-content > .lead {
    margin-bottom: 10px;
}

.pet-stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    margin: 2px 0 10px;
    overflow: hidden;
    border: 1px solid #ddcfc4;
    border-radius: 8px;
    background: #f5e5d9;
}

.pet-stage::before,
.pet-stage::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.pet-stage::before {
    inset: auto -8% -26% 20%;
    height: 58%;
    border-radius: 50%;
    background: rgba(255, 254, 251, .72);
    transform: rotate(-5deg);
}

.pet-stage::after {
    top: 18px;
    right: 22px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--sun);
    box-shadow: 0 0 0 8px rgba(230, 184, 90, .16);
}

.pet-large-avatar {
    position: relative;
    z-index: 2;
    width: min(176px, 44vw);
    height: min(176px, 44vw);
    border: 5px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    box-shadow: 0 16px 32px rgba(32, 37, 37, .16);
    animation: pet-breathe 3.2s ease-in-out infinite;
}

.pet-speech {
    position: absolute;
    z-index: 3;
    top: 14px;
    left: 15px;
    max-width: 56%;
    padding: 8px 10px;
    border-radius: 7px 7px 7px 2px;
    background: var(--surface);
    box-shadow: 0 5px 16px rgba(32, 37, 37, .1);
    font-size: 9px;
    font-weight: 700;
    line-height: 1.35;
}

.pet-stage.is-cared .pet-large-avatar {
    animation: pet-happy 620ms var(--ease-out), pet-breathe 3.2s 620ms ease-in-out infinite;
}

@keyframes pet-breathe {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-4px) scale(1.015); }
}

@keyframes pet-happy {
    0%, 100% { transform: translateY(0) rotate(0); }
    35% { transform: translateY(-12px) rotate(-4deg); }
    68% { transform: translateY(-5px) rotate(4deg); }
}

.bond-meter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 4px 10px;
    margin-bottom: 10px;
    font-size: 9px;
    font-weight: 800;
}

.bond-meter > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #a34f3c;
}

.bond-meter > strong {
    font-size: 11px;
}

.bond-meter > div {
    grid-column: 1 / -1;
    height: 7px;
    overflow: hidden;
    border-radius: 7px;
    background: #dfdfda;
}

.bond-meter > div > i {
    display: block;
    width: 8%;
    height: 100%;
    border-radius: inherit;
    background: var(--coral);
    transition: width 420ms var(--ease-out);
}

.pet-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.pet-actions button {
    min-width: 0;
    min-height: 70px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 5px;
    padding: 8px 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .78);
    color: var(--ink);
    cursor: pointer;
    transition: transform 140ms var(--ease-out), background 180ms ease, border-color 180ms ease;
}

.pet-actions button:active {
    transform: scale(.94);
}

.pet-actions button i {
    font-size: 24px;
    color: var(--coral);
}

.pet-actions button span {
    font-size: 9px;
    font-weight: 800;
}

.pet-actions button.is-complete {
    border-color: #93b9aa;
    background: var(--mint-soft);
    color: #477b69;
}

.pet-actions button.is-complete i {
    color: #477b69;
}

.pet-complete {
    flex: 0 0 auto;
    margin-top: 9px;
}

.checkin-screen,
.result-screen,
.reframe-screen,
.breathing-screen,
.compassion-screen {
    grid-template-rows: auto auto minmax(0, 1fr) auto;
}

.result-screen,
.reframe-screen,
.breathing-screen,
.compassion-screen {
    grid-template-rows: minmax(0, 1fr) auto;
}

.checkin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px 10px;
}

.checkin-header span,
.checkin-header strong {
    display: block;
}

.checkin-header span {
    color: var(--muted);
    font-size: 10px;
}

.checkin-header strong {
    font-size: 14px;
}

.checkin-header .icon-button {
    width: 38px;
    height: 38px;
}

.step-progress {
    height: 4px;
    margin: 0 20px;
    overflow: hidden;
    border-radius: 9px;
    background: #dddeda;
}

.step-progress span {
    display: block;
    width: var(--step-progress);
    height: 100%;
    border-radius: inherit;
    background: var(--coral);
    animation: progress-grow 500ms var(--ease-out) both;
}

@keyframes progress-grow {
    from { width: 0; }
}

.screen-footer-action {
    display: flex;
    gap: 10px;
    padding: 10px 18px calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(32, 37, 37, .08);
    background: rgba(246, 245, 240, .94);
    backdrop-filter: blur(16px);
}

.split-actions .primary-action {
    flex: 1;
}

.energy-content {
    overflow: hidden;
    padding-bottom: 8px;
}

.energy-workspace {
    display: grid;
    justify-items: center;
    margin-top: 12px;
}

.energy-value {
    width: min(280px, 86%);
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin-bottom: 10px;
}

.energy-value strong {
    font-size: 13px;
}

.energy-value span {
    color: var(--muted);
    font-size: 12px;
}

.energy-value b {
    color: var(--ink);
    font-size: 22px;
}

.energy-canvas {
    position: relative;
    width: min(184px, 45vw);
    height: min(334px, 42vh);
    touch-action: none;
    cursor: ns-resize;
}

.battery-tip {
    position: absolute;
    top: -9px;
    left: 50%;
    width: 62px;
    height: 12px;
    border: 3px solid var(--ink);
    border-bottom: 0;
    border-radius: 5px 5px 0 0;
    transform: translateX(-50%);
}

.battery-body {
    height: 100%;
    display: flex;
    flex-direction: column-reverse;
    gap: 5px;
    padding: 9px;
    border: 3px solid var(--ink);
    border-radius: 8px;
    background: rgba(255, 254, 251, .62);
}

.battery-segment {
    flex: 1;
    overflow: hidden;
    border-radius: 3px;
    background: #e2e2dc;
    transition: transform 150ms var(--ease-out), background 120ms ease;
}

.battery-segment.filled {
    background: var(--segment-color, var(--mint));
    animation: paint-fill 220ms var(--ease-out) both;
}

@keyframes paint-fill {
    from { transform: scaleX(.35); opacity: .4; }
    to { transform: scaleX(1); opacity: 1; }
}

.paint-cursor {
    position: absolute;
    top: 40%;
    right: -38px;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: 0 8px 22px rgba(32, 37, 37, .16);
    pointer-events: none;
    transition: top 100ms ease;
}

.paint-cursor i {
    font-size: 21px;
    transform: rotate(-22deg);
}

.energy-canvas.is-painting .paint-cursor {
    transform: scale(1.1) rotate(-6deg);
}

.drag-hint {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.story-content,
.sort-content,
.result-content {
    padding-top: 22px;
}

.prompt-row {
    display: flex;
    gap: 7px;
    overflow-x: auto;
    margin: 0 -24px 12px;
    padding: 0 24px 4px;
    scrollbar-width: none;
}

.prompt-row button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 11px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    color: #5d625f;
    font-size: 10px;
    font-weight: 700;
    cursor: pointer;
}

.prompt-row button i {
    margin-right: 4px;
    font-size: 15px;
}

.journal-field {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .78);
}

.journal-field textarea {
    width: 100%;
    height: 152px;
    resize: none;
    padding: 15px;
    border: 0;
    background: transparent;
    line-height: 1.58;
}

.journal-field textarea:focus {
    outline: 0;
}

.journal-meta {
    display: flex;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 9px;
}

.journal-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.emotion-prompt {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 18px 0 10px;
}

.emotion-prompt small,
.emotion-prompt strong {
    display: block;
}

.emotion-prompt small {
    color: var(--muted);
    font-size: 9px;
    text-transform: uppercase;
}

.emotion-prompt strong {
    margin-top: 2px;
    font-size: 14px;
}

.wheel-button,
.add-emotion-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    background: var(--lavender-soft);
    color: #5f507c;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.wheel-button i {
    font-size: 18px;
}

.selected-emotions,
.wheel-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    min-height: 34px;
}

.selected-emotions.empty {
    align-items: center;
    padding: 8px 0;
    color: #9a9c97;
    font-size: 11px;
}

.emotion-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    border: 1px solid rgba(32, 37, 37, .1);
    border-radius: 99px;
    background: var(--chip-color, var(--sky-soft));
    font-size: 10px;
    font-weight: 800;
}

.emotion-chip button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .62);
    cursor: pointer;
}

.emotion-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 18px;
}

.emotion-column {
    min-height: 214px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .66);
}

.emotion-column > header {
    display: grid;
    grid-template-columns: 36px 1fr;
    align-items: center;
    gap: 9px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.emotion-column > header > span {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
}

.positive-column > header > span { background: var(--sun-soft); color: #986b1f; }
.negative-column > header > span { background: var(--sky-soft); color: #41758d; }

.emotion-column header strong,
.emotion-column header small {
    display: block;
}

.emotion-column header strong {
    font-size: 11px;
}

.emotion-column header small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 8px;
}

.emotion-column > div {
    display: grid;
    gap: 6px;
    margin-top: 10px;
}

.sorted-emotion {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 32px 32px;
    grid-template-rows: auto 32px;
    align-items: center;
    gap: 5px 3px;
    min-height: 70px;
    padding: 8px;
    border-radius: 6px;
    background: var(--chip-color, var(--sun-soft));
    font-size: 9px;
    font-weight: 800;
}

.sorted-emotion > span {
    grid-column: 1 / -1;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.25;
}

.sorted-emotion button {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    padding: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .56);
    cursor: pointer;
}

.sorted-emotion button:first-of-type {
    grid-column: 2;
    grid-row: 2;
}

.sorted-emotion button:last-of-type {
    grid-column: 3;
    grid-row: 2;
}

.sorted-emotion button i {
    font-size: 14px;
}

.empty-column {
    align-self: center;
    padding: 18px 4px;
    color: #9a9c97;
    text-align: center;
    font-size: 9px;
}

.add-emotion-button {
    width: 100%;
    margin-top: 10px;
    border: 1px dashed #b9accb;
    background: transparent;
}

.sort-note,
.ai-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 7px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.sort-note i,
.ai-disclaimer i {
    flex: 0 0 auto;
    font-size: 16px;
}

.emotion-sheet {
    position: absolute;
    inset: 0;
    z-index: 100;
}

.emotion-sheet.is-open .sheet-backdrop {
    opacity: 1;
}

.emotion-sheet.is-open .sheet-panel {
    transform: translateY(0);
}

.sheet-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    background: rgba(21, 25, 24, .46);
    backdrop-filter: blur(4px);
}

.sheet-panel {
    position: absolute;
    inset: auto 0 0;
    max-height: 92%;
    overflow-y: auto;
    padding: 10px 20px calc(18px + env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
    background: var(--surface);
    box-shadow: 0 -24px 70px rgba(21, 25, 24, .18);
    scrollbar-width: none;
}

.sheet-panel::-webkit-scrollbar { display: none; }

.sheet-handle {
    width: 42px;
    height: 4px;
    margin: 0 auto 10px;
    border-radius: 8px;
    background: #d6d7d2;
}

.sheet-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.sheet-panel h2 {
    margin: 0;
    font-size: 23px;
}

.sheet-panel .eyebrow {
    margin-bottom: 3px;
    font-size: 8px;
}

.wheel-help {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 9px 0 4px;
    color: var(--muted);
    font-size: 10px;
}

.wheel-help i {
    font-size: 16px;
}

.wheel-stage {
    position: relative;
    width: min(100%, 360px);
    aspect-ratio: 1;
    margin: 0 auto;
}

.wheel-stage canvas {
    width: 100%;
    height: 100%;
    display: block;
    touch-action: none;
    cursor: crosshair;
}

.wheel-center-label {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 74px;
    height: 74px;
    display: grid;
    place-items: center;
    align-content: center;
    padding: 5px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(32, 37, 37, .12);
    text-align: center;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.wheel-center-label small,
.wheel-center-label strong {
    display: block;
}

.wheel-center-label small {
    color: var(--muted);
    font-size: 7px;
}

.wheel-center-label strong {
    max-width: 64px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
}

.wheel-breadcrumb {
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: -4px;
    color: var(--muted);
    font-size: 9px;
}

.wheel-breadcrumb b {
    color: var(--ink);
}

.wheel-selected {
    justify-content: center;
    min-height: 33px;
    margin: 5px 0 11px;
}

.emotion-sheet[data-mode="columns"] .wheel-selected .emotion-chip[data-valence="positive"] {
    box-shadow: inset 3px 0 #c9952f;
}

.emotion-sheet[data-mode="columns"] .wheel-selected .emotion-chip[data-valence="negative"] {
    box-shadow: inset 3px 0 #5f8fa5;
}

.result-celebration {
    position: relative;
    width: 154px;
}

.completion-check {
    position: absolute;
    right: -6px;
    bottom: 12px;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 4px solid var(--paper);
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
}

.ai-reading {
    margin-top: 18px;
    padding: 17px;
    border: 1px solid #cfc3dd;
    border-radius: 8px;
    background: #f0ebf5;
}

.ai-reading header {
    display: grid;
    grid-template-columns: 42px 1fr;
    align-items: center;
    gap: 10px;
}

.ai-reading header > span {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .86);
    box-shadow: 0 3px 10px rgba(32, 37, 37, .12);
}

.ai-reading small,
.ai-reading strong {
    display: block;
}

.ai-reading small {
    color: #75678e;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-reading strong {
    margin-top: 2px;
    font-size: 14px;
}

.ai-reading > p {
    margin: 14px 0;
    color: #55505f;
    font-size: 12px;
    line-height: 1.6;
}

.ai-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: -3px 0 12px;
    color: #75678e;
    font-size: 9px;
    font-weight: 700;
}

.ai-status.is-ready {
    color: #477b69;
}

.ai-status.is-fallback {
    color: #93633c;
}

.support-alert {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 15px 0 0;
    padding: 12px;
    border: 1px solid #dda99b;
    border-radius: 8px;
    background: #fae6df;
    color: #7c3d30;
    font-size: 10px;
    font-weight: 700;
    line-height: 1.5;
}

.support-alert[hidden] {
    display: none;
}

.support-alert i {
    flex: 0 0 auto;
    margin-top: 1px;
    font-size: 18px;
}

.emotion-balance {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tips-section {
    margin-top: 22px;
}

.tips-section h2,
.pattern-section h2,
.profile-section h2 {
    margin: 0 0 10px;
    font-size: 14px;
}

.tips-section h2,
.pattern-section h2 {
    display: flex;
    align-items: center;
    gap: 7px;
}

.tip-row {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 10px;
    padding: 11px 0;
    border-bottom: 1px solid var(--line);
}

.tip-number {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--mint-soft);
    color: #477b69;
    font-size: 11px;
    font-weight: 800;
}

.tip-row p {
    margin: 3px 0 0;
    font-size: 11px;
    line-height: 1.55;
}

.tool-card {
    width: 100%;
    min-height: 78px;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .74);
    text-align: left;
    cursor: pointer;
    transition: transform 140ms ease, border-color 180ms ease;
}

.tool-card.featured-tool {
    min-height: 118px;
    margin: 8px 0 10px;
    border-color: #dfa897;
    background: #fae6df;
}

.tool-illustration {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    clip-path: polygon(7% 14%, 33% 3%, 83% 8%, 99% 35%, 91% 89%, 62% 100%, 9% 91%, 0 52%);
}

.featured-tool .tool-illustration {
    width: 58px;
    height: 76px;
    background: var(--coral);
    color: #fff;
}

.tool-illustration i {
    font-size: 28px;
}

.tool-card small,
.tool-card strong,
.tool-card em {
    display: block;
    font-style: normal;
}

.tool-card small {
    margin-bottom: 3px;
    color: #a34f3c;
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.tool-card strong {
    font-size: 13px;
}

.tool-card em {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}

.tool-grid {
    display: grid;
    gap: 8px;
}

.micro-practice {
    margin-top: 18px;
    padding: 14px;
    border-left: 3px solid var(--sky);
    background: var(--sky-soft);
}

.micro-practice,
.micro-practice > div {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.micro-practice > div > span {
    font-size: 24px;
}

.micro-practice small,
.micro-practice strong {
    display: block;
}

.micro-practice small {
    color: #4a7588;
    font-size: 8px;
    text-transform: uppercase;
}

.micro-practice strong {
    margin-top: 3px;
    font-size: 10px;
}

.micro-practice button {
    flex: 0 0 auto;
    padding: 7px 10px;
    border-radius: 99px;
    background: var(--surface);
    font-size: 9px;
    font-weight: 800;
    cursor: pointer;
}

.breathing-content {
    display: flex;
    flex-direction: column;
}

.breath-visual {
    position: relative;
    width: min(290px, 68vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin: auto;
}

.breath-ring {
    position: absolute;
    inset: 0;
    border: 1px solid rgba(108, 154, 179, .42);
    border-radius: 50%;
    background: rgba(214, 231, 238, .42);
}

.ring-two {
    inset: 13%;
    background: rgba(214, 231, 238, .82);
}

.breath-core {
    position: relative;
    z-index: 2;
    width: 48%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-content: center;
    border-radius: 50%;
    background: var(--sky);
    color: #fff;
    box-shadow: 0 18px 40px rgba(108, 154, 179, .28);
}

.breath-core i {
    margin-bottom: 8px;
    font-size: 30px;
}

.breath-core strong,
.breath-core span {
    display: block;
}

.breath-core strong {
    font-size: 13px;
}

.breath-core span {
    margin-top: 3px;
    color: rgba(255, 255, 255, .72);
    font-size: 10px;
}

.breath-visual.running.inhale .breath-ring {
    animation: inhale 4s ease-in-out both;
}

.breath-visual.running.exhale .breath-ring {
    animation: exhale 6s ease-in-out both;
}

.breath-visual.running .ring-two {
    animation-delay: 90ms;
}

@keyframes inhale {
    from { transform: scale(.68); opacity: .5; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes exhale {
    from { transform: scale(1); opacity: 1; }
    to { transform: scale(.68); opacity: .5; }
}

.breath-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: auto;
}

.breath-stats span {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    text-align: center;
}

.breath-stats small,
.breath-stats strong {
    display: block;
}

.breath-stats small {
    color: var(--muted);
    font-size: 9px;
}

.breath-stats strong {
    margin-top: 3px;
    font-size: 15px;
}

.reframe-steps {
    display: grid;
    gap: 9px;
}

.reframe-field {
    display: grid;
    grid-template-columns: 30px 1fr;
    gap: 4px 9px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .7);
}

.reframe-field > span {
    grid-row: 1;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--ink);
    color: #fff;
    font-size: 10px;
    font-weight: 800;
}

.reframe-field strong,
.reframe-field small {
    display: block;
}

.reframe-field strong {
    font-size: 12px;
}

.reframe-field small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.reframe-field textarea {
    grid-column: 1 / -1;
    height: 76px;
    margin-top: 8px;
    resize: none;
    padding: 10px;
    border: 1px solid #e2e2dc;
    border-radius: 6px;
    background: var(--surface);
    font-size: 11px;
    line-height: 1.5;
}

.reframe-field:focus-within {
    border-color: var(--lavender);
}

.reframe-saved {
    align-items: center;
    gap: 7px;
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
    background: var(--mint-soft);
    color: #477b69;
    font-size: 10px;
    font-weight: 700;
}

.reframe-saved:not([hidden]) {
    display: flex;
}

.grounding-progress {
    position: relative;
    height: 8px;
    margin: 20px 0 18px;
    overflow: visible;
    border-radius: 8px;
    background: #dedfd9;
}

.grounding-progress span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--sky);
    transition: width 260ms var(--ease-out);
}

.grounding-progress strong {
    position: absolute;
    top: -7px;
    right: 0;
    padding-left: 7px;
    background: var(--paper);
    font-size: 9px;
}

.sense-list {
    display: grid;
    gap: 8px;
}

.sense-step {
    width: 100%;
    min-height: 66px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .76);
    text-align: left;
    cursor: pointer;
    transition: transform 140ms ease, border-color 180ms ease, background 180ms ease;
}

.sense-step:active {
    transform: scale(.98);
}

.sense-step.is-complete {
    border-color: #93b9aa;
    background: #edf7f2;
}

.sense-icon {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 8px;
}

.sense-icon i {
    font-size: 22px;
}

.sense-step strong,
.sense-step small {
    display: block;
}

.sense-step strong {
    font-size: 12px;
}

.sense-step small {
    margin-top: 2px;
    color: var(--muted);
    font-size: 9px;
}

.sense-step > b {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #ecece7;
    font-size: 11px;
}

.sense-step.is-complete > b {
    background: var(--mint);
    color: #fff;
}

.tool-complete {
    align-items: center;
    gap: 10px;
    margin-top: 13px;
    padding: 12px;
    border-radius: 8px;
    background: var(--mint-soft);
    color: #477b69;
}

.tool-complete:not([hidden]) {
    display: flex;
    animation: screen-in 280ms var(--ease-out) both;
}

.tool-complete > i {
    font-size: 28px;
}

.tool-complete strong,
.tool-complete small {
    display: block;
}

.tool-complete strong { font-size: 11px; }
.tool-complete small { margin-top: 2px; font-size: 9px; }

.compact-reset {
    width: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 14px auto 0;
}

.control-capture {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .78);
}

.control-capture textarea {
    width: 100%;
    height: 82px;
    resize: none;
    padding: 11px;
    border: 1px solid #dddeda;
    border-radius: 6px;
    background: var(--surface);
    font-size: 12px;
    line-height: 1.5;
}

.control-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 7px;
    margin-top: 8px;
}

.control-actions button {
    min-height: 52px;
    display: grid;
    grid-template-columns: 23px 1fr;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 7px;
    background: var(--mint-soft);
    color: #477b69;
    text-align: left;
    cursor: pointer;
}

.control-actions button:last-child {
    background: var(--lavender-soft);
    color: #65547f;
}

.control-actions button > i { font-size: 20px; }
.control-actions strong,
.control-actions small { display: block; }
.control-actions strong { font-size: 10px; }
.control-actions small { margin-top: 1px; font-size: 8px; }

.control-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 12px;
}

.control-columns > section {
    min-width: 0;
    min-height: 154px;
    padding: 10px;
    border: 1px solid #bed7cc;
    border-radius: 8px;
    background: #edf7f2;
}

.control-columns > section:last-child {
    border-color: #d3c9df;
    background: #f3eff7;
}

.control-columns header {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    color: #477b69;
    font-size: 10px;
}

.control-columns > section:last-child header { color: #65547f; }

.control-columns > section > p {
    margin: 18px 2px 0;
    color: var(--muted);
    font-size: 8px;
    text-align: center;
}

.control-list {
    display: grid;
    gap: 6px;
}

.control-item {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 25px;
    align-items: start;
    gap: 4px;
    padding: 7px 5px 7px 8px;
    border-radius: 6px;
    background: var(--surface);
    box-shadow: 0 2px 8px rgba(32, 37, 37, .05);
}

.control-item span {
    overflow-wrap: anywhere;
    font-size: 9px;
    line-height: 1.4;
}

.control-item button {
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.compassion-content {
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.compassion-visual {
    width: min(220px, 58vw);
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    margin: auto;
    border-radius: 8px;
    background: var(--coral);
    color: #fff;
    clip-path: polygon(8% 8%, 45% 2%, 91% 10%, 98% 49%, 88% 92%, 49% 98%, 7% 89%, 1% 43%);
    transition: background 240ms ease, transform 240ms var(--ease-out);
}

.compassion-visual[data-step="1"] { background: var(--lavender); transform: rotate(2deg); }
.compassion-visual[data-step="2"] { background: var(--mint); transform: rotate(-2deg); }

.compassion-visual i {
    font-size: 78px;
    filter: drop-shadow(0 8px 16px rgba(32, 37, 37, .14));
}

.compassion-copy {
    min-height: 92px;
    text-align: center;
}

.compassion-copy span,
.compassion-copy strong {
    display: block;
}

.compassion-copy span {
    color: var(--coral);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.compassion-copy strong {
    margin-top: 6px;
    font-size: 19px;
}

.compassion-copy p {
    margin: 5px 0 0;
    color: var(--muted);
    font-size: 11px;
}

.compassion-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.compassion-dots span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #d7d8d3;
    transition: width 180ms ease, background 180ms ease;
}

.compassion-dots span.active {
    width: 20px;
    border-radius: 7px;
    background: var(--coral);
}

.progress-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
    margin: 20px 0 16px;
}

.progress-summary article {
    padding: 11px 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .68);
}

.progress-summary small,
.progress-summary strong,
.progress-summary span {
    display: block;
}

.progress-summary small {
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
}

.progress-summary strong {
    margin: 5px 0 2px;
    font-size: 18px;
}

.progress-summary span {
    color: var(--muted);
    font-size: 8px;
}

.mood-chart {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 254, 251, .72);
}

.mood-chart header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.mood-chart small,
.mood-chart strong {
    display: block;
}

.mood-chart small {
    color: var(--muted);
    font-size: 8px;
    text-transform: uppercase;
}

.mood-chart strong {
    margin-top: 2px;
    font-size: 12px;
}

.chart-legend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 8px;
}

.chart-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--mint);
}

.bar-chart {
    height: 132px;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    align-items: end;
    gap: 8px;
    margin-top: 14px;
    border-bottom: 1px solid var(--line);
}

.chart-bar {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: end;
    gap: 5px;
}

.chart-bar i {
    width: min(20px, 70%);
    height: var(--bar-height);
    min-height: 8px;
    border-radius: 5px 5px 1px 1px;
    background: var(--bar-color);
    animation: bar-up 550ms var(--ease-out) both;
}

@keyframes bar-up { from { height: 0; } }

.chart-bar span {
    color: var(--muted);
    font-size: 8px;
}

.pattern-section {
    margin-top: 20px;
}

.pattern-section article {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: 10px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.pattern-section strong {
    display: block;
    font-size: 11px;
}

.pattern-section p {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 9px;
    line-height: 1.5;
}

.profile-hero {
    display: grid;
    grid-template-columns: 86px 1fr;
    align-items: center;
    gap: 18px;
    margin: 4px 0 26px;
}

.profile-avatar {
    width: 84px;
    height: 84px;
    display: block;
    border: 2px solid var(--surface);
    border-radius: 50%;
    background-color: #f2e8da;
    box-shadow: 0 0 0 4px var(--coral-soft);
    overflow: hidden;
}

.profile-hero h1 {
    margin: 0;
    font-size: 27px;
}

.profile-hero p:last-child {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 10px;
}

.profile-section {
    margin-bottom: 20px;
}

.profile-section button {
    width: 100%;
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 0 4px;
    border-bottom: 1px solid var(--line);
    background: transparent;
    font-size: 11px;
    cursor: pointer;
}

.profile-section button span {
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 700;
}

.profile-section button span i {
    font-size: 19px;
}

.profile-section button em {
    color: var(--muted);
    font-size: 10px;
    font-style: normal;
}

.version-label {
    color: #a2a49f;
    font-size: 9px;
    text-align: center;
}

.toast {
    position: absolute;
    z-index: 140;
    left: 50%;
    bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom));
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-radius: 99px;
    background: var(--ink);
    color: #fff;
    box-shadow: 0 12px 30px rgba(32, 37, 37, .24);
    font-size: 10px;
    font-weight: 700;
    transform: translateX(-50%);
    white-space: nowrap;
}

.toast:not([hidden]) {
    animation: toast-in 260ms var(--ease-out) both;
}

@keyframes toast-in {
    from { opacity: 0; transform: translate(-50%, 12px) scale(.94); }
}

.gratitude-capture {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 52px;
    gap: 8px;
    margin: 22px 0 14px;
}

.gratitude-capture input {
    min-width: 0;
    height: 52px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    font-size: 13px;
}

.gratitude-capture button {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: var(--sun);
    color: #28251e;
    cursor: pointer;
    transition: transform 140ms ease, opacity 140ms ease;
}

.gratitude-capture button:active { transform: scale(.94); }
.gratitude-capture button i { font-size: 24px; }
.gratitude-capture button:disabled { opacity: .38; cursor: default; }

.gratitude-meter {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 11px;
    margin-bottom: 15px;
}

.gratitude-meter > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    font-size: 9px;
}

.gratitude-meter > span i { color: var(--coral); }

.gratitude-meter > div {
    height: 6px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--line);
}

.gratitude-meter > div i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: var(--sun);
    transition: width 260ms var(--ease-out);
}

.gratitude-list {
    display: grid;
    gap: 9px;
}

.gratitude-item {
    min-height: 74px;
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) 34px;
    align-items: center;
    gap: 9px;
    margin: 0;
    padding: 10px 9px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    animation: screen-in 260ms var(--ease-out) both;
}

.gratitude-item > span {
    color: var(--sun);
    font-size: 12px;
    font-weight: 800;
}

.gratitude-item p {
    margin: 0;
    overflow-wrap: anywhere;
    font-size: 12px;
    line-height: 1.5;
}

.gratitude-item button {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.gratitude-empty {
    min-height: 190px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 8px;
    color: var(--muted);
}

.gratitude-empty i {
    color: var(--sun);
    font-size: 52px;
}

.gratitude-empty span { font-size: 10px; }
.gratitude-complete { background: var(--sun-soft); color: var(--ink); }

/* Pet companion · cozy sticker game */
.avatar-art {
    background-color: transparent;
    background-position: center bottom;
    background-size: contain;
}

.avatar-button,
.avatar-option {
    background: linear-gradient(145deg, #fff9f1, #f3e4dc);
}

.pet-home-avatar,
.profile-avatar,
.pet-intro > .avatar-art {
    background-color: #f3e4dc;
}

.avatar-button .avatar-art,
.avatar-option .avatar-art,
.pet-home-avatar,
.profile-avatar,
.pet-intro > .avatar-art {
    filter: drop-shadow(0 4px 6px rgba(35, 41, 40, .16));
}

.avatar-picker {
    gap: 9px;
}

.avatar-option {
    position: relative;
    overflow: visible;
    padding: 5px;
    border: 2px solid var(--game-outline-soft);
    border-radius: 17px;
    box-shadow: 0 3px 0 rgba(48, 55, 53, .1);
    transition: transform 160ms var(--ease-out), border-color 160ms ease, box-shadow 160ms ease;
}

.avatar-option .avatar-art {
    border-radius: 12px;
}

.avatar-option:hover {
    transform: translateY(-2px);
}

.avatar-option:active {
    transform: translateY(2px);
    box-shadow: none;
}

.avatar-option.is-selected {
    border-color: var(--game-outline);
    box-shadow: 0 4px 0 var(--game-outline), 0 0 0 3px rgba(117, 170, 152, .18);
}

.avatar-option.is-new > small {
    position: absolute;
    z-index: 2;
    top: -8px;
    right: -5px;
    bottom: auto;
    padding: 2px 5px;
    border: 1.5px solid var(--game-outline);
    border-radius: 99px;
    background: var(--sun);
    color: #2d291f;
    font-size: 9px;
    font-weight: 900;
    line-height: 1.2;
    text-transform: uppercase;
}

.pet-choice-strip button > small {
    display: none;
}

.onboarding-step[data-onboarding-step="3"] {
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.pet-home-card {
    grid-template-columns: 54px minmax(0, 1fr) auto 18px;
    gap: 10px;
    min-height: 78px;
    padding: 9px 11px;
    border: 2px solid #7fae9d;
    border-radius: 18px;
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, .65) 0 18px, transparent 19px),
        var(--mint-soft);
    box-shadow: 0 5px 0 rgba(71, 123, 105, .22);
}

.pet-home-card:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 rgba(71, 123, 105, .22);
}

.pet-home-avatar {
    width: 52px;
    height: 52px;
    border: 2.5px solid var(--game-outline);
    box-shadow: 0 3px 0 rgba(48, 55, 53, .18);
}

.pet-home-card small {
    font-size: 9px;
    letter-spacing: .04em;
}

.pet-home-card strong {
    font-size: 13px;
}

.pet-home-card em {
    font-size: 10px;
}

.pet-home-streak {
    min-width: 42px;
    height: 42px;
    display: grid;
    grid-template-columns: auto auto;
    place-content: center;
    gap: 3px;
    border: 2px solid #d8a33b;
    border-radius: 14px;
    background: var(--sun-soft);
    color: #805b1c;
    box-shadow: 0 3px 0 rgba(128, 91, 28, .16);
}

.pet-home-streak i {
    font-size: 14px;
}

.pet-home-streak b {
    font-size: 11px;
}

.pet-screen {
    grid-template-rows: minmax(0, 1fr);
}

.pet-content {
    display: block;
    overflow-y: auto;
    padding-top: 22px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
    overscroll-behavior: contain;
}

.pet-heading {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 12px;
}

.pet-heading h1 {
    margin: 0 0 4px;
    font-size: 29px;
    line-height: 1.08;
}

.pet-heading .lead {
    margin: 0;
    max-width: 290px;
    font-size: 12px;
}

.pet-customize-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0 11px;
    border: 2px solid var(--game-outline);
    border-radius: 13px;
    background: var(--lavender-soft);
    color: #594b79;
    box-shadow: 0 4px 0 var(--game-outline);
    font-size: 10px;
    font-weight: 900;
    cursor: pointer;
}

.pet-customize-button:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--game-outline);
}

.pet-customize-button i {
    font-size: 17px;
}

.pet-streak-card {
    margin: 15px 0 13px;
    padding: 13px;
    border: 2px solid var(--game-outline);
    border-radius: 19px;
    background: linear-gradient(145deg, #fff8de, #f7e8bc);
    box-shadow: var(--game-shadow);
}

.pet-streak-card header,
.pet-streak-card header > span,
.pet-streak-card p {
    display: flex;
    align-items: center;
}

.pet-streak-card header {
    justify-content: space-between;
    gap: 10px;
}

.pet-streak-card header > span {
    gap: 5px;
    color: #76551e;
    font-size: 12px;
    font-weight: 800;
}

.pet-streak-card header > span i {
    color: #d78a1d;
    font-size: 20px;
}

.pet-streak-card header > span b {
    font-size: 18px;
}

.pet-streak-card header em {
    color: #8b7345;
    font-size: 10px;
    font-style: normal;
    font-weight: 700;
}

.pet-week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin: 11px 0 10px;
}

.pet-week > span {
    min-width: 0;
    display: grid;
    justify-items: center;
    gap: 4px;
}

.pet-week small {
    color: #91784b;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
}

.pet-week b {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border: 2px solid rgba(118, 85, 30, .22);
    border-radius: 10px;
    background: rgba(255, 255, 255, .48);
    color: #8a754e;
    font-size: 11px;
}

.pet-week > span.is-done b {
    border-color: var(--game-outline);
    background: var(--coral);
    color: #fff;
    box-shadow: 0 3px 0 var(--game-outline);
}

.pet-week > span.is-today b {
    outline: 2px solid rgba(117, 170, 152, .62);
    outline-offset: 2px;
}

.pet-week i {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(118, 85, 30, .2);
}

.pet-week > span.is-done i {
    background: var(--coral);
}

.pet-streak-card p {
    gap: 7px;
    margin: 0;
    color: #806b42;
    font-size: 10px;
    font-weight: 700;
}

.pet-streak-card p i {
    font-size: 16px;
}

.pet-stage {
    position: relative;
    min-height: 300px;
    display: grid;
    place-items: center;
    align-content: end;
    margin: 0 0 13px;
    overflow: hidden;
    border: 3px solid var(--game-outline);
    border-radius: 24px;
    background: linear-gradient(180deg, #f5e7db 0 67%, #d7b59e 68% 100%);
    box-shadow: 0 7px 0 var(--game-outline), 0 16px 34px rgba(48, 55, 53, .13);
    isolation: isolate;
}

.pet-stage::before {
    inset: 23px auto auto 24px;
    width: 52px;
    height: 72px;
    border: 3px solid rgba(48, 55, 53, .22);
    border-radius: 50% 50% 42% 42%;
    background: rgba(255, 254, 251, .52);
    transform: rotate(-5deg);
}

.pet-stage::after {
    top: 24px;
    right: 28px;
    width: 46px;
    height: 46px;
    border: 3px solid var(--game-outline);
    background: var(--sun);
    box-shadow: 0 0 0 8px rgba(228, 180, 85, .18);
}

.pet-stage[data-room="garden"] {
    background: linear-gradient(180deg, #cbe9e0 0 66%, #95c5a2 67% 100%);
}

.pet-stage[data-room="garden"]::after {
    background: #fff2aa;
}

.pet-stage[data-room="night"] {
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .72) 0 2px, transparent 3px),
        radial-gradient(circle at 74% 17%, rgba(255, 255, 255, .6) 0 2px, transparent 3px),
        radial-gradient(circle at 85% 46%, rgba(255, 255, 255, .42) 0 1px, transparent 2px),
        linear-gradient(180deg, #554c78 0 67%, #38354c 68% 100%);
    color: #fff;
}

.pet-stage[data-room="night"]::before {
    background: rgba(228, 221, 239, .18);
    border-color: rgba(255, 255, 255, .22);
}

.pet-stage[data-room="night"]::after {
    background: #f2d979;
    box-shadow: -11px -4px 0 2px #554c78, 0 0 0 8px rgba(242, 217, 121, .13);
}

.pet-stage-prop {
    position: absolute;
    z-index: 1;
    display: grid;
    place-items: center;
    color: rgba(48, 55, 53, .32);
}

.pet-stage-prop i {
    font-size: 45px;
    stroke-width: 2.5;
}

.pet-stage-prop-one {
    left: 24px;
    bottom: 20px;
}

.pet-stage-prop-two {
    right: 25px;
    bottom: 28px;
}

.pet-stage[data-room="night"] .pet-stage-prop {
    color: rgba(255, 255, 255, .27);
}

.pet-shadow {
    position: absolute;
    z-index: 1;
    left: 50%;
    bottom: 13px;
    width: 170px;
    height: 30px;
    border-radius: 50%;
    background: rgba(48, 55, 53, .2);
    filter: blur(2px);
    transform: translateX(-50%);
}

.pet-large-avatar {
    position: relative;
    z-index: 2;
    width: min(238px, 62vw);
    height: min(238px, 62vw);
    border: 0;
    border-radius: 0;
    background-size: contain;
    filter: drop-shadow(0 9px 10px rgba(48, 55, 53, .18));
    animation: pet-breathe 3.2s ease-in-out infinite;
}

.pet-stage.is-reacting .pet-large-avatar,
.pet-stage.is-cared .pet-large-avatar {
    animation: pet-happy 620ms var(--ease-out), pet-breathe 3.2s 620ms ease-in-out infinite;
}

.pet-accessory {
    position: absolute;
    z-index: 4;
    top: 78px;
    left: calc(50% + 64px);
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border: 2.5px solid var(--game-outline);
    border-radius: 50% 50% 50% 14px;
    background: var(--coral-soft);
    color: #a34f62;
    box-shadow: 0 4px 0 var(--game-outline);
    transform: rotate(8deg);
}

.pet-accessory i {
    font-size: 23px;
}

.pet-stage[data-accessory="none"] .pet-accessory {
    display: none;
}

.pet-stage[data-accessory="moon"] .pet-accessory {
    background: var(--lavender-soft);
    color: #635184;
}

.pet-stage[data-accessory="crown"] .pet-accessory {
    background: var(--sun-soft);
    color: #9a6815;
}

.pet-speech {
    top: 18px;
    left: 17px;
    max-width: 60%;
    padding: 10px 12px;
    border: 2px solid var(--game-outline);
    border-radius: 14px 14px 14px 4px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 4px 0 var(--game-outline);
    font-size: 11px;
    line-height: 1.35;
}

.pet-level-chip {
    position: absolute;
    z-index: 4;
    right: 13px;
    bottom: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 7px 9px;
    border: 2px solid var(--game-outline);
    border-radius: 11px;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 3px 0 var(--game-outline);
    font-size: 9px;
    font-weight: 900;
}

.pet-level-chip i {
    color: var(--sun);
    font-size: 14px;
}

.pet-meters {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
    margin: 17px 0 13px;
}

.pet-meters .bond-meter,
.pet-meters .xp-meter {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px 8px;
    margin: 0;
    padding: 11px;
    border: 2px solid var(--game-outline);
    border-radius: 15px;
    background: var(--surface);
    box-shadow: 0 4px 0 rgba(48, 55, 53, .14);
}

.pet-meters span,
.pet-meters strong {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 900;
}

.pet-meters .xp-meter > span {
    color: #4f7690;
}

.pet-meters .bond-meter > div,
.pet-meters .xp-meter > div {
    grid-column: 1 / -1;
    height: 9px;
    overflow: hidden;
    border: 1px solid rgba(48, 55, 53, .14);
    border-radius: 99px;
    background: #e8e8e2;
}

.pet-meters .bond-meter > div > i,
.pet-meters .xp-meter > div > i {
    display: block;
    height: 100%;
    border-radius: inherit;
    transition: width 420ms var(--ease-out);
}

.pet-meters .bond-meter > div > i {
    background: linear-gradient(90deg, #dd6678, #ef95a1);
}

.pet-meters .xp-meter > div > i {
    width: 0;
    background: linear-gradient(90deg, #6c9ab3, #91bed0);
}

.pet-care-panel {
    padding: 13px;
    border: 2px solid var(--game-outline);
    border-radius: 19px;
    background: rgba(255, 254, 251, .74);
    box-shadow: var(--game-shadow);
}

.pet-care-panel > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
}

.pet-care-panel header small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.pet-care-panel h2 {
    margin: 1px 0 0;
    font-size: 16px;
}

.pet-care-panel > header > span {
    min-width: 50px;
    padding: 6px 8px;
    border: 2px solid var(--game-outline);
    border-radius: 11px;
    background: var(--mint-soft);
    box-shadow: 0 3px 0 var(--game-outline);
    color: #477b69;
    font-size: 11px;
    font-weight: 900;
    text-align: center;
}

.pet-actions {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.pet-actions button {
    min-height: 88px;
    gap: 3px;
    padding: 9px 5px;
    border: 2px solid var(--game-outline);
    border-radius: 16px;
    background: var(--surface);
    box-shadow: 0 4px 0 var(--game-outline);
}

.pet-actions button:active:not(:disabled) {
    transform: translateY(3px);
    box-shadow: 0 1px 0 var(--game-outline);
}

.pet-actions button:disabled:not(.is-complete) {
    opacity: .48;
    box-shadow: 0 2px 0 rgba(48, 55, 53, .35);
    cursor: default;
}

.pet-actions button i {
    font-size: 27px;
}

.pet-actions button span {
    font-size: 11px;
}

.pet-actions button small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.pet-actions button.is-complete {
    border-color: var(--game-outline);
    background: var(--mint-soft);
    color: #477b69;
    box-shadow: 0 4px 0 #477b69;
}

.pet-actions button.is-complete small,
.pet-actions button.is-complete i {
    color: #477b69;
}

.pet-complete {
    margin-top: 12px;
    border: 2px solid var(--game-outline);
    border-radius: 16px;
    box-shadow: 0 4px 0 var(--game-outline);
}

.pet-complete > i {
    color: var(--sun);
}

.pet-customizer {
    margin-top: 15px;
    padding: 14px;
    border: 3px solid var(--game-outline);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 7px 0 var(--game-outline), 0 16px 34px rgba(48, 55, 53, .12);
}

.pet-customizer > header,
.pet-group-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.pet-customizer > header small {
    color: var(--coral);
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
}

.pet-customizer h2 {
    margin: 2px 0 0;
    font-size: 19px;
}

.pet-customizer > header button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 2px solid var(--game-outline);
    border-radius: 12px;
    background: var(--paper);
    box-shadow: 0 3px 0 var(--game-outline);
    cursor: pointer;
}

.pet-name-editor {
    position: relative;
    display: block;
    margin: 15px 0 4px;
}

.pet-name-editor > span {
    display: block;
    margin: 0 0 6px 2px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 800;
}

.pet-name-editor .app-input {
    padding-right: 42px;
    border-width: 2px;
    border-color: var(--game-outline);
    border-radius: 14px;
}

.pet-name-editor > i {
    position: absolute;
    right: 14px;
    bottom: 14px;
    color: var(--muted);
}

.pet-customizer-group {
    margin-top: 18px;
}

.pet-group-heading h3 {
    margin: 0;
    font-size: 13px;
}

.pet-group-heading span {
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.pet-choice-strip {
    display: flex;
    gap: 9px;
    margin-top: 9px;
    padding: 2px 2px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.pet-choice-strip button {
    position: relative;
    width: 66px;
    height: 66px;
    flex: 0 0 66px;
    padding: 4px;
    overflow: hidden;
    border: 2px solid var(--game-outline-soft);
    border-radius: 17px;
    background: linear-gradient(145deg, #fff9f1, #f3e4dc);
    box-shadow: 0 3px 0 rgba(48, 55, 53, .12);
    cursor: pointer;
    scroll-snap-align: start;
}

.pet-choice-strip button.is-selected {
    border-color: var(--game-outline);
    background: var(--mint-soft);
    box-shadow: 0 4px 0 var(--game-outline);
}

.pet-option-grid,
.pet-room-options {
    display: grid;
    gap: 9px;
    margin-top: 9px;
}

.pet-option-grid {
    grid-template-columns: repeat(4, 1fr);
}

.pet-room-options {
    grid-template-columns: repeat(3, 1fr);
}

.pet-option-grid button,
.pet-room-options button {
    position: relative;
    min-width: 0;
    min-height: 72px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 4px;
    padding: 7px 4px;
    border: 2px solid var(--game-outline-soft);
    border-radius: 15px;
    background: var(--paper);
    color: var(--ink);
    box-shadow: 0 3px 0 rgba(48, 55, 53, .12);
    cursor: pointer;
}

.pet-option-grid button i,
.pet-room-options button i {
    color: var(--coral);
    font-size: 24px;
}

.pet-option-grid button span,
.pet-room-options button span {
    overflow: hidden;
    font-size: 9px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pet-option-grid button.is-selected,
.pet-room-options button.is-selected {
    border-color: var(--game-outline);
    background: var(--lavender-soft);
    box-shadow: 0 4px 0 var(--game-outline);
}

.pet-option-grid button.is-locked {
    opacity: .54;
    filter: grayscale(.55);
}

.pet-option-grid button > small {
    position: absolute;
    top: 4px;
    right: 4px;
    padding: 2px 4px;
    border-radius: 99px;
    background: var(--sun-soft);
    color: #805b1c;
    font-size: 9px;
    font-weight: 900;
}

@media (max-width: 430px) {
    .pet-heading {
        grid-template-columns: 1fr;
    }

    .pet-customize-button {
        justify-self: start;
    }
}

@media (max-width: 380px) {

    .pet-stage {
        min-height: 270px;
    }

    .pet-meters {
        grid-template-columns: 1fr;
    }

    .pet-option-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

:root[data-theme="dark"] {
    color-scheme: dark;
    --paper: #171b1b;
    --surface: #202626;
    --ink: #f2f0e9;
    --muted: #a5aaa7;
    --line: #343c3a;
    --coral: #e97888;
    --coral-soft: #492b32;
    --mint: #7bb5a1;
    --mint-soft: #233b34;
    --lavender: #9b8abf;
    --lavender-soft: #342e42;
    --sky: #78a9c0;
    --sky-soft: #263a43;
    --sun: #e7b95d;
    --sun-soft: #443a24;
    --shadow: 0 28px 90px rgba(0, 0, 0, .45);
    --game-outline: #090c0b;
    --game-outline-soft: #46504d;
    --game-shadow: 0 5px 0 rgba(5, 8, 7, .72);
}

:root[data-theme="dark"] body { background: #0e1111; }
:root[data-theme="dark"] .app-shell { border-color: #303735; }
:root[data-theme="dark"] .app-grain {
    opacity: .28;
    background-image:
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px);
}

:root[data-theme="dark"] .app-header {
    background: rgba(23, 27, 27, .9);
    border-bottom-color: rgba(255, 255, 255, .07);
}

:root[data-theme="dark"] .bottom-nav {
    background: rgba(24, 29, 28, .94);
    border-top-color: rgba(255, 255, 255, .08);
}

:root[data-theme="dark"] .screen-footer-action { background: rgba(23, 27, 27, .95); }
:root[data-theme="dark"] .icon-button,
:root[data-theme="dark"] .avatar-button,
:root[data-theme="dark"] .app-input,
:root[data-theme="dark"] .gender-picker button,
:root[data-theme="dark"] .personal-options button,
:root[data-theme="dark"] .support-grid button,
:root[data-theme="dark"] .recommendation,
:root[data-theme="dark"] .tool-card,
:root[data-theme="dark"] .reframe-field,
:root[data-theme="dark"] .sense-step,
:root[data-theme="dark"] .control-capture,
:root[data-theme="dark"] .progress-summary article,
:root[data-theme="dark"] .mood-chart {
    background: rgba(32, 38, 38, .86);
}

:root[data-theme="dark"] .auth-tabs,
:root[data-theme="dark"] .sense-step > b,
:root[data-theme="dark"] .step-dots span,
:root[data-theme="dark"] .compassion-dots span,
:root[data-theme="dark"] .sheet-handle,
:root[data-theme="dark"] .bond-meter > div,
:root[data-theme="dark"] .step-progress,
:root[data-theme="dark"] .battery-segment,
:root[data-theme="dark"] .grounding-progress { background: #2d3432; }

:root[data-theme="dark"] .calendar,
:root[data-theme="dark"] .pet-actions button,
:root[data-theme="dark"] .battery-body,
:root[data-theme="dark"] .journal-field,
:root[data-theme="dark"] .emotion-column,
:root[data-theme="dark"] .emotion-chip button,
:root[data-theme="dark"] .sorted-emotion button {
    background: rgba(32, 38, 38, .82);
}

:root[data-theme="dark"] .switch { background: #343c3a; }
:root[data-theme="dark"] .switch[aria-checked="true"] { background: var(--mint); }
:root[data-theme="dark"] .streak-pill,
:root[data-theme="dark"] .streak-pill i { color: #f0cc7d; }
:root[data-theme="dark"] .weekdays span,
:root[data-theme="dark"] .calendar-day { color: #b2b7b4; }
:root[data-theme="dark"] .calendar-day.completed { color: #202625; }
:root[data-theme="dark"] .insight-color { color: #add0df; }
:root[data-theme="dark"] .pet-home-card {
    border-color: #416356;
}
:root[data-theme="dark"] .pet-home-card small,
:root[data-theme="dark"] .pet-home-card em,
:root[data-theme="dark"] .pet-home-card > i { color: #a9d5c5; }
:root[data-theme="dark"] .profile-avatar { background-color: #3a2d31; }

:root[data-theme="dark"] .pet-stage { background: #3a2d31; border-color: #5c4148; }
:root[data-theme="dark"] .pet-stage::before { background: rgba(32, 38, 38, .62); }
:root[data-theme="dark"] .avatar-button { background: #342d2f; border-color: #564348; }
:root[data-theme="dark"] .auth-error { background: #482b30; color: #f1a4ad; }

:root[data-theme="dark"] .tool-card.featured-tool,
:root[data-theme="dark"] .recommendation.primary,
:root[data-theme="dark"] .support-alert { background: #442b27; border-color: #6f4036; }
:root[data-theme="dark"] .ai-reading { background: #2f2a3a; border-color: #4a405c; }
:root[data-theme="dark"] .ai-reading > p { color: #d8d1e0; }
:root[data-theme="dark"] .ai-reading small,
:root[data-theme="dark"] .ai-status { color: #b9acd0; }
:root[data-theme="dark"] .ai-status.is-ready { color: #a9d5c5; }
:root[data-theme="dark"] .ai-status.is-fallback { color: #e6bd88; }
:root[data-theme="dark"] .support-alert { color: #f1b6ad; }
:root[data-theme="dark"] .control-columns > section { background: #20342e; border-color: #36584c; }
:root[data-theme="dark"] .control-columns > section:last-child { background: #302b3b; border-color: #4d435e; }
:root[data-theme="dark"] .sense-step.is-complete { background: #203a32; border-color: #497866; }
:root[data-theme="dark"] .pet-actions button.is-complete,
:root[data-theme="dark"] .pet-actions button.is-complete i,
:root[data-theme="dark"] .reframe-saved,
:root[data-theme="dark"] .control-actions button,
:root[data-theme="dark"] .control-columns header { color: #a9d5c5; }
:root[data-theme="dark"] .control-actions button:last-child,
:root[data-theme="dark"] .control-columns > section:last-child header { color: #c9bae5; }
:root[data-theme="dark"] .prompt-row button { color: var(--ink); }
:root[data-theme="dark"] .wheel-button,
:root[data-theme="dark"] .add-emotion-button { color: #c9bae5; }
:root[data-theme="dark"] .selected-emotions.empty,
:root[data-theme="dark"] .empty-column { color: var(--muted); }
:root[data-theme="dark"] .emotion-chip,
:root[data-theme="dark"] .sorted-emotion { color: #232827; }
:root[data-theme="dark"] .emotion-chip button,
:root[data-theme="dark"] .sorted-emotion button { color: var(--ink); }
:root[data-theme="dark"] .positive-column > header > span { color: #f0cc7d; }
:root[data-theme="dark"] .negative-column > header > span { color: #add0df; }
:root[data-theme="dark"] .bond-meter > span,
:root[data-theme="dark"] .tool-card small,
:root[data-theme="dark"] .compassion-copy span { color: #f0a18e; }
:root[data-theme="dark"] .micro-practice small { color: #add0df; }

:root[data-theme="dark"] .primary-action,
:root[data-theme="dark"] .gender-picker button.is-selected,
:root[data-theme="dark"] .personal-options button.is-selected,
:root[data-theme="dark"] .reframe-field > span,
:root[data-theme="dark"] .tip-number,
:root[data-theme="dark"] .completion-check {
    background: var(--coral);
    color: #fff;
}

:root[data-theme="dark"] .toast { background: #f0ede5; color: #171b1b; }

:root[data-theme="dark"] .lavender { color: #c9bae5; }
:root[data-theme="dark"] .coral { color: #f0a18e; }
:root[data-theme="dark"] .sky { color: #add0df; }
:root[data-theme="dark"] .mint { color: #a9d5c5; }
:root[data-theme="dark"] .sun { color: #f0cc7d; }
:root[data-theme="dark"] .support-grid button.is-selected { color: #b5d6e4; }
:root[data-theme="dark"] .pet-intro small,
:root[data-theme="dark"] .pet-intro p,
:root[data-theme="dark"] .tool-complete { color: #b6d9cc; }
:root[data-theme="dark"] input::placeholder,
:root[data-theme="dark"] textarea::placeholder { color: #777f7b; }

:root[data-theme="dark"] .avatar-button,
:root[data-theme="dark"] .avatar-option,
:root[data-theme="dark"] .pet-choice-strip button {
    background: linear-gradient(145deg, #3e3437, #282d2c);
}

:root[data-theme="dark"] .pet-home-avatar,
:root[data-theme="dark"] .profile-avatar,
:root[data-theme="dark"] .pet-intro > .avatar-art {
    background-color: #342d2f;
}

:root[data-theme="dark"] .avatar-button .avatar-art,
:root[data-theme="dark"] .avatar-option .avatar-art,
:root[data-theme="dark"] .pet-home-avatar,
:root[data-theme="dark"] .profile-avatar,
:root[data-theme="dark"] .pet-intro > .avatar-art {
    filter: drop-shadow(0 4px 7px rgba(4, 7, 6, .28));
}

:root[data-theme="dark"] .pet-home-card {
    border-color: #527d6d;
    background:
        radial-gradient(circle at 88% 18%, rgba(255, 255, 255, .08) 0 18px, transparent 19px),
        #203b33;
    box-shadow: 0 5px 0 rgba(7, 12, 10, .72);
}

:root[data-theme="dark"] .pet-home-streak {
    border-color: #765d2a;
    background: #443a24;
    color: #f0cc7d;
}

:root[data-theme="dark"] .pet-customize-button {
    background: #342e42;
    color: #d2c3ee;
}

:root[data-theme="dark"] .pet-streak-card {
    background: linear-gradient(145deg, #403722, #322f25);
}

:root[data-theme="dark"] .pet-streak-card header > span,
:root[data-theme="dark"] .pet-streak-card header em,
:root[data-theme="dark"] .pet-streak-card p,
:root[data-theme="dark"] .pet-week small,
:root[data-theme="dark"] .pet-week b {
    color: #e8ce91;
}

:root[data-theme="dark"] .pet-week b {
    border-color: #66583a;
    background: rgba(255, 255, 255, .045);
}

:root[data-theme="dark"] .pet-week > span.is-done b {
    border-color: var(--game-outline);
    background: var(--coral);
    color: #fff;
}

:root[data-theme="dark"] .pet-stage[data-room="nest"] {
    border-color: var(--game-outline);
    background: linear-gradient(180deg, #4b373c 0 67%, #302b2d 68% 100%);
}

:root[data-theme="dark"] .pet-stage[data-room="garden"] {
    border-color: var(--game-outline);
    background: linear-gradient(180deg, #29443c 0 66%, #20332d 67% 100%);
}

:root[data-theme="dark"] .pet-stage[data-room="night"] {
    border-color: var(--game-outline);
    background:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, .72) 0 2px, transparent 3px),
        radial-gradient(circle at 74% 17%, rgba(255, 255, 255, .6) 0 2px, transparent 3px),
        radial-gradient(circle at 85% 46%, rgba(255, 255, 255, .42) 0 1px, transparent 2px),
        linear-gradient(180deg, #393452 0 67%, #242331 68% 100%);
}

:root[data-theme="dark"] .pet-speech,
:root[data-theme="dark"] .pet-level-chip,
:root[data-theme="dark"] .pet-meters .bond-meter,
:root[data-theme="dark"] .pet-meters .xp-meter,
:root[data-theme="dark"] .pet-care-panel,
:root[data-theme="dark"] .pet-customizer {
    background: #202626;
}

:root[data-theme="dark"] .pet-meters .bond-meter > div,
:root[data-theme="dark"] .pet-meters .xp-meter > div {
    border-color: #434b48;
    background: #2d3432;
}

:root[data-theme="dark"] .pet-meters .xp-meter > span {
    color: #add0df;
}

:root[data-theme="dark"] .pet-care-panel > header > span {
    background: #233b34;
    color: #a9d5c5;
}

:root[data-theme="dark"] .pet-actions button,
:root[data-theme="dark"] .pet-option-grid button,
:root[data-theme="dark"] .pet-room-options button,
:root[data-theme="dark"] .pet-customizer > header button {
    background: #292f2e;
}

:root[data-theme="dark"] .pet-actions button.is-complete {
    background: #234138;
    color: #a9d5c5;
}

:root[data-theme="dark"] .pet-choice-strip button.is-selected,
:root[data-theme="dark"] .pet-option-grid button.is-selected,
:root[data-theme="dark"] .pet-room-options button.is-selected {
    background: #342e42;
}

body,
.app-shell,
.app-header,
.bottom-nav,
.icon-button,
.app-input,
.tool-card,
.gratitude-item,
.sheet-panel {
    transition: background-color 220ms ease, border-color 220ms ease, color 220ms ease;
}

@media (max-height: 730px) {
    :root {
        --header-content-h: 58px;
        --nav-h: 68px;
    }

    .app-header {
        padding-inline: 15px;
    }

    .screen-content,
    .onboarding-step {
        padding-top: 18px;
        padding-inline: 20px;
    }

    h1 {
        font-size: 27px;
    }

    .home-screen .screen-content {
        padding-top: 14px;
    }

    .home-greeting h1 {
        font-size: 27px;
    }

    .month-toolbar {
        margin: 10px 0 7px;
    }

    .paint-illustration {
        height: 130px;
        margin-bottom: 16px;
    }

    .onboarding-step[data-onboarding-step="1"] .paint-illustration {
        height: 104px;
        margin-bottom: 12px;
    }

    .onboarding-step[data-onboarding-step="1"] .lead {
        margin-bottom: 12px;
    }

    .onboarding-step[data-onboarding-step="1"] .app-input {
        height: 48px;
    }

    .paint-illustration > i {
        font-size: 64px;
    }

    .calendar {
        padding-block: 5px 7px;
    }

    .weekdays span {
        height: 20px;
    }

    .calendar-day {
        height: 38px;
        aspect-ratio: auto;
        margin: 1px 2px;
    }

    .calendar-day.completed::before {
        inset: 1px 7px;
    }

    .pet-home-card {
        min-height: 60px;
        margin-top: 7px;
        padding-block: 5px;
    }

    .today-insight {
        display: none;
    }

    .energy-canvas {
        height: min(286px, 40vh);
    }

    .wheel-stage {
        width: min(100%, 315px);
    }
}

@media (max-height: 650px) {
    .pet-content {
        padding-top: 12px;
    }

    .pet-heading {
        gap: 7px;
    }

    .pet-heading .lead,
    .pet-week,
    .pet-streak-card p {
        display: none;
    }

    .pet-streak-card {
        margin: 9px 0 10px;
        padding: 9px 11px;
        border-radius: 15px;
    }

    .pet-stage {
        min-height: 255px;
    }
}

@media (max-height: 600px) {
    .home-screen .screen-content {
        padding-top: 12px;
    }

    .home-greeting h1 {
        font-size: 28px;
    }

    .home-greeting .eyebrow {
        margin-bottom: 4px;
    }

    .month-toolbar {
        margin: 7px 0 6px;
    }

    .month-toolbar h2 {
        font-size: 18px;
    }

    .month-actions .icon-button {
        width: 38px;
        height: 38px;
    }

    .calendar {
        padding: 3px 8px 5px;
    }

    .weekdays {
        margin-bottom: 1px;
    }

    .weekdays span {
        height: 17px;
    }

    .calendar-day {
        height: 36px;
        aspect-ratio: auto;
        margin: 0 2px;
    }

    .calendar-day.completed::before {
        inset: 1px 7px;
    }

    .home-cta {
        padding-top: 6px;
        padding-bottom: 6px;
    }

    .checkin-action {
        min-height: 60px;
    }
}

@media (max-width: 560px) {
    body {
        display: block;
        min-height: 100svh;
        min-height: 100dvh;
        background: var(--paper);
    }

    .app-shell {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (display-mode: standalone) {
    .app-shell {
        width: 100%;
        height: 100dvh;
        border: 0;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* Native application shell */
:root {
    --header-content-h: 56px;
    --nav-h: 68px;
}

h1 {
    font-size: 30px;
}

.eyebrow {
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
}

.app-header {
    gap: 8px;
    padding-inline: 20px;
    background: rgba(246, 245, 240, .96);
    backdrop-filter: blur(22px);
}

.wordmark {
    gap: 8px;
    font-size: 17px;
}

.wordmark-icon {
    width: 26px;
    height: 30px;
}

.header-context-title {
    min-width: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.app-header .back-button {
    width: 38px;
    height: 38px;
    margin-left: -9px;
    border: 0;
    background: transparent;
}

.screen-content {
    padding: 22px 20px calc(28px + env(safe-area-inset-bottom));
}

.screen.has-nav .screen-content {
    padding: 17px 20px 20px;
}

.screen.is-active.is-tab-transition {
    animation: tab-screen-in 200ms ease both;
}

.screen.is-leaving.is-tab-transition {
    animation: tab-screen-out 160ms ease both;
}

@keyframes tab-screen-in {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tab-screen-out {
    to { opacity: 0; transform: translateY(-3px); }
}

.bottom-nav {
    padding: 4px 8px var(--safe-bottom);
    background: rgba(255, 254, 251, .97);
}

.bottom-nav button {
    gap: 2px;
    border-radius: 0;
    font-size: 10px;
}

.bottom-nav button i {
    font-size: 22px;
}

.bottom-nav button.active::before {
    display: none;
}

.bottom-nav button.active i {
    color: var(--coral);
}

.primary-action,
.secondary-action {
    min-height: 54px;
    border-radius: 12px;
}

/* Home */
.home-screen .screen-content {
    padding-top: 13px;
    padding-bottom: 4px;
    overflow-y: auto;
}

.home-greeting {
    min-height: 32px;
    gap: 12px;
}

.home-greeting h1 {
    min-width: 0;
    margin: 0;
    overflow: hidden;
    font-size: 23px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streak-pill {
    flex: 0 0 auto;
    gap: 4px;
    padding: 0;
    background: transparent;
    color: var(--muted);
    font-size: 10px;
}

.month-toolbar {
    margin: 17px 0 7px;
}

.month-toolbar h2 {
    font-size: 19px;
}

.month-actions {
    gap: 0;
}

.month-actions .icon-button {
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
}

.calendar {
    padding: 2px 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.pet-home-card {
    grid-template-columns: 46px minmax(0, 1fr) auto 16px;
    gap: 9px;
    min-height: 64px;
    margin-top: 10px;
    padding: 7px 2px;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.pet-home-card:active {
    transform: scale(.985);
    background: rgba(117, 170, 152, .08);
    box-shadow: none;
}

.pet-home-avatar {
    width: 44px;
    height: 44px;
    border: 0;
    box-shadow: none;
}

.pet-home-card small {
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
}

.pet-home-card strong {
    margin-top: 0;
    font-size: 13px;
}

.pet-home-card em {
    margin-top: 1px;
    font-size: 9px;
}

.pet-home-streak {
    min-width: 35px;
    height: 34px;
    gap: 3px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.home-cta {
    padding: 8px 20px 10px;
    border-top: 1px solid rgba(32, 37, 37, .07);
    background: var(--paper);
}

.checkin-action {
    min-height: 58px;
    padding: 7px 13px;
    box-shadow: 0 6px 16px rgba(32, 37, 37, .13);
}

/* Tools */
.tools-screen .screen-content > h1,
.progress-screen .screen-content > h1 {
    margin: 1px 0 17px;
    font-size: 24px;
    line-height: 1.2;
}

.tool-card.featured-tool {
    min-height: 88px;
    margin: 0 0 14px;
    padding: 10px 12px;
    border: 0;
    border-radius: 8px;
    box-shadow: none;
}

.tool-card.featured-tool .tool-illustration {
    width: 48px;
    height: 58px;
    border-radius: 8px;
    clip-path: none;
}

.tool-card.featured-tool small {
    letter-spacing: 0;
    text-transform: none;
}

.tool-grid {
    gap: 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.tool-grid .tool-card {
    min-height: 66px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 11px;
    padding: 7px 0;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
}

.tool-grid .tool-card:last-child {
    border-bottom: 0;
}

.tool-grid .tool-illustration {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    clip-path: none;
}

.tool-grid .tool-illustration i {
    font-size: 23px;
}

.tool-card strong {
    font-size: 13px;
}

.tool-card em {
    margin-top: 2px;
    font-size: 10px;
}

.micro-practice {
    margin-top: 16px;
    padding: 12px;
    border: 0;
    border-radius: 8px;
}

.micro-practice small {
    letter-spacing: 0;
    text-transform: none;
}

/* Progress */
.progress-summary {
    gap: 0;
    margin: 0 0 16px;
    padding: 12px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.progress-summary article {
    min-width: 0;
    padding: 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.progress-summary article:first-child {
    padding-left: 0;
}

.progress-summary article:last-child {
    padding-right: 0;
}

.progress-summary article + article {
    border-left: 1px solid var(--line);
}

.progress-summary small {
    font-size: 9px;
    letter-spacing: 0;
    text-transform: none;
}

.progress-summary strong {
    margin: 4px 0 1px;
    overflow-wrap: anywhere;
    font-size: 19px;
    line-height: 1.15;
}

.progress-summary article:last-child strong {
    font-size: 15px;
}

.progress-summary span {
    font-size: 9px;
}

.mood-chart {
    padding: 15px;
}

.mood-chart small {
    letter-spacing: 0;
    text-transform: none;
}

.pattern-section {
    margin-top: 18px;
}

.pattern-section article {
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 13px 0;
}

.pattern-section strong {
    font-size: 12px;
}

.pattern-section p {
    font-size: 10px;
}

/* Profile */
.profile-screen .screen-content {
    padding-top: 12px;
}

.profile-hero {
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    margin: 0 0 22px;
}

.profile-avatar {
    width: 60px;
    height: 60px;
    border: 0;
    box-shadow: none;
}

.profile-hero h1 {
    font-size: 22px;
}

.profile-hero p:last-child {
    margin-top: 2px;
    font-size: 10px;
}

.profile-section {
    margin-bottom: 21px;
}

.profile-section h2 {
    margin-bottom: 5px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
}

.profile-section button {
    min-height: 56px;
    padding: 0;
    font-size: 13px;
}

.profile-section button span i {
    width: 25px;
    color: var(--coral);
    font-size: 20px;
    text-align: center;
}

.profile-section button em {
    font-size: 11px;
}

/* Onboarding choices advance after selection, while the layout stays consistent. */
.onboarding-progress {
    margin-bottom: 22px;
}

.onboarding-visual {
    width: 64px;
    height: 64px;
    margin: 4px 0 20px;
    clip-path: none;
}

.onboarding-step > h1 {
    font-size: 28px;
}

.onboarding-step > .lead {
    margin-bottom: 20px;
}

/* Dark mode keeps the same hierarchy instead of restoring card surfaces. */
:root[data-theme="dark"] .app-header {
    background: rgba(23, 27, 27, .96);
}

:root[data-theme="dark"] .bottom-nav {
    background: rgba(24, 29, 28, .98);
}

:root[data-theme="dark"] .calendar,
:root[data-theme="dark"] .tool-grid .tool-card,
:root[data-theme="dark"] .progress-summary article {
    background: transparent;
}

:root[data-theme="dark"] .pet-home-card {
    border-color: var(--line);
    background: transparent;
    box-shadow: none;
}

:root[data-theme="dark"] .pet-home-card:active {
    background: rgba(123, 181, 161, .08);
    box-shadow: none;
}

:root[data-theme="dark"] .pet-home-streak {
    border: 0;
    background: transparent;
    box-shadow: none;
}

:root[data-theme="dark"] .home-cta {
    border-top-color: rgba(255, 255, 255, .07);
    background: var(--paper);
}

:root[data-theme="dark"] .checkin-action > span:first-child {
    background: rgba(255, 255, 255, .16);
}

:root[data-theme="dark"] .tool-card.featured-tool {
    background: #442b27;
}

@media (max-height: 730px) {
    h1,
    .onboarding-step > h1 {
        font-size: 27px;
    }

    .home-screen .screen-content {
        padding-top: 9px;
    }

    .home-greeting h1 {
        font-size: 21px;
    }

    .month-toolbar {
        margin: 9px 0 4px;
    }

    .pet-home-card {
        min-height: 56px;
        margin-top: 5px;
        padding-block: 4px;
    }

    .pet-home-avatar {
        width: 40px;
        height: 40px;
    }

    .home-cta {
        padding-block: 6px;
    }

    .checkin-action {
        min-height: 54px;
    }
}

@media (max-width: 350px) {
    .screen-content,
    .screen.has-nav .screen-content {
        padding-inline: 16px;
    }

    .app-header {
        padding-inline: 16px;
    }

    .home-greeting h1 {
        font-size: 20px;
    }

    .progress-summary article {
        padding-inline: 7px;
    }

    .profile-section button {
        font-size: 12px;
    }
}

@media (max-height: 600px) {
    .home-greeting {
        min-height: 26px;
    }

    .month-toolbar {
        margin: 5px 0 2px;
    }

    .month-toolbar h2 {
        font-size: 18px;
    }

    .month-toolbar p {
        font-size: 9px;
    }

    .weekdays {
        margin-bottom: 0;
    }

    .weekdays span {
        height: 15px;
    }

    .calendar-day {
        height: 30px;
        margin: 0 1px;
    }

    .calendar-day.completed::before {
        inset: 1px 6px;
    }

    .pet-home-card {
        min-height: 48px;
        grid-template-columns: 38px minmax(0, 1fr) auto 14px;
        margin-top: 3px;
        padding-block: 3px;
    }

    .pet-home-avatar {
        width: 36px;
        height: 36px;
    }

    .pet-home-card small,
    .pet-home-card em {
        font-size: 8px;
    }

    .pet-home-streak {
        min-width: 30px;
        height: 30px;
    }
}
