#tdna-app {
    width: 100%;
    min-height: 70vh;
    background: #f4f5f1;
    color: #1e231d;
}

.tdna-shell {
    width: min(760px, 100%);
    margin: 0 auto;
    padding: 22px 16px 56px;
    box-sizing: border-box;
}

.tdna-progress {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    margin: 0 0 28px;
}

.tdna-progress-step {
    text-align: center;
    opacity: .4;
    font-size: 12px;
}

.tdna-progress-step span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin: 0 auto 4px;
    border: 2px solid #596253;
    border-radius: 999px;
    font-weight: 700;
    background: #fff;
}

.tdna-progress-step small {
    display: block;
    font-size: 11px;
}

.tdna-progress-step.is-active,
.tdna-progress-step.is-done {
    opacity: 1;
}

.tdna-progress-step.is-active span,
.tdna-progress-step.is-done span {
    background: #303a2e;
    border-color: #303a2e;
    color: #fff;
}

.tdna-screen[hidden] {
    display: none !important;
}

.tdna-hero,
.tdna-screen-heading {
    margin-bottom: 22px;
}

.tdna-eyebrow {
    margin-bottom: 7px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .09em;
    color: #68725f;
}

.tdna-hero h1,
.tdna-screen-heading h1,
.tdna-processing h1 {
    margin: 0 0 12px;
    font-size: clamp(30px, 7vw, 46px);
    line-height: 1.05;
}

.tdna-lead {
    margin: 0 0 12px;
    font-size: 20px;
    line-height: 1.4;
    font-weight: 650;
}

.tdna-copy,
.tdna-screen-heading p,
.tdna-processing p {
    margin: 0;
    font-size: 16px;
    line-height: 1.55;
    color: #50584c;
}

.tdna-card {
    padding: 20px;
    border: 1px solid #d8dbd3;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .05);
}

.tdna-upload-card {
    text-align: center;
}

.tdna-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin: 0 auto 14px;
    border-radius: 999px;
    background: #e7eadf;
    color: #303a2e;
    font-size: 34px;
    line-height: 1;
}

.tdna-card h2 {
    margin: 0 0 10px;
    font-size: 23px;
}

.tdna-card p {
    line-height: 1.5;
}

.tdna-primary-button,
.tdna-secondary-button,
.tdna-back-button,
.tdna-range-card {
    font: inherit;
    cursor: pointer;
}

.tdna-primary-button {
    width: 100%;
    min-height: 50px;
    padding: 13px 18px;
    border: 0;
    border-radius: 10px;
    background: #303a2e;
    color: #fff;
    font-weight: 750;
    font-size: 16px;
}

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

.tdna-secondary-button,
.tdna-back-button {
    min-height: 45px;
    padding: 11px 16px;
    border: 1px solid #bfc5b9;
    border-radius: 9px;
    background: #fff;
    color: #30382e;
    font-weight: 700;
}

.tdna-privacy-note,
.tdna-range-note,
.tdna-crop-help {
    margin-top: 16px !important;
    color: #687064;
    font-size: 13px;
}

.tdna-status {
    min-height: 20px;
    margin-top: 12px;
    font-size: 14px;
}

.tdna-status.is-error {
    color: #8f2f28;
}

.tdna-crop-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: #161916;
}

#tdna-crop-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.tdna-crop-frame {
    position: absolute;
    inset: 0;
    pointer-events: none;
    border: 3px solid rgba(255,255,255,.85);
    box-shadow:
        inset 0 0 0 1px rgba(0,0,0,.45);
    box-sizing: border-box;
}

.tdna-zoom-row {
    display: grid;
    grid-template-columns: 24px 1fr 24px;
    gap: 8px;
    align-items: center;
    margin: 12px 0;
}

.tdna-zoom-row span {
    text-align: center;
    font-weight: 800;
}

#tdna-zoom {
    width: 100%;
}

.tdna-actions {
    display: grid;
    grid-template-columns: .7fr 1.3fr;
    gap: 10px;
    margin-top: 18px;
}

.tdna-range-list {
    display: grid;
    gap: 12px;
}

.tdna-range-card {
    width: 100%;
    padding: 18px;
    text-align: left;
    border: 2px solid #d4d8cf;
    border-radius: 14px;
    background: #fff;
    color: #242a22;
}

.tdna-range-card:hover {
    border-color: #929c89;
}

.tdna-range-card.is-selected {
    border-color: #303a2e;
    box-shadow: 0 0 0 2px rgba(48,58,46,.12);
}

.tdna-range-name {
    margin-bottom: 5px;
    font-size: 22px;
    font-weight: 800;
}

.tdna-range-copy {
    color: #596155;
    font-size: 14px;
    line-height: 1.45;
}

.tdna-processing {
    padding: 54px 12px;
    text-align: center;
}

.tdna-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 20px;
    border: 4px solid #d8dbd3;
    border-top-color: #303a2e;
    border-radius: 50%;
    animation: tdna-spin .8s linear infinite;
}

@keyframes tdna-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (min-width: 680px) {

    .tdna-shell {
        padding-top: 32px;
    }

    .tdna-card {
        padding: 26px;
    }

    .tdna-range-list {
        grid-template-columns: repeat(3, 1fr);
    }

    .tdna-range-card {
        min-height: 165px;
    }

}


/* TERRAIN DNA LIVE RESULTS V1 */

.tdna-processing-panel {
    max-width: 460px;
    margin: 24px auto 0;
    padding: 20px;
    border: 1px solid #d7dbd1;
    border-radius: 14px;
    background: #fff;
    text-align: left;
}

.tdna-processing-panel h2 {
    margin: 0 0 8px;
    font-size: 21px;
}

.tdna-processing-panel p {
    margin-bottom: 16px;
}

.tdna-login-button {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 13px 16px;
    box-sizing: border-box;
    border: 1px solid #aeb5a8;
    border-radius: 9px;
    background: #fff;
    color: #20261f;
    text-align: center;
    text-decoration: none;
    font-weight: 750;
}

.tdna-processing-panel .tdna-secondary-button {
    width: 100%;
    margin-top: 10px;
}

.tdna-result-summary {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    align-items: center;
    margin-bottom: 18px;
}

.tdna-result-terrain {
    display: block;
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 10px;
}

.tdna-result-summary h2 {
    margin: 0 0 7px;
    font-size: 18px;
}

.tdna-result-summary p {
    margin: 0;
    font-size: 13px;
    color: #5d6559;
}

.tdna-result-card {
    margin-bottom: 14px;
    padding: 18px;
    border: 1px solid #d5d9d0;
    border-radius: 14px;
    background: #fff;
}

.tdna-result-card.is-top {
    padding: 21px;
    border: 2px solid #303a2e;
    box-shadow: 0 5px 20px rgba(0, 0, 0, .07);
}

.tdna-result-head {
    display: flex;
    gap: 13px;
    align-items: center;
}

.tdna-result-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: #303a2e;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
}

.tdna-result-title h2 {
    margin: 2px 0 0;
    font-size: 21px;
    line-height: 1.15;
}

.tdna-result-brand {
    color: #65705e;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.tdna-result-why {
    margin: 14px 0;
    color: #454d42;
    font-size: 14px;
    line-height: 1.5;
}

.tdna-family-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 5px;
}

.tdna-family {
    padding: 8px 4px;
    border-radius: 8px;
    background: #f1f2ee;
    text-align: center;
}

.tdna-family-label {
    margin-bottom: 3px;
    color: #666d62;
    font-size: 10px;
    font-weight: 700;
}

.tdna-family-level {
    font-size: 11px;
    font-weight: 800;
}

.tdna-family-strong {
    background: #e1e8dc;
}

.tdna-family-good {
    background: #eaeee5;
}

.tdna-family-moderate {
    background: #f1f2ee;
}

.tdna-family-lower {
    background: #f4ece8;
}

.tdna-result-actions {
    margin-top: 15px;
}

.tdna-result-actions .tdna-secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    text-decoration: none;
}

.tdna-results-note {
    margin: 22px 2px;
    color: #687064;
    font-size: 12px;
    line-height: 1.5;
}

.tdna-results-note p {
    margin: 7px 0;
}

.tdna-results-next {
    display: grid;
    gap: 9px;
    margin-top: 22px;
}

.tdna-results-next .tdna-secondary-button {
    width: 100%;
}

@media (max-width: 430px) {

    .tdna-family-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .tdna-result-summary {
        grid-template-columns: 82px 1fr;
    }

    .tdna-result-terrain {
        width: 82px;
        height: 82px;
    }

}

/* TERRAIN DNA LAB HANDOFF V1 */

.tdna-result-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 9px;
}

.tdna-result-actions .tdna-primary-button,
.tdna-result-actions .tdna-secondary-button {
    width: 100%;
    min-height: 46px;
}

@media (max-width: 430px) {
    .tdna-result-actions {
        grid-template-columns: 1fr;
    }
}

/* TERRAIN DNA TWO-PATTERN COMPARE V1 */

.tdna-select-compare {
    width: 100%;
    margin-top: 14px;
    padding: 10px 12px;
    border: 1px dashed #aeb5a8;
    border-radius: 8px;
    background: #f7f8f5;
    color: #4d5649;
    font: inherit;
    font-size: 13px;
    font-weight: 750;
    cursor: pointer;
}

.tdna-select-compare.is-selected {
    border-style: solid;
    border-color: #303a2e;
    background: #e3e8de;
    color: #22291f;
}

.tdna-compare-tray {
    position: sticky;
    bottom: 10px;
    z-index: 20;
    margin: 18px 0;
    padding: 14px;
    border: 1px solid #bfc5b9;
    border-radius: 13px;
    background: rgba(255,255,255,.97);
    box-shadow: 0 8px 28px rgba(0,0,0,.16);
    backdrop-filter: blur(8px);
}

.tdna-compare-tray[hidden] {
    display: none !important;
}

.tdna-compare-summary {
    margin-bottom: 10px;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
}

.tdna-compare-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.tdna-compare-actions[hidden] {
    display: none !important;
}

.tdna-compare-actions .tdna-primary-button,
.tdna-compare-actions .tdna-secondary-button {
    width: 100%;
}

@media (max-width: 500px) {
    .tdna-compare-actions {
        grid-template-columns: 1fr;
    }
}

/* TERRAIN DNA RESULT POLISH V1 */

.tdna-results-pair-hint {
    margin-top: 7px !important;
    font-size: 13px !important;
    color: #687064 !important;
}

.tdna-result-head {
    min-width: 0;
}

.tdna-pattern-swatch-wrap {
    position: relative;
    flex: 0 0 100px;
    width: 100px;
    height: 68px;
    overflow: hidden;
    border-radius: 10px;
    background: #dfe2da;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.tdna-result-card.is-top .tdna-pattern-swatch-wrap {
    flex-basis: 112px;
    width: 112px;
    height: 76px;
}

.tdna-pattern-swatch {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdna-pattern-swatch-wrap .tdna-result-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    font-size: 14px;
}

.tdna-result-title {
    min-width: 0;
}

.tdna-result-title h2 {
    overflow-wrap: anywhere;
}

.tdna-pattern-dna-link {
    font-size: 13px;
    font-weight: 700;
    color: #535c4f;
    background: #fafbf9;
}

.tdna-select-compare {
    display: inline-flex;
    width: auto;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 8px 13px;
    border-style: solid;
    border-radius: 999px;
}

.tdna-compare-tray {
    bottom: 8px;
    padding: 11px 12px;
}

.tdna-compare-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tdna-compare-count {
    color: #626a5e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tdna-compare-clear {
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: #5b6356;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    text-decoration: underline;
    cursor: pointer;
}

.tdna-compare-summary {
    margin: 3px 0 9px;
    font-size: 13px;
}

.tdna-compare-actions .tdna-primary-button,
.tdna-compare-actions .tdna-secondary-button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
}

@media (max-width: 430px) {

    .tdna-pattern-swatch-wrap {
        flex-basis: 94px;
        width: 94px;
        height: 64px;
    }

    .tdna-result-card.is-top .tdna-pattern-swatch-wrap {
        flex-basis: 104px;
        width: 104px;
        height: 70px;
    }

    .tdna-result-head {
        gap: 11px;
    }

    .tdna-result-title h2 {
        font-size: 19px;
    }

}

/* TERRAIN DNA RESULT POLISH V1 */

.tdna-results-pair-hint {
    margin-top: 7px !important;
    font-size: 13px !important;
    color: #687064 !important;
}

.tdna-result-head {
    min-width: 0;
}

.tdna-pattern-swatch-wrap {
    position: relative;
    flex: 0 0 100px;
    width: 100px;
    height: 68px;
    overflow: hidden;
    border-radius: 10px;
    background: #dfe2da;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}

.tdna-result-card.is-top .tdna-pattern-swatch-wrap {
    flex-basis: 112px;
    width: 112px;
    height: 76px;
}

.tdna-pattern-swatch {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tdna-pattern-swatch-wrap .tdna-result-rank {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    flex: none;
    box-shadow: 0 2px 8px rgba(0,0,0,.25);
    font-size: 14px;
}

.tdna-result-title {
    min-width: 0;
}

.tdna-result-title h2 {
    overflow-wrap: anywhere;
}

.tdna-pattern-dna-link {
    font-size: 13px;
    font-weight: 700;
    color: #535c4f;
    background: #fafbf9;
}

.tdna-select-compare {
    display: inline-flex;
    width: auto;
    min-height: 42px;
    align-items: center;
    justify-content: center;
    margin-top: 12px;
    padding: 8px 13px;
    border-style: solid;
    border-radius: 999px;
}

.tdna-compare-tray {
    bottom: 8px;
    padding: 11px 12px;
}

.tdna-compare-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.tdna-compare-count {
    color: #626a5e;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.tdna-compare-clear {
    padding: 5px 4px;
    border: 0;
    background: transparent;
    color: #5b6356;
    font: inherit;
    font-size: 12px;
    font-weight: 750;
    text-decoration: underline;
    cursor: pointer;
}

.tdna-compare-summary {
    margin: 3px 0 9px;
    font-size: 13px;
}

.tdna-compare-actions .tdna-primary-button,
.tdna-compare-actions .tdna-secondary-button {
    min-height: 44px;
    padding: 10px 12px;
    font-size: 13px;
}

@media (max-width: 430px) {

    .tdna-pattern-swatch-wrap {
        flex-basis: 94px;
        width: 94px;
        height: 64px;
    }

    .tdna-result-card.is-top .tdna-pattern-swatch-wrap {
        flex-basis: 104px;
        width: 104px;
        height: 70px;
    }

    .tdna-result-head {
        gap: 11px;
    }

    .tdna-result-title h2 {
        font-size: 19px;
    }

}

/* Terrain DNA requested results email */
.tdna-email-results-wrap {
    flex: 1 1 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 4px;
}

.tdna-email-results-wrap .tdna-primary-button {
    width: 100%;
}

.tdna-email-status {
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.35;
    text-align: center;
    opacity: 0.78;
}

/* Terrain DNA additional recommendations */
.tdna-result-card[hidden] {
    display: none !important;
}

.tdna-more-results {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 14px 0 20px;
}

.tdna-more-results .tdna-secondary-button {
    width: auto;
    min-width: 160px;
}

/* Terrain DNA public explanation / crawlable feature copy */
.tdna-about {
    max-width: 980px;
    margin: 32px auto 48px;
    padding: 0 18px;
}

.tdna-about-inner {
    padding: 28px;
    border: 1px solid #d8ddd3;
    border-radius: 14px;
    background: #f7f8f5;
}

.tdna-about h2 {
    max-width: 760px;
    margin: 0 0 16px;
    font-size: 1.75rem;
    line-height: 1.2;
}

.tdna-about p {
    max-width: 820px;
    line-height: 1.6;
}

.tdna-about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-top: 24px;
}

.tdna-about-card {
    padding: 20px;
    border: 1px solid #dde1d8;
    border-radius: 10px;
    background: #fff;
}

.tdna-about-card h3,
.tdna-about-independence h3 {
    margin: 0 0 10px;
}

.tdna-about-card p {
    margin: 0 0 12px;
}

.tdna-about-card p:last-child {
    margin-bottom: 0;
}

.tdna-about-independence {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #d8ddd3;
}

.tdna-about-independence a {
    font-weight: 700;
}

@media (max-width: 700px) {
    .tdna-about {
        margin: 24px auto 36px;
        padding: 0 12px;
    }

    .tdna-about-inner {
        padding: 20px 16px;
    }

    .tdna-about h2 {
        font-size: 1.45rem;
    }

    .tdna-about-grid {
        grid-template-columns: 1fr;
    }
}

/* Fix light Terrain DNA explanation section text */
.tdna-about,
.tdna-about-inner {
    color: #252a24;
}

.tdna-about h2,
.tdna-about h3,
.tdna-about p,
.tdna-about-card,
.tdna-about-card h3,
.tdna-about-card p,
.tdna-about-independence,
.tdna-about-independence h3,
.tdna-about-independence p {
    color: #252a24;
}

.tdna-about .tdna-eyebrow {
    color: #52644e;
}

.tdna-about a {
    color: #355037;
}

.tdna-about a:hover {
    color: #223524;
}
