/*
 * Doncs 2026 visual refresh.
 * Presentation-only layer: behavior, state selectors and navigation remain in
 * doncs-journal.js and the original stylesheet.
 */

:root {
    --paper: #f7f7f3;
    --surface: #ffffff;
    --ink: #1d2522;
    --muted: #707873;
    --line: #e2e6e1;
    --coral: #e66578;
    --coral-soft: #fbe7ea;
    --mint: #5b9c86;
    --mint-soft: #e1f0ea;
    --lavender: #8173a2;
    --lavender-soft: #ece8f4;
    --sky: #5f91a8;
    --sky-soft: #e0edf2;
    --sun: #c89536;
    --sun-soft: #fbefcf;
    --shadow: 0 28px 90px rgba(35, 44, 40, .16);
    --shadow-card: 0 1px 2px rgba(29, 37, 34, .04), 0 8px 24px rgba(29, 37, 34, .055);
    --radius-sm: 12px;
    --radius-md: 18px;
    --radius-lg: 24px;
    --radius-xl: 30px;
    --header-content-h: 60px;
    --nav-h: 72px;
}

:root[data-theme="dark"] {
    --paper: #121715;
    --surface: #1b211f;
    --ink: #f2f5f3;
    --muted: #9ca6a1;
    --line: #303936;
    --coral: #ff8293;
    --coral-soft: #3c282d;
    --mint: #75b9a1;
    --mint-soft: #203730;
    --lavender: #ad9bd0;
    --lavender-soft: #302a3c;
    --sky: #80b1c8;
    --sky-soft: #24363e;
    --sun: #e5ba64;
    --sun-soft: #3c3424;
    --shadow: 0 28px 90px rgba(0, 0, 0, .4);
    --shadow-card: 0 1px 1px rgba(0, 0, 0, .16), 0 10px 28px rgba(0, 0, 0, .16);
}

body {
    background: #e5eae6;
    font-size: 15px;
    letter-spacing: -.008em;
}

:root[data-theme="dark"] body {
    background: #090c0b;
}

.app-shell {
    width: min(440px, 100%);
    height: min(920px, calc(100dvh - 24px));
    border-color: rgba(29, 37, 34, .1);
    border-radius: 38px;
    box-shadow: var(--shadow);
}

.app-grain {
    opacity: .18;
    background-size: 32px 32px;
}

.app-header {
    gap: 10px;
    padding-inline: 20px;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    border-bottom-color: color-mix(in srgb, var(--line) 74%, transparent);
    backdrop-filter: blur(24px) saturate(1.2);
}

.wordmark {
    gap: 9px;
    font-size: 18px;
    letter-spacing: -.025em;
}

.wordmark-icon {
    width: 28px;
    height: 32px;
}

.icon-button,
.avatar-button,
.month-actions .icon-button,
.checkin-header .icon-button,
.app-header .back-button {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
}

.icon-button,
.avatar-button {
    border-color: var(--line);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(29, 37, 34, .04);
}

.app-header .back-button {
    margin-left: -10px;
    background: transparent;
    box-shadow: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
[role="slider"]:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--coral) 34%, transparent);
    outline-offset: 2px;
}

.screen-content {
    padding: 24px 20px calc(30px + var(--safe-bottom));
}

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

h1,
.onboarding-step > h1 {
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: -.045em;
}

h2,
h3,
strong {
    letter-spacing: -.018em;
}

.lead {
    color: var(--muted);
    line-height: 1.55;
}

.eyebrow {
    color: var(--coral);
    font-size: 12px;
    font-weight: 750;
}

.primary-action,
.secondary-action {
    min-height: 56px;
    border-radius: var(--radius-md);
}

.primary-action {
    background: var(--coral);
    color: #fff;
    box-shadow: 0 10px 24px color-mix(in srgb, var(--coral) 22%, transparent);
}

.primary-action:hover {
    background: color-mix(in srgb, var(--coral) 92%, #9e3446);
}

.secondary-action {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
}

.bottom-nav {
    padding: 5px 10px var(--safe-bottom);
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top-color: color-mix(in srgb, var(--line) 80%, transparent);
    backdrop-filter: blur(24px) saturate(1.15);
}

.bottom-nav button {
    position: relative;
    min-height: 60px;
    gap: 3px;
    border-radius: var(--radius-sm);
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.bottom-nav button i {
    position: relative;
    z-index: 1;
    font-size: 23px;
}

.bottom-nav button span {
    position: relative;
    z-index: 1;
}

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

.bottom-nav button.active::before {
    display: block;
    position: absolute;
    top: 1px;
    left: 50%;
    width: 24px;
    height: 3px;
    border-radius: 99px;
    background: var(--coral);
    transform: translateX(-50%);
}

/* Home: the calendar remains the anchor; the pet stays one tap away. */
.home-screen .screen-content {
    padding-top: 18px;
    padding-bottom: 12px;
}

.home-greeting {
    position: relative;
    display: block;
    min-height: 44px;
}

.home-greeting-copy {
    width: 100%;
    min-width: 0;
}

.home-kicker {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 5px;
    color: var(--mint);
    font-size: 10px;
    font-weight: 800;
    padding-right: 86px;
}

.home-kicker i {
    font-size: 13px;
}

.home-greeting h1 {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 24px;
    font-size: 25px;
    line-height: 1.18;
    letter-spacing: -.04em;
    text-overflow: clip;
    white-space: normal;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.streak-pill {
    position: absolute;
    top: 0;
    right: 0;
    min-height: 34px;
    gap: 4px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--coral) 22%, var(--line));
    border-radius: 99px;
    background: var(--coral-soft);
    color: var(--coral);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

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

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

.month-toolbar p {
    margin-top: 3px;
    font-size: 11px;
}

.month-actions {
    gap: 2px;
}

.month-actions .icon-button {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.calendar {
    padding: 12px 10px 10px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.weekdays {
    margin-bottom: 4px;
}

.weekdays span {
    height: 22px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 750;
}

.calendar-grid {
    gap: 2px 0;
}

.calendar-day {
    min-width: 40px;
    height: 44px;
    margin: 0 2px;
    border-radius: 14px;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.calendar-day.completed::before {
    inset: 2px 5px;
    border-radius: 13px;
}

.calendar-day.today {
    box-shadow: inset 0 0 0 2px var(--coral);
}

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

.pet-home-card {
    grid-template-columns: 54px minmax(0, 1fr) auto 18px;
    gap: 11px;
    min-height: 76px;
    margin-top: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: linear-gradient(112deg, color-mix(in srgb, var(--mint-soft) 56%, var(--surface)), var(--surface) 62%);
    box-shadow: var(--shadow-card);
}

.pet-home-card:active {
    transform: scale(.985);
    border-color: color-mix(in srgb, var(--mint) 34%, var(--line));
    background: var(--mint-soft);
    box-shadow: 0 1px 2px rgba(29, 37, 34, .04);
}

.pet-home-avatar {
    width: 52px;
    height: 52px;
    border: 1px solid color-mix(in srgb, var(--mint) 25%, var(--line));
    box-shadow: none;
}

.pet-home-card small {
    color: var(--mint);
    font-size: 9px;
    font-weight: 800;
}

.pet-home-card strong {
    margin-top: 1px;
    font-size: 15px;
}

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

.pet-home-streak {
    min-width: 42px;
    height: 38px;
    border: 0;
    border-radius: 99px;
    background: var(--sun-soft);
    color: var(--sun);
    font-variant-numeric: tabular-nums;
    box-shadow: none;
}

.home-cta {
    padding: 10px 20px 12px;
    border-top-color: color-mix(in srgb, var(--line) 76%, transparent);
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(20px);
}

.checkin-action {
    min-height: 62px;
    padding: 8px 14px;
    border-radius: var(--radius-md);
    box-shadow: 0 12px 28px color-mix(in srgb, var(--coral) 24%, transparent);
}

.checkin-action > span:first-child {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, .18);
}

/* Companion: preserve every care action, with calmer hierarchy. */
.pet-content {
    padding-top: 20px;
}

.pet-heading h1 {
    font-size: 29px;
}

.pet-customize-button {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid color-mix(in srgb, var(--lavender) 26%, var(--line));
    border-radius: 99px;
    background: var(--lavender-soft);
    color: var(--lavender);
    box-shadow: none;
}

.pet-streak-card,
.pet-care-panel,
.pet-customizer {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.pet-streak-card {
    padding: 16px;
}

.pet-stage {
    border: 1px solid color-mix(in srgb, var(--mint) 28%, var(--line));
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.pet-speech {
    min-height: 62px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 8px 20px rgba(29, 37, 34, .08);
}

.pet-level-chip {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    box-shadow: 0 4px 12px rgba(29, 37, 34, .08);
}

.pet-meters {
    gap: 10px;
}

.pet-meters .bond-meter,
.pet-meters .xp-meter {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: none;
}

.pet-care-panel {
    padding: 16px;
}

.pet-actions {
    gap: 10px;
}

.pet-actions button {
    min-height: 82px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--paper);
}

.pet-actions button.is-complete {
    border-color: color-mix(in srgb, var(--mint) 38%, var(--line));
    background: var(--mint-soft);
}

/* Check-in: the battery remains step one and gains clearer focus. */
.energy-workspace,
.journal-field,
.emotion-prompt,
.ai-reading,
.tips-section,
.tool-session-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.energy-workspace {
    padding: 18px;
}

.energy-value {
    font-variant-numeric: tabular-nums;
}

.energy-canvas {
    border-radius: var(--radius-lg);
    background: var(--paper);
}

.battery-body {
    border-color: var(--ink);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: 0 14px 32px rgba(29, 37, 34, .1);
}

.battery-segment {
    border-radius: 10px;
}

.battery-segment.filled {
    background: var(--segment-color, var(--coral));
}

.energy-scale {
    width: min(250px, 70vw);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 11px auto 0;
    color: var(--muted);
    font-size: 9px;
    font-weight: 700;
}

.energy-scale span:nth-child(2) {
    color: var(--sun);
}

.energy-scale span:last-child {
    color: var(--mint);
}

.journal-field textarea {
    min-height: 190px;
}

.prompt-row button,
.wheel-button,
.add-emotion-button {
    min-height: 44px;
}

/* Tools: scannable cards without changing destinations or order. */
.tools-screen .screen-content > h1,
.progress-screen .screen-content > h1 {
    margin: 2px 0 20px;
    font-size: 28px;
}

.tool-card.featured-tool {
    min-height: 96px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border: 1px solid color-mix(in srgb, var(--coral) 18%, var(--line));
    border-radius: var(--radius-lg);
    background: var(--coral-soft);
    box-shadow: none;
}

.tool-card.featured-tool .tool-illustration {
    width: 52px;
    height: 64px;
    border-radius: var(--radius-sm);
}

.tool-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 2px 9px;
}

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

.tool-section-heading span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
}

.tool-grid {
    gap: 10px;
    border: 0;
}

.tool-grid .tool-card {
    min-height: 70px;
    grid-template-columns: 46px minmax(0, 1fr) auto;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
    box-shadow: 0 1px 2px rgba(29, 37, 34, .025);
}

.tool-grid .tool-card:last-child {
    border-bottom: 1px solid var(--line);
}

.tool-grid .tool-illustration {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
}

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

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

.micro-practice {
    margin-top: 14px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--sky) 16%, var(--line));
    border-radius: var(--radius-md);
    background: var(--sky-soft);
}

.micro-practice button {
    min-width: 64px;
    min-height: 44px;
    padding: 0 14px;
    font-size: 10px;
}

/* Breathing: one continuous, eased journey around a three-phase triangle. */
.breathing-content {
    align-items: stretch;
    text-align: center;
}

.breathing-content > .eyebrow {
    justify-content: center;
}

.breathing-content > h1 {
    margin-top: 7px;
}

.breathing-content > .lead {
    margin-top: 6px;
}

.breath-visual {
    --breath-blue: #4d8fba;
    --breath-blue-soft: #dcecf5;
    --breath-red: #e25f72;
    --breath-red-soft: #fae1e5;
    position: relative;
    width: min(332px, 86vw);
    aspect-ratio: 320 / 288;
    display: block;
    margin: auto;
    isolation: isolate;
}

.breath-triangle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 14px 22px rgba(29, 37, 34, .06));
}

.breath-track,
.breath-edge {
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.breath-track {
    stroke: color-mix(in srgb, var(--line) 82%, var(--ink));
    stroke-width: 8;
}

.breath-edge {
    opacity: .25;
    stroke-width: 8;
    transition: opacity 360ms ease, stroke-width 360ms ease, filter 360ms ease;
}

.breath-edge-inhale,
.breath-edge-hold {
    stroke: var(--breath-blue);
}

.breath-edge-exhale {
    stroke: var(--breath-red);
}

.breath-visual[data-phase="inhale"] .breath-edge-inhale,
.breath-visual[data-phase="hold"] .breath-edge-hold,
.breath-visual[data-phase="exhale"] .breath-edge-exhale {
    opacity: 1;
    stroke-width: 11;
    filter: drop-shadow(0 0 7px color-mix(in srgb, currentColor 28%, transparent));
}

.breath-orb {
    position: absolute;
    z-index: 4;
    left: 50%;
    top: 9%;
    width: 24px;
    height: 24px;
    border: 5px solid color-mix(in srgb, #fff 86%, transparent);
    border-radius: 50%;
    background: var(--breath-blue);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--breath-blue) 16%, transparent), 0 8px 18px color-mix(in srgb, var(--breath-blue) 34%, transparent);
    transform: translate(-50%, -50%);
    transition: background-color 420ms ease, box-shadow 420ms ease;
    will-change: left, top;
}

.breath-visual[data-phase="hold"] .breath-orb {
    background: var(--breath-blue);
    box-shadow: 0 0 0 9px color-mix(in srgb, var(--breath-blue) 18%, transparent), 0 8px 20px color-mix(in srgb, var(--breath-blue) 36%, transparent);
}

.breath-visual[data-phase="exhale"] .breath-orb {
    background: var(--breath-red);
    box-shadow: 0 0 0 7px color-mix(in srgb, var(--breath-red) 16%, transparent), 0 8px 18px color-mix(in srgb, var(--breath-red) 34%, transparent);
}

.breath-core {
    position: absolute;
    z-index: 2;
    left: 50%;
    top: 57%;
    width: 132px;
    min-height: 104px;
    aspect-ratio: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    padding: 16px;
    border: 1px solid color-mix(in srgb, var(--line) 78%, transparent);
    border-radius: var(--radius-lg);
    background: color-mix(in srgb, var(--surface) 91%, transparent);
    color: var(--ink);
    box-shadow: 0 14px 38px rgba(29, 37, 34, .1);
    backdrop-filter: blur(18px);
    transform: translate(-50%, -50%);
    transition: border-color 360ms ease, box-shadow 360ms ease;
}

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

.breath-core small {
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.breath-core strong {
    margin-top: 5px;
    font-size: 20px;
    line-height: 1.1;
}

.breath-core span {
    margin-top: 6px;
    color: var(--muted);
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.breath-visual[data-phase="inhale"] .breath-core,
.breath-visual[data-phase="hold"] .breath-core {
    border-color: color-mix(in srgb, var(--breath-blue) 28%, var(--line));
    box-shadow: 0 14px 38px color-mix(in srgb, var(--breath-blue) 13%, transparent);
}

.breath-visual[data-phase="exhale"] .breath-core {
    border-color: color-mix(in srgb, var(--breath-red) 28%, var(--line));
    box-shadow: 0 14px 38px color-mix(in srgb, var(--breath-red) 13%, transparent);
}

.breath-side-label {
    position: absolute;
    z-index: 3;
    padding: 5px 9px;
    border: 1px solid var(--line);
    border-radius: 99px;
    background: var(--surface);
    color: var(--muted);
    font-size: 9px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(29, 37, 34, .05);
    transition: color 240ms ease, border-color 240ms ease, background-color 240ms ease, transform 240ms cubic-bezier(.23, 1, .32, 1);
}

.breath-side-inhale {
    top: 43%;
    right: -1%;
    transform: rotate(60deg);
}

.breath-side-hold {
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
}

.breath-side-exhale {
    top: 43%;
    left: -1%;
    transform: rotate(-60deg);
}

.breath-visual[data-phase="inhale"] .breath-side-inhale,
.breath-visual[data-phase="hold"] .breath-side-hold {
    border-color: color-mix(in srgb, var(--breath-blue) 34%, var(--line));
    background: var(--breath-blue-soft);
    color: #2e6f99;
}

.breath-visual[data-phase="exhale"] .breath-side-exhale {
    border-color: color-mix(in srgb, var(--breath-red) 34%, var(--line));
    background: var(--breath-red-soft);
    color: #af3e50;
}

.breath-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    width: 100%;
    margin-top: 16px;
}

.breath-stats span {
    padding: 11px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: var(--surface);
}

.breath-stats small {
    font-size: 9px;
}

.breath-stats strong {
    font-size: 14px;
    font-variant-numeric: tabular-nums;
}

:root[data-theme="dark"] .breath-visual {
    --breath-blue: #6eb6e1;
    --breath-blue-soft: #203847;
    --breath-red: #ff778b;
    --breath-red-soft: #43262d;
}

:root[data-theme="dark"] .breath-core,
:root[data-theme="dark"] .breath-side-label,
:root[data-theme="dark"] .breath-stats span {
    background: color-mix(in srgb, var(--surface) 94%, transparent);
}

/* Breathing v2: one word, a soft white path, and one dimensional orb. */
.breathing-screen {
    background:
        radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--sky-soft) 26%, transparent) 0, transparent 46%),
        var(--paper);
}

.breathing-content {
    align-items: center;
    justify-content: center;
    padding: 12px 20px 24px;
    text-align: center;
}

.breath-phase-word {
    min-height: 44px;
    display: grid;
    place-items: center;
    margin: 0 0 34px;
    color: var(--ink);
    font-size: clamp(28px, 8vw, 36px);
    font-weight: 650;
    letter-spacing: .08em;
    line-height: 1;
    text-transform: uppercase;
    transition: opacity 140ms ease, transform 140ms ease;
}

.breath-phase-word.is-fading {
    opacity: 0;
    transform: translateY(-5px);
}

.breath-visual {
    position: relative;
    width: min(326px, 84vw);
    aspect-ratio: 320 / 288;
    display: block;
    margin: 0;
    isolation: isolate;
}

.breath-triangle {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 10px 18px rgba(29, 37, 34, .12));
}

.breath-track {
    fill: none;
    stroke: rgba(255, 255, 255, .96);
    stroke-width: 10;
    stroke-linecap: round;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

.breath-orb {
    --orb-distance: 0%;
    --orb-scale: .76;
    position: absolute;
    z-index: 4;
    top: 0;
    left: 0;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, .76);
    border-radius: 50%;
    background: radial-gradient(circle at 34% 28%, #cdeeff 0 7%, #74bde7 28%, #398dc0 60%, #17628f 82%, #0d4568 100%);
    box-shadow:
        inset -7px -8px 12px rgba(6, 50, 78, .26),
        inset 6px 6px 10px rgba(255, 255, 255, .34),
        0 0 0 9px rgba(70, 153, 202, .12),
        0 16px 28px rgba(32, 105, 151, .3);
    offset-path: polygon(50% 9%, 90.625% 86.8%, 9.375% 86.8%, 50% 9%);
    offset-distance: var(--orb-distance);
    offset-rotate: 0deg;
    transform: scale(var(--orb-scale));
    transition: box-shadow 420ms ease;
    will-change: offset-distance, transform;
}

.breath-orb::before,
.breath-orb::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    pointer-events: none;
}

.breath-orb::before {
    z-index: 2;
    background: radial-gradient(circle at 32% 23%, rgba(255, 255, 255, .95) 0 7%, rgba(255, 255, 255, .42) 8% 17%, transparent 30%);
}

.breath-orb::after {
    z-index: 1;
    background: radial-gradient(circle at 34% 28%, #ffd6dc 0 7%, #ff8294 28%, #e7556b 60%, #ae3045 82%, #771f30 100%);
    opacity: 0;
    transition: opacity 420ms ease;
}

.breath-visual[data-phase="hold"] .breath-orb {
    background: radial-gradient(circle at 34% 28%, #cdeeff 0 7%, #74bde7 28%, #398dc0 60%, #17628f 82%, #0d4568 100%);
    box-shadow:
        inset -7px -8px 12px rgba(6, 50, 78, .26),
        inset 6px 6px 10px rgba(255, 255, 255, .34),
        0 0 0 12px rgba(70, 153, 202, .11),
        0 18px 32px rgba(32, 105, 151, .3);
}

.breath-visual[data-phase="exhale"] .breath-orb {
    background: radial-gradient(circle at 34% 28%, #cdeeff 0 7%, #74bde7 28%, #398dc0 60%, #17628f 82%, #0d4568 100%);
    box-shadow:
        inset -7px -8px 12px rgba(102, 15, 34, .25),
        inset 6px 6px 10px rgba(255, 255, 255, .28),
        0 0 0 9px rgba(226, 85, 107, .12),
        0 16px 28px rgba(163, 41, 62, .28);
}

.breath-visual[data-phase="exhale"] .breath-orb::after {
    opacity: 1;
}

.breath-countdown {
    min-width: 24px;
    display: block;
    margin-top: 30px;
    color: color-mix(in srgb, var(--muted) 72%, transparent);
    font-size: 11px;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
}

.breathing-screen .screen-footer-action {
    min-height: 92px;
    display: grid;
    place-items: center;
    padding: 10px 20px calc(12px + var(--safe-bottom));
    border-top: 0;
    background: transparent;
}

.breath-control {
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
    border-radius: 50%;
    background: var(--surface);
    color: var(--ink);
    box-shadow: 0 12px 28px rgba(29, 37, 34, .12);
    cursor: pointer;
    transition: transform 120ms cubic-bezier(.23, 1, .32, 1), box-shadow 120ms ease, background-color 120ms ease;
}

.breath-control i {
    display: none;
}

.breath-control::before {
    content: '';
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 9px solid transparent;
    border-bottom: 9px solid transparent;
    border-left: 14px solid currentColor;
}

.breath-control[aria-label^="Pausar"]::before {
    width: 14px;
    height: 18px;
    margin-left: 0;
    border: 0;
    background: linear-gradient(90deg, currentColor 0 5px, transparent 5px 9px, currentColor 9px 14px);
}

.breath-control:active {
    transform: scale(.95);
    box-shadow: 0 6px 16px rgba(29, 37, 34, .1);
}

:root[data-theme="dark"] .breathing-screen {
    background:
        radial-gradient(circle at 50% 44%, rgba(72, 110, 126, .13) 0, transparent 48%),
        var(--paper);
}

:root[data-theme="dark"] .breath-track {
    stroke: rgba(255, 255, 255, .88);
}

:root[data-theme="dark"] .breath-control {
    border-color: rgba(255, 255, 255, .1);
    background: #f4f5f4;
    color: #1d2522;
}

/* Progress and profile use inset groups familiar on mobile. */
.progress-summary {
    gap: 10px;
    margin-bottom: 16px;
    padding: 0;
    border: 0;
}

.progress-intro {
    margin: -12px 0 18px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.progress-summary article {
    min-width: 0;
    padding: 13px 11px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.progress-summary article:first-child,
.progress-summary article:last-child {
    padding-inline: 11px;
}

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

.mood-chart {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-card);
}

.pattern-section article {
    min-height: 66px;
    padding: 12px 0;
}

.profile-screen .screen-content {
    padding-top: 18px;
}

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

.profile-avatar {
    width: 64px;
    height: 64px;
    border: 1px solid var(--line);
    background-color: var(--surface);
}

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

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

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

.profile-section button {
    min-height: 56px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 0;
    background: var(--surface);
}

.profile-section button + button {
    margin-top: -1px;
}

.profile-section button:first-of-type {
    border-radius: var(--radius-md) var(--radius-md) 0 0;
}

.profile-section button:last-of-type {
    border-radius: 0 0 var(--radius-md) var(--radius-md);
}

.profile-section button:only-of-type {
    border-radius: var(--radius-md);
}

/* Authentication and onboarding retain their exact sequence. */
.auth-card,
.onboarding-step {
    border-color: var(--line);
}

.app-input {
    min-height: 52px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
}

.question-row,
.onboarding-choice-grid button,
.support-grid button,
.avatar-option {
    min-height: 52px;
    border-radius: var(--radius-md);
}

.onboarding-screen,
.onboarding-step {
    overflow-x: hidden;
}

.onboarding-step {
    transform: none;
}

.onboarding-step:is(
    [data-onboarding-step="2"],
    [data-onboarding-step="4"],
    [data-onboarding-step="5"],
    [data-onboarding-step="6"],
    [data-onboarding-step="7"]
) > h1 {
    font-size: clamp(26px, 7.2vw, 28px);
    line-height: 1.1;
    text-wrap: balance;
}

.onboarding-step:is(
    [data-onboarding-step="4"],
    [data-onboarding-step="5"]
) .onboarding-progress {
    margin-bottom: 18px;
}

.onboarding-step:is(
    [data-onboarding-step="4"],
    [data-onboarding-step="5"]
) .onboarding-visual {
    margin-bottom: 16px;
}

.onboarding-step:is(
    [data-onboarding-step="4"],
    [data-onboarding-step="5"]
) > .lead {
    margin-bottom: 16px;
}

.onboarding-step.is-active {
    animation: onboarding-redesign-in 240ms cubic-bezier(.23, 1, .32, 1) both;
}

@keyframes onboarding-redesign-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Deliberate motion: feedback only, short and cancellable. */
.icon-button,
.avatar-button,
.primary-action,
.secondary-action,
.pet-home-card,
.tool-card,
.pet-actions button,
.profile-section button,
.bottom-nav button,
.calendar-day {
    transition: transform 120ms cubic-bezier(.23, 1, .32, 1), background-color 120ms ease, border-color 120ms ease, color 120ms ease, box-shadow 120ms ease;
}

@media (hover: hover) {
    .tool-grid .tool-card:hover,
    .pet-home-card:hover,
    .profile-section button:hover {
        border-color: color-mix(in srgb, var(--coral) 20%, var(--line));
        background: color-mix(in srgb, var(--surface) 92%, var(--coral-soft));
    }
}

:root[data-theme="dark"] .app-header,
:root[data-theme="dark"] .bottom-nav,
:root[data-theme="dark"] .home-cta {
    background: color-mix(in srgb, var(--paper) 90%, transparent);
}

:root[data-theme="dark"] .calendar,
:root[data-theme="dark"] .pet-home-card,
:root[data-theme="dark"] .tool-grid .tool-card,
:root[data-theme="dark"] .progress-summary article,
:root[data-theme="dark"] .mood-chart,
:root[data-theme="dark"] .profile-section button,
:root[data-theme="dark"] .pet-streak-card,
:root[data-theme="dark"] .pet-care-panel,
:root[data-theme="dark"] .pet-customizer,
:root[data-theme="dark"] .pet-meters .bond-meter,
:root[data-theme="dark"] .pet-meters .xp-meter,
:root[data-theme="dark"] .energy-workspace,
:root[data-theme="dark"] .journal-field,
:root[data-theme="dark"] .emotion-prompt,
:root[data-theme="dark"] .ai-reading,
:root[data-theme="dark"] .tips-section,
:root[data-theme="dark"] .tool-session-card {
    border-color: var(--line);
    background: var(--surface);
}

:root[data-theme="dark"] .pet-home-card:active,
:root[data-theme="dark"] .tool-grid .tool-card:active {
    background: color-mix(in srgb, var(--surface) 82%, var(--mint-soft));
}

@media (max-width: 560px) {
    body {
        background: var(--paper);
    }

    .app-shell {
        height: 100dvh;
        border-radius: 0;
    }
}

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

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

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

    .home-kicker {
        margin-bottom: 3px;
    }

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

    .calendar {
        padding: 6px 8px;
    }

    .calendar-day {
        height: 36px;
        min-width: 36px;
        margin-inline: 2px;
    }

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

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

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

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

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

    .breathing-content {
        padding-top: 8px;
    }

    .breath-visual {
        width: min(258px, 74vw);
    }

    .breath-phase-word {
        margin-bottom: 22px;
        font-size: 28px;
    }

    .breath-countdown {
        margin-top: 20px;
    }
}

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

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

    .calendar {
        margin-inline: -2px;
        padding-inline: 5px;
    }

    .calendar-day {
        min-width: 34px;
        margin-inline: 1px;
    }

    .pet-home-card {
        grid-template-columns: 46px minmax(0, 1fr) auto 14px;
        padding-inline: 9px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .screen.is-active.is-tab-transition,
    .screen.is-leaving.is-tab-transition {
        animation: none;
    }

    .breath-phase-word,
    .breath-orb,
    .breath-orb::after {
        transition: none;
    }
}
