body {
    margin: 0;
    padding: 0;
    color: darkslategray;

    font-family: Arial, sans-serif;
}

#heroWrapper {
    grid-area: hero;
    width: 100%;
    height: auto;
    margin-left: 3vw;
}

#lobby_hero_main {
    /* Ensure the SVG takes up the full width of its parent (.grid-item) */
    width: 100%;
    /* Maintain the SVG's intrinsic aspect ratio */
    height: auto;
    /* Optional: Prevents the SVG from overflowing its container on smaller screens if the container has explicit min/max widths */
    display: block;
    max-width: 100%;
    max-height: 150px;
}

#linksWrapper {
    grid-area: links;

    display: flex;
    gap: 36px;
    justify-content: space-around;
    align-items: center;
    font-size: small;

}

header {
    height: 150px;
    display: grid;
    grid-template-columns: 20vw 1fr;
    grid-template-rows:1fr 1fr;
    grid-template-areas:
            "hero links"
            "hero search";
    gap: 1px;

    place-items: center;

    /*height: 150px;*/
    /*box-sizing: border-box;*/
    /*display: flex;*/
    /*flex-direction: column;*/
    /*justify-content: space-evenly;*/
    /*align-items: center;*/
    /*gap: 8px;*/
}

#searchWrapper {

    grid-area: search;

    margin: 0 auto;
    /*padding-left: 30px;*/
    /*padding-top: 30px;*/
    display: grid;
    grid-template-columns:300px 150px 150px 150px 120px 120px;
    grid-template-rows: 1fr 30px;
    grid-template-areas:
            "s d1 d2 cvd sB vB"
            "sL d1Label d2Label cvdLabel . .";

    gap: 2px;

    max-width: 70vw;
}

#quickstartVideoLink, #contactLink, #deepDiveVideoLink {
    font-weight: initial;
    font-size: small;
    margin-left: 1vw;
    margin-right: 1vw;
}

#searchTerm {
    grid-area: s;
}

#searchTermLabel {
    grid-area: sL;
}

#startDate {
    grid-area: d1;
    margin-left: 8px;
}

#startDateLabel {
    grid-area: d1Label;
    margin-left: 8px;
}

#endDate {
    grid-area: d2;
    margin-left: 8px;

}

#endDateLabel {
    grid-area: d2Label;
    margin-left: 8px;
}

#countVsDollar {
    grid-area: cvd;
    margin-left: 8px;
}

#countVsDollarLabel {
    grid-area: cvdLabel;
    margin-left: 8px;
}

#searchButton {
    grid-area: sB;
    margin-left: 8px;
}

#vizButton {
    grid-area: vB;
}

#searchButton, #vizButton {
    padding: 0.6rem 1.2rem;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 0.6rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease;

    max-width: 100px;
}

#searchButton:hover {
    background: #1666ca;
    transform: translateY(-1px);
}

#searchButton:active {
    background: #0f4ea2;
    transform: translateY(0);
}


#columnsWrapper {
    padding-left: 1vw;
    padding-right: 1vw;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    height: calc(100vh - 150px);
    gap: 16px;

    font-size: 0.8em;
}

/* Shared header style */
.sticky-header:before {
    position: sticky;
    top: 0;
    background-color: lightgray;
    padding: 8px;
    font-size: 0.8em;
    z-index: 1;
    margin-bottom: 2px;
    border: thin solid lightgray;
    box-sizing: border-box;
    width: 100%;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

/* Per-ID content labels */

#jurisdiction.sticky-header:before {
    content: "Jurisdiction";
}

#beneficiary.sticky-header:before {
    content: "Beneficiary";
}

#firm.sticky-header:before {
    content: "Firm";
}

#lobbyist.sticky-header:before {
    content: "Lobbyist";
}

#poh.sticky-header:before {
    content: "POH";
}

#branch.sticky-header:before {
    content: "Branch";
}

#dept.sticky-header:before {
    content: "Dept";
}

#fullComm.sticky-header:before {
    content: "Full Communcation";
}

#fullComm .notes {
    font-size: smaller;
}

.dataWrapper {
    /*overflow: scroll;*/
    /*flex: 1 0 auto;*/
    /*border: thin solid lightgray;*/
    /*padding: 8px;*/

    overflow: auto;
    flex: 1 0 0;
    min-width: 0;
    border: thin solid lightgray;
    padding: 8px;

}

#jurisdiction {
    flex: 0 1 auto;
}

#beneficiary .dataRow .nameCell {
}

#fullComm {
    /*flex: 0 1 200px;*/
}

.dataRow {
    display: flex;
    gap: 16px;
    margin-bottom: 2px;
    border-bottom: thin solid lightgray;
    justify-content: start;
}

#fullComm .dataRow {
    flex-direction: column;
    gap: 2px;
    padding-top: 3px;
    padding-bottom: 3px;
    margin-top: 4px;
    margin-bottom: 4px;
}

#fullComm .dataRow .jurisdiction::before {
    content: "";
    display: inline-block;
    width: 24px;
    height: 16px;
    margin-right: 4px;
    background-size: contain;
    background-repeat: no-repeat;
    vertical-align: middle;
}

#fullComm .dataRow .jurisdiction.canada::before {
    background-image: url('/images/Flag_of_Canada.svg');
}

#fullComm .dataRow .jurisdiction.ontario::before {
    background-image: url('/images/Flag_of_Ontario.svg');
}

#fullComm .dataRow .jurisdiction.toronto::before {
    background-image: url('/images/Flag_of_Toronto.svg');
}

#fullComm .dataRow .jurisdiction.usa::before {
    background-image: url('/images/usa.png');
}

#fullComm .dataRow .dataCell {
    max-width: 250px;
}

#fullComm .dataRow .upperRow {
    display: flex;
    justify-content: start;
    gap: 6px;
    position: relative;
}

#fullComm .dataRow .id {
    font-size: x-small;
    /*position: absolute;*/
    /*right: 0;*/
    /*top: 0;*/
}

#fullComm .dataRow .dataCell:before {
    font-weight: bold;
    font-size: small;
    font-variant: small-caps;
}

#fullComm .dataRow .beneficiary:before {
    content: 'Beneficiary: ';
}

#fullComm .dataRow .firm:before {
    content: 'Firm: ';
}

#fullComm .dataRow .lobbyist:before {
    content: 'Lobbyist: ';
}

#fullComm .dataRow .poh:before {
    content: 'POH: ';
}

#fullComm .dataRow .dept:before {
    content: 'Dept: ';
}

#fullComm .dataRow .branch:before {
    content: 'Branch: ';
}

#fullComm .dataRow .amt:before {
    content: 'Amt: ';
}

#fullComm .dataRow .notes:before {
    content: 'Notes: ';
}

#fullComm .dataRow .dataCell.hit {
    /*background-color: #e8e3e3;*/
    color: blue;
}

#fullComm .dataRow .notes .hitWord {
    background: linear-gradient(
            transparent 50%,
            rgba(255, 225, 90, 0.95) 50%
    );
    padding: 0.05em 0.14em;
    border-radius: 3px;
    box-shadow: inset 0 -0.08em 0 rgba(255, 200, 0, 0.6),
    0 1px 0 rgba(0, 0, 0, 0.05);
}

.valCell {
    text-align: right;
    font-size: smaller;
    flex: 0 1 auto;
    /*min-width: 20px;*/


}

.nameCell {
    /*flex: 1 0 auto;*/
    flex: 0 1 200px;
    cursor: pointer;

}

#viz {
    width: 100%;
    height: 100%;
    background: whitesmoke;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 999;
    opacity: .95;
}

#vizControls {
    position: fixed;
    top: 3vh;
    left: 3vw;
    right: 0;
    background: lightgray;
    padding: 8px;
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: start;
    gap: 8px;
    width: 200px;
    height: 500px;
    z-index: 1000;
    border: thin solid gray;

}

.instructions {
    font-size: .8em;

    li {
        position: relative;
        left: -16px;
        margin-bottom: 4px;
    }
}

.dragmenu {
    position: relative;
    background-color: lightgray;
    height: 350px;
    min-width: 200px;
}

.dragmenu-item {
    position: absolute;
    background-color: lightblue;
    will-change: transform;
    cursor: move;
    /*min-width: 150px;*/
    padding: 4px;
    border-radius: 4px;
    border: thin solid gray;
    /*touch-action: none;   !* CRITICAL for mobile *!*/

}

.dragmenu-item label {
    cursor: move;
}

.dragmenu-item.animate {
    opacity: 1;
}

/* layout only */
.dragmenu-item.zero {
    top: 0;
}

.dragmenu-item.one {
    top: 40px;
}

.dragmenu-item.two {
    top: 80px;
}

.dragmenu-item.three {
    top: 120px;
}

.dragmenu-item.four {
    top: 160px;
}

.dragmenu-item.five {
    top: 200px;
}

.dragmenu-item.six {
    top: 240px;
}

.dragmenu-item.seven {
    top: 280px;
}

.dragmenu-item.eight {
    top: 320px;
}

.dragmenu-item.nine {
    top: 360px;
}

.dragmenu-item.ten {
    top: 400px;
}

.dragmenu-item.eleven {
    top: 440px;
}

.dragmenu-item.twelve {
    top: 480px;
}

.circleDrillDownDiv {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 90vw;
    max-height: 70vh;
    border-radius: 4px;
    background-color: lightgray;
    /*position: absolute;*/
    /*overflow: scroll;*/
    padding: 4px;
    border: thin solid gray;
    z-index: 9999;
    display: flex;
    flex-direction: column;

    .tableWrapper {
        flex: 1 1 auto;
        overflow: scroll;
        margin-top: 24px;
    }

    .closerX {
        position: absolute;
        top: 8px;
        right: 8px;
        padding: 3px;
        background-color: red;
        color: white;
        cursor: pointer;
        border: thin solid gray;
        border-radius: 4px;
    }

}

.circleDrillDownDiv table {
    font-size: .6rem;
    border-collapse: collapse;
    /*table-layout: fixed; !* keeps columns aligned *!*/
}

.circleDrillDownDiv table {
    width: 80vw;

    /*.dt {*/
    /*    width: 100px;*/
    /*}*/

    /*.beneficiary {*/
    /*    width: 200px;*/
    /*}*/

    /*.firm {*/
    /*    width: 200px;*/
    /*}*/

    /*.lobbyist {*/
    /*    width: 150px;*/
    /*}*/

    /*.poh {*/
    /*    width: 200px;*/
    /*}*/

    .notes {
        width: 400px;
    }

    thead {
        position: sticky;
        top: 0;
    }
}

.circleDrillDownDiv th,
.circleDrillDownDiv td {
    /*padding: 6px 8px;*/
    /*vertical-align: top;*/
    /*white-space: normal; !* allow wrapping *!*/
    /*word-break: break-word; !* break long words *!*/
    /*overflow-wrap: anywhere; !* modern wrap handling *!*/
}


.closerX:before {
    content: "X";
}

#spinner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loader {
    width: 40px;
    height: 40px;
    border: 4px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.questionMark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    margin-left: 0.25em;

    /*font-size: 0.9em;*/
    font-weight: 600;
    border-radius: 50%;

    background-color: #eef2f7;
    color: #475569;
    cursor: help;

    position: relative;
    user-select: none;
}

.qmTooltip {
    position: absolute;
    z-index: 99999;

    /* positioning anchor (down + right of ?) */
    top: 120%;
    left: 100%;

    /* sizing */
    width: 360px;
    /*max-width: 90vw;*/
    box-sizing: border-box;

    /* visual */
    background: #111827;
    color: #f9fafb;
    font-size: 0.75rem;
    line-height: 1.35;
    padding: 0.55em 0.65em;
    border-radius: 6px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);

    /* animation base state */
    opacity: 0;
    transform: translate(8px, 8px);
    pointer-events: none;

    /* animation behavior */
    transition: opacity 120ms ease-out,
    transform 120ms ease-out;

    /* text behavior */
    white-space: normal;
}


.questionMark:hover .qmTooltip,
.questionMark:focus .qmTooltip {
    opacity: 1;
    pointer-events: auto;
    transform: translate(8px, 4px); /* same direction as base */
    z-index: 999999;
}

#smallScreenOnly {
    display: none;
}

/* small screens only */
@media (max-width: 700px) {
    body {
        /*background-color: red;*/
    }

    header, #columnsWrapper {
        display: none;
    }

    #smallScreenOnly {
        display: flex;
        flex-direction: column;
        gap: 16px;
        height: 80vh;
        justify-content: center;
        align-items: center;

        margin-left: auto;
        margin-right: auto;
        padding: 10vmin;


    }

    #smallScreenOnly div {


    }

    #dimensions {
        position: fixed;
        right: 10px;
        bottom: 10px;
        font-size: 7px;
    }

    /*#searchWrapper {*/
    /*    grid-template-columns: repeat(6, 1fr);*/
    /*    grid-template-rows: 36px 16px;*/
    /*}*/
    /*#searchWrapper label {*/
    /*    font-size: x-small;*/
    /*}*/
    /*#instructions {*/
    /*    display: none;*/
    /*}*/
}

