:root {
    --bg: #f6f3eb;
    --bg-deep: #efe8d8;
    --ink: #1a2230;
    --muted: #627082;
    --line: rgba(26, 34, 48, 0.1);
    --line-strong: rgba(26, 34, 48, 0.16);
    --panel: rgba(255, 255, 255, 0.78);
    --panel-strong: rgba(255, 255, 255, 0.92);
    --accent: #0f766e;
    --accent-deep: #115e59;
    --accent-soft: #d7f3ee;
    --coral: #f97360;
    --gold: #e5a93d;
    --sky: #73b8ff;
    --sage: #7fb48b;
    --danger: #b24747;
    --shadow-lg: 0 28px 70px rgba(26, 34, 48, 0.16);
    --shadow-md: 0 18px 40px rgba(26, 34, 48, 0.1);
    --radius-xl: 32px;
    --radius-lg: 24px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

* {
    box-sizing: border-box;
}

body.wellness-body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(115, 184, 255, 0.25), transparent 28%),
        radial-gradient(circle at top right, rgba(249, 115, 96, 0.15), transparent 24%),
        linear-gradient(180deg, #fbfaf7 0%, var(--bg) 48%, var(--bg-deep) 100%);
}

.wellness-shell {
    width: min(1440px, calc(100% - 28px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.flash-banner {
    margin: 0 0 18px;
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid var(--line);
    font: 700 0.95rem/1.4 "Segoe UI", Arial, sans-serif;
    backdrop-filter: blur(18px);
}

.flash-banner.success {
    background: rgba(15, 118, 110, 0.12);
    color: var(--accent-deep);
}

.flash-banner.error {
    background: rgba(178, 71, 71, 0.12);
    color: var(--danger);
}

.flash-banner.info {
    background: rgba(26, 34, 48, 0.08);
    color: var(--ink);
}

.wellness-hero,
.panel,
.summary-card {
    border: 1px solid var(--line);
    background: var(--panel);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(18px);
}

.wellness-hero {
    position: relative;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 26px;
    padding: 34px;
    border-radius: var(--radius-xl);
    margin-bottom: 24px;
}

.wellness-hero::before {
    content: "";
    position: absolute;
    inset: auto -4% -30% auto;
    width: 320px;
    height: 320px;
    border-radius: 999px;
    background: radial-gradient(circle, rgba(15, 118, 110, 0.12), transparent 70%);
    pointer-events: none;
}

.eyebrow,
.card-label,
.summary-label {
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font: 700 0.72rem/1.3 "Segoe UI", Arial, sans-serif;
    color: var(--muted);
}

h1,
h2,
h3 {
    margin: 0;
}

h1 {
    max-width: 11ch;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    font-size: clamp(2.8rem, 5vw, 5.1rem);
    line-height: 0.96;
    letter-spacing: -0.04em;
}

h2 {
    font-size: clamp(1.4rem, 1.7vw, 2rem);
    line-height: 1.05;
    letter-spacing: -0.03em;
}

.lead {
    max-width: 64ch;
    margin-top: 16px;
    color: var(--muted);
    font-size: 1.03rem;
    line-height: 1.7;
}

.muted,
label,
input,
textarea,
select,
button {
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

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

.small {
    font-size: 0.92rem;
}

.hero-feature-list,
.hero-actions,
.metric-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.hero-feature-list {
    margin-top: 22px;
}

.hero-actions {
    margin-top: 22px;
}

.feature-chip,
.metric-chip,
.profile-pill,
button {
    border-radius: 999px;
    font-weight: 700;
}

.feature-chip,
.metric-chip {
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(26, 34, 48, 0.08);
    color: var(--ink);
    font-size: 0.88rem;
}

.inline-form {
    margin: 0;
}

.inline-form button {
    height: 100%;
}

.profile-pill,
button {
    border: 0;
    padding: 12px 16px;
    text-decoration: none;
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

button:hover,
.profile-pill:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 28px rgba(15, 118, 110, 0.22);
}

.profile-pill {
    background: rgba(255, 255, 255, 0.78);
    color: var(--accent-deep);
    border: 1px solid rgba(15, 118, 110, 0.1);
    box-shadow: none;
}

.profile-pill.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-deep));
    color: #fff;
    box-shadow: 0 12px 26px rgba(15, 118, 110, 0.22);
}

.hero-card {
    padding: 24px;
    border-radius: 26px;
    background: var(--panel-strong);
    border: 1px solid rgba(255, 255, 255, 0.8);
}

.hero-card.glass {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(255, 255, 255, 0.68));
}

.hero-score {
    align-self: stretch;
    display: grid;
    gap: 14px;
}

.hero-score-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.hero-score-grid div {
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 118, 110, 0.06);
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.hero-score-grid span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.hero-score-grid strong {
    display: block;
    margin-top: 6px;
    font-size: 1.35rem;
}

.login-hero {
    align-items: start;
}

.login-grid {
    display: grid;
    gap: 14px;
}

.login-card,
.password-card,
.summary-card,
.consistency-card {
    border-radius: 22px;
}

.login-card,
.password-card {
    padding: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.74);
}

.password-card {
    margin-bottom: 8px;
}

.summary-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.section-nav {
    position: sticky;
    top: 12px;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 24px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(18px);
    box-shadow: var(--shadow-md);
}

.section-nav a {
    padding: 10px 14px;
    border-radius: 999px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 700;
}

.section-nav a:hover {
    background: rgba(15, 118, 110, 0.08);
    color: var(--accent-deep);
}

.summary-card {
    padding: 22px;
    border-radius: 24px;
    position: relative;
    overflow: hidden;
}

.summary-card::after {
    content: "";
    position: absolute;
    inset: auto -24px -24px auto;
    width: 120px;
    height: 120px;
    border-radius: 999px;
    opacity: 0.22;
}

.summary-card h2 {
    margin-top: 4px;
    font-size: clamp(1.45rem, 2.2vw, 2.2rem);
}

.summary-meta {
    margin: 12px 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.accent-sage::after {
    background: var(--sage);
}

.accent-coral::after {
    background: var(--coral);
}

.accent-sky::after {
    background: var(--sky);
}

.accent-gold::after {
    background: var(--gold);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.dashboard-grid-top {
    align-items: stretch;
}

.panel {
    padding: 28px;
    border-radius: var(--radius-xl);
}

.panel-span-4 {
    grid-column: span 4;
}

.panel-span-6 {
    grid-column: span 6;
}

.panel-span-8 {
    grid-column: span 8;
}

.panel-span-12 {
    grid-column: span 12;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

.analytics-panel .panel-head {
    margin-bottom: 16px;
}

.goal-rings {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
}

.goal-card {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid rgba(15, 118, 110, 0.08);
    text-align: center;
}

.goal-ring {
    width: 142px;
    height: 142px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background:
        conic-gradient(var(--accent) 0 var(--goal-deg), rgba(15, 118, 110, 0.1) var(--goal-deg) 360deg);
}

.goal-ring-inner {
    width: 104px;
    height: 104px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: inset 0 0 0 1px rgba(15, 118, 110, 0.06);
}

.goal-ring-inner strong {
    font-size: 1.5rem;
    line-height: 1;
}

.goal-ring-inner span {
    color: var(--muted);
    font-size: 0.8rem;
    margin-top: -6px;
}

.goal-card h3 {
    font-size: 1rem;
}

.goal-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.macro-stack {
    display: grid;
    gap: 16px;
}

.macro-row {
    display: grid;
    gap: 8px;
}

.macro-label-line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 0.94rem;
}

.macro-bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(26, 34, 48, 0.08);
    overflow: hidden;
}

.macro-fill {
    height: 100%;
    border-radius: inherit;
}

.macro-fill.protein {
    background: linear-gradient(90deg, #0f766e, #14b8a6);
}

.macro-fill.carbs {
    background: linear-gradient(90deg, #73b8ff, #3b82f6);
}

.macro-fill.fat {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.metric-chips {
    margin-top: 18px;
}

.chart-svg {
    width: 100%;
    display: block;
}

.chart-grid {
    stroke: rgba(26, 34, 48, 0.08);
    stroke-width: 1;
}

.chart-axis {
    fill: var(--muted);
    font-size: 12px;
    text-anchor: middle;
}

.chart-bar {
    fill: rgba(15, 118, 110, 0.78);
}

.consistency-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.consistency-card {
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(241, 248, 246, 0.92));
    border: 1px solid rgba(15, 118, 110, 0.08);
}

.consistency-card strong {
    display: block;
    font-size: 1.9rem;
    line-height: 1;
}

.consistency-card span {
    display: block;
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.5;
}

.empty-state {
    padding: 30px 0;
}

.stack {
    display: grid;
    gap: 14px;
}

.field-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.field-grid.four-up {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
}

input,
textarea,
select {
    width: 100%;
    padding: 13px 14px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font-size: 1rem;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: rgba(15, 118, 110, 0.42);
    box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.08);
    background: #fff;
}

textarea {
    resize: vertical;
}

.search-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    margin-bottom: 16px;
}

.food-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}

.quick-food-sections {
    display: grid;
    gap: 14px;
    margin-bottom: 12px;
}

.quick-food-block {
    padding: 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.56);
    border: 1px solid var(--line);
}

.compact-results {
    margin-bottom: 0;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.food-result-card {
    display: grid;
    gap: 6px;
    padding: 16px;
    text-align: left;
    background: rgba(255, 255, 255, 0.82);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: none;
}

.quick-food-card {
    min-height: 86px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    padding: 0;
}

.history-list,
.mini-list,
.photo-grid {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.history-card,
.mini-item,
.photo-card {
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.72);
}

.history-card {
    padding: 18px;
}

.history-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
}

.history-title {
    margin: 0;
    font-size: 1.08rem;
    font-weight: 700;
}

.macro-pill {
    margin: 0;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(15, 118, 110, 0.12);
    color: var(--accent-deep);
    font: 700 0.85rem/1 "Segoe UI", Arial, sans-serif;
}

.coach-note {
    margin-top: 14px;
    padding: 14px;
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: rgba(15, 118, 110, 0.08);
    line-height: 1.6;
}

.mini-item {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px;
    font: 600 0.95rem/1.5 "Segoe UI", Arial, sans-serif;
}

.mini-item.column {
    display: grid;
}

.photo-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.photo-card {
    overflow: hidden;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    display: block;
}

.photo-card figcaption {
    padding: 12px 14px 16px;
    color: var(--muted);
    font: 600 0.88rem/1.5 "Segoe UI", Arial, sans-serif;
}

.status-line {
    min-height: 1.2rem;
    font: 600 0.9rem/1.4 "Segoe UI", Arial, sans-serif;
    color: var(--muted);
}

.status-line.ok {
    color: var(--accent-deep);
}

.status-line.error {
    color: var(--danger);
}

.email-actions {
    display: grid;
    gap: 12px;
    margin-top: 18px;
}

.inline-action {
    display: flex;
}

@media (max-width: 1180px) {
    .wellness-hero,
    .summary-strip,
    .goal-rings,
    .hero-score-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-strip {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel-span-8,
    .panel-span-6,
    .panel-span-4 {
        grid-column: span 12;
    }
}

@media (max-width: 880px) {
    .wellness-shell {
        width: min(100%, calc(100% - 18px));
    }

    .wellness-hero,
    .summary-strip,
    .goal-rings,
    .hero-score-grid,
    .field-grid,
    .field-grid.four-up,
    .consistency-grid {
        grid-template-columns: 1fr;
    }

    .wellness-hero,
    .panel,
    .summary-card {
        border-radius: 24px;
    }

    .wellness-hero,
    .panel {
        padding: 22px;
    }

    .search-row {
        grid-template-columns: 1fr;
    }

    .section-nav {
        position: static;
        border-radius: 24px;
    }

    h1 {
        max-width: none;
        font-size: clamp(2.4rem, 10vw, 3.8rem);
    }
}
