/* static/css/main/grant-finder.css */

body, html {
    background: var(--background-light-shade);
    overflow-x: hidden;
}

/* ── PAGE CONTAINER ──────────────────────────────────────────────────────── */

.gf-page {
    max-width: 96rem;
    margin: 0 auto;
    padding: 36px 2.5rem 0;
    background: var(--white);
    min-height: calc(100vh - var(--navbar-height) - var(--navbar-shadow-height, 0px));
}

/* ── TITLEBAR — mirrors .report-header on /data, left-aligned ────────────── */

/* Header row: title only (add-grant action lives under Matching Grants). */
.gf-header-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    align-items: end;
}

.gf-titlebar {
    grid-column: 1 / -1;
    padding: 0;
}

.gf-titlebar h1 {
    font-size: 22px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary-dark);
    background: var(--background-light-shade);
    margin: 0;
    border: 2px solid var(--primary-dark);
    border-bottom: none;
    border-radius: 8px 8px 0 0;
    padding: 12px 20px 6px;
    line-height: 1.2;
    text-align: left;
}

.gf-titlebar-sub {
    font-size: 0.9rem;
    color: var(--primary-light);
    margin: 0;
    line-height: 1.5;
    background: var(--background-light-shade);
    border: 2px solid var(--primary-dark);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 0 20px 12px;
    text-align: left;
}

/* ── THREE-COLUMN WRAP ───────────────────────────────────────────────────── */

.gf-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0;
    height: calc(100vh - var(--navbar-height) - var(--navbar-shadow-height, 0px) - 160px);
    padding: 0;
    overflow: hidden;
    border: 2px solid var(--primary-dark);
    border-radius: 8px;
    margin-top: 14px;
}

/* ── COLUMNS ─────────────────────────────────────────────────────────────── */

.gf-col {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--background-light-shade);
    border-right: 1px solid var(--border-gray);
    transition: opacity 0.35s ease;
}
.gf-col:last-child { border-right: none; }

/* Columns 2 & 3 dim until ready */
.gf-col-grants.gf-dim,
.gf-col-reports.gf-dim {
    opacity: 0.35;
    pointer-events: none;
}

.gf-col-reports.gf-dim .gf-download-btn-row {
    pointer-events: auto;
    opacity: 1;
}

/* ── COLUMN HEADER ───────────────────────────────────────────────────────── */

.gf-col-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    flex-shrink: 0;
    background: var(--background);
    border-bottom: 1px solid var(--border-gray);
    border-left: 3px solid var(--accent);
}

/* “Your Story” only — H3 corner tick (no full-height pink rail against blue wrap) */
.gf-col-goals .gf-col-header {
    border-left: none;
}

.gf-col-goals .gf-col-title {
    position: relative;
    padding-left: 14px;
}

.gf-col-goals .gf-col-title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}

.gf-col-title {
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--primary-dark);
    margin: 0;
    flex-shrink: 0;
}

.gf-header-line {
    flex: 1;
    height: 0;
    border-top: 2px dashed #ccc;
    transition: border-color 0.4s ease;
    min-width: 20px;
}

.gf-header-line.lit {
    border-color: var(--primary-light);
}

/* ── COLUMN BODY (scrollable) ────────────────────────────────────────────── */

.gf-col-goals {
    overflow-y: auto;
    padding: 0;
}

.gf-col-grants,
.gf-col-reports {
    overflow-y: auto;
}

/* ── FIELDS (col 1) ──────────────────────────────────────────────────────── */

.gf-field {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-gray);
}
.gf-field:last-child { border-bottom: none; }

.gf-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.gf-opt {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    opacity: 0.7;
}

.gf-opt-required {
    font-weight: 700;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10px;
    color: var(--accent);
}

/* ── GEOGRAPHY ROWS ──────────────────────────────────────────────────────── */

/* Align “Add” with the right edge of the Area dropdown (same 4-col grid as geo rows). */
.gf-geo-field-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 6px;
    align-items: center;
    margin-bottom: 10px;
}
.gf-geo-field-header__label {
    grid-column: 1 / 3;
    margin: 0 !important;
}
.gf-geo-field-header .gf-add-geo-btn {
    grid-column: 3;
    justify-self: end;
}
.gf-geo-field-header__spacer {
    grid-column: 4;
}

/* Geography “Add” — solid fills only (default = former hover look); hover → pink */
.gf-add-geo-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 14px;
    background: var(--primary-light);
    border: 2px solid var(--primary-light);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 800;
    font-family: var(--main-font-family);
    color: var(--white);
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.45px;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
}
.gf-add-geo-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}
.gf-add-geo-btn:focus-visible {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.gf-geo-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gf-geo-row-labels {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 6px;
    padding: 0 0 6px 0;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    opacity: 0.85;
}

.gf-geo-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 6px;
    align-items: center;
    animation: gf-fadein 0.15s ease;
}

@keyframes gf-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Same control family as map sidebar (.select-dropdown in index-controls.css); compact for 3-col grid */
.gf-col-goals .gf-geo-row .select-dropdown.gf-geo-select-dropdown {
    width: 100%;
    padding: 8px 28px 8px 10px;
    font-size: 12px;
    border-radius: 6px;
    background-size: 14px;
    background-position: right 8px center;
}

/* Geography remove — variant B: solid blue + white ×; pink on hover (no motion) */
.gf-geo-remove {
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--primary-light);
    border-radius: 4px;
    background: var(--primary-light);
    color: var(--white);
    line-height: 0;
    cursor: pointer;
    overflow: visible;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.gf-geo-remove svg {
    display: block;
    overflow: visible;
    flex-shrink: 0;
    /* Inset strokes so round caps don’t clip at the viewBox edge */
    transform: translateZ(0);
}

.gf-geo-remove:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}
.gf-geo-remove:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Keeps grid when remove is hidden (only one required row) */
.gf-geo-remove-spacer {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    pointer-events: none;
}

/* county chip (shown in queue) */
.gf-county-chip { background: var(--primary-dark); color: var(--white); }
/* region chip */
.gf-region-chip { background: var(--primary-light); color: var(--white); }
/* grant chip — matches "Add Grant" button blue */
.gf-grant-chip { background: var(--primary-light); color: var(--white); }

/* ── INTENT / POPULATION PILLS ───────────────────────────────────────────── */

.gf-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gf-pill {
    padding: 5px 12px;
    border-radius: 20px;
    border: 1.5px solid var(--border-gray);
    background: var(--white);
    color: var(--text-dark);
    font-size: 12px;
    font-weight: 600;
    font-family: var(--main-font-family);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}

.gf-pill:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.gf-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--white);
}

/* ── SELECTED GRANTS BAR (col 2) ────────────────────────────────────────── */

.gf-selected-grants-bar {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-gray);
    background: var(--background);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.gf-selected-grants-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: var(--accent);
    white-space: nowrap;
}

.gf-selected-grants {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 18px;
}

/* Add grant — below Selected bar; only visible when at least one grant is selected (JS toggles wrap). */
.gf-grants-add-row-wrap {
    flex-shrink: 0;
}
.gf-grants-add-row-wrap--hidden {
    display: none;
}

.gf-grants-add-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 8px 16px 10px;
}

.gf-grants-library-btn {
    padding: 7px 14px !important;
    font-size: 12px !important;
    gap: 6px;
    white-space: nowrap;
}

/* ── GRANT CARDS (col 2) ────────────────────────────────────────────────── */

.gf-card-list {
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
    gap: 8px;
    overflow-y: auto;
}

.gf-card {
    background: var(--white);
    border: 1.5px solid var(--border-gray);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition:
        border-color 0.2s ease,
        box-shadow 0.22s ease,
        transform 0.2s ease,
        background 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

/* Hover: thin blue on all edges + lift */
.gf-card:hover {
    border: 1.5px solid var(--primary-light);
    box-shadow:
        0 4px 16px rgba(58, 134, 183, 0.2),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Selected: same thin blue ring all around; tone from fill + shadow */
.gf-card.gf-selected {
    border: 1.5px solid var(--primary-light);
    background: var(--background);
    box-shadow: 0 2px 10px rgba(44, 62, 80, 0.12);
}

.gf-card.gf-selected:hover {
    border: 1.5px solid var(--primary-light);
    box-shadow:
        0 4px 16px rgba(58, 134, 183, 0.22),
        0 1px 3px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Same pink corner tick as “Your Story” title — sits left of grant name */
.gf-card-name {
    position: relative;
    padding-left: 14px;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--primary-dark);
    margin: 0 0 2px 0;
    line-height: 1.25;
}

.gf-card-name::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}

.gf-card-funder {
    font-size: 11px;
    color: var(--text-muted);
    margin: 0 0 6px 0;
}

.gf-card-desc {
    font-size: 12px;
    color: var(--text-dark);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gf-card-link {
    display: inline-flex;
    align-items: center;
    margin-top: 0;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary-light);
    text-decoration: none;
    letter-spacing: 0.02em;
    transition: color 0.15s;
}
.gf-card-link:hover { color: var(--accent); }
.gf-card.gf-selected .gf-card-link {
    color: var(--primary-light);
}
.gf-card.gf-selected .gf-card-link:hover {
    color: var(--accent);
}

/* ── REPORTS PANE (col 3) ───────────────────────────────────────────────── */

.gf-reports-pane {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 16px 16px;
    flex: 1;
}

.gf-download-btn-row {
    display: flex;
    justify-content: center;
    padding-top: 2px;
}

.gf-dl-btn {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 7px 14px !important;
    font-size: 12px !important;
    white-space: nowrap;
    display: inline-flex !important;
    align-items: center;
    gap: 6px;
}
.gf-dl-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* No pink hover until the queue has chips (button is :disabled). */
#gf-download-all.advanced-report-btn:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

#gf-download-all.advanced-report-btn:disabled:hover {
    background-color: var(--primary-light);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* The chip box — reuse .drop-zone from selections.css */
.gf-drop-zone {
    width: 100%;
    border-radius: 8px;
    background: var(--background);
    min-height: 70px;
    box-sizing: border-box;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: center;
    gap: 6px;
}

/* ── EMPTY STATES ────────────────────────────────────────────────────────── */

.gf-col-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 24px;
    gap: 12px;
    color: var(--text-muted);
    border: 2px dashed var(--border-gray);
    border-radius: 8px;
    margin: 14px 16px;
    flex: 1;
    background: var(--background);
}
.gf-col-empty svg { opacity: 0.2; }
.gf-col-empty p { font-size: 13px; line-height: 1.6; margin: 0; font-weight: 500; }

.gf-empty-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: 1.5px solid var(--accent);
    border-radius: 6px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    font-family: var(--main-font-family);
    cursor: pointer;
    padding: 6px 14px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    transition: background 0.15s, color 0.15s;
    margin-top: 2px;
}
.gf-empty-submit-btn:hover {
    background: var(--accent);
    color: var(--white);
}

/* ── REPORT CARDS ────────────────────────────────────────────────────────── */

.gf-report-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0 0;
}

.gf-report-card {
    background: var(--white);
    border-radius: 10px;
    padding: 16px 18px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.15s ease;
    cursor: default;
}

.gf-report-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.gf-report-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.gf-report-icon svg { width: 24px; height: 24px; color: var(--white); }

.gf-report-icon.uscb-chip,
.gf-report-icon.bfs-chip        { background: var(--uscb-purple); }
.gf-report-icon.opportunityinsights-chip { background: var(--opportunity-insights-color); }
.gf-report-icon.state_of_indiana-chip   { background: var(--state-of-indiana-color); }
.gf-report-icon.uwphi-chip      { background: var(--dataset-health-outcomes, #D32F2F); }

.gf-report-info { flex: 1; min-width: 0; }
.gf-report-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.gf-report-title { font-size: 14px; font-weight: 800; color: var(--primary-dark); margin: 0 0 2px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gf-report-subtitle { font-size: 12px; color: var(--text-muted); margin: 0 0 6px 0; }
.gf-report-geo { font-size: 12px; color: var(--text-muted); margin: 0; }

.gf-report-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; flex-shrink: 0; }
.gf-action-row { display: flex; gap: 8px; }

.gf-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid var(--border-gray);
    background: var(--white);
    color: var(--primary-dark);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.gf-action-btn svg { width: 14px; height: 14px; }
.gf-action-btn:hover { border-color: var(--primary-dark); background: var(--background-light-shade); transform: translateY(-1px); }

.gf-action-btn.primary {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: var(--white);
}
.gf-action-btn.primary:hover {
    background: var(--primary-light);
    border-color: var(--primary-light);
}

.gf-action-btn.danger {
    background: transparent;
    border-color: var(--border-gray);
    color: var(--text-muted);
}

.gf-action-btn.danger:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: transparent;
}

.gf-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
}

.gf-eye-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1.5px solid var(--border-gray);
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    cursor: pointer;
    flex-shrink: 0;
    transition: border-color 0.15s, color 0.15s;
}
.gf-eye-btn:hover { border-color: var(--primary-dark); color: var(--primary-dark); }

.gf-queue-btn {
    flex: 1;
    padding: 6px 12px;
    background: var(--primary-dark);
    border: 1.5px solid var(--primary-dark);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    font-family: var(--main-font-family);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--white);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.gf-queue-btn:hover { background: var(--primary-light); border-color: var(--primary-light); }
.gf-queue-btn.gf-queued { background: var(--accent); border-color: var(--accent); }

.gf-region-note {
    font-size: 11px;
    color: var(--text-muted);
    font-style: italic;
    margin: 4px 0 0 0;
}

/* ── QUEUE STRIP ─────────────────────────────────────────────────────────── */

.gf-queue-strip {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: var(--background);
    border-top: 2px solid var(--primary-dark);
    padding: 10px 20px;
    z-index: 500;
    animation: gf-rise 0.2s ease;
}

@keyframes gf-rise {
    from { transform: translateY(120px); }
    to   { transform: translateY(0); }
}

.gf-queue-inner {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    max-width: 1800px;
    margin: 0 auto;
}

.gf-queue-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    flex-shrink: 0;
}

.gf-queue-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    white-space: nowrap;
}

.gf-q-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.gf-q-eye {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    text-decoration: none;
    transition: color 0.12s;
}
.gf-q-eye:hover { color: #fff; }

/* ── Submit grant sheet (compact; not contact/chip labels) ── */

/* Centered like report params (#gf-params-modal + .modal-overlay defaults) */
#gf-submit-modal.modal-overlay {
    align-items: center;
    justify-content: center;
    padding: min(4vh, 1.5rem) min(1.25rem, 4vw);
}

#gf-submit-modal .gf-submit-sheet,
.gf-sg-sample__row .gf-submit-sheet {
    width: 100%;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--primary-dark);
    background: var(--white);
}

#gf-submit-modal .gf-submit-sheet {
    width: 92%;
    max-height: min(90vh, 820px);
}

.gf-sg-sample__row .gf-submit-sheet {
    max-height: 37rem;
}

#gf-submit-modal .gf-submit-sheet__hd,
.gf-sg-sample__row .gf-submit-sheet__hd {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px 12px;
    background: var(--background-light-shade);
    border-bottom: 1px solid var(--border-gray);
    flex-shrink: 0;
}

#gf-submit-modal .gf-submit-sheet__hd-main,
.gf-sg-sample__row .gf-submit-sheet__hd-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#gf-submit-modal .gf-submit-sheet__title,
.gf-sg-sample__row .gf-submit-sheet__title {
    position: relative;
    margin: 0;
    padding-left: 14px;
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--primary-dark);
}

/* Pink tick — same language as .gf-col-goals .gf-col-title::before */
#gf-submit-modal .gf-submit-sheet__title::before,
.gf-sg-sample__row .gf-submit-sheet__title::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--accent);
}

#gf-submit-modal .gf-submit-sheet__hd .gf-geo-remove,
.gf-sg-sample__row .gf-submit-sheet__hd .gf-geo-remove {
    flex-shrink: 0;
}

#gf-submit-modal .gf-submit-sheet__bd,
.gf-sg-sample__row .gf-submit-sheet__bd {
    padding: 10px 14px 12px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
    background: var(--white);
}

#gf-submit-modal .gf-submit-sheet__lead,
.gf-sg-sample__row .gf-submit-sheet__lead {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-muted);
}

#gf-submit-modal .gf-submit-form,
.gf-sg-sample__row .gf-submit-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#gf-submit-modal .gf-submit-grid,
.gf-sg-sample__row .gf-submit-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

#gf-submit-modal .gf-submit-field--full,
.gf-sg-sample__row .gf-submit-field--full {
    grid-column: 1 / -1;
}

#gf-submit-modal .gf-submit-label,
.gf-sg-sample__row .gf-submit-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.65px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

#gf-submit-modal .gf-submit-input,
#gf-submit-modal .gf-submit-textarea,
.gf-sg-sample__row .gf-submit-input,
.gf-sg-sample__row .gf-submit-textarea {
    width: 100%;
    box-sizing: border-box;
    font-family: var(--main-font-family);
    font-size: 14px;
    padding: 9px 11px;
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    background: var(--white);
    color: var(--primary-dark);
    transition: border-color 0.15s, box-shadow 0.15s;
}

#gf-submit-modal .gf-submit-input:focus,
#gf-submit-modal .gf-submit-textarea:focus,
.gf-sg-sample__row .gf-submit-input:focus,
.gf-sg-sample__row .gf-submit-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 107, 107, 0.2);
}

#gf-submit-modal .gf-submit-textarea,
.gf-sg-sample__row .gf-submit-textarea {
    min-height: 5.25rem;
    max-height: 8.5rem;
    resize: vertical;
    line-height: 1.5;
}

#gf-submit-modal .gf-submit-date-row,
.gf-sg-sample__row .gf-submit-date-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

#gf-submit-modal .gf-submit-sheet__ft,
.gf-sg-sample__row .gf-submit-sheet__ft {
    padding-top: 2px;
    flex-shrink: 0;
}

/* Match Download Report (.advanced-report-btn in index-controls.css) */
#gf-submit-modal .gf-submit-primary,
.gf-sg-sample__row .gf-submit-primary {
    width: 100%;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-family: var(--main-font-family);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    background-color: var(--primary-light);
    color: var(--white);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#gf-submit-modal .gf-submit-primary:hover:not(:disabled),
.gf-sg-sample__row .gf-submit-primary:hover:not(:disabled) {
    background-color: var(--accent);
    color: var(--white);
    box-shadow: 0 4px 14px rgba(255, 107, 107, 0.28);
}

#gf-submit-modal .gf-submit-primary:disabled,
.gf-sg-sample__row .gf-submit-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

#gf-submit-modal .gf-submit-status .alert,
.gf-sg-sample__row .gf-submit-status .alert {
    margin-top: 4px;
    font-size: 0.9rem;
}

@media (max-width: 720px) {
    #gf-submit-modal .gf-submit-grid,
    #gf-submit-modal .gf-submit-date-row,
    .gf-sg-sample__row .gf-submit-grid,
    .gf-sg-sample__row .gf-submit-date-row {
        grid-template-columns: 1fr;
    }
}

/* Organization type: same track width as State + Type + Area (3×1fr + 24px spacer, gap 6px) */
.gf-org-select-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 24px;
    gap: 6px;
    align-items: center;
}

.gf-org-select-wrap .gf-org-select-dropdown.select-dropdown {
    grid-column: 1 / 4;
    width: 100%;
    min-width: 0;
    font-size: 12px;
    padding: 8px 28px 8px 10px;
    border-radius: 6px;
    background-size: 14px;
    background-position: right 8px center;
}

/* ── CHIP GEAR BUTTON ────────────────────────────────────────────────────── */

.gf-q-gear {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.65);
    cursor: pointer;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, transform 0.2s;
    flex-shrink: 0;
}
.gf-q-gear:hover {
    color: #fff;
    transform: rotate(45deg);
}
.gf-q-gear--custom {
    color: rgba(255, 255, 255, 0.95);
}
.gf-q-gear--custom svg {
    filter: drop-shadow(0 0 2px rgba(255,255,255,0.6));
}

/* ── REPORT PARAMS MODAL (aligned with /data provider tags + preview lab) ── */

#gf-params-modal.gf-params-modal-overlay.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

.gf-params-modal-inner {
    position: relative;
    width: 400px;
    max-width: 95vw;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid rgba(58, 134, 183, 0.42);
    box-shadow: 0 6px 22px rgba(44, 62, 80, 0.12);
}

.gf-pm-l-corner {
    position: absolute;
    top: 1px;
    left: 1px;
    width: 50px;
    height: 50px;
    box-sizing: border-box;
    border-top: 3px solid var(--accent);
    border-left: 3px solid var(--accent);
    border-radius: 9px 0 0 0;
    pointer-events: none;
    z-index: 3;
}

/* Same control as geography row remove (.gf-geo-remove) */
.gf-params-modal-inner > .gf-geo-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
}

.gf-pm-modal-body {
    position: relative;
    z-index: 1;
    padding: 22px 20px 16px;
}

.gf-pm-head {
    margin-bottom: 14px;
    padding-right: 42px;
    text-align: left;
}

.gf-pm-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    line-height: 1.25;
}

.gf-pm-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

/* /data .provider-tag.data-provider-tag + generic geography bubbles */
.gf-pm-tags-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    margin-bottom: 16px;
}

.gf-pm-data-tag {
    font-size: 0.85rem;
    font-weight: 900;
    color: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
    box-sizing: border-box;
    line-height: 1.25;
    max-width: 100%;
    word-break: break-word;
}

.gf-pm-data-tag[data-provider-id="uscensusbureau"] {
    background: var(--uscb-purple);
}

.gf-pm-data-tag[data-provider-id="opportunityinsights"] {
    background: var(--opportunity-insights-color);
}

.gf-pm-data-tag[data-provider-id="state_of_indiana"] {
    background: var(--state-of-indiana-color);
}

.gf-pm-data-tag[data-provider-id="uwphi"] {
    background: var(--dataset-health-outcomes, #d32f2f);
}

.gf-pm-modal-footer {
    padding: 12px 20px 18px;
    background: var(--background-light-shade);
    border-top: 1px solid var(--border-gray);
}

.gf-pm-modal-footer .download-button.advanced-report-btn.gf-pm-apply {
    width: 100%;
    max-width: none;
    margin: 0;
    font-size: 12px;
    padding: 9px 16px;
}


/* Parameter fields inside modal body */
.gf-pm-field {
    margin-bottom: 16px;
}
.gf-pm-field:last-child { margin-bottom: 0; }

.gf-pm-label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.gf-pm-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-gray);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--main-font-family);
    color: var(--text-dark);
    background: var(--white);
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}
.gf-pm-select:focus {
    border-color: var(--primary-dark);
    box-shadow: 0 0 0 3px rgba(44, 62, 80, 0.08);
}

/* ── Submit combobox (intent / population) ───────────────────────────────── */

.gs-combo {
    position: relative;
}

.gs-combo-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 4px;
    min-height: 0;
}

.gs-combo-chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    cursor: default;
}

.gs-combo-chip--existing {
    background: var(--primary-dark);
    color: var(--white);
}

.gs-combo-chip--proposed {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent);
    border: 1px dashed var(--accent);
}

.gs-combo-chip-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: 0.7;
    padding: 0;
    line-height: 1;
    font-size: 14px;
    display: flex;
    align-items: center;
}

.gs-combo-chip-remove:hover { opacity: 1; }

.gs-combo-input {
    margin-bottom: 0 !important;
}

.gs-combo-dropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: var(--white);
    border: 1px solid var(--border-gray);
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    z-index: 9999;
    max-height: 200px;
    overflow-y: auto;
    display: none;
}

.gs-combo-dropdown.open { display: block; }

.gs-combo-option {
    padding: 8px 12px;
    font-size: 13px;
    color: var(--primary-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gs-combo-option:hover,
.gs-combo-option.focused {
    background: var(--bg-light, #f5f7fa);
}

.gs-combo-option--add {
    color: var(--accent);
    font-style: italic;
    border-top: 1px solid var(--border-gray);
}

.gs-combo-option--add::before {
    content: '+';
    font-style: normal;
    font-weight: 900;
    font-size: 15px;
    margin-right: 2px;
}

.gs-combo-option--selected::after {
    content: '✓';
    margin-left: auto;
    font-size: 12px;
    color: var(--primary-dark);
}

/* ── Grant detail modal ───────────────────────────────────────────────────── */

.gf-detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 5000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.18s ease-out;
}

.gf-detail-modal.active { display: flex; }

.gf-detail-modal-content {
    background: var(--white);
    border-radius: 16px;
    max-width: 600px;
    width: 100%;
    max-height: 88vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.22);
    display: flex;
    flex-direction: column;
}

.gf-detail-modal-header {
    padding: 28px 28px 0 28px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1px solid var(--border-gray);
    padding-bottom: 20px;
}

.gf-detail-modal-header-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gf-detail-modal-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--primary-dark);
    line-height: 1.25;
    margin: 0;
}

.gf-detail-modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.gf-detail-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gf-detail-tag--funder {
    background: var(--primary-dark);
    color: var(--white);
}

.gf-detail-tag--deadline {
    background: rgba(255, 107, 107, 0.12);
    color: var(--accent);
}

.gf-detail-modal-close {
    background: rgba(44, 62, 80, 0.06);
    border: 1px solid rgba(44, 62, 80, 0.15);
    color: var(--primary-dark);
    border-radius: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}

.gf-detail-modal-close:hover {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
    transform: scale(1.05);
}

.gf-detail-modal-body {
    padding: 20px 28px;
    flex: 1;
}

.gf-detail-section {
    margin-bottom: 20px;
}

.gf-detail-section:last-child { margin-bottom: 0; }

.gf-detail-section-title {
    font-size: 10px;
    font-weight: 900;
    color: var(--primary-dark);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding-bottom: 4px;
    margin-bottom: 8px;
    border-bottom: 2px solid var(--primary-dark);
    display: inline-block;
}

.gf-detail-section-text {
    font-size: 14px;
    line-height: 1.75;
    color: var(--primary-dark);
    margin: 0;
}

.gf-detail-tag-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.gf-detail-vocab-tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(44, 62, 80, 0.07);
    color: var(--primary-dark);
}

.gf-detail-date-row {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.gf-detail-date-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.gf-detail-date-label {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
}

.gf-detail-date-val {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary-dark);
}

.gf-detail-url-link {
    display: inline-flex;
    align-items: center;
    font-size: 13px;
    color: var(--primary-light);
    text-decoration: none;
    word-break: break-all;
    font-weight: 600;
    transition: color 0.15s;
}

.gf-detail-url-link:hover { color: var(--accent); }

.gf-detail-modal-footer {
    padding: 16px 28px;
    border-top: 1px solid var(--border-gray);
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* Eyeball button on grant cards */
.gf-card-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.gf-card-eye {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    border: 1px solid var(--border-gray);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    flex-shrink: 0;
}

.gf-card-eye:hover {
    background: var(--primary-dark);
    color: var(--white);
    border-color: var(--primary-dark);
}

@media (max-width: 640px) {
    .gf-detail-modal-header { padding: 20px 18px 16px; }
    .gf-detail-modal-body { padding: 16px 18px; }
    .gf-detail-modal-footer { padding: 12px 18px; }
    .gf-detail-modal-title { font-size: 16px; }
}

/* Long NAICS industry list: listbox-style select with in-panel scroll (no faux dropdown chevron) */
#gf-params-fields .gf-pm-select--listbox {
    max-height: 280px;
    overflow-y: auto;
    padding-right: 14px;
    background-image: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
