.cf-page {
    background: #f4f5f1;
    color: #20231f;
}

.cf-wrap {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
}

.cf-hero {
    padding: 70px 0 58px;
    text-align: center;
    background:
        linear-gradient(
            180deg,
            #eef1eb 0%,
            #f4f5f1 100%
        );
}

.cf-eyebrow,
.cf-step {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #52644e;
}

.cf-hero h1 {
    margin: 8px 0 5px;
    font-size: clamp(40px, 8vw, 66px);
    line-height: 1;
}

.cf-tagline {
    max-width: 650px;
    margin: 0 auto;
    font-size: clamp(18px, 4vw, 24px);
    font-weight: 700;
}

.cf-hero-copy {
    max-width: 620px;
    margin: 18px auto 27px;
    font-size: 16px;
    line-height: 1.6;
    color: #555b53;
}

.cf-primary,
.cf-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 20px;
    border-radius: 9px;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
}

.cf-primary {
    border: 1px solid #344d35;
    background: #344d35;
    color: #fff;
}

.cf-primary:hover {
    background: #293d2a;
    color: #fff;
}

.cf-primary:disabled {
    opacity: .42;
    cursor: not-allowed;
}

.cf-secondary {
    border: 1px solid #c6cac2;
    background: #fff;
    color: #30342e;
}

.cf-hero-button {
    min-width: 180px;
}

.cf-search-section {
    padding: 24px 0 54px;
    scroll-margin-top: 70px;
}

.cf-search-card,
.cf-search-summary {
    max-width: 780px;
    margin: 0 auto;
    background: #fff;
    border: 1px solid #dedfd9;
    border-radius: 18px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .05);
}

.cf-search-card {
    padding: 28px;
}

.cf-search-heading,
.cf-summary-top,
.cf-results-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.cf-search-heading h2,
.cf-summary-top h2,
.cf-results-heading h2 {
    margin: 4px 0 5px;
    line-height: 1.18;
}

.cf-search-heading p,
.cf-result-count,
.cf-method-note {
    margin: 0;
    color: #676c64;
}

.cf-text-button {
    border: 0;
    background: none;
    color: #50644d;
    text-decoration: underline;
    font-weight: 700;
    cursor: pointer;
}

.cf-trait-list {
    margin-top: 24px;
    border: 1px solid #e0e2dc;
    border-radius: 13px;
    overflow: hidden;
}

.cf-trait-row {
    position: relative;
    display: flex;
    border-bottom: 1px solid #e8e9e4;
    background: #fff;
}

.cf-trait-row:last-child {
    border-bottom: 0;
}

.cf-trait-select {
    flex: 1;
    min-height: 67px;
    padding: 12px 58px 12px 16px;
    border: 0;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    text-align: left;
    cursor: pointer;
}

.cf-trait-select:hover {
    background: #f8f9f6;
}

.cf-trait-name {
    font-weight: 800;
}

.cf-trait-right {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #596058;
}

.cf-trait-value {
    text-align: right;
}

.cf-chevron {
    font-size: 25px;
    line-height: 1;
    color: #858a82;
}

.cf-info-button {
    position: absolute;
    right: 38px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 27px;
    height: 27px;
    border-radius: 50%;
    border: 1px solid #b9beb5;
    background: #fff;
    color: #536050;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.cf-find-button {
    width: 100%;
    margin-top: 22px;
    min-height: 52px;
    font-size: 17px;
}

.cf-any-note {
    margin: 12px 0 0;
    text-align: center;
    color: #747970;
    font-size: 13px;
}

.cf-results-section {
    padding: 0 0 70px;
    scroll-margin-top: 70px;
}

.cf-search-summary {
    padding: 22px 24px;
    margin-bottom: 32px;
}

.cf-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
}

.cf-chip {
    padding: 7px 11px;
    border-radius: 999px;
    background: #edf1ea;
    border: 1px solid #d6ded2;
    font-size: 13px;
    font-weight: 800;
}

.cf-results-heading {
    margin: 0 0 20px;
    align-items: flex-end;
}

.cf-method-note {
    max-width: 360px;
    font-size: 13px;
    text-align: right;
}

.cf-results {
    display: grid;
    gap: 22px;
}

.cf-result-card {
    overflow: hidden;
    background: #fff;
    border: 1px solid #dfe1db;
    border-radius: 18px;
    box-shadow: 0 7px 22px rgba(0, 0, 0, .045);
}

.cf-result-grid {
    display: grid;
    grid-template-columns: 36% 1fr;
}

.cf-result-image-wrap {
    min-height: 285px;
    background: #ddd;
}

.cf-result-image {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 285px;
    object-fit: cover;
}

.cf-result-content {
    padding: 25px 27px;
}

.cf-result-brand {
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6a7067;
    font-weight: 800;
}

.cf-result-name {
    margin: 3px 0 9px;
    font-size: 27px;
    line-height: 1.1;
}

.cf-match-label {
    display: inline-block;
    padding: 6px 9px;
    border-radius: 7px;
    background: #eaf0e7;
    color: #385038;
    font-size: 13px;
    font-weight: 900;
}

.cf-explanation {
    margin: 16px 0 0;
    line-height: 1.58;
    color: #424740;
}

.cf-difference {
    margin-top: 14px;
    padding: 11px 13px;
    border-left: 3px solid #9c8254;
    background: #f7f4ed;
    font-size: 14px;
    line-height: 1.45;
}

.cf-difference strong {
    display: block;
    margin-bottom: 2px;
}

.cf-match-counts {
    margin-top: 15px;
    font-size: 13px;
    font-weight: 800;
    color: #646a61;
}

.cf-trait-toggle {
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #415940;
    font-weight: 800;
    cursor: pointer;
    text-decoration: underline;
}

.cf-trait-details {
    margin-top: 15px;
    border-top: 1px solid #e4e6e0;
    padding-top: 12px;
}

.cf-trait-comparison {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.cf-trait-comparison th,
.cf-trait-comparison td {
    padding: 8px 6px;
    border-bottom: 1px solid #eceee9;
    text-align: left;
}

.cf-trait-status {
    font-weight: 800;
    text-transform: capitalize;
}

.cf-result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 18px;
}

.cf-result-actions a,
.cf-result-actions button {
    min-height: 40px;
    padding: 0 13px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}

.cf-dna-button {
    border: 1px solid #344d35;
    background: #344d35;
    color: #fff;
}

.cf-card-link {
    border: 1px solid #d1d5cc;
    background: #fff;
    color: #343934;
    display: inline-flex;
    align-items: center;
}

.cf-loading {
    padding: 35px 10px;
    text-align: center;
    font-weight: 800;
    color: #60675e;
}

.cf-results-footer {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.cf-end-message {
    max-width: 640px;
    margin: 28px auto 0;
    padding: 17px;
    text-align: center;
    background: #fff;
    border: 1px solid #dfe1db;
    border-radius: 12px;
}

.cf-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(18, 20, 17, .72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cf-overlay[hidden] {
    display: none;
}

.cf-sheet,
.cf-profile-modal {
    width: min(680px, 100%);
    max-height: min(90vh, 850px);
    overflow: auto;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .28);
}

.cf-sheet {
    padding: 22px;
}

.cf-sheet-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.cf-sheet-head h2 {
    margin: 0;
}

.cf-modal-close {
    width: 40px;
    height: 40px;
    border: 0;
    background: #eff1ec;
    border-radius: 50%;
    font-size: 27px;
    line-height: 1;
    cursor: pointer;
}

.cf-sheet-body {
    margin-top: 18px;
}

.cf-choice {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 49px;
    padding: 8px 4px;
    border-bottom: 1px solid #eceee9;
    font-weight: 700;
}

.cf-choice input {
    width: 20px;
    height: 20px;
}

.cf-sheet-done {
    width: 100%;
    margin-top: 20px;
}

.cf-info-copy h3 {
    margin: 20px 0 5px;
    font-size: 16px;
}

.cf-info-copy h3:first-child {
    margin-top: 0;
}

.cf-info-copy p {
    margin: 0;
    line-height: 1.55;
    color: #50564e;
}

.cf-profile-modal {
    position: relative;
    padding: 26px;
}

.cf-profile-close {
    position: absolute;
    right: 16px;
    top: 16px;
}

.cf-profile-head {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 20px;
    padding-right: 42px;
}

.cf-profile-image {
    width: 150px;
    height: 150px;
    border-radius: 12px;
    object-fit: cover;
}

.cf-profile-brand {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #6a7067;
}

.cf-profile-head h2 {
    margin: 4px 0 8px;
}

.cf-profile-snapshot {
    line-height: 1.5;
    color: #4f554d;
}

.cf-swatches {
    display: flex;
    gap: 5px;
    margin-top: 12px;
}

.cf-swatch {
    width: 32px;
    height: 32px;
    border-radius: 5px;
    border: 1px solid rgba(0, 0, 0, .18);
}

.cf-profile-section {
    margin-top: 26px;
}

.cf-profile-section h3 {
    margin-bottom: 12px;
}

.cf-standout {
    padding: 13px 0;
    border-bottom: 1px solid #e8eae5;
}

.cf-standout strong {
    display: block;
}

.cf-standout-result {
    margin-top: 3px;
    font-weight: 700;
    color: #485645;
}

.cf-standout p {
    margin: 5px 0 0;
    line-height: 1.5;
    color: #5c625a;
}

.cf-profile-trait {
    border-top: 1px solid #e5e7e1;
}

.cf-profile-trait summary {
    padding: 13px 0;
    cursor: pointer;
    font-weight: 800;
}

.cf-profile-trait div {
    padding: 0 0 14px;
    line-height: 1.5;
    color: #565c54;
}

.cf-profile-trait div strong {
    display: block;
    margin-bottom: 5px;
    color: #333833;
}

.cf-profile-actions {
    margin-top: 23px;
}

.cf-no-scroll {
    overflow: hidden;
}

@media (max-width: 760px) {

    .cf-wrap {
        width: min(100% - 22px, 680px);
    }

    .cf-hero {
        padding: 45px 0 40px;
    }

    .cf-search-card {
        padding: 18px 14px;
        border-radius: 15px;
    }

    .cf-search-heading {
        gap: 8px;
    }

    .cf-search-heading h2 {
        font-size: 23px;
    }

    .cf-trait-select {
        min-height: 64px;
        padding-left: 13px;
    }

    .cf-result-grid {
        grid-template-columns: 1fr;
    }

    .cf-result-image-wrap,
    .cf-result-image {
        min-height: 210px;
        max-height: 300px;
    }

    .cf-result-content {
        padding: 20px 17px;
    }

    .cf-result-name {
        font-size: 25px;
    }

    .cf-results-heading {
        display: block;
    }

    .cf-method-note {
        margin-top: 12px;
        text-align: left;
    }

    .cf-summary-top {
        display: block;
    }

    .cf-summary-top .cf-secondary {
        margin-top: 12px;
        min-height: 40px;
    }

    .cf-search-summary {
        padding: 18px 16px;
    }

    .cf-results-footer {
        flex-direction: column;
    }

    .cf-results-footer button {
        width: 100%;
    }

    .cf-overlay {
        align-items: flex-end;
        padding: 0;
    }

    .cf-sheet {
        width: 100%;
        max-height: 88vh;
        border-radius: 20px 20px 0 0;
        padding: 20px 16px;
    }

    .cf-profile-modal {
        width: 100%;
        max-height: 94vh;
        border-radius: 20px 20px 0 0;
        padding: 22px 16px;
    }

    .cf-profile-head {
        grid-template-columns: 96px 1fr;
        gap: 13px;
    }

    .cf-profile-image {
        width: 96px;
        height: 96px;
    }

    .cf-trait-comparison {
        font-size: 12px;
    }
}

/* ============================================================
   V1 VISUAL REFINEMENT 1
   Explicit modal colors + tighter page spacing
   ============================================================ */

/* Prevent global Camo Matrix styles from creating white-on-white
   text inside Finder sheets/modals. */
.cf-sheet,
.cf-sheet h2,
.cf-sheet h3,
.cf-sheet p,
.cf-sheet label,
.cf-sheet span,
.cf-choice,
.cf-choice span,
.cf-info-copy,
.cf-info-copy h3,
.cf-info-copy p,
.cf-profile-modal,
.cf-profile-modal h2,
.cf-profile-modal h3,
.cf-profile-modal p,
.cf-profile-modal summary,
.cf-profile-modal div {
    color: #20231f;
}

.cf-sheet {
    background: #fff;
}

.cf-choice {
    color: #20231f !important;
    background: #fff;
}

.cf-choice span {
    color: #20231f !important;
}

.cf-sheet-head h2 {
    color: #20231f !important;
    font-size: 24px;
    line-height: 1.15;
}

.cf-info-copy h3 {
    color: #2f4932 !important;
}

.cf-profile-trait summary {
    color: #20231f !important;
}

/* Tighten desktop rhythm */
.cf-hero {
    padding-top: 50px;
    padding-bottom: 38px;
}

.cf-hero-copy {
    margin-top: 13px;
    margin-bottom: 20px;
}

.cf-search-section {
    padding-top: 12px;
    padding-bottom: 42px;
}

.cf-search-card {
    padding: 24px;
}

.cf-search-summary {
    margin-bottom: 24px;
}

.cf-results-heading {
    margin-bottom: 16px;
}

.cf-result-content {
    padding-top: 22px;
    padding-bottom: 22px;
}

/* Make selector choices slightly more compact */
.cf-choice {
    min-height: 46px;
    padding-top: 7px;
    padding-bottom: 7px;
}

/* Mobile */
@media (max-width: 760px) {

    .cf-hero {
        padding-top: 30px;
        padding-bottom: 28px;
    }

    .cf-hero-copy {
        margin-top: 10px;
        margin-bottom: 16px;
        line-height: 1.45;
    }

    .cf-search-section {
        padding-top: 8px;
        padding-bottom: 30px;
    }

    .cf-search-card {
        padding: 16px 12px;
    }

    .cf-search-heading h2 {
        margin-top: 3px;
        margin-bottom: 2px;
    }

    .cf-search-heading p {
        line-height: 1.35;
    }

    .cf-trait-list {
        margin-top: 17px;
    }

    .cf-search-summary {
        margin-bottom: 20px;
    }

    .cf-results-heading {
        margin-bottom: 13px;
    }

    .cf-sheet-head h2 {
        font-size: 21px;
    }

    .cf-choice {
        min-height: 45px;
    }
}

/* ============================================================
   V1 VISUAL REFINEMENT 2
   Compact results and vertical rhythm
   ============================================================ */

.cf-results-section {
    padding-bottom: 52px;
}

.cf-search-summary {
    padding: 19px 22px;
    margin-bottom: 20px;
}

.cf-chip-list {
    margin-top: 11px;
}

.cf-chip {
    padding: 6px 10px;
}

.cf-results-heading {
    margin-bottom: 13px;
}

.cf-results {
    gap: 17px;
}

/* Keep desktop cards from becoming excessively tall
   when source imagery is portrait-oriented. */
.cf-result-grid {
    grid-template-columns: 34% 1fr;
    min-height: 0;
}

.cf-result-image-wrap {
    height: 315px;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #dedede;
}

.cf-result-image {
    width: 100%;
    height: 315px;
    min-height: 0;
    object-fit: contain;
}

.cf-result-content {
    padding: 20px 24px;
}

.cf-result-name {
    margin-top: 2px;
    margin-bottom: 7px;
}

.cf-match-label {
    padding: 5px 8px;
}

.cf-explanation {
    margin-top: 13px;
    margin-bottom: 0;
    line-height: 1.5;
}

.cf-difference {
    margin-top: 11px;
    padding: 9px 11px;
}

.cf-match-counts {
    margin-top: 12px;
}

.cf-trait-toggle {
    margin-top: 7px;
}

.cf-trait-details {
    margin-top: 11px;
}

.cf-result-actions {
    gap: 8px;
    margin-top: 14px;
}

.cf-result-actions a,
.cf-result-actions button {
    min-height: 38px;
    padding-left: 12px;
    padding-right: 12px;
}

/* Pattern DNA modal */
.cf-profile-section {
    margin-top: 21px;
}

.cf-standout {
    padding: 10px 0;
}

.cf-profile-trait summary {
    padding: 10px 0;
}

.cf-profile-actions {
    margin-top: 18px;
}

@media (max-width: 760px) {

    .cf-search-summary {
        padding: 15px 13px;
        margin-bottom: 15px;
    }

    .cf-chip-list {
        margin-top: 9px;
        gap: 6px;
    }

    .cf-chip {
        padding: 5px 8px;
        font-size: 12px;
    }

    .cf-results-heading {
        margin-bottom: 10px;
    }

    .cf-results {
        gap: 13px;
    }

    .cf-result-image-wrap {
        height: 210px;
        min-height: 0;
    }

    .cf-result-image {
        height: 210px;
        min-height: 0;
        object-fit: contain;
    }

    .cf-result-content {
        padding: 14px 12px 15px;
    }

    .cf-result-brand {
        font-size: 10px;
    }

    .cf-result-name {
        margin-top: 2px;
        margin-bottom: 5px;
        font-size: 21px;
    }

    .cf-match-label {
        font-size: 11px;
        padding: 4px 6px;
    }

    .cf-explanation {
        margin-top: 10px;
        font-size: 14px;
        line-height: 1.42;
    }

    .cf-difference {
        margin-top: 9px;
        padding: 8px 9px;
        font-size: 13px;
    }

    .cf-match-counts {
        margin-top: 9px;
        font-size: 12px;
    }

    .cf-trait-toggle {
        margin-top: 6px;
        font-size: 13px;
    }

    .cf-result-actions {
        margin-top: 11px;
        gap: 6px;
    }

    .cf-result-actions a,
    .cf-result-actions button {
        min-height: 35px;
        padding: 0 9px;
        font-size: 11px;
    }

    .cf-end-message {
        margin-top: 18px;
    }
}

/* ============================================================
   V1 VISUAL REFINEMENT 3
   Restore app-style stacked result cards on mobile
   ============================================================ */

@media (max-width: 760px) {

    .cf-result-grid {
        grid-template-columns: 1fr;
    }

    .cf-result-image-wrap {
        width: 100%;
        height: 185px;
    }

    .cf-result-image {
        width: 100%;
        height: 185px;
        object-fit: contain;
    }

    .cf-result-content {
        padding: 13px 12px 14px;
    }

    .cf-results {
        gap: 11px;
    }
}

/* ============================================================
   V1 VISUAL REFINEMENT 4
   Mobile trait comparison
   ============================================================ */

@media (max-width: 760px) {

    .cf-trait-details {
        margin-top: 10px;
        padding-top: 7px;
    }

    .cf-trait-comparison,
    .cf-trait-comparison tbody,
    .cf-trait-comparison tr,
    .cf-trait-comparison td {
        display: block;
        width: 100%;
    }

    .cf-trait-comparison thead {
        display: none;
    }

    .cf-trait-comparison tr {
        display: grid;
        grid-template-columns: 1fr auto;
        gap: 2px 10px;
        padding: 8px 0;
        border-bottom: 1px solid #e7e9e3;
    }

    .cf-trait-comparison tr:last-child {
        border-bottom: 0;
    }

    .cf-trait-comparison td {
        padding: 0;
        border: 0;
    }

    .cf-trait-comparison td:nth-child(1) {
        grid-column: 1 / -1;
        font-weight: 800;
        margin-bottom: 2px;
    }

    .cf-trait-comparison td:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .cf-trait-comparison td:nth-child(2)::before {
        content: "You: ";
        font-weight: 700;
        color: #686e65;
    }

    .cf-trait-comparison td:nth-child(3) {
        grid-column: 2;
        grid-row: 2;
        align-self: center;
        padding: 2px 6px;
        border-radius: 5px;
        background: #eef1eb;
    }

    .cf-trait-comparison td:nth-child(4) {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .cf-trait-comparison td:nth-child(4)::before {
        content: "Pattern: ";
        font-weight: 700;
        color: #686e65;
    }
}

/* Finder hidden controls must stay hidden despite button display rules. */
.cf-primary[hidden],
.cf-secondary[hidden],
#cf-show-more[hidden] {
    display: none !important;
}
