/* Tactile Doncs: ivory surfaces, coral actions, quiet supporting controls. */
:root {
    --paper: #f7f6f2;
    --ink: #252b28;
    --muted: #69716b;
    --line: #e5e5de;
    --coral: #d74c66;
    --coral-soft: #fbe8ec;
    --body-light: #fffdf4;
    --body-edge: #d9d8c9;
    --shadow-card: 0 2px 8px rgba(43, 45, 35, .035);
    --radius-sm: 12px;
    --radius-md: 16px;
    --radius-lg: 24px;
}
:root[data-theme="dark"] {
    --paper: #191c1a;
    --surface: #232724;
    --ink: #f5f4ee;
    --muted: #afb4ad;
    --line: #383d37;
    --coral: #fa91a3;
    --coral-soft: #432b31;
    --body-light: #a6ad9d;
    --body-edge: #657361;
    --shadow-card: 0 2px 8px rgba(0, 0, 0, .08);
}
.primary-action { box-shadow: none; }
:root[data-theme="dark"] .primary-action { color: #351820; }
.app-header, .bottom-nav, .home-cta { border-color: transparent; }
.home-greeting { position: relative; padding-top: 0; }
.home-greeting h1 { margin-top: 12px; font-size: 26px; line-height: 1.2; }
.home-kicker { color: var(--muted); font-weight: 500; }
.home-kicker i { display: none; }
.streak-pill { background: transparent; border: 0; color: var(--muted); font-size: 11px; min-height: 28px; padding: 4px 0; }
.streak-pill i { color: var(--muted); font-size: 15px; }
.month-toolbar h2 { font-size: 19px; }
.calendar { border: 0; padding: 12px 6px; box-shadow: none; border-radius: 24px; }
.calendar-grid { grid-template-rows: repeat(var(--calendar-weeks, 5), minmax(44px, 1fr)); gap: 3px 0; }
.calendar-day { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 2px; min-height: 44px; font-variant-numeric: tabular-nums; border-radius: 14px; }
.calendar-day.completed { background: transparent; }
.calendar-day.completed::before { display: none; }
.calendar-emotion { display: grid; place-items: center; width: 20px; height: 18px; border-radius: 7px; background: var(--day-color); color: #344138; font-size: 13px; line-height: 1; }
.calendar-day.today { box-shadow: inset 0 0 0 1.5px var(--coral); background: var(--coral-soft); }
.calendar-day.outside { opacity: .45; }
.pet-home-card { border: 0; background: var(--surface); box-shadow: none; border-radius: 24px; }
.pet-home-avatar { width: 52px; height: 52px; border: 0; background-color: var(--mint-soft); box-shadow: none; }
.pet-home-card small, .pet-home-card em { color: var(--muted); font-size: 11px; }
.pet-home-streak { background: transparent; color: var(--muted); min-width: 30px; padding: 4px; }
.home-cta { background: var(--paper); }
.checkin-action { border-radius: 20px; }

/* Pet content order is also the reading and keyboard order in the markup. */
.pet-heading { margin-bottom: 16px; }
.pet-heading h1 { font-size: 27px; }
.pet-heading .eyebrow { font-size: 11px; color: var(--muted); margin-bottom: 8px; }
.pet-heading .lead { font-size: 13px; }
.pet-customize-button { min-height: 44px; padding: 8px 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 16px; box-shadow: none; }
.pet-stage { min-height: 300px; margin-top: 0; border: 0; border-radius: 32px; background: linear-gradient(180deg, #f1ece0 0 74%, #e0d8c7 74%); box-shadow: inset 0 1px 3px #fff8; }
.pet-stage::before { width: 74px; height: 116px; left: 20px; top: 16px; border: 0; border-radius: 44px 44px 20px 20px; background: #fffcf080; box-shadow: inset 0 0 20px #c8c5b033; transform: none; }
.pet-stage::after { top: 22px; right: 24px; width: 40px; height: 40px; border: 0; background: #dfc591; box-shadow: inset 3px 3px 6px #f8edc8, 0 6px 14px #aa956322; }
.pet-stage[data-room="garden"] { background: linear-gradient(180deg, #e7eee1 0 74%, #cbd9ba 74%); }
.pet-stage[data-room="night"] { background: linear-gradient(180deg, #303c43 0 74%, #263139 74%); }
.pet-stage[data-room="night"]::after { background: #f3e5bf; box-shadow: -9px -3px 0 1px #303c43; }
.pet-stage-prop { opacity: .25; color: #6c785f; }
.pet-stage-prop i { font-size: 28px; }
.pet-shadow { height: 20px; width: 140px; bottom: 20px; background: #776c5840; filter: blur(8px); }
.pet-large-avatar { width: 210px; height: 210px; filter: drop-shadow(0 5px 8px #6d68441a); }
.pet-speech { border: 0; border-radius: 20px 20px 20px 6px; box-shadow: 0 4px 12px #24291e06; font-size: 12px; max-width: 68%; }
.pet-accessory { width: 36px; height: 36px; top: 86px; border: 0; border-radius: 50%; box-shadow: inset 0 2px 3px #fff8, 0 3px 7px #66543f18; }
.pet-accessory i { font-size: 20px; }
.pet-level-chip { border: 0; border-radius: 16px; box-shadow: none; }
.pet-care-panel, .pet-streak-card, .pet-meters > div { border: 0; box-shadow: none; border-radius: 24px; }
.pet-care-panel { margin-top: 16px; }
.pet-care-panel header > span { border: 0; box-shadow: none; background: var(--coral-soft); color: var(--coral); }
.pet-actions button { border: 1px solid var(--line); box-shadow: none; border-radius: 16px; }
.pet-streak-card { margin-top: 16px; color: var(--muted); }
.pet-streak-card header > span, .pet-streak-card header > span i, .pet-streak-card header em { color: var(--muted); font-size: 12px; }
.pet-streak-card p { font-size: 11px; font-weight: 500; color: var(--muted); }
.pet-week b { border: 1px solid var(--line); border-radius: 12px; }
.pet-meters { margin-top: 16px; }
:root[data-theme="dark"] .pet-stage:not([data-room="night"]) { background: linear-gradient(180deg, #384035 0 74%, #30372c 74%); box-shadow: none; }
:root[data-theme="dark"] .pet-stage::before { background: #b1b59a12; }

/* A material battery, with one continuous fill and subtle segment markers. */
.energy-workspace { border: 0; background: transparent; box-shadow: none; }
.battery-body { position: relative; isolation: isolate; overflow: hidden; padding: 10px; gap: 4px; border: 1px solid var(--line); border-radius: 30px; background: color-mix(in srgb, var(--surface) 80%, var(--line)); box-shadow: inset 5px 5px 12px #ffffff80, inset -5px -5px 14px #52594715, 0 14px 24px #30372b0d; }
.battery-body::before { content: ''; position: absolute; z-index: -1; inset: 9px; border-radius: 22px; background: linear-gradient(90deg, color-mix(in srgb, var(--energy-color) 60%, white), var(--energy-color) 55%, color-mix(in srgb, var(--energy-color) 85%, #37433a)); transform: scaleY(var(--energy-fill, .6)); transform-origin: bottom; transition: transform 120ms ease-out, background 180ms ease-out; }
.battery-body::after { content: ''; position: absolute; left: 17px; top: 14px; bottom: 14px; width: 12%; border-radius: 20px; background: linear-gradient(90deg, #ffffff66, #ffffff00); pointer-events: none; }
.battery-body .battery-segment, .battery-body .battery-segment.filled { flex: 1; border-radius: 0; background: transparent; border-bottom: 1px solid color-mix(in srgb, var(--surface) 35%, transparent); animation: none; }
.battery-tip { top: -12px; width: 60px; height: 16px; border: 0; background: var(--line); border-radius: 8px 8px 0 0; box-shadow: inset 0 2px 3px #ffffff80; }
.paint-cursor { box-shadow: none; border-color: var(--line); }
:root[data-theme="dark"] .battery-body { background: #333a32; box-shadow: inset 3px 3px 8px #ffffff08, inset -4px -4px 12px #0003, 0 10px 25px #0002; }

.tools-screen h1 { font-size: 28px; margin-bottom: 20px; }
.featured-tool { min-height: 84px; border: 0; border-radius: 24px; }
.wellness-filters, .wellness-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.wellness-filters { margin: 24px 0 16px; }
.wellness-filters button, .wellness-chips button { min-height: 44px; padding: 9px 13px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; line-height: 1.3; }
.wellness-filters [aria-pressed="true"], .wellness-chips [aria-pressed="true"] { border-color: var(--coral); background: var(--coral-soft); color: var(--coral); }
.tool-section-heading { margin-top: 20px; }
.tool-grid .tool-card { min-height: 78px; border: 0; border-radius: 20px; box-shadow: none; }
.tool-grid .tool-card strong { font-size: 15px; line-height: 1.35; }
.tool-grid .tool-card em { font-size: 11px; line-height: 1.5; }
.tool-grid .tool-illustration { width: 44px; height: 44px; border-radius: 16px; background: var(--paper); color: var(--muted); }
.tool-grid .tool-illustration i { font-size: 22px; }
.progress-summary article, .mood-chart { border: 0; box-shadow: none; }
.progress-summary article + article { border-left: 0; }
.mood-chart header strong { font-size: 15px; }
.mood-chart header { gap: 12px; }
.chart-legend { flex-shrink: 0; font-variant-numeric: tabular-nums; }
.bar-chart { padding-top: 32px; }
.chart-bar { position: relative; }
.chart-bar > i { display: flex; justify-content: center; padding-top: 6px; color: #163d30; font-size: 11px; font-style: normal; font-weight: 700; }
.chart-bar.is-missing > i { min-height: 0; height: 3px; background: transparent; color: var(--muted); overflow: visible; padding: 0; line-height: 1; }
.chart-caption { color: var(--muted); font-size: 11px; line-height: 1.5; margin: 24px 0 0; }
.pattern-section h2 { font-size: 18px; }
.pattern-section article p { font-size: 12px; }

/* New tools share the structure and spacing of the approved reference board. */
.wellness-screen .screen-content { padding-top: 20px; padding-bottom: calc(32px + var(--safe-bottom)); }
.wellness-screen h1 { font-size: 27px; line-height: 1.18; margin: 0 0 8px; overflow-wrap: anywhere; }
.wellness-screen .lead { margin: 0 0 24px; font-size: 14px; }
.wellness-screen h2 { font-size: 17px; line-height: 1.4; margin: 0 0 14px; }
.wellness-card { padding: 20px; background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-card); }
.wellness-form { display: flex; flex-direction: column; gap: 10px; }
.wellness-form label { font-size: 13px; font-weight: 650; color: var(--ink); }
.wellness-form label:not(:first-child) { margin-top: 6px; }
.wellness-form .app-input { width: 100%; min-width: 0; max-width: 100%; min-height: 52px; padding: 14px; font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: 16px; box-sizing: border-box; }
.wellness-form textarea { resize: vertical; }
.wellness-form input[type="datetime-local"] { appearance: none; color-scheme: light; }
:root[data-theme="dark"] .wellness-form input[type="datetime-local"] { color-scheme: dark; }
.wellness-form .primary-action { margin-top: 8px; }
.wellness-hint, .wellness-empty { color: var(--muted); font-size: 12px; line-height: 1.6; }
.wellness-hint { margin: 0; }
.wellness-empty { margin: 0; padding: 16px; border: 1px dashed var(--line); border-radius: 16px; }
.wellness-error { margin: 0; font-size: 13px; line-height: 1.5; color: var(--coral); }
.wellness-feedback { color: var(--mint); font-size: 13px; line-height: 1.5; margin: 12px 0 0; }
.wellness-feedback:empty { display: none; }
.wellness-history { margin-top: 28px; }
.wellness-history h2 { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.wellness-history h2 > span { color: var(--muted); font-size: 13px; font-weight: 500; }
.wellness-record { width: 100%; min-width: 0; margin-bottom: 10px; padding: 16px; text-align: left; border: 0; border-radius: 20px; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); }
.wellness-record p { margin: 6px 0 0; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-wrap; }
.wellness-record small { color: var(--muted); font-size: 11px; line-height: 1.5; }
.wellness-record strong { font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.record-copy { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.wellness-screen .text-action { min-height: 44px; font-size: 13px; padding: 8px 10px; color: var(--coral); text-decoration: none; }
.wellness-motif { position: relative; isolation: isolate; display: grid; place-items: center; width: 144px; height: 120px; margin: 0 auto 16px; }
.wellness-motif::before { position: absolute; z-index: -1; content: ''; width: 108px; height: 92px; background: var(--mint-soft); border-radius: 55% 42% 48% 38%; transform: rotate(-14deg); }
.wellness-motif > i { font-size: 64px; color: var(--mint); font-weight: 400; }
.envelope-motif { height: 96px; margin: -4px auto 16px; }
.envelope-motif > i { color: var(--ink); font-size: 60px; }
.envelope-motif::before { width: 128px; height: 72px; }
.wellness-review-actions { display: flex; flex-direction: column; gap: 8px; }
.wellness-review-actions .secondary-action { width: 100%; font-size: 13px; }
.worry-row { display: flex; align-items: center; gap: 12px; }
.worry-row > i { color: var(--muted); font-size: 22px; flex: 0 0 auto; }
.worry-row .record-copy strong { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
.wellness-archive { margin-top: 20px; }
.wellness-archive summary, .refuge-picker summary { min-height: 44px; padding: 12px 4px; font-size: 13px; color: var(--muted); cursor: pointer; }
.wellness-archive > div { padding-top: 12px; }
.body-map-stage { position: relative; width: 220px; height: 320px; margin: -8px auto 16px; isolation: isolate; }
.body-map-stage::before { content: ''; position: absolute; z-index: -1; width: 200px; height: 142px; top: 90px; left: 10px; background: var(--mint-soft); border-radius: 58% 38% 54% 36%; transform: rotate(-32deg); }
.body-silhouette { display: block; width: 100%; height: 100%; overflow: visible; fill: url(#body-material); filter: drop-shadow(2px 4px 3px #42482f12); }
.body-point { position: absolute; left: var(--x); top: var(--y); width: 44px; height: 44px; min-width: 44px; min-height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; border-radius: 50%; transform: translate(-50%, -50%); }
.body-point span { width: 14px; height: 14px; border: 1.5px solid var(--coral); background: var(--surface); border-radius: 50%; transition: box-shadow 140ms ease-out, background 140ms ease-out; }
.body-point[aria-pressed="true"] span { background: var(--coral); box-shadow: 0 0 0 5px var(--coral-soft); }
.body-point.is-current span { box-shadow: 0 0 0 5px var(--coral-soft), 0 0 0 6px var(--coral); }
.body-zone-labels { justify-content: center; gap: 4px; margin-bottom: 16px; }
.body-zone-labels button { flex: 1 1 28%; padding-inline: 6px; font-size: 11px; }
.body-intensity { padding: 16px; }
.body-intensity label { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.body-intensity label span { color: var(--muted); font-variant-numeric: tabular-nums; }
.body-intensity input[type="range"] { width: 100%; min-height: 44px; accent-color: var(--coral); margin: 0; }
.range-ends { display: flex; justify-content: space-between; color: var(--muted); font-size: 10px; }
.body-intensity .text-action { display: block; width: 100%; margin-top: 4px; }
.wellness-save { width: 100%; margin-top: 16px; }
.wellness-screen button:disabled { opacity: .42; cursor: not-allowed; box-shadow: none; }
.step-categories { flex-wrap: nowrap; margin-bottom: 20px; gap: 6px; }
.step-categories button { flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px; padding: 10px 7px; font-size: 11px; }
.step-categories i { font-size: 17px; }
.step-idea { text-align: center; margin-bottom: 24px; }
.step-idea h2 { margin: 0 0 8px; }
.step-idea p { margin: 0 0 16px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.step-idea .secondary-action { width: 100%; min-height: 44px; font-size: 12px; gap: 8px; }
.step-record { display: flex; align-items: center; gap: 10px; padding-left: 10px; }
.step-checkbox { flex: 0 0 44px; width: 44px; height: 44px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); font-size: 23px; border-radius: 16px; }
.step-checkbox[aria-checked="true"] { background: var(--mint-soft); color: var(--mint); }
.step-record.is-done strong { text-decoration: line-through; color: var(--muted); }
.favorite-record { display: flex; align-items: center; gap: 12px; min-height: 72px; }
.favorite-record > i:first-child { width: 42px; height: 42px; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); border-radius: 16px; font-size: 22px; }
.favorite-record strong { flex: 1; }
.favorite-record > i:last-child { font-size: 18px; color: var(--muted); }
.refuge-picker { margin-top: 4px; }
.refuge-picker summary { color: var(--coral); }
.refuge-favorite-options { padding: 8px 0; }
.favorite-option { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 48px; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); font-size: 13px; text-align: left; }
.favorite-option i { font-size: 19px; color: var(--muted); }
.favorite-option[aria-pressed="true"] i { color: var(--coral); }
.refuge-record { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 12px; }
.refuge-record.is-note { background: color-mix(in srgb, var(--surface) 55%, var(--sun-soft)); }
.refuge-kind-label { text-transform: uppercase; letter-spacing: .06em; font-size: 9px !important; }
.refuge-record .record-copy { flex-basis: calc(100% - 60px); }
.person-initial { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--mint-soft); color: var(--mint); font-size: 18px; }
.refuge-record-actions { display: flex; gap: 8px; width: 100%; justify-content: flex-end; }
.refuge-record-actions .text-action { display: inline-flex; align-items: center; justify-content: center; margin: 0; width: auto; min-width: 44px; color: var(--muted); font-size: 12px; }
.refuge-add { margin-top: 24px; width: 100%; color: var(--coral); }
.refuge-screen .wellness-form { margin-top: 20px; padding: 16px; }
.refuge-phone { display: flex; flex-direction: column; gap: 10px; }

.day-dialog { inset: auto 0 0; margin: 0 auto; width: min(440px, 100%); max-width: 100%; max-height: min(80dvh, 680px); padding: 12px 24px calc(24px + env(safe-area-inset-bottom, 0px)); border: 0; border-radius: 28px 28px 0 0; background: var(--surface); color: var(--ink); box-shadow: 0 -12px 48px #0002; overflow-y: auto; overscroll-behavior: contain; }
.day-dialog[open] { animation: day-open 220ms cubic-bezier(.23, 1, .32, 1); }
.day-dialog::backdrop { background: #18221b66; backdrop-filter: blur(3px); }
.day-dialog-handle { width: 36px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 12px; }
.day-dialog header { display: flex; align-items: center; justify-content: space-between; }
.day-dialog header p { margin: 0; }
.day-dialog h2 { font-size: 24px; line-height: 1.3; margin: 12px 0 20px; text-transform: capitalize; }
.day-dialog-summary { display: flex; gap: 8px; flex-wrap: wrap; }
.day-dialog-summary > span { padding: 10px 12px; border-radius: 12px; background: var(--paper); font-size: 13px; }
.day-dialog-story { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.7; margin: 20px 0; }
.day-emotions { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 24px; }
.day-emotions span { padding: 6px 10px; border-radius: 10px; background: var(--mint-soft); color: var(--ink); font-size: 12px; }
.day-dialog > .secondary-action { width: 100%; }
@keyframes day-open { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 380px) {
    .wellness-screen h1 { font-size: 25px; }
    .wellness-filters button { padding-inline: 10px; font-size: 11px; }
    .header-context-title { font-size: 14px; }
    .body-map-stage { height: 280px; width: 200px; }
    .pet-stage { min-height: 280px; }
}
@media (prefers-reduced-motion: reduce) {
    .day-dialog[open] { animation: none; }
    .battery-body::before, .body-point span { transition: none; }
    .wellness-screen *, .wellness-screen *::before { scroll-behavior: auto !important; }
}
