* {
    box-sizing: border-box;
}

body {
    margin: 0;

    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    background: #f5f6f8;
    color: #1f2937;
}


.container {
    width: min(1000px, 94%);
    margin: 35px auto 70px;
}


/* ---------------------------------
   Header
--------------------------------- */

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
}


h1 {
    margin: 0 0 8px;
}


.subtitle {
    margin-top: 0;
    color: #6b7280;
}


.reset-button,
.new-search-button {
    display: inline-block;

    padding: 9px 15px;

    border: 1px solid #d1d5db;
    border-radius: 7px;

    background: white;
    color: #111827;

    text-decoration: none;
    font-weight: 600;

    white-space: nowrap;
}


.reset-button:hover,
.new-search-button:hover {
    background: #f3f4f6;
}


/* ---------------------------------
   Cards
--------------------------------- */

form,
.result,
.message,
.loading {
    margin-top: 28px;
    padding: 30px;

    background: white;

    border-radius: 14px;
    border: 1px solid #e5e7eb;
}


/* ---------------------------------
   Form
--------------------------------- */

label {
    display: block;

    margin-top: 18px;
    margin-bottom: 7px;

    font-weight: 600;
}


input {
    width: 100%;

    padding: 13px;

    border: 1px solid #d1d5db;
    border-radius: 8px;

    font-size: 16px;
}


input:focus {
    outline: 2px solid #9ca3af;
    outline-offset: 1px;
}


button {
    width: 100%;

    margin-top: 28px;
    padding: 14px;

    border: 0;
    border-radius: 8px;

    background: #111827;
    color: white;

    font-size: 16px;
    font-weight: 700;

    cursor: pointer;
}


button:disabled {
    opacity: 0.55;
    cursor: wait;
}


/* ---------------------------------
   Loading
--------------------------------- */

.hidden {
    display: none;
}


.loading-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 18px;
}


.loading-status {
    color: #6b7280;
    font-size: 14px;
}


.progress-track {
    position: relative;

    width: 100%;
    height: 12px;

    overflow: hidden;

    background: #e5e7eb;

    border-radius: 999px;
}


.progress-bar {
    position: absolute;

    height: 100%;
    width: 35%;

    border-radius: 999px;

    background: #111827;

    animation:
        search-progress 1.5s
        ease-in-out infinite;
}


@keyframes search-progress {

    0% {
        left: -35%;
    }

    50% {
        left: 50%;
    }

    100% {
        left: 100%;
    }

}


.loading p {
    margin-bottom: 0;
}


.loading-note {
    color: #6b7280;
    font-size: 14px;
}


/* ---------------------------------
   Result
--------------------------------- */

.result-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 20px;

    margin-bottom: 20px;
}


.success {
    font-size: 20px;
    font-weight: 700;
}


dl {
    display: grid;

    grid-template-columns:
        170px minmax(0, 1fr);

    gap: 12px;
}


dt {
    font-weight: 600;
}


dd {
    margin: 0;

    overflow-wrap: anywhere;
}


.page {
    font-size: 24px;
    font-weight: 700;
}


.result h2 {
    margin-top: 30px;
}


.entry-image {
    display: block;

    width: 100%;
    height: auto;

    margin-top: 15px;

    border: 1px solid #d1d5db;
    border-radius: 8px;
}


/* ---------------------------------
   Messages
--------------------------------- */

.warning {
    margin-top: 25px;
    padding: 15px;

    background: #fffbeb;

    border-radius: 8px;

    font-size: 14px;
}


.error {
    color: #991b1b;
}


.message-action {
    margin-top: 20px;
}


/* ---------------------------------
   Mobile
--------------------------------- */

@media (max-width: 650px) {

    .container {
        width: 94%;
        margin-top: 25px;
    }

    .header-row {
        display: block;
    }

    .reset-button {
        margin-top: 10px;
    }

    form,
    .result,
    .message,
    .loading {
        padding: 20px;
    }

    dl {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    dd {
        margin-bottom: 12px;
    }

    .result-header {
        align-items: flex-start;
        flex-direction: column;
    }

}

.previous-files {
    margin-top: 14px;
    padding: 14px 16px;

    background: #f9fafb;

    border: 1px solid #e5e7eb;
    border-radius: 8px;

    font-size: 14px;
}

.previous-files-title {
    margin-bottom: 8px;

    font-weight: 600;
}

.previous-files ul {
    margin: 0;
    padding-left: 20px;
}

.previous-files li {
    margin: 4px 0;

    overflow-wrap: anywhere;

    color: #4b5563;
}