.csv-api-app .card {
    max-width: 960px;
    margin: 1rem auto;
    padding: 1.5rem;
    border: 1px solid #ddd;
    border-radius: 10px;
    box-sizing: border-box;
}

/* --- BUTTONS --- */
.csv-api-app button {
    padding: 0.45rem 1.1rem; /* left/right padding added */
    border-radius: 6px;
    cursor: pointer;
    border: none;
    background: #3b82f6;
    color: #fff;
    font-size: 0.95rem;
    transition: background 0.15s ease;
}

    .csv-api-app button:hover:not(:disabled) {
        background: #2563eb;
    }

    .csv-api-app button:disabled {
        opacity: 0.55;
        cursor: not-allowed;
    }

.csv-api-app .secondary {
    background: #f3f4f6;
    color: #111827;
    border: 1px solid #e5e7eb;
}

    .csv-api-app .secondary:hover {
        background: #e5e7eb;
    }

/* --- LAYOUT SECTIONS --- */
.csv-api-app .controls {
    display: flex;
    gap: 0.6rem;
    margin: 0.9rem 0;
    flex-wrap: wrap;
}

/* progress bar */
.csv-api-app .progress {
    margin: .75rem 0;
}

.csv-api-app #bar {
    background: #eee;
    height: 8px;
    border-radius: 6px;
    overflow: hidden;
}

.csv-api-app #bar-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: #3b82f6;
    transition: width .2s ease;
}

/* table */
.csv-api-app table.csv-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: .75rem;
}

    .csv-api-app table.csv-table th,
    .csv-api-app table.csv-table td {
        border: 1px solid #e5e7eb;
        padding: .45rem .55rem;
        font-size: .9rem;
    }

.csv-api-app #log {
    color: #555;
    margin-top: .75rem;
    font-size: .85rem;
}

/* --- bottom buttons area --- */
.csv-api-app .bottom-buttons {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 0.7rem;
    margin-top: 1.1rem;
    flex-wrap: wrap;
}
/* ================================
   THEME TOKENS — tweak if needed
   ================================ */
:root {
    /* try to match loveit.wales look */
    --li-primary: #0A66CC; /* primary blue */
    --li-primary-hover: #084FA0;
    --li-text: #111827; /* near-black */
    --li-muted: #6B7280; /* grey-500-ish */
    --li-radius: 10px;
    --li-font: inherit; /* inherits site font */
}

/* Ensure plugin inherits your site font */
.csv-api-app {
    font-family: var(--li-font);
    color: var(--li-text);
}

    /* Match buttons to site style */
    .csv-api-app button {
        background: var(--li-primary);
        color: #fff;
        padding: 0.55rem 1.15rem;
        border: none;
        border-radius: 8px;
        font-size: 0.95rem;
        line-height: 1;
        cursor: pointer;
        transition: background .15s ease, box-shadow .15s ease;
    }

        .csv-api-app button:hover:not(:disabled) {
            background: var(--li-primary-hover);
        }

        .csv-api-app button:disabled {
            opacity: .55;
            cursor: not-allowed;
        }

        .csv-api-app button.secondary {
            background: #f3f4f6;
            color: var(--li-text);
            border: 1px solid #e5e7eb;
        }

    /* ================================
   FILE INPUT: modern, on-brand
   ================================ */

    /* Standard (Chromium/Firefox recent) */
    .csv-api-app input[type="file"]::file-selector-button {
        background: #f3f4f6;
        color: var(--li-text);
        padding: 0.55rem 1.15rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font: inherit;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease;
    }

        .csv-api-app input[type="file"]::file-selector-button:hover {
            background: #e5e7eb;
            border-color: #d1d5db;
        }

    /* WebKit fallback (older Safari) */
    .csv-api-app input[type="file"]::-webkit-file-upload-button {
        background: #f3f4f6;
        color: var(--li-text);
        padding: 0.55rem 1.15rem;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font: inherit;
        cursor: pointer;
        transition: background .15s ease, border-color .15s ease;
    }

        .csv-api-app input[type="file"]::-webkit-file-upload-button:hover {
            background: #e5e7eb;
            border-color: #d1d5db;
        }

    /* Reduce the default input chrome so the button stands out */
    .csv-api-app input[type="file"] {
        font: inherit;
        color: var(--li-muted);
    }

    /* ================================
   CHECKBOX: larger + accent color
   ================================ */
    .csv-api-app input[type="checkbox"] {
        /* Modern browsers: tint */
        accent-color: var(--li-primary);
        /* Make it bigger and align nicely */
        width: 18px;
        height: 18px;
        vertical-align: middle;
        margin: 0 0.45rem 0 0;
    }

    .csv-api-app .grid label {
        display: flex;
        align-items: center;
        gap: .4rem;
        font-size: 0.95rem;
        color: var(--li-text);
    }

    /* Optional focus style (accessibility) */
    .csv-api-app input[type="checkbox"]:focus,
    .csv-api-app input[type="file"]:focus-visible,
    .csv-api-app button:focus-visible {
        outline: 2px solid var(--li-primary);
        outline-offset: 2px;
        border-radius: 8px;
    }



/* ==== Spacing & layout fixes for top form fields and consent checkbox ==== */

/* Target the inline-grid container and increase spacing */
.csv-api-app .card > div[style*="display:grid"] {
  gap: 1rem !important;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)) !important;
}

/* Ensure labels stack their input underneath cleanly */
.csv-api-app .card > div[style*="display:grid"] label {
  display: block;
}

/* Give text inputs breathing room under their label text */
#orgName, #empForename, #empSurname {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  box-sizing: border-box;
}

/* Prevent the consent label from hugging the bottom of its grid cell */
.csv-api-app .card > div[style*="display:grid"] label[style*="align-self:end"] {
  align-self: start !important;
  display: flex !important;
  gap: 0.5rem !important;
  padding-top: 0.2rem;
}

/* Tidy checkbox vertical alignment and text wrapping */
#consent { 
  margin-top: 0.15rem;
}
#consent + span {
  line-height: 1.3;
  display: inline-block;
  margin-top: 0.05rem;
  max-width: 60ch;
  word-break: normal;
}

