:root {
    color-scheme: light;
    --cream: #fff9f1;
    --orange: #e99b65;
    --green: #a7c7a1;
    --ink: #38332f
}

* {
    box-sizing: border-box
}

body.animal-page {
    margin: 0;
    min-height: 100vh;
    background: radial-gradient(ellipse at 90% 5%, #e6efd9 0, transparent 42%), var(--cream);
    background-attachment: fixed;
    color: var(--ink);
    font: 16px/1.5 ui-sans-serif, system-ui, sans-serif;
    text-align: center
}

.animal-page main {
    max-width: 448px;
    margin: 0 auto;
    padding: 0 0 24px
}

.animal-page .capture-area {
    position: relative;
    padding: 64px 8px 0;
    min-height: 0
}

.animal-page header {
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 40px
}

.animal-page #logo-link {
    position: absolute;
    top: 0;
    left: 0;
    display: block
}

.animal-page header img {
    display: block;
    height: 40px;
    width: auto;
    max-width: none
}

.animal-page #language {
    position: absolute;
    right: 0;
    top: 0;
    padding: 4px;
    border: 1px solid #ead7c4;
    border-radius: 4px;
    background: #fff;
    color: #000;
    font: 16px/24px ui-sans-serif, system-ui, sans-serif;
    max-width: 160px
}

.animal-page .intro {
    padding: 8px 16px 0
}

.animal-page h1 {
    font-size: 30px;
    line-height: 36px;
    font-weight: 800;
    margin: 0 0 8px;
    letter-spacing: 0;
    background: linear-gradient(90deg, #b76a37, #df965e, #728c66);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent
}

.animal-page.result-page h1 {
    font-size: 24px;
    line-height: 32px;
    margin-bottom: 4px
}

.animal-page .subtitle {
    font-size: 14px;
    line-height: 21px;
    margin: 0 0 12px;
    color: #565049
}

.animal-page.result-page .subtitle {
    font-size: 12px;
    line-height: 18px;
    margin-bottom: 16px;
    color: #776e63
}

.animal-page p {
    margin: 0
}

.animal-page h2 {
    font-size: 16px;
    line-height: 24px;
    font-weight: 700;
    margin: 0 0 12px
}

.animal-page .upload-area {
    padding: 0 16px
}

.animal-page .hero {
    display: block;
    width: 208px;
    height: 208px;
    object-fit: cover;
    margin: 0 auto 12px;
    border: 1px solid #ead7c4;
    border-radius: 24px;
    box-shadow: 0 12px 30px #b16f3d1a;
    background: white
}

.animal-page .upload-guide {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px;
    padding: 10px 16px;
    text-align: left;
    border: 1px solid #e1e8d7;
    border-radius: 16px;
    background: #edf2e6b3;
    font-size: 14px;
    line-height: 20px
}

.animal-page .muted {
    font-size: 12px;
    line-height: 18px;
    color: #776e63
}

.animal-page .upload-guide .muted {
    margin-top: 6px
}

.animal-page .upload-input {
    width: 100%;
    max-width: 320px;
    margin: 0 auto 12px;
    text-align: left
}

.animal-page input[type=file] {
    display: block;
    width: 100%;
    border: 1px solid #ead7c4;
    border-radius: 12px;
    padding: 8px 12px;
    font: 14px/20px ui-sans-serif, system-ui, sans-serif;
    color: #000;
    background: #fff
}

.animal-page input[type=file]::file-selector-button {
    padding: 2px 6px;
    margin-right: 6px;
    border: 1px solid #a9a9a9;
    border-radius: 2px;
    background: #eee;
    color: #111;
    font: inherit;
    cursor: pointer
}

.animal-page .main-button,
.animal-page .share-button,
.animal-page .retry-button {
    font: 600 16px/24px ui-sans-serif, system-ui, sans-serif;
    cursor: pointer;
    transition: filter .15s;
    text-align: center;
    text-decoration: none
}

.animal-page .main-button,
.animal-page .share-button,
.animal-page .retry-button {
    display: block;
    width: 100%;
    border-radius: 9999px;
    padding: 12px 16px;
    border: 1px solid transparent
}

.animal-page .main-button {
    color: #fff;
    background: linear-gradient(135deg, #e99b65, #d99058, #ba7b47);
    box-shadow: 0 9px 24px #cc865526
}

.animal-page #analyze {
    max-width: 320px;
    margin: 0 auto
}

.animal-page button:disabled {
    background: #d1d5db;
    box-shadow: none;
    color: #fff;
    cursor: not-allowed
}

.animal-page button:hover:not(:disabled) {
    filter: brightness(.96)
}

.animal-page .share-button {
    background: #cc8650;
    color: white;
    box-shadow: 0 1px 3px #7654321a
}

.animal-page .retry-button {
    border-color: #ead7c4;
    background: #fff;
    color: #a86737;
    box-shadow: 0 1px 3px #7654321a
}

.animal-page .button-area {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 24px 16px 24px
}

.animal-page .button-area .main-button {
    margin: 0
}

.animal-page .animal-list {
    margin: 24px auto 16px;
    padding: 0 24px;
    max-width: 368px
}

.animal-page .animals {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px
}

.animal-page .animal {
    font-size: 11px;
    line-height: 16px
}

.animal-page .animal img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 12px;
    margin-bottom: 4px
}

.animal-page .support {
    padding: 0 24px;
    margin-top: 12px
}

.animal-page .notice {
    font-size: 11px;
    line-height: 17px;
    background: #edf2e6;
    padding: 10px 12px;
    border-radius: 12px;
    text-align: left;
    margin-bottom: 10px
}

.animal-page .support>.muted {
    text-align: left
}

.animal-page footer {
    font-size: 12px;
    color: #776e63;
    margin: 24px 0 0
}

.animal-page footer p {
    margin-top: 8px
}

.animal-page footer a {
    text-decoration: underline
}

.animal-page #results {
    padding: 0 8px
}

.animal-page .face-comparison {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    max-width: 368px;
    margin: 0 auto 12px
}

.animal-page figure {
    min-width: 0;
    margin: 0
}

.animal-page figure img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    object-position: center;
    border: 1px solid #ead7c4;
    border-radius: 16px;
    background: white
}

.animal-page figcaption {
    font-size: 12px;
    line-height: 18px;
    color: #776e63;
    margin-top: 6px
}

.animal-page .result-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 9999px;
    background: #f8eddf;
    border: 1px solid #ead7c4;
    color: #ae6a35;
    font-size: 11px;
    font-weight: 800;
    margin-bottom: 8px
}

.animal-page .match-card {
    max-width: 336px;
    margin: 0 auto 12px;
    padding: 12px 16px;
    border: 1px solid #ead7c4;
    border-radius: 16px;
    background: #ffffffef;
    box-shadow: 0 10px 28px #b16f3d14
}

.animal-page .match-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px
}

.animal-page .match-heading h2 {
    font-size: 20px;
    font-weight: 900;
    margin: 0;
    text-align: left
}

.animal-page .score {
    font-size: 24px;
    font-weight: 900;
    color: #bb743c;
    #white-space: nowrap
}

.animal-page .match-description {
    font-size: 12px;
    color: #776e63;
    text-align: left;
    margin-top: 6px
}

.animal-page .evidence {
    margin-top: 10px;
    font-size: 11px;
    line-height: 18px;
    text-align: left;
    color: #776e63
}

.animal-page summary {
    cursor: pointer;
    font-weight: 600
}

.animal-page .evidence p {
    margin-top: 4px
}

.animal-page .result-note {
    font-size: 10px;
    line-height: 16px;
    color: #8d857b;
    text-align: left;
    border: 1px solid #ead7c4;
    background: #ffffffb3;
    border-radius: 12px;
    padding: 8px 12px;
    max-width: 384px;
    margin: auto
}

.animal-page #status {
   # white-space: pre-line;
    font-size: 14px;
    color: #a2482e;
    margin: 0 16px 12px
}

.animal-page #status:empty {
    display: none
}

.animal-page #loading {
    padding: 64px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 14px;
    color: #776e63
}

.animal-page .loading-spinner {
    width: 34px;
    height: 34px;
    border: 4px solid #f1e4d5;
    border-top-color: #e99b65;
    border-radius: 50%;
    animation: spin .9s linear infinite;
    margin-bottom: 16px
}

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

[hidden] {
    display: none !important
}

.animal-page :focus-visible {
    outline: 3px solid #69875f;
    outline-offset: 3px
}

@media(prefers-reduced-motion:reduce) {
    .animal-page .loading-spinner {
        animation: none
    }
}

@media(max-width:350px) {
    .animal-page h1 {
        font-size: 26px
    }

    .animal-page .face-comparison {
        gap: 8px
    }

    .animal-page .score {
        font-size: 22px
    }
}

.animal-page .main-button,
.animal-page .share-button {
    border: 0
}