:root {
    color-scheme: light;
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #647086;
    --line: #dce3ef;
    --line-strong: #b8c4d6;
    --brand: #177a63;
    --brand-dark: #0d5f4c;
    --brand-soft: #e4f5f0;
    --danger: #b3261e;
    --danger-soft: #fdecea;
    --shadow: 0 18px 50px rgba(30, 42, 72, 0.12);
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

html {
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(23, 122, 99, 0.08), transparent 32%),
        linear-gradient(315deg, rgba(43, 96, 176, 0.08), transparent 36%),
        var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
    font: inherit;
}

.app-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 32px 18px;
}

.converter {
    width: min(940px, 100%);
    padding: clamp(24px, 4vw, 42px);
    border: 1px solid rgba(220, 227, 239, 0.9);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow);
}

.heading {
    max-width: 720px;
    margin-bottom: 28px;
}

.eyebrow,
.result-label {
    margin: 0 0 8px;
    color: var(--brand-dark);
    font-size: 0.78rem;
    font-weight: 750;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    max-width: 760px;
    margin-bottom: 12px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    line-height: 1.04;
    letter-spacing: 0;
}

h2 {
    margin-bottom: 0;
    font-size: 1.35rem;
    letter-spacing: 0;
}

.lede {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
}

.upload-form {
    display: grid;
    gap: 16px;
}

.drop-zone {
    display: grid;
    min-height: 260px;
    place-items: center;
    padding: 34px 20px;
    border: 2px dashed var(--line-strong);
    border-radius: 8px;
    background: #fbfcff;
    cursor: pointer;
    text-align: center;
    transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.drop-zone:hover,
.drop-zone:focus-within,
.drop-zone.is-dragging {
    border-color: var(--brand);
    background: var(--brand-soft);
}

.drop-zone.is-dragging {
    transform: translateY(-2px);
}

.drop-icon {
    display: grid;
    width: 60px;
    height: 60px;
    margin-bottom: 18px;
    place-items: center;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
}

.drop-icon svg {
    width: 32px;
    height: 32px;
    fill: currentColor;
}

.drop-title {
    display: block;
    color: var(--ink);
    font-size: 1.2rem;
    font-weight: 760;
}

.drop-copy {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.drop-zone input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
}

.file-name {
    min-width: 0;
    overflow: hidden;
    color: var(--ink);
    font-weight: 650;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.primary-button,
.ghost-button,
.maps-button {
    min-height: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 750;
    text-decoration: none;
}

.primary-button,
.maps-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    background: var(--brand);
    color: #fff;
}

.primary-button:hover,
.maps-button:hover {
    background: var(--brand-dark);
}

.ghost-button {
    flex: 0 0 auto;
    padding: 0 14px;
    background: #edf2f7;
    color: var(--ink);
}

.ghost-button:hover {
    background: #dce5ef;
}

.message {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: 8px;
    line-height: 1.5;
}

.error {
    border: 1px solid rgba(179, 38, 30, 0.2);
    background: var(--danger-soft);
    color: var(--danger);
}

.result-panel {
    display: grid;
    gap: 18px;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}

.url-field {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 650;
}

textarea {
    width: 100%;
    min-height: 116px;
    resize: vertical;
    padding: 13px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
    color: var(--ink);
    line-height: 1.5;
}

textarea:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(23, 122, 99, 0.16);
}

.stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.stats div {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcff;
}

.stats span {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
}

.stats small {
    color: var(--muted);
    font-size: 0.82rem;
}

@media (max-width: 640px) {
    .app-shell {
        align-items: start;
        padding: 14px;
    }

    .converter {
        padding: 22px 16px;
    }

    .drop-zone {
        min-height: 220px;
    }

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