:root {
    --mood-ink: #24352f;
    --mood-muted: #6f7c73;
    --mood-green: #3e6b55;
    --mood-deep: #294b3b;
    --mood-lime: #d4df9f;
    --mood-line: #dce5dc;
    --mood-paper: #f5f7f0;
    --mood-white: #fffefa;
    --mood-warm: #c9825b;
}

body.ar-mood-page {
    background: var(--mood-paper);
    color: var(--mood-ink);
}

.mood-page {
    min-height: calc(100vh - 90px);
    padding: 132px 20px 70px;
    background-image: radial-gradient(ellipse at 8% 12%, rgba(212, 223, 159, .32), transparent 34%), radial-gradient(ellipse at 93% 34%, rgba(206, 222, 211, .55), transparent 30%);
}

.mood-intro,
.scan-steps,
.step-panel,
.app-message {
    width: min(100%, 860px);
    margin-left: auto;
    margin-right: auto;
}

.mood-intro {
    text-align: center;
    margin-bottom: 30px;
    animation: mood-rise .55s ease both;
}

.mood-intro-mark {
    display: grid;
    width: 46px;
    height: 46px;
    margin: 0 auto 15px;
    place-items: center;
    color: var(--mood-deep);
    background: var(--mood-lime);
    border-radius: 50%;
    font-size: 18px;
}

.eyebrow {
    margin: 0 0 8px;
    color: var(--mood-green);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.2px;
}

.mood-intro h1,
.panel-heading h2,
.results-header h2 {
    margin: 0;
    color: var(--mood-ink);
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
}

.mood-intro h1 {
    font-size: clamp(36px, 8vw, 54px);
    line-height: 1.1;
}

.intro-copy {
    max-width: 500px;
    margin: 12px auto 0;
    color: var(--mood-muted);
    font-size: 15px;
    line-height: 1.65;
}

.scan-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 13px;
    margin-bottom: 24px;
}

.scan-step {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #9aa59b;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.scan-step span:first-child {
    display: grid;
    width: 26px;
    height: 26px;
    place-items: center;
    border: 1px solid #d4ddd4;
    border-radius: 50%;
    font-size: 10px;
}

.scan-step.is-current,
.scan-step.is-complete {
    color: var(--mood-deep);
}

.scan-step.is-current span:first-child,
.scan-step.is-complete span:first-child {
    color: #fff;
    background: var(--mood-green);
    border-color: var(--mood-green);
}

.step-rule {
    width: min(12vw, 72px);
    height: 1px;
    background: #d4ddd4;
}

.app-message {
    margin-bottom: 14px;
    padding: 12px 16px;
    color: #764c35;
    background: #fff1e7;
    border: 1px solid #efd1bc;
    border-radius: 5px;
    font-size: 13px;
}

.step-panel {
    padding: clamp(20px, 5vw, 38px);
    background: var(--mood-white);
    border: 1px solid rgba(56, 91, 68, .12);
    border-radius: 8px;
    box-shadow: 0 18px 55px rgba(44, 69, 51, .08);
    animation: mood-rise .4s ease both;
}

.panel-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 28px;
}

.panel-heading h2 {
    font-size: clamp(23px, 5vw, 30px);
    line-height: 1.25;
}

.onboarding-hint {
    margin: 8px 0 0;
    color: var(--mood-muted);
    font-size: 13px;
    line-height: 1.5;
}

.onboarding-progress {
    margin: 0 0 27px;
}

.onboarding-progress-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    color: var(--mood-muted);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .9px;
}

.onboarding-progress-track {
    height: 5px;
    overflow: hidden;
    background: #e9eee7;
    border-radius: 5px;
}

.onboarding-progress-track span {
    display: block;
    width: 10%;
    height: 100%;
    background: linear-gradient(90deg, #6c9274, #b4c68b);
    border-radius: inherit;
    transition: width .35s ease;
}

.onboarding-stage.is-active {
    animation: onboarding-enter .32s ease both;
}

.onboarding-navigation {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
}

.onboarding-navigation .start-button {
    width: auto;
    margin-left: auto;
}

.onboarding-shortcut {
    margin: 10px 0 0;
    color: #9aa49b;
    font-size: 10px;
    text-align: right;
}

.required-note,
.optional-note {
    color: #8b968d;
    font-size: 11px;
    white-space: nowrap;
}

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

.form-grid-narrow {
    align-items: end;
}

.field-group {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 8px;
    margin: 0 0 23px;
    color: var(--mood-ink);
    font-size: 13px;
    font-weight: 700;
}

.field-group input[type="text"],
.field-group input[type="tel"],
.field-group select {
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    color: var(--mood-ink);
    background: #fff;
    border: 1px solid var(--mood-line);
    border-radius: 4px;
    outline: none;
    font: inherit;
    font-size: 13px;
    font-weight: 500;
}

.field-group input:focus,
.field-group select:focus {
    border-color: var(--mood-green);
    box-shadow: 0 0 0 3px rgba(62, 107, 85, .12);
}

.required-mark {
    color: var(--mood-warm);
}

.choice-fieldset {
    min-width: 0;
    margin: 2px 0 24px;
    padding: 0;
    border: 0;
}

.choice-fieldset legend {
    display: flex;
    align-items: baseline;
    gap: 7px;
    margin-bottom: 12px;
    color: var(--mood-ink);
    font-size: 13px;
    font-weight: 700;
}

.choice-fieldset legend small {
    color: #8b968d;
    font-size: 11px;
    font-weight: 500;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.scent-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.choice-option {
    position: relative;
    display: flex;
    min-height: 43px;
    align-items: center;
    margin: 0;
    cursor: pointer;
}

.choice-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.choice-option span {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    padding: 8px 10px;
    color: #59675e;
    background: #fff;
    border: 1px solid var(--mood-line);
    border-radius: 4px;
    font-size: 11px;
    line-height: 1.3;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.choice-option input:checked + span {
    color: var(--mood-deep);
    background: #edf2e6;
    border-color: #8ca88c;
}

.choice-option input:focus-visible + span {
    outline: 3px solid rgba(62, 107, 85, .3);
    outline-offset: 2px;
}

.field-error {
    display: block;
    margin-top: 7px;
    color: #a44331;
    font-size: 12px;
}

.range-group {
    gap: 9px;
}

.range-labels {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #89948b;
    font-size: 10px;
    font-weight: 500;
}

.range-labels output {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    color: #fff;
    background: var(--mood-green);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 800;
}

.range-group input[type="range"] {
    width: 100%;
    accent-color: var(--mood-green);
}

.allergy-field {
    margin-bottom: 20px;
}

.allergy-field > span {
    display: flex;
    justify-content: space-between;
}

.consent-option {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 9px 0 10px;
    color: #4f5e53;
    font-size: 12px;
    line-height: 1.55;
    cursor: pointer;
}

.consent-option input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    margin-top: 1px;
    accent-color: var(--mood-green);
}

.mood-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.start-button:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.privacy-note {
    display: flex;
    gap: 7px;
    margin: 0 0 22px 27px;
    color: #89948b;
    font-size: 11px;
}

.privacy-note i {
    color: var(--mood-green);
}

.primary-button,
.secondary-button {
    display: inline-flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border: 0;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .18s ease, background .18s ease;
}

.primary-button {
    color: #fff;
    background: var(--mood-deep);
}

.primary-button:hover {
    color: #fff;
    background: #1f3d30;
    transform: translateY(-1px);
}

.primary-button:disabled,
.primary-button:disabled:hover {
    color: #f5f7f0;
    background: #718278;
    cursor: not-allowed;
    opacity: .62;
    transform: none;
}

.start-button {
    width: 100%;
}

.onboarding-navigation .start-button:disabled {
    cursor: not-allowed;
}

.scan-heading {
    align-items: center;
    margin-bottom: 20px;
}

.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: #8d5143;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .8px;
}

.live-indicator span {
    width: 7px;
    height: 7px;
    background: #cc735d;
    border-radius: 50%;
    animation: live-pulse 1.4s infinite;
}

.camera-frame {
    position: relative;
    width: min(100%, 620px);
    aspect-ratio: 4 / 3;
    margin: 0 auto;
    overflow: hidden;
    background: #17221d;
    border-radius: 6px;
}

.camera-frame video,
.camera-frame canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.camera-frame video {
    object-fit: cover;
    transform: scaleX(-1);
}

.camera-frame canvas {
    pointer-events: none;
}

.camera-guide {
    position: absolute;
    inset: 9% 20%;
    display: grid;
    place-items: center;
    pointer-events: none;
}

.camera-guide span {
    width: min(72%, 230px);
    aspect-ratio: .78;
    border: 1px solid rgba(220, 236, 191, .65);
    border-radius: 48% 48% 44% 44% / 38% 38% 56% 56%;
    box-shadow: 0 0 0 999px rgba(10, 24, 17, .08), inset 0 0 26px rgba(212, 223, 159, .07);
}

.camera-status {
    position: absolute;
    top: 14px;
    left: 50%;
    max-width: calc(100% - 24px);
    padding: 8px 12px;
    color: #fff;
    background: rgba(22, 36, 29, .75);
    border: 1px solid rgba(228, 238, 209, .23);
    border-radius: 30px;
    font-size: 12px;
    text-align: center;
    transform: translateX(-50%);
}

.scan-progress {
    position: absolute;
    right: 15px;
    bottom: 15px;
    display: grid;
    width: 60px;
    height: 60px;
    place-items: center;
    color: #fff;
    background: rgba(22, 36, 29, .65);
    border-radius: 50%;
}

.scan-progress svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.scan-progress circle {
    fill: none;
    stroke-width: 3;
}

.progress-track {
    stroke: rgba(255, 255, 255, .25);
}

.progress-value {
    stroke: var(--mood-lime);
    stroke-dasharray: 170;
    stroke-dashoffset: 170;
    stroke-linecap: round;
    transition: stroke-dashoffset .15s linear;
}

.scan-progress span {
    z-index: 1;
    font-size: 11px;
    font-weight: 800;
}

.camera-hint {
    margin: 14px 0 0;
    color: var(--mood-muted);
    font-size: 12px;
    text-align: center;
}

.scan-actions {
    margin-top: 18px;
    text-align: center;
}

.secondary-button {
    color: var(--mood-deep);
    background: #eaf0e7;
}

.secondary-button:hover {
    color: var(--mood-deep);
    background: #dce8d9;
    transform: translateY(-1px);
}

.results-panel {
    padding-bottom: 30px;
}

.results-header {
    padding-bottom: 23px;
    border-bottom: 1px solid var(--mood-line);
}

.results-header h2 {
    font-size: clamp(25px, 5vw, 34px);
}

.mood-summary {
    max-width: 570px;
    margin: 9px 0 0;
    color: var(--mood-muted);
    font-size: 14px;
    line-height: 1.65;
}

.mood-chart {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    padding: 23px 0 26px;
}

.mood-chart[hidden] {
    display: none;
}

.mood-bar {
    min-width: 0;
}

.mood-bar-label {
    display: flex;
    justify-content: space-between;
    gap: 3px;
    margin-bottom: 7px;
    color: #66746a;
    font-size: 10px;
}

.mood-bar-track {
    height: 5px;
    overflow: hidden;
    background: #e9eee7;
    border-radius: 4px;
}

.mood-bar-fill {
    height: 100%;
    background: #7d9c6a;
    border-radius: inherit;
    transition: width .5s ease;
}

.recommendation-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 10px;
    padding: 19px 0 14px;
    border-top: 1px solid var(--mood-line);
}

.recommendation-heading h3 {
    margin: 0;
    color: var(--mood-ink);
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 23px;
}

.recommendation-notices {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}

.recommendation-notice {
    margin: 0;
    padding: 11px 13px;
    color: #53614f;
    background: #f2f5eb;
    border-left: 3px solid #91a77f;
    font-size: 12px;
    line-height: 1.55;
}

.blend-label {
    color: #89948b;
    font-size: 10px;
}

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

.recommendation-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    padding: 17px;
    background: #fff;
    border: 1px solid var(--mood-line);
    border-radius: 5px;
}

.recommendation-card.is-primary {
    grid-column: 1 / -1;
    background: #f2f5eb;
    border-color: #bdcdb7;
}

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

.product-rank {
    color: var(--mood-green);
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .8px;
    text-transform: uppercase;
}

.product-aroma {
    color: #89948b;
    font-size: 10px;
}

.recommendation-card h4 {
    margin: 0 0 7px;
    color: var(--mood-ink);
    font-size: 16px;
    font-weight: 800;
}

.recommendation-card p {
    margin: 0 0 11px;
    color: #6f7c73;
    font-size: 12px;
    line-height: 1.55;
}

.usage-line {
    margin-top: auto !important;
    color: #475b4c !important;
}

.whatsapp-button {
    display: inline-flex;
    min-height: 39px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 8px;
    padding: 0 12px;
    color: #fff;
    background: #3b795c;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.whatsapp-button:hover {
    color: #fff;
    background: #2c6047;
}

.sensitivity-notice {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    padding: 12px;
    color: #785337;
    background: #fff4e8;
    border: 1px solid #f0d7b8;
    border-radius: 4px;
}

.sensitivity-notice i {
    margin-top: 2px;
}

.sensitivity-notice p {
    margin: 0;
    font-size: 11px;
    line-height: 1.5;
}

.disclaimer {
    margin: 17px 0 18px;
    color: #78847a;
    font-size: 11px;
    line-height: 1.6;
}

.rescan-button {
    min-height: 40px;
}

.mood-footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 22px max(20px, calc((100vw - 860px) / 2));
    color: #738076;
    background: #edf1e8;
    font-size: 11px;
}

.mood-footer span:first-child {
    color: var(--mood-deep);
    font-weight: 800;
}

[hidden] {
    display: none !important;
}

@keyframes mood-rise {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes onboarding-enter {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes live-pulse {
    50% { box-shadow: 0 0 0 5px rgba(204, 115, 93, .17); }
}

@media (max-width: 640px) {
    .mood-page {
        padding: 112px 14px 44px;
    }

    .mood-intro {
        margin-bottom: 23px;
    }

    .scan-steps {
        gap: 7px;
        margin-bottom: 17px;
    }

    .scan-step {
        gap: 5px;
        font-size: 10px;
    }

    .scan-step span:first-child {
        width: 23px;
        height: 23px;
    }

    .step-rule {
        width: 7vw;
    }

    .panel-heading {
        align-items: flex-start;
        margin-bottom: 22px;
    }

    .onboarding-hint {
        max-width: 34ch;
        font-size: 12px;
    }

    .onboarding-progress {
        margin-bottom: 23px;
    }

    .required-note {
        padding-top: 6px;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

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

    .onboarding-navigation {
        gap: 8px;
    }

    .onboarding-navigation .primary-button,
    .onboarding-navigation .secondary-button {
        padding: 0 13px;
        font-size: 12px;
    }

    .onboarding-navigation .start-button {
        flex: 1;
    }

    .camera-frame {
        aspect-ratio: 3 / 4;
        max-height: 68vh;
    }

    .mood-chart {
        grid-template-columns: 1fr;
        gap: 9px;
    }

    .mood-bar-label {
        font-size: 11px;
    }

    .recommendation-list {
        grid-template-columns: 1fr;
    }

    .recommendation-card.is-primary {
        grid-column: auto;
    }

    .recommendation-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }

    .mood-footer {
        flex-direction: column;
        padding: 18px 20px;
    }
}

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

    .onboarding-stage.is-active {
        animation: none;
    }
}