#rr, select, button {
    font: 16px/1.5 'Montserrat', 'Gill Sans', 'Trebuchet MS', sans-serif;
}

#rr {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
}

#rr_top {
    width: 100%;
    height: 260px;
    display: flex;
    position: relative;
    margin-bottom: 4px;
}

.title {
    /* width: 100%; */
    text-align: center;
    margin: 3px 4px -2px 4px;
    font-weight: 600;
    color: #404040;
    font-size: 23px;
    background: #e3e3e3;
}

.gap {flex: 1}

#top #charts_options {
    display: flex;
    flex-direction: column;
}

#chart_controls {
    margin: 5px;
    border: 1px solid #aaa;
    width: 150px;
    padding: 5px;
    display: flex;
    flex-direction: column;
    font-size: 0.9em;
}

#chart_controls label {
    padding: 2px 0 0 0;
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

#chart_controls select {
    width: 80px;
    max-width: 80px;
    padding: 1px 0;
    margin: 0;
}

#chart_controls input[type='number'] {
    width: 72px;
    /* max-width: 85px; */
    padding: 0px 2px;
    margin: 0;
}

#stats_table {
    table-layout: fixed
}

#stats {
    /* margin: 0px 0 0 3px; */
    /* border: 1px solid #aaa; */
    width: 270px;
    padding: 0px 2px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.9em;
    line-height: 19px;
}

#stats .stats_hist_th {
    width: 142px;
}

#stats .stats_stat {
    display: flex;
    justify-content: space-between;
    flex: 1;
}

#date_controls {
    display: flex;
    justify-content: flex-end;
    padding: 2px 2px 0 0;
    margin: 0 0 -8px 0px;
    z-index: 100;
    /* display: none; */
}

#date_controls .date_control {
    font-size: 0.8em;
    font-weight: 600;
    width: 58px;
    text-align: center;
    padding: 0 2px;
    margin: 0 0 0 4px;
    border: 1px solid #aaa;
    border-radius: 1px;
    cursor:pointer;
    /* display: none; */
}

#date_controls .date_control:hover {
    background:#ccc;
}

#date_controls .date_control.selected {
    background:#ccc;
    cursor:default
}

#charts {
    position:relative;
    display: grid;
    gap: 4px 4px;
    padding: 0px 3px 0px 0px;
    /* margin: 4px 0 0 0; */
    width: 100%;
    max-height: 100%;
    grid-template-columns: repeat(auto-fill, minmax(var(--chart_container-width), 1fr));
    overflow: auto;
}

#loading {background: #ffffffed;display: none;margin: 20px auto;border-radius: 133px;/* width: 190px; *//* border: solid #ccc; */position: absolute;left: calc(50% - 100px);top: 70px;z-index: 10001;text-align: center;}
#loading .msg {
    position: absolute;
    top: calc(50% - 67px);
    left: calc(50% - 25px);
    font-size: 0.8em;
    border: 1px solid #615e5e;
    border-radius: 50px;
    width: 50px;
    height: 50px;
    line-height: 50px;
    background: #ffffffa1;
}
#loading .cancel {
    position: absolute;
    top: calc(50% - 10px);
    left: calc(50% - 45px);
    border: 1px solid #000;
    border-radius: 5px;
    font-size: 0.8em;
    width: 90px;
    background: #ffffffc4;
}
#loading .cancel:hover {
    cursor: pointer;
    opacity: 0.5;
}
.chart_container {height: var(--chart_container-height);display: flex;flex-direction: column;border: 1px solid #aaa;padding: 0px 5px 5px 5px;}


#expanded_chart_dialog {
    width: 95%;
    height: auto;
    margin-bottom: 3vh;
    /* max-width: 1200px; */
    overflow: hidden;
    padding: 0;
}

#expanded_chart_dialog .chart_container {
    overflow: hidden;
    height: 100%;
    padding: 5px;
    /* margin: 6px; */
}

.query_block_title {
    /*  starts at position 1, ends 1 from the end (the end!) - forces a new row for thr title */
    display: flex;
    grid-column-start: 1;
    grid-column-end: -1;
    border-top: 3px solid #ccc;
    margin: 0px 6px -5px 0;
    padding: 7px 0 0 0;
    /* font-size: 16px; */
    font-weight: 600;
}

.query_block_title:first-child {
    border-top: none;
}

.group_data_container {

}

#expanded_chart_dialog .group_data_container .chart {
    min-height: 500px;
}

.group_data_container  .chart {
    max-height: 600px;
}

.chart_title_container {
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
    margin: 2px 0px 1px 0;
    font-size: 14px;
}

.chart_title {
    font-weight: 600;
    font-size: 14px;
}

.chart_title_vals {
    font-weight: 500;
    font-size: 12px;
    margin: 0 0 0 5px;
}

.chart_title_options {display: flex;align-items: center;gap: 5px;}


.chart_time {
    flex: 1;
    flex-direction: column;
    margin: 0 0px;
    border: 1px solid #aaa;
    display: flex;
    overflow: hidden;
}

.chart_time canvas {
    flex: 1;
}

.chart_container .zero {
    display: flex; gap: 2px; font-size: 14px
}
.chart_container .zero_val {
    font-weight: 600
}

.chart_container input, .chart_container select {border: 1px solid #aaa;}
.chart_container select {margin: 0;user-select: none;}

.chart_container select:focus {outline: none;}

.chart_hover, .chart_selected {
    display: none;
    position: absolute;
    top: 10px;
    width: 2px;
}

.chart_hover_min {
    background: #b54949;
    box-shadow: rgb(181 73 73) 0px 0px 2px 0px;
}

.chart_hover_max {
    background: #497fb5;
    box-shadow: rgb(73, 127, 181) 0px 0px 2px 0px;
}

.chart_hover {
    opacity: 0.6;
}

.chart_selected.selected {
    display: block !important;
}

/* tables */
#main .chart_container .group_data_container {/* display: flex; */height: 100%;overflow: hidden auto;padding: 0;/* background: #ccc; */}

#main .chart_container  table {width: calc(100% + 2px);height: auto;max-width: 800px;margin: 0 auto;}
#main .chart_container table thead {
    position: sticky;
    inset-block-start: 0;
    background-color: #fff;
  }
#main .chart_container  table td, #main .chart_container  table th {border: 1px solid #dbdbdb;/* padding: 0px 2px; */text-align: center;line-height: 23px;}
#main .chart_container  table th {/* background: #e3e3e3; */font-weight: 600;font-size: 0.9em;width: 42px;max-width: 42px;min-width: 42px;}
#main .chart_container  table th.sortable {cursor: pointer;position: relative;border-top: 0;width: 40px;}
#main .chart_container  table th.sortable:hover {background: #ddd;color: #123456;}
#main .chart_container  table th.sortable.sorted[sort-order='desc']:after {
    content: "";
    border-top: 2px solid #497fb5;
    display: block;
    left: 0;
    right: 0;
    top: 0;
    position: absolute;
}
#main .chart_container  table th.sortable.sorted[sort-order='asc']:before {
    content: "";
    border-top: 2px solid #b54949;
    display: block;
    left: 0;
    right: 0;
    top: 0;
    position: absolute;
}
#main .chart_container  table .left {text-align: left;}
#main .chart_container  table .right {text-align: right; font-variant-numeric: tabular-nums;}
#main .chart_container  table .opt {width: 30px;max-width: 30px;}
#main .chart_container  table th.grp {width: auto;max-width: unset;}
#main .chart_container  table input[type='checkbox'] {width: 18px;height: 18px;vertical-align: middle;}

#update_shorlist_settings.highlight, #query_shorlist_settings.highlight  {
    background: #58e7838c;
}

#app button.subset_set_btn {
    width: auto;
    flex: 1;
    font-size: 12px;
    padding: 0;
    font-weight: 600;
}

#stats_controls {
    display: flex;
    background: white;
    /* height: 18px; */
    border-radius: 2px;
    margin: 2px;
}

#aia {
    padding: 5px;
    /* overflow: auto; */
}
#main .stats_hist {
    cursor:  default;
    opacity: 0.5;
    margin: 1px 2px 0 2px;
}
#main .stats_hist.on {
    cursor: pointer;
    color: #123456;
    opacity: 0.9;
}
#main .stats_hist:hover {
    color: null;
}
#main .stats_hist.on:hover {
    opacity: 0.75;
}

#main .inc_exc {
    width: 50px;
    margin: 0 2px 0px 0px;
    /* height: 22px; */
    /* line-height: 10px; */
    /* display: none; */
}
#main .inc_full_width {
    width: 182px;
    margin: 1px 0 1px 0;
}

.shortlist_export_dialog {
    display: flex;
    flex-direction: column;
}

#shortlist_export_dialog label {display: flex;width: 100%;/* justify-content: space-between; */margin: 2px 0;align-items: center;}
#shortlist_export_dialog label div {
    width: 100px;
}
#shortlist_export_dialog select {
    flex: 1;
}

#main .fa#show_research_settings {
    display: none;
    position: absolute;
    left: -2px;
    top: 4px;
    font-size: 32px;
}

#main #toggle_shortlist_filters {
    font-size: 24px;
}