.agebyphoto-wrap,
.agebyphoto-wrap * {
    box-sizing: border-box;
}

.agebyphoto-wrap {
    --agebyphoto-ink: #07142d;
    --agebyphoto-muted: #64728e;
    --agebyphoto-blue: #1f78ff;
    --agebyphoto-purple: #7a4dff;
    --agebyphoto-pink: #f63aa9;
    --agebyphoto-green: #21c783;
    --agebyphoto-line: rgba(117, 105, 255, .18);
    --agebyphoto-shadow: 0 20px 55px rgba(68, 75, 140, .15);
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0;
    color: var(--agebyphoto-ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    background: transparent !important;
}

.agebyphoto-tool-card {
    position: relative;
    width: 100%;
    padding: 26px 34px 26px;
    border-radius: 34px;
    background: transparent !important;
    overflow: hidden;
}

.agebyphoto-head {
    text-align: center;
    position: relative;
    z-index: 1;
}


/* v2.1.1 hard design fixes: no top upload icon/logo above heading, no NEW tag. */
.agebyphoto-wrap .agebyphoto-head > .agebyphoto-upload-icon,
.agebyphoto-wrap .agebyphoto-head > .agebyphoto-mini-logo,
.agebyphoto-wrap .agebyphoto-new-tag,
.agebyphoto-wrap .agebyphoto-celeb-option em {
    display: none !important;
}


.agebyphoto-mini-logo {
    width: 66px;
    height: 66px;
    margin: 0 auto 10px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--agebyphoto-purple);
    background: radial-gradient(circle, #fff 0%, #fff 55%, #f5edff 100%);
    box-shadow: 0 9px 26px rgba(112, 73, 255, .16);
}

.agebyphoto-mini-logo svg {
    width: 38px;
    height: 38px;
}

.agebyphoto-head h1 {
    margin: 0;
    font-size: clamp(30px, 4.8vw, 49px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -1.6px;
    color: var(--agebyphoto-ink);
}

.agebyphoto-head h1 span,
.agebyphoto-result-top h3,
.agebyphoto-celeb-card strong,
.agebyphoto-metric strong {
    background: linear-gradient(100deg, #f335b5 0%, #844cff 50%, #167cff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.agebyphoto-head p {
    margin: 14px 0 28px;
    color: var(--agebyphoto-muted);
    font-size: clamp(14px, 1.9vw, 20px);
    line-height: 1.3;
}

.agebyphoto-spark {
    position: absolute;
    color: #df4fd3;
    font-size: 42px;
    line-height: 1;
    pointer-events: none;
}

.agebyphoto-spark-left {
    top: 56px;
    left: 6px;
}

.agebyphoto-spark-right {
    top: 72px;
    right: 10px;
    color: #8b58ff;
}

.agebyphoto-form {
    position: relative;
    z-index: 1;
}

.agebyphoto-upload-box {
    width: 100%;
    min-height: 218px;
    border-radius: 30px;
    border: 3px dashed transparent;
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(90deg, #ff4bc2, #8d55ff, #1b77ff) border-box;
    color: var(--agebyphoto-ink);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    box-shadow: inset 0 0 60px rgba(120, 92, 255, .04);
    font: inherit;
    padding: 22px;
    -webkit-tap-highlight-color: transparent;
}

.agebyphoto-upload-box:hover,
.agebyphoto-upload-box.agebyphoto-is-drag {
    transform: translateY(-2px);
    box-shadow: 0 18px 40px rgba(100, 83, 255, .12), inset 0 0 55px rgba(246, 58, 169, .05);
}

.agebyphoto-upload-icon {
    width: 94px;
    height: 94px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--agebyphoto-purple);
    background: radial-gradient(circle at 30% 20%, #fff 0, #fff 52%, #f6efff 100%);
    box-shadow: 0 14px 30px rgba(93, 70, 180, .14);
    margin-bottom: 22px;
}

.agebyphoto-upload-icon svg {
    width: 52px;
    height: 52px;
}

.agebyphoto-upload-title {
    display: block;
    font-size: clamp(18px, 2.4vw, 26px);
    line-height: 1.15;
    font-weight: 900;
}

.agebyphoto-upload-sub {
    display: block;
    margin-top: 8px;
    color: var(--agebyphoto-muted);
    font-size: clamp(14px, 1.6vw, 19px);
}

.agebyphoto-selected-file {
    margin-top: 18px;
    min-width: min(420px, 100%);
    max-width: 100%;
    height: 52px;
    padding: 7px 12px 7px 7px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid rgba(114, 89, 255, .18);
    box-shadow: 0 10px 24px rgba(69, 57, 117, .12);
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.agebyphoto-selected-file[hidden] {
    display: none;
}

.agebyphoto-selected-thumb {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #8b55ff;
}

.agebyphoto-selected-name {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #43506b;
    font-weight: 800;
    font-size: 14px;
    text-align: left;
}

.agebyphoto-remove-file {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #f43c9f;
    background: #fff0fa;
    font-size: 19px;
    line-height: 1;
}

.agebyphoto-options-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin: 28px 0 26px;
}

.agebyphoto-celeb-option,
.agebyphoto-private-note {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    border-radius: 999px;
    color: #07142d;
    font-size: 16px;
    font-weight: 800;
}

.agebyphoto-celeb-option {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.agebyphoto-celeb-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    font-size: 16px !important;
}

.agebyphoto-check-ui {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    color: #fff;
    background: linear-gradient(135deg, #9255ff, #6a40fa);
    box-shadow: 0 10px 25px rgba(122, 77, 255, .22);
}

.agebyphoto-celeb-option input:not(:checked) + .agebyphoto-check-ui {
    color: transparent;
    background: #fff;
    border: 2px solid rgba(122, 77, 255, .3);
    box-shadow: none;
}

.agebyphoto-celeb-option em {
    padding: 7px 14px;
    border-radius: 12px;
    background: #ffe6f7;
    color: #ff2aa6;
    font-style: normal;
    font-size: 18px;
    line-height: 1;
}

.agebyphoto-private-note {
    color: #5f6f8d;
    font-weight: 700;
}

.agebyphoto-private-note svg {
    width: 32px;
    height: 32px;
    color: #18bd72;
    flex: 0 0 auto;
}

.agebyphoto-celeb-option > span:last-child,
.agebyphoto-private-note span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.agebyphoto-celeb-option {
    min-width: 0;
}

.agebyphoto-private-note {
    flex-shrink: 0;
}

.agebyphoto-analyze-btn {
    width: 100%;
    height: 66px;
    border: 0;
    border-radius: 23px;
    background: linear-gradient(100deg, #f238aa 0%, #9b4cff 48%, #087dff 100%);
    color: #fff;
    font: inherit;
    font-size: clamp(18px, 2.3vw, 26px);
    font-weight: 900;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    box-shadow: 0 18px 36px rgba(82, 77, 239, .25);
    transition: transform .2s ease, opacity .2s ease;
    -webkit-tap-highlight-color: transparent;
}

.agebyphoto-analyze-btn:hover {
    transform: translateY(-2px);
}

.agebyphoto-analyze-btn:disabled {
    cursor: wait;
    opacity: .9;
    transform: none;
}

.agebyphoto-btn-icon {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    font-size: 30px;
}

.agebyphoto-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid rgba(255,255,255,.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: agebyphotoSpin .8s linear infinite;
}

@keyframes agebyphotoSpin {
    to { transform: rotate(360deg); }
}

.agebyphoto-progress-slot {
    margin-top: 22px;
}

.agebyphoto-progress-card {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 18px;
    border-radius: 22px;
    background: rgba(255,255,255,.9);
    border: 1px solid rgba(126, 101, 255, .15);
    box-shadow: 0 18px 35px rgba(84, 76, 150, .11);
}

.agebyphoto-progress-ring {
    --agebyphoto-progress: 0%;
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: conic-gradient(#7a4dff var(--agebyphoto-progress), #e8eafb 0);
    display: grid;
    place-items: center;
    position: relative;
}

.agebyphoto-progress-ring::after {
    content: '';
    position: absolute;
    inset: 8px;
    background: #fff;
    border-radius: 50%;
}

.agebyphoto-progress-ring span {
    position: relative;
    z-index: 1;
    color: #6437eb;
    font-weight: 900;
    font-size: 16px;
}

.agebyphoto-progress-copy strong,
.agebyphoto-progress-copy small {
    display: block;
}

.agebyphoto-progress-copy strong {
    font-size: 18px;
    color: #182642;
}

.agebyphoto-progress-copy small {
    margin-top: 3px;
    color: #65738c;
}

.agebyphoto-result-slot {
    margin-top: 32px;
}

.agebyphoto-result-card {
    position: relative;
    overflow: hidden;
    padding: 34px;
    border-radius: 34px;
    background:
        radial-gradient(circle at 2% 0%, rgba(255, 189, 221, .55), transparent 28%),
        radial-gradient(circle at 100% 80%, rgba(166, 184, 255, .32), transparent 32%),
        linear-gradient(135deg, rgba(255,255,255,.98), rgba(250,248,255,.97));
    border: 1px solid rgba(129, 107, 255, .14);
    box-shadow: 0 26px 70px rgba(64, 54, 134, .16);
}

.agebyphoto-result-top {
    text-align: center;
}

.agebyphoto-shield {
    width: 68px;
    height: 68px;
    margin: 0 auto 12px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--agebyphoto-purple);
    background: #fff;
    box-shadow: 0 12px 28px rgba(96, 68, 180, .16);
}

.agebyphoto-shield svg {
    width: 32px;
    height: 32px;
}

.agebyphoto-result-top h3 {
    margin: 0;
    font-size: clamp(26px, 4.1vw, 44px);
    line-height: 1.05;
    font-weight: 900;
    letter-spacing: -1.8px;
}

.agebyphoto-result-top p {
    margin: 10px 0 24px;
    color: #65728c;
    font-size: clamp(13px, 1.8vw, 18px);
}

.agebyphoto-photo-frame {
    width: 100%;
    height: clamp(280px, 38vw, 430px);
    border-radius: 28px;
    overflow: hidden;
    box-shadow: 0 18px 40px rgba(43, 45, 80, .12);
    background: linear-gradient(135deg, #f7f8ff, #ffffff);
    border: 1px solid rgba(119, 101, 255, .12);
    padding: 12px;
    display: grid;
    place-items: center;
}

.agebyphoto-photo-frame img {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 0;
    border-radius: 22px;
    object-fit: contain;
    object-position: center;
}

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

.agebyphoto-metric {
    min-height: 100px;
    padding: 20px 22px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 18px;
    background: rgba(255,255,255,.78);
    border: 1px solid rgba(93, 101, 255, .18);
    box-shadow: 0 12px 28px rgba(66, 62, 140, .07);
}

.agebyphoto-age-metric {
    border-color: rgba(246, 58, 169, .18);
}

.agebyphoto-metric-icon {
    width: 74px;
    height: 74px;
    flex: 0 0 auto;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #376bff;
    background: linear-gradient(135deg, #edf2ff, #eee8ff);
}

.agebyphoto-age-metric .agebyphoto-metric-icon {
    color: #e93ba5;
    background: linear-gradient(135deg, #ffe5f5, #f2eaff);
}

.agebyphoto-metric-icon svg {
    width: 32px;
    height: 32px;
}

.agebyphoto-metric small {
    display: block;
    color: #5e6b84;
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 4px;
}

.agebyphoto-metric strong {
    display: block;
    font-size: 27px;
    line-height: 1;
    font-weight: 900;
}

.agebyphoto-celeb-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 22px;
    padding: 24px 26px;
    border-radius: 24px;
    background: rgba(255,255,255,.8);
    border: 1px solid rgba(128, 106, 255, .18);
    box-shadow: 0 14px 34px rgba(82, 70, 155, .08);
}

.agebyphoto-star-orb {
    width: 82px;
    height: 82px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #ffb000;
    background: radial-gradient(circle at 50% 50%, #fff 0, #fff 48%, #f0e8ff 100%);
    box-shadow: 0 12px 24px rgba(126, 83, 255, .12);
}

.agebyphoto-star-orb svg {
    width: 48px;
    height: 48px;
}

.agebyphoto-celeb-line {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #4f5c77;
    font-size: 19px;
}

.agebyphoto-celeb-line b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 72px;
    padding: 7px 16px;
    border-radius: 999px;
    background: #ddffeb;
    color: #11a95f;
    font-size: 18px;
    font-weight: 900;
}

.agebyphoto-celeb-name {
    margin-top: 8px;
    color: #34415d;
    font-size: 19px;
}

.agebyphoto-celeb-name strong {
    font-size: 22px;
    margin-left: 8px;
    font-weight: 900;
}


.agebyphoto-celeb-card.agebyphoto-no-match {
    grid-template-columns: auto 1fr;
}

.agebyphoto-celeb-card.agebyphoto-no-match .agebyphoto-match-pill {
    display: none !important;
}

.agebyphoto-match-pill {
    min-width: 94px;
    padding: 13px 12px;
    border-radius: 18px;
    background: linear-gradient(135deg, #f3eaff, #eef0ff);
    text-align: center;
}

.agebyphoto-match-pill strong,
.agebyphoto-match-pill span {
    display: block;
}

.agebyphoto-match-pill strong {
    color: #7a4dff;
    font-size: 27px;
    line-height: 1;
}

.agebyphoto-match-pill span {
    color: #4f5e7a;
    font-size: 16px;
    margin-top: 4px;
}

.agebyphoto-extra-note {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid rgba(96, 109, 145, .18);
    color: #66748e;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 22px;
    font-size: 16px;
    text-align: center;
}

.agebyphoto-error-card,
.agebyphoto-limit-card {
    border-radius: 24px;
    padding: 22px;
    text-align: center;
    background: linear-gradient(135deg, #fff2f7, #f6f2ff);
    border: 1px solid rgba(246, 58, 169, .18);
    color: #d11a72;
    box-shadow: 0 16px 34px rgba(92, 50, 130, .1);
}

.agebyphoto-limit-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 12px;
    min-height: 42px;
    padding: 0 20px;
    border-radius: 999px;
    color: #fff;
    text-decoration: none;
    background: linear-gradient(100deg, #f238aa, #7a4dff, #087dff);
    font-weight: 900;
}

@media (min-width: 801px) {
    .agebyphoto-result-card {
        max-width: 1020px;
        margin: 0 auto;
    }
}

@media (max-width: 700px) {
    .agebyphoto-wrap {
        max-width: 100%;
    }

    .agebyphoto-tool-card {
        padding: 16px 0 16px;
        border-radius: 0;
    }

    .agebyphoto-spark {
        font-size: 26px;
    }

    .agebyphoto-spark-left {
        top: 38px;
        left: -2px;
    }

    .agebyphoto-spark-right {
        top: 44px;
        right: -2px;
    }

    .agebyphoto-mini-logo {
        width: 48px;
        height: 48px;
        margin-bottom: 8px;
    }

    .agebyphoto-mini-logo svg {
        width: 29px;
        height: 29px;
    }

    .agebyphoto-head h1 {
        font-size: clamp(22px, 6.1vw, 31px);
        letter-spacing: -1.15px;
        white-space: nowrap;
        max-width: 100%;
        overflow: visible;
    }

    .agebyphoto-head h1 span {
        display: inline;
        white-space: nowrap;
    }

    .agebyphoto-head p {
        font-size: 14.5px;
        margin: 9px auto 20px;
        max-width: 340px;
        padding: 0 6px;
    }

    .agebyphoto-upload-box {
        min-height: 205px;
        border-radius: 24px;
        border-width: 2px;
        padding: 18px 10px;
    }

    .agebyphoto-upload-icon {
        width: 82px;
        height: 82px;
        margin-bottom: 16px;
    }

    .agebyphoto-upload-icon svg {
        width: 48px;
        height: 48px;
    }

    .agebyphoto-upload-title {
        font-size: 19px;
        white-space: nowrap;
    }

    .agebyphoto-upload-sub {
        font-size: 17px;
    }

    .agebyphoto-selected-file {
        height: 44px;
        min-width: 0;
        width: min(360px, 92%);
    }

    .agebyphoto-options-row {
        margin: 18px 0 18px;
        gap: 3px;
        flex-wrap: nowrap;
        width: 100%;
    }

    .agebyphoto-celeb-option,
    .agebyphoto-private-note {
        gap: 4px;
        font-size: 11.8px;
        min-height: 32px;
        white-space: nowrap;
        letter-spacing: -.1px;
    }

    .agebyphoto-celeb-option {
        flex: 1 1 auto;
    }

    .agebyphoto-private-note {
        flex: 0 0 auto;
    }

    .agebyphoto-check-ui,
    .agebyphoto-private-note svg {
        width: 23px;
        height: 23px;
        flex: 0 0 auto;
    }

    .agebyphoto-celeb-option em {
        display: none !important;
    }

    .agebyphoto-analyze-btn {
        height: 58px;
        border-radius: 18px;
        font-size: 21px;
    }

    .agebyphoto-progress-card {
        padding: 12px;
        border-radius: 18px;
    }

    .agebyphoto-progress-ring {
        width: 58px;
        height: 58px;
    }

    .agebyphoto-progress-ring span {
        font-size: 13px;
    }

    .agebyphoto-progress-copy strong {
        font-size: 14px;
        white-space: nowrap;
    }

    .agebyphoto-progress-copy small {
        font-size: 12px;
    }

    .agebyphoto-result-slot {
        margin-top: 24px;
    }

    .agebyphoto-result-card {
        padding: 20px 12px 18px;
        border-radius: 26px;
    }

    .agebyphoto-shield {
        width: 50px;
        height: 50px;
        margin-bottom: 9px;
    }

    .agebyphoto-shield svg {
        width: 31px;
        height: 31px;
    }

    .agebyphoto-result-top h3 {
        font-size: 30px;
        letter-spacing: -1px;
    }

    .agebyphoto-result-top p {
        margin: 8px 0 16px;
        font-size: 16px;
    }

    .agebyphoto-photo-frame {
        height: 260px;
        border-radius: 20px;
        padding: 10px;
    }

    .agebyphoto-photo-frame img {
        height: 100%;
        min-height: 0;
        border-radius: 16px;
        object-fit: contain;
    }

    .agebyphoto-metrics {
        grid-template-columns: 1fr;
        gap: 12px;
        margin: 14px 0;
    }

    .agebyphoto-metric {
        min-height: 82px;
        padding: 14px 16px;
        gap: 14px;
        border-radius: 18px;
    }

    .agebyphoto-metric-icon {
        width: 56px;
        height: 56px;
    }

    .agebyphoto-metric-icon svg {
        width: 32px;
        height: 32px;
    }

    .agebyphoto-metric small {
        font-size: 15px;
        margin-bottom: 2px;
    }

    .agebyphoto-metric strong {
        font-size: 27px;
    }

    .agebyphoto-celeb-card {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
        padding: 14px 12px;
        border-radius: 18px;
    }

    .agebyphoto-star-orb {
        width: 54px;
        height: 54px;
    }

    .agebyphoto-star-orb svg {
        width: 33px;
        height: 33px;
    }

    .agebyphoto-celeb-line {
        font-size: 15px;
        gap: 8px;
        white-space: nowrap;
    }

    .agebyphoto-celeb-line b {
        min-width: 45px;
        padding: 5px 10px;
        font-size: 13px;
    }

    .agebyphoto-celeb-name {
        font-size: 15px;
        white-space: nowrap;
    }

    .agebyphoto-celeb-name strong {
        display: inline-block;
        max-width: 126px;
        margin-left: 3px;
        font-size: 19px;
        vertical-align: bottom;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

    .agebyphoto-match-pill {
        display: none !important;
    }

    .agebyphoto-celeb-card {
        grid-template-columns: auto 1fr;
    }

    .agebyphoto-extra-note {
        flex-direction: column;
        gap: 4px;
        margin-top: 18px;
        padding-top: 14px;
        font-size: 13px;
    }
}

@media (max-width: 380px) {
    .agebyphoto-tool-card {
        padding-left: 2px;
        padding-right: 2px;
    }

    .agebyphoto-head h1 {
        font-size: 20.5px;
        letter-spacing: -.95px;
    }

    .agebyphoto-head p {
        font-size: 14px;
    }

    .agebyphoto-options-row {
        gap: 4px;
    }

    .agebyphoto-celeb-option,
    .agebyphoto-private-note {
        font-size: 11px;
    }

    .agebyphoto-celeb-option em {
        display: none !important;
    }

    .agebyphoto-private-note svg,
    .agebyphoto-check-ui {
        width: 23px;
        height: 23px;
    }

    .agebyphoto-photo-frame {
        height: 228px;
        padding: 9px;
    }

    .agebyphoto-celeb-name strong {
        max-width: 100px;
        font-size: 17px;
    }
}


/* v3.1.9 mobile heading hard-fit: keep full title in one line, no Photo crop. */
@media (max-width: 430px) {
    .agebyphoto-head h1 {
        font-size: clamp(20.5px, 5.55vw, 25px) !important;
        line-height: 1.08;
        letter-spacing: -1px;
        padding: 0 2px;
    }
    .agebyphoto-spark {
        font-size: 21px;
    }
    .agebyphoto-spark-left {
        left: -5px;
    }
    .agebyphoto-spark-right {
        right: -5px;
    }
}

@media (max-width: 340px) {
    .agebyphoto-head h1 {
        font-size: 18.5px !important;
        letter-spacing: -.85px;
    }
}
