:root {
    --border-radius: 8px;
    --border: 1px solid var(--light-gray-third);
}

/* Pagination */
    .pagination {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    .pagination-total, .pagination-entries-shown label {
        font-size: 14px;
        color: var(--gray-secondary);
    }
    .pagination-entries-shown > form{
        display: flex;
        flex-direction: row;
        justify-content: center;
        gap: 8px;
        align-items: center;
    }
    .pagination-form {
        display: flex;
        flex-direction: row;
        gap: 10px;
        align-items: center;
    }
    .pagination-input {
        font-size: 14px;
        display: flex;
        justify-content: center;
        align-items: center;
        width: 28px;
        height: 28px;
        border-radius: 4px;
        background: var(--light-secondary);
        border: none;
        cursor: pointer;
        place-items: center;
        transition: background .1s, color .1s, outline .1s;
    }
    .pagination-input, .pagination-input > svg {
        fill: var(--gray-secondary);
        color: var(--gray-secondary);
    }
    .pagination-input:hover {
        outline: 2px solid var(--blue-main);
        background-color: var(--blue-main);
        outline-offset: 2px;
    }
    .pagination-input:hover, .pagination-input:hover.pagination-input > svg, .pagination-input:active.pagination-input > svg {
        fill: var(--light-primary);
        color: var(--light-primary);
    }
    .pagination-input#selected {
        color: var(--light-primary);
        background: var(--blue-main);
    }
    .pagination-input#selected:hover {
        outline: 2px solid var(--blue-main);
        outline-offset: 2px;
    }
    .pagination-input#selected:active, .pagination-input:active {
        outline-color: var(--blue-secondary);
        background-color: var(--blue-secondary);
        color: var(--light-primary);
    }

/* Table */
    table {
        font-family: 'Roboto', sans-serif;
        border-spacing: 0;
        border-collapse: separate;
        width: 100%;
        color: var(--gray-secondary);
    }

    th {
        color: var(--dark-secondary);
        background-color: var(--light-gray-secondary);
        font-weight: 500;
        transition: background .1s, color .1s;
    }
    td {
        background-color: var(--light-primary);
        transition: background .1s, color .1s;
    }
    tbody > tr:hover td{
        background-color: var(--light-secondary);
        color: var(--dark-secondary);
    }
    tbody > tr:hover td a {
        color: var(--dark-secondary);
    }
    thead:hover th {
        color: var(--gray-third);
    }
    th:hover:not(:last-of-type){
        background-color: #DFE4EE;
        color: black;
    }

    th, td, td p {
        text-align: start;
        text-wrap: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 0;
    }
    td, th {
    padding: 16px 12px;  /* fallback for plain text cells */
    }

    tr th:first-of-type, tr td:first-of-type {
        text-align: start;
    }
    .table-wrapper {
        overflow-x: auto;
        scroll-behavior: smooth;
        scrollbar-width: thin;
        padding-bottom: 8px;
    }
    td > div, th > div, .anchor-wrapper { /* Entry Name Formatting*/
        display: flex;
        flex-direction: row;
        gap: 8px;
        align-items: center;
    }
    tr > td:last-of-type, tr > th:last-of-type { /* Link Formatting */
        text-align: center;
        width: 49px;
        min-width: 49px;
        padding-left: 0;
        padding-right: 0;
    }
    table a {
        color: var(--gray-secondary);
    }
    table a:hover {
        color: var(--blue-secondary) !important;
    }
    /* Table Border and Corners*/
        tr th:first-of-type                 {border-top-left-radius: var(--border-radius);}
        tr th:last-of-type                  {border-top-right-radius: var(--border-radius);}
        tr:last-of-type td:first-of-type    {border-bottom-left-radius: var(--border-radius)}
        tr:last-of-type td:last-of-type     {border-bottom-right-radius: var(--border-radius)}
        
        tr th:first-of-type, tr td:first-of-type {
            border-left: var(--border);
        }
        tr th:last-of-type, tr td:last-of-type {
            border-right: var(--border);
        }
        tr:first-of-type th {
            border-top: var(--border);
        }
        tr:last-of-type td {
            border-bottom: var(--border);
        }
        td {
            border-top: var(--border);
        }
        td:not(:last-of-type), th {
            border-radius: 1px ;
            border-right: 1px dashed var(--light-gray-third);
        }
        td:not(:last-of-type), tr:not(:last-of-type) {
            width: auto;
        }
    /* Header Logic */
        th > div {
            display: flex;
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
            gap: 4px;
            text-wrap: nowrap;
        }
        th > div > form {
            display: flex;
            flex-direction: column;
            gap: 0;
            margin: 0;
        }
        .inner_th_button {
            background: none;
            position: relative;
            z-index: 1;
            color: inherit;
            border: none;
            outline: none;
            cursor: pointer;
            opacity: 25%;
            width: fit-content;
            transition: opacity 100ms linear;
        }
        .main_th:hover .inner_th_button{
            opacity: 50%;
        }
        .inner_th_button.active {
            opacity: 100% !important;
        }
        .toggled .inner_th_button {
            opacity: 50%;
        }
        .inner_th_button:hover {
            opacity: 100% !important;
        }

        .inner_form > .inner_th_button:nth-last-child(2)::before{
            content: '';
            position: absolute;
            top: -16px;
            left: -16px;
            right: -16px;
            bottom: 0;
            cursor: pointer;
            pointer-events: none;
        }
        .inner_form > .inner_th_button:last-child::before{
            content: '';
            position: absolute;
            top: 0;
            left: -16px;
            right: -16px;
            bottom: -16px;
            cursor: pointer;
            pointer-events: none;
        }
        .filter_button {
            background:none;
            outline: 0;
            border: 0;
            transition: background .1s, color .1s, text-decoration-line .1s;

        }
        .filter_button:hover {
            opacity: 50%;
        }
        .filter_button:active {
            opacity: 75%;
        }

/* Factsheet*/
    .factsheet_div, .stats-div, .title_div {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    .title_div p {
        color: var(--dark-third);
    }
    .factsheet-article {
        display: inline-flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 16px;
    }
    .fact-div {
        display: flex;
        flex-direction: column;
        width: fit-content;
        border-radius: 4px;
        background-color: var(--light-primary);
        border: 1px solid var(--light-gray-third);
        padding: 16px;
        gap: 8px;
        box-sizing: border-box;
    }
    .fact-div.analysis {
        width: 100%;
    }
    .fact-form > select {
        padding: 0;
    }
    .positive, .green{
        color: #53A667 !important;
    }
    .negative, .red{
        color: #E86365 !important;
    }
    .value-div {
        display: flex;
        flex-direction: row;
        gap:8px;
        align-content: center;
    }
    .fact-content {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-content: center;
        gap: 8px;
    }
    .value-p {
        margin: 0;
        color: var(--gray-primary);
        align-content: center;
    }
    .fact-heading {
        display: flex;
        flex-direction: row;
        gap: 8px;
        justify-content: space-between;
        align-items: center;
    }
    .fact-heading > :first-child {
        margin-right: auto;
    }
    .fact-heading > :nth-child(2) {
        margin-left: 8px;
    }

/* Mobile breakpoint */
    @media (max-width: 768px) {
        .factsheet-article{
            display: flex;
            flex-direction:column;
        }
        .fact-div{
            width: 100%;
        }
        .pagination {
            display: grid;
            grid-template-columns: 1fr 1fr;
            grid-template-rows: 1fr 1fr;
            gap: 0px;
            grid-template-areas: 
            "total entries-shown"
            "form form";
        }
        .pagination-total {
            grid-area: total;
            order: 1;
            margin-bottom: 16px;
        }
        .pagination-entries-shown {
            grid-area: entries-shown;
            order: 2;
            margin-bottom: 16px;
            margin-left: auto;
        }
        .pagination-form {
            grid-area: form;
            order: 3;
            margin: auto;
        }
    }
