@import url("https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Manrope:wght@500;600;700;800&display=swap");

:root {
    font-family: "DM Sans", "Segoe UI", sans-serif;
    color: #17324D;
    background: #f5f7fa;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    --ink: #17324D;
    --muted: #667085;
    --line: #e6eaf0;
    --navy: #17324D;
    --blue: #1F6FEB;
    --blue-dark: #1554C0;
    --teal: #00B8A9;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    padding: 48px 28px 30px;
    background:
        radial-gradient(ellipse at 82% 0%, rgba(31, 111, 235, 0.10), transparent 34rem),
        #f5f7fa;
}

button,
input,
select {
    font: inherit;
}

.app {
    max-width: 1360px;
    margin: 0 auto;
}

.page-header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin: 0 0 30px 2px;
}

.brand-mark {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border: 1px solid var(--navy);
    border-radius: 15px;
    color: #fff;
    background: var(--navy);
    box-shadow: 0 4px 12px rgba(27, 47, 91, 0.06);
    font: 800 14px "Manrope", sans-serif;
    letter-spacing: -0.07em;
}

.eyebrow {
    margin: 2px 0 6px;
    color: #758198;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.13em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1,
.section-heading h2 {
    color: var(--ink);
    font-family: "Manrope", "Segoe UI", sans-serif;
    letter-spacing: -0.045em;
}

h1 {
    margin-bottom: 5px;
    font-size: clamp(24px, 3vw, 32px);
    line-height: 1.2;
}

.subtitle {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 14px;
}

.upload-card,
.results-section {
    border: 1px solid #e8ebf0;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 32px rgba(24, 39, 75, 0.045);
}

.upload-card {
    padding: 20px;
}

.drop-zone {
    display: flex;
    min-height: 144px;
    align-items: center;
    justify-content: center;
    gap: 19px;
    padding: 22px;
    border: 1.5px dashed #cbd4e3;
    border-radius: 12px;
    background: #fbfcfe;
    transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.drop-zone.is-dragging {
    border-color: var(--teal);
    background: #effaf8;
    box-shadow: inset 0 0 0 1px var(--teal);
}

.drop-zone.is-disabled {
    opacity: 0.65;
}

.upload-icon {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 14px;
    color: #fff;
    background: var(--teal);
}

.upload-icon svg,
.button-primary svg,
.privacy-note svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.drop-copy h2 {
    margin: 0 0 5px;
    font-family: "Manrope", "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.drop-copy p {
    margin: 0 0 5px;
    color: #525f73;
    font-size: 13px;
}

.browse-link {
    color: var(--blue);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.hint {
    color: #8792a4;
    font-size: 11px;
}

#pdfFiles,
#csvFile {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
}

.browse-link:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 2px;
}

.toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    padding: 19px 2px 17px;
}

.format-control {
    display: grid;
    gap: 6px;
}

.format-control label {
    color: #5e6a7d;
    font-size: 11px;
    font-weight: 700;
}

.format-control select {
    min-width: 270px;
    height: 38px;
    padding: 0 32px 0 11px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    outline: none;
    color: #344054;
    background: #fff;
    font-size: 12px;
}

.format-control select:focus-visible,
.table-input:focus-visible {
    border-color: #78aaf5;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.toolbar-actions {
    display: flex;
    gap: 9px;
}

.button {
    display: inline-flex;
    height: 39px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 14px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.button:not(:disabled):active {
    transform: translateY(1px);
}

.button:disabled {
    opacity: 0.48;
    cursor: not-allowed;
}

.button-secondary {
    border-color: #dfe4ec;
    color: #3c485b;
    background: white;
}

.button-secondary:not(:disabled):hover {
    border-color: #b7c3d6;
    background: #f8faff;
}

.button-icon {
    color: var(--blue);
    font-size: 15px;
}

.button-primary {
    color: #fff;
    background: #007F76;
    box-shadow: 0 3px 7px rgba(0, 127, 118, 0.2);
}

.button-primary:not(:disabled):hover {
    background: #006A63;
}

.button-primary svg {
    width: 16px;
    height: 16px;
}

.status {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 9px;
    padding: 0 11px;
    border-radius: 7px;
    color: #667085;
    background: #f7f8fa;
    font-size: 11px;
}

.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: #9aa5b5;
}

.status.is-working .status-dot {
    background: var(--blue);
    box-shadow: 0 0 0 3px #dceaff;
    animation: pulse 1.25s ease-in-out infinite;
}

.status.is-error {
    color: #a33b3b;
    background: #fff6f5;
}

.status.is-error .status-dot {
    background: #d45252;
}

@keyframes pulse {
    50% { box-shadow: 0 0 0 5px rgba(228, 234, 255, 0.3); }
}

.results-section {
    margin-top: 22px;
    padding: 22px 20px 16px;
}

.section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin: 0 2px 17px;
}

.section-heading .eyebrow {
    margin-bottom: 4px;
}

.section-heading h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 19px;
}

.count-badge {
    display: inline-grid;
    min-width: 23px;
    height: 22px;
    place-items: center;
    padding: 0 6px;
    border-radius: 20px;
    color: #5d6e91;
    background: #eef2f8;
    font: 700 11px "DM Sans", sans-serif;
    letter-spacing: 0;
}

.edit-hint {
    margin: 0 0 2px;
    color: #8993a3;
    font-size: 11px;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border: 1px solid #e8ebf0;
    border-radius: 10px;
}

table {
    width: 100%;
    min-width: 970px;
    border-collapse: separate;
    border-spacing: 0;
    text-align: left;
}

thead th {
    height: 40px;
    padding: 0 10px;
    border-bottom: 1px solid #e8ebf0;
    color: #7a8596;
    background: #fafbfd;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    white-space: nowrap;
}

thead th:first-child {
    padding-left: 14px;
}

tbody td {
    height: 62px;
    padding: 8px 8px;
    border-bottom: 1px solid #eef0f4;
    color: #344054;
    font-size: 12px;
}

tbody tr:last-child td {
    border-bottom: 0;
}

tbody tr:not(.empty-row):hover {
    background: #fcfdff;
}

.file-cell {
    width: 205px;
    max-width: 205px;
    padding-left: 14px;
}

.original-name {
    display: block;
    overflow: hidden;
    color: #344054;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-success,
.row-error {
    display: block;
    overflow: hidden;
    margin-top: 4px;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-success {
    color: #27835d;
}

.row-error {
    color: #bf4545;
}

.table-input {
    width: 100%;
    min-width: 85px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    outline: none;
    color: #263248;
    background: transparent;
    font-size: 11px;
    transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.table-input:hover,
.table-input:focus {
    border-color: #e1e6ef;
    background: #fff;
}

.table-input::placeholder {
    color: #a1a9b6;
}

.filename-input {
    min-width: 205px;
    color: var(--blue);
    font-weight: 600;
}

.confidence {
    display: inline-flex;
    min-width: 53px;
    justify-content: center;
    padding: 5px 7px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
}

.confidence-high {
    color: #25764f;
    background: #e9f7ef;
}

.confidence-medium {
    color: #9a6a18;
    background: #fff5dc;
}

.confidence-low,
.confidence-pending {
    color: #687487;
    background: #f0f2f5;
}

.confidence-error {
    color: #a33b3b;
    background: #fff0ef;
}

.action-cell {
    width: 40px;
    padding: 4px 8px 4px 2px;
    text-align: center;
}

.remove-button {
    width: 27px;
    height: 27px;
    border: 0;
    border-radius: 6px;
    color: #8993a3;
    background: transparent;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.remove-button:hover {
    color: #b54242;
    background: #fff0ef;
}

.empty-row td {
    height: 185px;
    padding: 0;
}

.empty-state {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    color: #8792a4;
    font-size: 11px;
}

.empty-state strong {
    margin-top: 5px;
    color: #596579;
    font-size: 12px;
}

.empty-icon {
    display: grid;
    width: 40px;
    height: 44px;
    place-items: center;
    border: 1px solid #dce3ed;
    border-radius: 7px;
    color: var(--teal);
    background: #effaf8;
    font-size: 9px;
    font-weight: 700;
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 13px 2px 0;
    color: #7c8798;
    font-size: 10px;
}

.privacy-note svg {
    width: 14px;
    height: 14px;
    color: var(--teal);
    stroke-width: 2;
}

footer {
    padding: 20px 4px 0;
    color: #667085;
    font-size: 10px;
    text-align: center;
}

footer p {
    margin: 0 0 6px;
}

footer span {
    padding: 0 4px;
}

footer a,
footer a:visited {
    color: inherit;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

footer a:focus-visible {
    outline: 2px solid var(--navy);
    outline-offset: 3px;
    border-radius: 2px;
}

.extents-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 12px;
}

.extents-grid label {
    display: grid;
    gap: 6px;
    color: #5e6a7d;
    font-size: 11px;
    font-weight: 700;
}

.extents-grid input {
    height: 38px;
    width: 100%;
    padding: 0 10px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    outline: none;
    color: #344054;
    background: #fff;
    font-size: 12px;
}

.extents-grid input:focus-visible {
    border-color: #78aaf5;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.contact-form {
    display: grid;
    gap: 8px;
}

.contact-form label {
    color: #5e6a7d;
    font-size: 11px;
    font-weight: 700;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #dfe4ec;
    border-radius: 8px;
    outline: none;
    color: #344054;
    background: #fff;
    font: inherit;
    font-size: 12px;
}

.contact-form textarea {
    min-height: 140px;
    resize: vertical;
}

.contact-form input:focus-visible,
.contact-form textarea:focus-visible {
    border-color: #78aaf5;
    box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

.contact-form button {
    justify-self: start;
    margin-top: 6px;
}

.warning {
    min-height: 28px;
    margin: 8px 0 0;
    color: #b42318;
    font-size: 11px;
}

.progress-container {
    display: none;
    position: relative;
    height: 20px;
    margin-top: 10px;
    overflow: hidden;
    border: 1px solid #dfe4ec;
    border-radius: 7px;
    background: #eef1f5;
}

.progress-bar {
    width: 0;
    height: 100%;
    background: var(--blue);
    transition: width 120ms ease;
}

.progress-container span {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: #344054;
    font-size: 10px;
    font-weight: 700;
}

.raster-map {
    width: 100%;
    height: 420px;
    overflow: hidden;
    border: 1px solid #dfe4ec;
    border-radius: 10px;
    background: #edf1f5;
}

.map-placeholder {
    display: grid;
    height: 100%;
    place-items: center;
    color: #7c8798;
    font-size: 12px;
}

.map-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.sr-only {
    position: absolute;
    left: 0;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    clip-path: inset(50%);
    border: 0;
}

@media (max-width: 700px) {
    body {
        padding: 28px 14px 22px;
    }

    .extents-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .page-header {
        gap: 13px;
        margin-bottom: 22px;
    }

    .brand-mark {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 12px;
    }

    .subtitle {
        max-width: 400px;
        font-size: 12px;
        line-height: 1.5;
    }

    .upload-card,
    .results-section {
        padding: 14px;
    }

    .drop-zone {
        min-height: 130px;
        gap: 12px;
        padding: 16px 10px;
    }

    .upload-icon {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 12px;
    }

    .format-control select {
        width: 100%;
        min-width: 0;
    }

    .toolbar-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .button {
        padding: 0 8px;
        font-size: 11px;
    }

    .section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 340px) {
    .toolbar-actions {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
