/* AI output and consultant: editorial black / white / pink system. */

.ai-result {
    margin-top: 24px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dcdce2;
    border-radius: 24px;
    box-shadow: none;
}

.ai-result-header {
    min-height: 76px;
    padding: 16px 20px;
    color: #fff;
    background: #0f0f14;
    border-bottom: 0;
}

.ai-avatar-sm {
    width: 40px;
    height: 40px;
    color: #fff;
    background: #ff2f74;
    border: 0;
    border-radius: 14px;
    font-size: .76rem;
    font-weight: 800;
    box-shadow: none;
}

.ai-result-title {
    color: #fff;
    font-size: .96rem;
    font-weight: 800;
    letter-spacing: -.015em;
}

.ai-result-sub {
    margin-top: 2px;
    color: #b7b7c0;
    font-size: .75rem;
}

.ai-result-body {
    padding: 24px;
    color: #3f3f47;
    background: #fff;
    font-size: .94rem;
    line-height: 1.72;
}

.ai-result-body > :first-child { margin-top: 0; }
.ai-result-body > :last-child { margin-bottom: 0; }

.ai-result-body h2,
.ai-result-body h3,
.ai-result-body h4 {
    margin: 22px 0 10px;
    color: #0f0f14;
    font-family: var(--font-body);
    font-weight: 800;
    letter-spacing: -.025em;
    line-height: 1.2;
}

.ai-result-body p { margin: 0 0 14px; }

.ai-result-body strong {
    color: #0f0f14;
    font-weight: 800;
}

.ai-result-body ul,
.ai-result-body ol {
    margin: 12px 0 18px;
    padding-left: 22px;
}

.ai-result-body li { margin: 6px 0; }

.ai-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ai-result-heading-copy {
    min-width: 0;
}

.inci-verdict-pill {
    margin-left: auto;
    padding: 7px 11px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 999px;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .015em;
    line-height: 1.2;
    text-align: center;
}

.ai-result[data-verdict="strong"] .inci-verdict-pill,
.ai-result[data-verdict="balanced"] .inci-verdict-pill {
    color: #d7ffe9;
    background: rgba(47, 166, 105, .22);
    border-color: rgba(105, 229, 162, .35);
}

.ai-result[data-verdict="caution"] .inci-verdict-pill {
    color: #ffe9af;
    background: rgba(198, 132, 0, .24);
    border-color: rgba(255, 207, 91, .34);
}

.ai-result[data-verdict="poor"] .inci-verdict-pill {
    color: #ffdce8;
    background: rgba(255, 47, 116, .24);
    border-color: rgba(255, 122, 166, .38);
}

.ai-result--structured .ai-result-body {
    padding: 0;
    line-height: 1.6;
}

.inci-report {
    color: #3f3f47;
    background: #fff;
}

.inci-report__section {
    padding: 30px;
    border-bottom: 1px solid #ececf0;
}

.inci-report__section:nth-child(even) {
    background: #fbfafb;
}

.inci-report__eyebrow,
.inci-report__verdict-kicker {
    display: block;
    margin-bottom: 10px;
    color: #e82568;
    font-size: .68rem;
    font-weight: 850;
    letter-spacing: .12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.inci-report h3 {
    margin: 0 0 12px;
    color: #111116;
    font-size: clamp(1.08rem, 2vw, 1.34rem);
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.18;
}

.inci-report p {
    margin: 0;
}

.inci-report__overview p,
.inci-report__effect p,
.inci-report__fit > p {
    max-width: 780px;
    color: #55555e;
    font-size: .98rem;
}

.inci-report__unproven {
    margin-top: 15px !important;
    padding: 14px 16px;
    background: #f8f6f7;
    border-left: 3px solid #a97785;
    border-radius: 0 10px 10px 0;
}

.inci-report__breakdown {
    margin-top: 18px;
    border: 1px solid #e3e3e8;
    border-radius: 16px;
    overflow: hidden;
}

.inci-report__breakdown-row {
    display: grid;
    grid-template-columns: minmax(150px, 30%) minmax(0, 1fr);
    gap: 18px;
    padding: 15px 18px;
    border-bottom: 1px solid #ededf1;
    font-size: .84rem;
    line-height: 1.55;
}

.inci-report__breakdown-row:nth-child(even) { background: #fbfafb; }
.inci-report__breakdown-row:last-child { border-bottom: 0; }
.inci-report__breakdown-row > strong { color: #1c1a20; overflow-wrap: anywhere; }
.inci-report__breakdown-role { display: block; margin-bottom: 4px; color: #77737b; font-weight: 750; }
.inci-report__breakdown-row p { color: #55555e; }

.inci-report__sources > p { max-width: 780px; color: #666670; font-size: .85rem; }
.inci-report__sources ul { display: grid; gap: 12px; margin: 18px 0 0; padding: 0; list-style: none; }
.inci-report__sources li { padding: 14px 16px; background: #f7f7f9; border-radius: 12px; font-size: .82rem; }
.inci-report__sources a { display: block; width: fit-content; margin-bottom: 4px; color: #a51550; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.inci-report__sources li span { display: block; color: #62616a; line-height: 1.5; }

.inci-report__cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
}

.inci-report__ingredient {
    position: relative;
    min-width: 0;
    padding: 17px 17px 16px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e3e3e8;
    border-radius: 17px;
}

.inci-report__ingredient::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: #2fa669;
    content: '';
}

.inci-report__ingredient--low::before { background: #d1a027; }
.inci-report__ingredient--medium::before { background: #ef7d32; }
.inci-report__ingredient--high::before { background: #e82568; }

.inci-report__ingredient-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 7px;
    color: #111116;
}

.inci-report__ingredient-head strong {
    min-width: 0;
    font-size: .9rem;
    font-weight: 850;
    overflow-wrap: anywhere;
}

.inci-report__dot {
    width: 7px;
    height: 7px;
    flex: 0 0 auto;
    background: #2fa669;
    border-radius: 50%;
}

.inci-report__ingredient--low .inci-report__dot { background: #d1a027; }
.inci-report__ingredient--medium .inci-report__dot { background: #ef7d32; }
.inci-report__ingredient--high .inci-report__dot { background: #e82568; }

.inci-report__role {
    display: block;
    margin: -1px 0 8px 15px;
    color: #767680;
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .02em;
}

.inci-report__ingredient p {
    color: #5a5a63;
    font-size: .84rem;
    line-height: 1.55;
}

.inci-report__ingredient .inci-report__for-whom {
    margin-top: 10px;
    padding-top: 10px;
    color: #4a4a52;
    border-top: 1px solid #ededf1;
    font-size: .78rem;
}

.inci-report__severity {
    margin-left: auto;
    padding: 4px 7px;
    color: #73737c;
    background: #f3f3f6;
    border-radius: 999px;
    font-size: .62rem;
    font-weight: 800;
    line-height: 1;
    text-transform: uppercase;
}

.inci-report__ingredient--high .inci-report__severity {
    color: #b7194e;
    background: #fff0f5;
}

.inci-report__empty {
    padding: 16px 18px;
    color: #666670;
    background: #f6f6f8;
    border-radius: 14px;
    font-size: .86rem;
}

.inci-report__steps {
    display: grid;
    gap: 10px;
    margin: 18px 0 0;
    padding: 0;
    counter-reset: inci-step;
    list-style: none;
}

.inci-report__steps li {
    position: relative;
    min-height: 34px;
    margin: 0;
    padding: 6px 0 4px 45px;
    color: #44444c;
    counter-increment: inci-step;
}

.inci-report__steps li::before {
    position: absolute;
    top: 0;
    left: 0;
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    color: #fff;
    background: #111116;
    border-radius: 10px;
    content: counter(inci-step, decimal-leading-zero);
    font-size: .64rem;
    font-weight: 850;
}

.inci-report__note {
    margin-top: 20px;
    padding: 16px 18px;
    color: #686872;
    background: #f4f4f6;
    border-radius: 14px;
    font-size: .78rem;
}

.inci-report__note > strong {
    display: block;
    margin-bottom: 5px;
    color: #2f2f36;
}

.inci-report__note ul {
    margin: 0;
    padding-left: 18px;
}

.inci-report__note li {
    margin: 3px 0;
}

.inci-report__verdict {
    position: relative;
    padding: 30px;
    overflow: hidden;
    color: #34343c;
    background: #f5f3f3;
    border-top: 1px solid #e2dede;
    box-shadow: inset 3px 0 0 #7b7175;
}

.inci-report__verdict::after {
    display: none;
}

.inci-report__verdict[data-level="strong"],
.inci-report__verdict[data-level="balanced"] { box-shadow: inset 3px 0 0 #39765a; }
.inci-report__verdict[data-level="caution"] { box-shadow: inset 3px 0 0 #a87319; }
.inci-report__verdict[data-level="poor"] { box-shadow: inset 3px 0 0 #ad365c; }
.inci-report__verdict[data-level="insufficient"] { box-shadow: inset 3px 0 0 #77777f; }

.inci-report__verdict-kicker {
    color: #6c6568;
}

.inci-report__verdict-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
}

.inci-report__verdict-label {
    display: inline-flex;
    padding: 7px 10px;
    color: #4b4548;
    background: transparent;
    border: 1px solid #c8c1c4;
    border-radius: 8px;
    font-size: .74rem;
    font-weight: 850;
}

.inci-report__verdict[data-level="strong"] .inci-report__verdict-label,
.inci-report__verdict[data-level="balanced"] .inci-report__verdict-label {
    color: #285f47;
    background: transparent;
    border-color: #9bb9aa;
}

.inci-report__verdict[data-level="caution"] .inci-report__verdict-label {
    color: #815b18;
    background: transparent;
    border-color: #c8ad7b;
}

.inci-report__verdict[data-level="poor"] .inci-report__verdict-label {
    color: #963151;
    background: transparent;
    border-color: #c99aaa;
}

.inci-report__verdict[data-level="insufficient"] .inci-report__verdict-label {
    color: #55555e;
    background: transparent;
    border-color: #bcbcc2;
}

.inci-report__verdict-mark {
    width: 10px;
    height: 10px;
    flex: 0 0 auto;
    background: #ff2f74;
    border: 0;
    border-radius: 50%;
    box-shadow: none;
}

.inci-report__verdict[data-level="strong"] .inci-report__verdict-mark,
.inci-report__verdict[data-level="balanced"] .inci-report__verdict-mark {
    background: #39765a;
    box-shadow: none;
}
.inci-report__verdict[data-level="caution"] .inci-report__verdict-mark {
    background: #a87319;
    box-shadow: none;
}
.inci-report__verdict[data-level="poor"] .inci-report__verdict-mark {
    background: #ad365c;
    box-shadow: none;
}
.inci-report__verdict[data-level="insufficient"] .inci-report__verdict-mark {
    background: #77777f;
    box-shadow: none;
}

.inci-report__verdict h3 {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 0 10px;
    color: #171318;
    font-size: clamp(1.25rem, 2.7vw, 1.75rem);
}

.inci-report__verdict p {
    position: relative;
    z-index: 1;
    max-width: 760px;
    color: #61616a;
    font-size: .91rem;
}

.ai-ingredient {
    margin: 3px 2px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 700;
}

.ai-ing-good {
    color: #176b3a;
    background: #effaf3;
    border-color: #bfe8ce;
}

.ai-ing-warn {
    color: #925700;
    background: #fff8e8;
    border-color: #f2d392;
}

.ai-ing-bad {
    color: #b51f50;
    background: #fff1f6;
    border-color: #ffbad1;
}

.ai-loading.visible {
    min-height: 64px;
    padding: 18px 20px;
    color: #64646d;
    background: #fff;
    border: 1px solid #dcdce2;
    border-radius: 18px;
}

.ai-loading .dot { background: #ff2f74; }

.inci-result-tools .btn-secondary {
    min-height: 48px;
    color: #0f0f14;
    background: #fff;
    border: 1px solid #cfcfd6;
    border-radius: 16px;
    box-shadow: none;
}

.inci-result-tools .btn-secondary:hover {
    color: #0f0f14;
    background: #fff6f9;
    border-color: #ff2f74;
}

/* Photo diagnosis output. */
#photo .photo-result-panel {
    margin-top: 0;
    padding: 0;
    overflow: hidden;
    background: #fff;
    border: 1px solid #dcdce2;
    border-radius: 24px;
    box-shadow: none;
}

#photo .photo-result-head {
    min-height: 72px;
    margin: 0;
    padding: 16px 20px;
    color: #fff;
    background: #0f0f14;
}

#photo .photo-result-badge {
    color: #ff5a91;
    font-size: .7rem;
    font-weight: 800;
    letter-spacing: .12em;
}

#photo .photo-result-tag {
    margin-left: auto;
    color: #fff;
    background: #ff2f74;
    border: 0;
    border-radius: 999px;
}

#photo .photo-result-summary {
    margin: 0;
    padding: 22px 22px 16px;
    color: #0f0f14;
    font-size: 1rem;
    font-weight: 650;
    line-height: 1.58;
}

#photo .photo-result-scores {
    gap: 14px;
    margin: 0;
    padding: 4px 22px 22px;
}

#photo .photo-score-label {
    color: #64646d;
    font-weight: 650;
}

#photo .photo-score-value {
    color: #0f0f14;
    font-weight: 800;
}

#photo .score-bar { background: #ededf1; }
#photo .score-fill { background: #ff2f74; }

#photo .photo-result-rec {
    margin: 0 22px 18px;
    padding: 18px;
    color: #3f3f47;
    background: #fff4f8;
    border: 1px solid #ffd2e1;
    border-radius: 16px;
}

#photo .photo-result-rec strong { color: #ff2f74; }

#photo .photo-disclaimer {
    margin: 0;
    padding: 0 22px 18px;
    color: #7b7b84;
}

#photo .photo-result-cta {
    width: auto;
    min-height: 52px;
    margin: 0 22px 22px;
    color: #0f0f14;
    background: #fff;
    border: 1px solid #ff2f74;
    border-radius: 17px;
}

/* Compatibility and routine output. */
.compat-matrix {
    padding: 4px;
    border: 1px solid #ececf0;
    border-radius: 16px;
}

.conflict-card,
.routine-note {
    border-radius: 16px;
}

.routine-result.visible {
    padding: 24px;
    background: #fff;
    border: 1px solid #dcdce2;
    border-radius: 24px;
}

.routine-result .ai-result-title { color: #0f0f14; }

.routine-col-header.morning,
.routine-col-header.evening {
    color: #fff;
    background: #0f0f14;
    border-color: #0f0f14;
}

.routine-col-header .routine-col-title { color: #fff; }
.routine-col-header .routine-col-sub { color: #b7b7c0; }

.routine-step {
    background: #fff;
    border-color: #dedee3 !important;
}

.routine-note {
    color: #3f3f47;
    background: #fff4f8;
    border-color: #ffd2e1;
}

/* Floating AI consultant. */
.chat-window {
    bottom: 102px;
    width: min(420px, calc(100vw - 40px));
    overflow: hidden;
    background: #fff;
    border: 1px solid #d4d4da;
    border-radius: 26px;
    box-shadow: 0 24px 70px rgba(15,15,20,.18);
    backdrop-filter: none;
}

.chat-header {
    min-height: 72px;
    padding: 14px 16px;
    color: #fff;
    background: #0f0f14;
    border-bottom: 0;
}

.chat-avatar {
    width: 42px;
    height: 42px;
    color: #fff;
    background: #ff2f74;
    border: 0;
    border-radius: 14px;
    font-size: .75rem;
    font-weight: 800;
}

.chat-name {
    color: #fff;
    font-size: .98rem;
    font-weight: 800;
    letter-spacing: -.015em;
}

.chat-status {
    color: #b7b7c0;
    font-size: .72rem;
}

.chat-close-btn {
    color: #fff !important;
    background: rgba(255,255,255,.1) !important;
    border: 1px solid rgba(255,255,255,.16) !important;
}

.chat-close-btn:hover { background: rgba(255,255,255,.18) !important; }

.chat-messages {
    height: 340px;
    gap: 14px;
    padding: 20px 16px;
    background: #f7f7f9;
}

.chat-messages::-webkit-scrollbar-thumb { background: #c9c9d0; }

.msg { max-width: 92%; }

.msg-avatar {
    width: 30px;
    height: 30px;
    color: #fff;
    background: #ff2f74;
    border-radius: 10px;
    font-size: .62rem;
    font-weight: 800;
}

.msg-bubble {
    padding: 12px 14px;
    border-radius: 17px;
    font-size: .86rem;
    line-height: 1.58;
}

.msg.bot .msg-bubble {
    color: #2f2f36;
    background: #fff;
    border: 1px solid #dedee3;
    border-bottom-left-radius: 6px;
}

.msg.user .msg-bubble {
    color: #fff;
    background: #ff2f74;
    border: 1px solid #ff2f74;
    border-bottom-right-radius: 6px;
}

.msg-bubble a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.chat-input-wrap {
    gap: 10px;
    padding: 14px;
    background: #fff;
    border-top: 1px solid #dedee3;
}

.chat-input {
    min-width: 0;
    min-height: 46px;
    padding: 11px 14px;
    color: #0f0f14;
    background: #fff;
    border: 1px solid #cfcfd6;
    border-radius: 15px;
    font-size: 16px;
}

.chat-input:focus {
    border-color: #ff2f74;
    box-shadow: 0 0 0 4px rgba(255,47,116,.08);
}

.chat-send {
    width: 46px;
    height: 46px;
    background: #ff2f74;
    border-radius: 15px;
}

.chat-send:hover {
    background: #e91f63;
    transform: none;
}

@media (max-width: 640px) {
    .ai-result { border-radius: 20px; }
    .ai-result-header { min-height: 68px; padding: 14px 16px; }
    .ai-result-body { padding: 20px 16px; font-size: .9rem; }
    .ai-result--structured .ai-result-body { padding: 0; }
    .inci-verdict-pill {
        max-width: 118px;
        padding: 6px 8px;
        font-size: .61rem;
    }
    .inci-report__section,
    .inci-report__verdict { padding: 24px 18px; }
    .inci-report__cards { grid-template-columns: 1fr; }
    .inci-report__ingredient { padding: 15px 14px; }
    .inci-report__ingredient-head { flex-wrap: wrap; }
    .inci-report__breakdown-row { grid-template-columns: 1fr; gap: 4px; padding: 13px 15px; }
    .inci-report__severity { margin-left: 0; }
    .inci-report__verdict-head { align-items: flex-start; }

    #photo .photo-result-head {
        min-height: 0;
        padding: 16px;
    }

    #photo .photo-result-tag {
        margin-left: 0;
    }

    #photo .photo-result-summary { padding: 20px 16px 14px; }
    #photo .photo-result-scores { padding: 4px 16px 18px; }
    #photo .photo-result-rec { margin: 0 16px 16px; }
    #photo .photo-disclaimer { padding: 0 16px 16px; }
    #photo .photo-result-cta { margin: 0 16px 16px; }

    .routine-result.visible { padding: 18px 14px; border-radius: 20px; }

    #chat-widget {
        right: 14px;
        bottom: 14px;
    }

    .chat-window {
        right: 0;
        bottom: 88px;
        width: calc(100vw - 28px);
        max-height: min(650px, calc(100dvh - 116px));
        border-radius: 22px;
    }

    .chat-messages {
        height: min(360px, calc(100dvh - 292px));
        min-height: 220px;
    }

    .chat-toggle {
        width: 70px;
        height: 70px;
        border-width: 2px;
    }

    .chat-toggle-icon img {
        width: 66px;
        height: 66px;
    }

    .chat-toggle::after {
        right: 60px;
        min-width: 104px;
        padding: 9px 12px;
        color: #fff;
        background: #ff2f74;
        box-shadow: 0 10px 24px rgba(255,47,116,.2);
    }
}
