* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    color-scheme: dark;

    --bg: #08090d;
    --surface: #11131a;
    --surface-2: #171a23;
    --surface-3: #0d0f15;

    --border: #292d38;
    --border-light: #373c49;

    --text: #f4f6fa;
    --muted: #969daa;

    --accent: #5ca8ff;
    --accent-hover: #4895ee;

    --green: #32d583;
    --yellow: #f5c451;
    --red: #ff4f68;
    --blue: #55a8ff;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;

    background:
        radial-gradient(
            circle at top,
            #131e2a 0,
            #08090d 42%
        );

    color: var(--text);

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

    line-height: 1.5;
}

button,
select,
input {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

[hidden] {
    display: none !important;
}


/* =========================
   HEADER
========================= */

.site-header {
    width: min(1200px, calc(100% - 32px));

    margin: 0 auto;
    padding: 22px 0;

    display: flex;
    align-items: center;
    gap: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 42px;
    padding: 8px 15px;

    color: var(--text);
    text-decoration: none;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 10px;

    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.back-button:hover {
    background: var(--surface-2);
    border-color: var(--border-light);
    transform: translateX(-2px);
}

.brand h1 {
    font-size: 1.2rem;
    font-weight: 800;
}

.brand span {
    display: block;

    margin-top: 2px;

    color: var(--muted);

    font-size: 0.8rem;
}


/* =========================
   MAIN
========================= */

main {
    width: min(1100px, calc(100% - 32px));

    margin: 0 auto;

    padding-bottom: 60px;
}


/* =========================
   HERO
========================= */

.hero {
    padding: 35px 15px 30px;

    text-align: center;
}

.hero-icon {
    width: 78px;
    height: 78px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #182a3f,
            #141722
        );

    border: 1px solid #314051;
    border-radius: 23px;

    font-size: 2.2rem;

    box-shadow:
        0 15px 40px rgba(0, 0, 0, 0.35);
}

.hero h2 {
    margin-bottom: 12px;

    font-size: clamp(2rem, 5vw, 3rem);

    line-height: 1.1;
}

.hero > p {
    max-width: 700px;

    margin: 0 auto;

    color: var(--muted);

    font-size: 1rem;
}

.privacy-note {
    width: fit-content;
    max-width: 100%;

    margin: 18px auto 0;

    padding: 9px 15px;

    color: #c1c6d0;

    background: rgba(20, 23, 31, 0.85);

    border: 1px solid var(--border);
    border-radius: 999px;

    font-size: 0.82rem;
}


/* =========================
   CARDS
========================= */

.tool-card {
    margin-top: 20px;

    padding: 24px;

    background:
        linear-gradient(
            145deg,
            rgba(23, 26, 35, 0.96),
            rgba(13, 15, 21, 0.96)
        );

    border: 1px solid var(--border);
    border-radius: 18px;

    box-shadow:
        0 15px 45px rgba(0, 0, 0, 0.22);
}


/* =========================
   UPLOAD
========================= */

.upload-area {
    min-height: 250px;

    padding: 35px 20px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-align: center;

    border: 2px dashed #353a49;
    border-radius: 16px;

    transition:
        border-color 0.2s,
        background 0.2s;
}

.upload-area.dragover {
    border-color: var(--accent);

    background:
        rgba(124, 92, 255, 0.08);
}

.upload-icon {
    margin-bottom: 10px;

    font-size: 2.5rem;
}

.upload-area h3 {
    margin-bottom: 6px;

    font-size: 1.25rem;
}

.upload-area p {
    margin-bottom: 18px;

    color: var(--muted);
}

.upload-area .drop-text {
    margin: 15px 0 0;

    font-size: 0.82rem;
}


/* =========================
   BUTTONS
========================= */

.primary-button,
.secondary-button,
.danger-button {
    min-height: 44px;

    padding: 9px 16px;

    border: 1px solid transparent;
    border-radius: 10px;

    font-weight: 700;

    transition:
        background 0.2s,
        border-color 0.2s,
        transform 0.2s;
}

.primary-button {
    color: #fff;

    background: var(--accent);
}

.primary-button:hover:not(:disabled) {
    background: var(--accent-hover);

    transform: translateY(-1px);
}

.secondary-button {
    color: var(--text);

    background: #191c25;

    border-color: var(--border);
}

.secondary-button:hover:not(:disabled) {
    background: #222632;

    border-color: var(--border-light);
}

.danger-button {
    color: #ffb1bb;

    background:
        rgba(255, 79, 104, 0.08);

    border-color:
        rgba(255, 79, 104, 0.25);
}

.danger-button:hover:not(:disabled) {
    background:
        rgba(255, 79, 104, 0.15);
}


/* =========================
   SECTION HEADING
========================= */

.section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 15px;

    margin-bottom: 20px;
}

.section-heading h3 {
    font-size: 1.15rem;
}

.section-heading p {
    margin-top: 3px;

    color: var(--muted);

    font-size: 0.82rem;
}


/* =========================
   SELECTED IMAGES
========================= */

.image-list {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fill,
            minmax(220px, 1fr)
        );

    gap: 14px;
}

.image-item {
    overflow: hidden;

    background: var(--surface-3);

    border: 1px solid var(--border);
    border-radius: 13px;

    transition:
        border-color 0.2s,
        box-shadow 0.2s;
}

.image-item.active {
    border-color: var(--accent);

    box-shadow:
        0 0 0 1px var(--accent);
}

.image-item-preview {
    width: 100%;
    height: 150px;

    display: block;

    object-fit: contain;

    background:
        repeating-conic-gradient(
            #171a22 0% 25%,
            #101219 0% 50%
        )
        50% / 20px 20px;
}

.image-item-info {
    padding: 11px 12px;
}

.image-item-name {
    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 0.9rem;
    font-weight: 700;
}

.image-item-meta {
    margin-top: 4px;

    color: var(--muted);

    font-size: 0.75rem;
}

.image-item-actions {
    display: flex;

    gap: 7px;

    padding:
        0 12px 12px;
}

.image-item-actions button {
    flex: 1;

    min-height: 36px;

    padding: 6px 8px;

    color: var(--text);

    background: #191c25;

    border: 1px solid var(--border);
    border-radius: 8px;

    font-size: 0.78rem;
    font-weight: 700;
}

.image-item-actions button:hover {
    background: #242936;
}


/* =========================
   INSPECTOR PREVIEW
========================= */

.inspector-preview {
    width: 100%;

    margin-bottom: 26px;
}

.preview-wrapper {
    min-height: 300px;

    max-height: 650px;

    padding: 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    overflow: auto;

    background:
        repeating-conic-gradient(
            #171a22 0% 25%,
            #111319 0% 50%
        )
        50% / 24px 24px;

    border: 1px solid var(--border);
    border-radius: 14px;
}

#previewImage {
    display: block;

    max-width: 100%;
    max-height: 600px;

    width: auto;
    height: auto;

    object-fit: contain;

    box-shadow:
        0 12px 35px rgba(0, 0, 0, 0.35);
}


/* =========================
   INFORMATION SECTIONS
========================= */

.info-section {
    margin-top: 24px;

    padding: 18px;

    background:
        rgba(9, 11, 16, 0.65);

    border: 1px solid var(--border);

    border-radius: 14px;
}

.subheading {
    margin-bottom: 15px;
}

.subheading h4 {
    font-size: 0.98rem;
}


/* =========================
   SUMMARY GRID
========================= */

.info-grid {
    display: grid;

    grid-template-columns:
        repeat(
            auto-fit,
            minmax(150px, 1fr)
        );

    gap: 10px;
}

.summary-item {
    padding: 14px;

    background: #151821;

    border: 1px solid var(--border);

    border-radius: 10px;
}

.summary-label {
    color: var(--muted);

    font-size: 0.72rem;
}

.summary-value {
    margin-top: 4px;

    overflow: hidden;

    white-space: nowrap;
    text-overflow: ellipsis;

    font-size: 0.95rem;
    font-weight: 800;
}


/* =========================
   INFORMATION TABLE
========================= */

.info-table {
    display: flex;
    flex-direction: column;

    border: 1px solid var(--border);

    border-radius: 10px;

    overflow: hidden;
}

.info-row {
    display: grid;

    grid-template-columns:
        minmax(130px, 0.75fr)
        minmax(0, 1.5fr);

    gap: 15px;

    padding: 11px 13px;

    background: #11141b;

    border-bottom: 1px solid var(--border);

    font-size: 0.82rem;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row:nth-child(even) {
    background: #0e1117;
}

.info-label {
    color: var(--muted);

    font-weight: 600;
}

.info-value {
    min-width: 0;

    overflow-wrap: anywhere;

    color: var(--text);

    font-weight: 600;
}

.info-value.empty {
    color: #707581;

    font-weight: 400;
}

.info-value.success {
    color: var(--green);
}

.info-value.warning {
    color: var(--yellow);
}

.info-value.danger {
    color: var(--red);
}

.info-value.link-like {
    color: var(--blue);
}


/* =========================
   AI ANALYSIS
========================= */

.ai-section {
    border-color:
        rgba(124, 92, 255, 0.3);
}

.ai-notice {
    margin-bottom: 15px;

    padding: 13px 15px;

    color: #c7cbd5;

    background:
        rgba(124, 92, 255, 0.07);

    border:
        1px solid
        rgba(124, 92, 255, 0.2);

    border-radius: 10px;

    font-size: 0.82rem;
}

.ai-result {
    margin-bottom: 15px;

    padding: 18px;

    background: #11141b;

    border: 1px solid var(--border);

    border-radius: 12px;

    text-align: center;
}

.ai-result-badge {
    display: inline-flex;

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

    min-width: 180px;

    padding: 10px 18px;

    border-radius: 999px;

    font-size: 1rem;
    font-weight: 800;
}

.ai-result-badge.unknown {
    color: #c8ccd5;

    background:
        rgba(150, 157, 170, 0.1);

    border:
        1px solid
        rgba(150, 157, 170, 0.25);
}

.ai-result-badge.indicator {
    color: #c8e2ff;

    background:
        rgba(124, 92, 255, 0.12);

    border:
        1px solid
        rgba(124, 92, 255, 0.3);
}

.ai-result-badge.camera {
    color: #a9f0c9;

    background:
        rgba(50, 213, 131, 0.1);

    border:
        1px solid
        rgba(50, 213, 131, 0.25);
}

.ai-result-description {
    max-width: 700px;

    margin: 12px auto 0;

    color: var(--muted);

    font-size: 0.82rem;
}


/* =========================
   RAW METADATA
========================= */

.raw-data {
    width: 100%;

    min-height: 120px;
    max-height: 500px;

    overflow: auto;

    padding: 15px;

    color: #cbd0da;

    background: #090b10;

    border: 1px solid var(--border);

    border-radius: 10px;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;

    font-size: 0.76rem;

    line-height: 1.6;

    white-space: pre-wrap;
    overflow-wrap: anywhere;
}


/* =========================
   ACTIONS
========================= */

.action-section {
    margin-top: 24px;

    display: grid;

    grid-template-columns:
        repeat(3, 1fr);

    gap: 10px;
}


/* =========================
   FOOTER
========================= */

.site-footer {
    padding: 30px 16px 45px;

    text-align: center;

    color: var(--muted);

    border-top:
        1px solid
        rgba(255, 255, 255, 0.04);
}

.site-footer p {
    color: var(--text);

    font-weight: 700;
}

.site-footer span {
    display: block;

    margin-top: 4px;

    font-size: 0.78rem;
}


/* =========================
   RESPONSIVE
========================= */

@media (max-width: 800px) {

    .action-section {
        grid-template-columns: 1fr;
    }

    .preview-wrapper {
        min-height: 250px;
    }
}


@media (max-width: 650px) {

    .site-header {
        width:
            min(
                100% - 22px,
                1200px
            );

        padding: 16px 0;
    }

    main {
        width:
            min(
                100% - 22px,
                1100px
            );
    }

    .hero {
        padding-top: 25px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .tool-card {
        padding: 16px;

        border-radius: 15px;
    }

    .section-heading {
        align-items: flex-start;
    }

    .image-list {
        grid-template-columns: 1fr;
    }

    .info-section {
        padding: 14px;
    }

    .info-row {
        grid-template-columns: 1fr;

        gap: 4px;
    }

    .info-label {
        font-size: 0.72rem;
    }

    .info-value {
        font-size: 0.82rem;
    }

    .preview-wrapper {
        min-height: 220px;

        padding: 12px;
    }

    #previewImage {
        max-height: 450px;
    }
}


@media (max-width: 450px) {

    .brand h1 {
        font-size: 1rem;
    }

    .back-button {
        min-height: 38px;

        padding: 7px 11px;

        font-size: 0.85rem;
    }

    .privacy-note {
        border-radius: 12px;

        font-size: 0.76rem;
    }

    .upload-area {
        min-height: 220px;

        padding: 25px 14px;
    }

    .section-heading {
        flex-direction: column;
    }

    .section-heading .danger-button {
        width: 100%;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .summary-item {
        padding: 11px;
    }

    .summary-value {
        font-size: 0.85rem;
    }
}


@media (max-width: 380px) {

    .hero-icon {
        width: 64px;
        height: 64px;

        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 1.75rem;
    }

    .tool-card {
        padding: 13px;
    }

    .site-header {
        gap: 10px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }
}