* {
    box-sizing: border-box;
}

:root {
    --green-900: #0e5f43;
    --green-700: #14805f;
    --green-600: #14a37f;
    --green-300: #7ed1b2;
    --green-100: #eaf8f2;
    --dark-900: #1f2933;
    --dark-700: #3f4a54;
    --gray-600: #687078;
    --gray-300: #d9dfe3;
    --gray-200: #e9edef;
    --gray-100: #f5f7f7;
    --white: #ffffff;
    --shadow: 0 14px 38px rgba(31, 41, 51, 0.09);
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;
    background: #ffffff;
    color: var(--dark-900);
}

a {
    color: inherit;
}

button,
input {
    font: inherit;
}

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

.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--gray-200);
    backdrop-filter: blur(10px);
}

.site-header-inner {
    width: min(1180px, calc(100% - 32px));
    min-height: 80px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 32px;
}

.brand {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    flex: 0 0 auto;
}

.brand-logo {
    display: block;
    width: 245px;
    max-width: 100%;
    height: auto;
}

.main-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 28px;
}

.main-nav a {
    color: var(--dark-700);
    text-decoration: none;
    font-size: 14px;
    font-weight: 650;
    transition: 0.18s ease;
}

.main-nav a:hover {
    color: var(--green-700);
}

.header-upload-button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border-radius: 9px;
    background: var(--green-700);
    color: var(--white);
    text-decoration: none;
    font-size: 14px;
    font-weight: 750;
    box-shadow: 0 8px 18px rgba(20, 128, 95, 0.16);
    transition: 0.18s ease;
}

.header-upload-button:hover {
    background: var(--green-900);
    transform: translateY(-1px);
}

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

.hero {
    position: relative;
    overflow: hidden;
    padding: 76px 16px 82px;
    background:
        radial-gradient(circle at 86% 18%, rgba(126, 209, 178, 0.25), transparent 32%),
        linear-gradient(180deg, #fbfefd 0%, #f3faf7 100%);
    border-bottom: 1px solid #edf2ef;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0.25;
    background-image:
        linear-gradient(rgba(20, 128, 95, 0.07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(20, 128, 95, 0.07) 1px, transparent 1px);
    background-size: 42px 42px;
    mask-image: linear-gradient(to left, black, transparent 75%);
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: min(1180px, 100%);
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(500px, 1.15fr);
    align-items: start;
    gap: 58px;
}

.hero-copy {
    padding-top: 52px;
}

.hero-kicker {
    margin-bottom: 15px;
    color: var(--green-700);
    font-size: 12px;
    line-height: 1;
    letter-spacing: 0.16em;
    font-weight: 800;
}

.hero h1 {
    margin: 0;
    max-width: 560px;
    font-size: clamp(40px, 5vw, 66px);
    line-height: 1.02;
    letter-spacing: -0.045em;
    color: var(--dark-900);
}

.hero h1 span {
    color: var(--green-700);
}

.hero-description {
    max-width: 570px;
    margin: 24px 0 0;
    color: var(--gray-600);
    font-size: 18px;
    line-height: 1.65;
}

.hero-benefits {
    margin-top: 31px;
    display: grid;
    gap: 14px;
}

.hero-benefit {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--dark-700);
    font-size: 15px;
    font-weight: 650;
}

.benefit-icon {
    width: 31px;
    height: 31px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: var(--green-100);
    color: var(--green-700);
    font-size: 17px;
    font-weight: 800;
}

/* ============================================================
   CONVERTER
   ============================================================ */

.converter-card {
    width: 100%;
    background: var(--white);
    border: 1px solid #e1ebe6;
    border-radius: 18px;
    padding: 30px;
    box-shadow: var(--shadow);
}

.converter-heading {
    margin-bottom: 21px;
}

.converter-heading h2 {
    margin: 0 0 6px;
    font-size: 22px;
}

.converter-heading p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.5;
}

.drop-zone {
    border: 2px dashed #8fc5b2;
    border-radius: 13px;
    padding: 42px 25px;
    text-align: center;
    cursor: pointer;
    transition: 0.2s;
    background: #fbfefd;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--green-700);
    background: var(--green-100);
}

.drop-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--green-700);
    border-radius: 50%;
    color: var(--green-700);
    font-size: 29px;
    line-height: 1;
    font-weight: 500;
}

.drop-title {
    font-size: 18px;
    font-weight: 750;
    margin-bottom: 7px;
}

.drop-subtitle {
    color: #758079;
    font-size: 14px;
}

#fileInput {
    display: none;
}

.file-info {
    display: none;
    margin-top: 18px;
    padding: 14px 16px;
    background: #f5f8f6;
    border: 1px solid #e4ebe7;
    border-radius: 8px;
    font-size: 14px;
    word-break: break-all;
}

.file-info.visible {
    display: block;
}

.file-name {
    font-weight: bold;
}

.file-size {
    color: #777;
    margin-top: 4px;
}

.dataset-section {
    display: none;
    margin-top: 28px;
}

.dataset-section.visible {
    display: block;
}

.section-heading {
    margin-bottom: 14px;
}

.section-heading h2 {
    margin: 0 0 6px;
    font-size: 20px;
}

.section-heading p {
    margin: 0;
    color: #6d747b;
    font-size: 14px;
    line-height: 1.5;
}

.dataset-card {
    border: 1px solid #e0e3e6;
    border-radius: 12px;
    margin-top: 14px;
    overflow: hidden;
    background: #fff;
}

.dataset-card.unsupported {
    border-color: #efc8c8;
}

.dataset-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 16px 18px;
    background: #f8f9fa;
}

.dataset-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.dataset-title {
    font-weight: 700;
    word-break: break-all;
}

.dataset-meta {
    margin-top: 5px;
    color: #70777e;
    font-size: 12px;
}

.dataset-body {
    padding: 18px;
}

.toggle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 18px;
    margin-bottom: 14px;
}

.toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.toggle-label input {
    width: 16px;
    height: 16px;
    accent-color: var(--green-700);
}

.label-options {
    display: none;
    padding-top: 4px;
}

.label-options.visible {
    display: block;
}

.label-options.disabled {
    opacity: 0.45;
    pointer-events: none;
}

.field-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 10px;
}

.field-heading strong {
    font-size: 14px;
}

.field-actions {
    display: flex;
    gap: 10px;
}

.link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--green-700);
    cursor: pointer;
    font-size: 12px;
}

.field-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.field-item {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    padding: 9px 10px;
    border: 1px solid #eceff1;
    border-radius: 8px;
    cursor: pointer;
    min-width: 0;
}

.field-item:hover {
    background: #fafbfc;
}

.field-item input {
    margin-top: 2px;
    flex: 0 0 auto;
    accent-color: var(--green-700);
}

.field-text {
    min-width: 0;
}

.field-name {
    display: block;
    font-size: 13px;
    font-weight: 700;
    word-break: break-word;
}

.field-meta,
.field-sample {
    display: block;
    margin-top: 3px;
    color: #788087;
    font-size: 11px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.label-settings {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
}

.setting label {
    display: block;
    margin-bottom: 5px;
    color: #5f666d;
    font-size: 12px;
    font-weight: 600;
}

.setting input {
    width: 100%;
    height: 38px;
    padding: 7px 9px;
    border: 1px solid #d6dade;
    border-radius: 7px;
    font-size: 14px;
}

.setting input:focus {
    outline: 2px solid rgba(20, 128, 95, 0.14);
    border-color: var(--green-700);
}

.xdata-note {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #f4f7fa;
    color: #5d6872;
    font-size: 12px;
    line-height: 1.45;
}

.unsupported-message {
    padding: 10px 12px;
    border-radius: 8px;
    background: #fff2f2;
    color: #963838;
    font-size: 13px;
}

.convert-button {
    width: 100%;
    margin-top: 22px;
    height: 50px;
    border: 0;
    border-radius: 9px;
    background: var(--green-700);
    color: white;
    font-size: 16px;
    font-weight: 750;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 8px 18px rgba(20, 128, 95, 0.16);
}

.convert-button:hover:not(:disabled) {
    background: var(--green-900);
    transform: translateY(-1px);
}

.convert-button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
    box-shadow: none;
}

.status {
    display: none;
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
}

.status.loading {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #eef3f8;
    color: #334;
}

.status.success {
    display: block;
    background: #edf8ef;
    color: #236b2e;
}

.status.error {
    display: block;
    background: #fff0f0;
    color: #a32626;
}

.spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #c8d0d8;
    border-top-color: var(--green-700);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex: 0 0 auto;
}

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

.note {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #777;
    font-size: 13px;
    line-height: 1.6;
}

.note strong {
    color: #444;
}

.dataset-card.excluded .dataset-body {
    opacity: 0.5;
}

/* ============================================================
   CONTENT SECTIONS
   ============================================================ */

.content-section {
    padding: 82px 16px;
    background: #fff;
}

.section-muted {
    background: #f7faf8;
}

.content-section-inner {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.section-title {
    max-width: 650px;
    margin-bottom: 34px;
}

.section-title > span {
    display: block;
    margin-bottom: 10px;
    color: var(--green-700);
    font-size: 12px;
    letter-spacing: 0.14em;
    font-weight: 800;
    text-transform: uppercase;
}

.section-title h2 {
    margin: 0;
    font-size: clamp(29px, 3.2vw, 42px);
    line-height: 1.12;
    letter-spacing: -0.025em;
}

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

.info-card {
    position: relative;
    padding: 25px;
    background: #fff;
    border: 1px solid #e3ebe7;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(31, 41, 51, 0.04);
}

.info-card h3 {
    margin: 0 0 10px;
    font-size: 18px;
}

.info-card p {
    margin: 0;
    color: var(--gray-600);
    font-size: 14px;
    line-height: 1.65;
}

.step-number {
    width: 36px;
    height: 36px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--green-100);
    color: var(--green-700);
    font-weight: 800;
}

.faq-list {
    display: grid;
    gap: 12px;
}

.faq-list details {
    border: 1px solid #dfe8e3;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}

.faq-list summary {
    padding: 18px 20px;
    cursor: pointer;
    font-weight: 750;
}

.faq-list p {
    margin: 0;
    padding: 0 20px 20px;
    color: var(--gray-600);
    line-height: 1.65;
}

.about-block > p {
    max-width: 850px;
    margin: 0;
    color: var(--gray-600);
    font-size: 16px;
    line-height: 1.75;
}

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

.site-footer {
    border-top: 1px solid #e4ebe7;
    background: #fff;
}

.site-footer-inner {
    width: min(1080px, calc(100% - 32px));
    min-height: 82px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    color: #758079;
    font-size: 13px;
}

.site-footer-inner img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

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

@media (max-width: 980px) {
    .site-header-inner {
        min-height: 72px;
        gap: 18px;
    }

    .brand-logo {
        width: 210px;
    }

    .main-nav {
        display: none;
    }

    .header-upload-button {
        margin-left: auto;
    }

    .hero {
        padding-top: 45px;
    }

    .hero-inner {
        grid-template-columns: 1fr;
        gap: 36px;
        max-width: 760px;
    }

    .hero-copy {
        padding-top: 0;
    }

    .hero h1,
    .hero-description {
        max-width: 680px;
    }

    .steps-grid,
    .formats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .site-header-inner {
        width: min(100% - 22px, 1180px);
        min-height: 66px;
    }

    .brand-logo {
        width: 175px;
    }

    .header-upload-button {
        min-height: 39px;
        padding: 0 13px;
        font-size: 12px;
    }

    .hero {
        padding: 34px 12px 52px;
    }

    .hero h1 {
        font-size: 41px;
    }

    .hero-description {
        font-size: 16px;
    }

    .converter-card {
        padding: 20px;
        border-radius: 14px;
    }

    .drop-zone {
        padding: 34px 15px;
    }

    .dataset-header {
        flex-direction: column;
    }

    .field-list,
    .label-settings {
        grid-template-columns: 1fr;
    }

    .content-section {
        padding: 58px 16px;
    }
}

@media (max-width: 460px) {
    .brand-logo {
        width: 145px;
    }

    .header-upload-button {
        padding: 0 10px;
    }

    .hero h1 {
        font-size: 35px;
    }

    .converter-card {
        padding: 17px;
    }

    .drop-title {
        font-size: 16px;
    }

    .note {
        font-size: 12px;
    }
}
