:root {
    --text-color: #333;
    --secondary-color: #999;
    --grid-border-color: #eee;
    --cell-border-color: #ddd;
    --drawer-bg-color: #eee;
    --variant-header-bg-color: #dbf5ff;
    --error-bg-color: #f4c1c1;
    --kpi-impact-positive-bg-color: #77dd76;
    --kpi-impact-negative-bg-color: #ee6969;
    --advice-none-bg-color: #e4e4e2;
    --advice-pause-bg-color: #ffdfba;
    --advice-call-positive-bg-color: #77dd76;
    --advice-run-positive-bg-color: #e0f6e3;
    --advice-call-negative-bg-color: #ee6969;
    --advice-run-negative-bg-color: #f4c1c1;
    --busy-status-color: #ffa500;
    --error-status-color: #ff0000;
    --success-status-color: #00a36c;
    --fresh-status-color: #009dff;
    --done-status-color: #cfcfcf;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,
        'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol';
    color: var(--text-color);
    /* font-smoothing: antialiased; */
    text-rendering: optimizeLegibility;
}

#configure,
#configure-view-button {
    display: none;
}

#configure.show-config,
.show-config #configure-view-button {
    display: unset;
}

button {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    background-color: transparent;
    border: 1px solid;
    box-sizing: border-box;
    transition: background-color 200ms ease-in, border-color 200ms ease-in, color 200ms ease-in;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

.regular-button {
    border-color: #ddd;
}

.regular-button:hover,
.regular-button:focus {
    background-color: #f8f8f8;
}

.regular-button:active {
    color: #666;
    background-color: #eee;
}

.action-button {
    color: #fff;
    background-color: #0056b3;
    border-color: #083e77;
}

.action-button:hover,
.action-button:focus {
    background-color: #0b73e2;
}

.action-button:active {
    color: #eee;
    background-color: #085fbe;
}

.action-button:disabled,
.regular-button:disabled {
    color: #ddd;
    background-color: transparent;
    border-color: #eee;
    cursor: default;
}

body:not(#configure) .configure-only,
body:not(#report) .report-only {
    display: none !important;
}

.app-toolbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 8px;
    box-sizing: border-box;
    padding: 16px 32px;
    background: #fff;
}

.toolbar-buttons {
    order: 1;
    display: flex;
    gap: 16px;
}

.toolbar-button {
    font-size: 18px;
    font-weight: 500;
    padding: 12px 16px;
    min-width: 120px;
    border-radius: 4px;
}

.status {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.status-group {
    display: flex;
    flex-direction: row;
    column-gap: 10px;
    transition: opacity 300ms ease-out 12s;
    overflow: hidden;
}

#status-saving_configurations.success,
#status-loading_configurations.success {
    opacity: 0;
}

#status-saving_configurations.busy + #status-loading_configurations,
#status-saving_configurations.error + #status-loading_configurations,
#status-saving_configurations.success + #status-loading_configurations {
    display: none;
}

.status-message {
    display: none;
    flex-direction: row;
    justify-content: flex-start;
    align-items: center;
    color: var(--secondary-color);
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    margin: 0 0 5px;
    transition: opacity 300ms ease-out 3s;
}

.status-group:last-child > .status-message {
    margin: 0;
}

.status-group.busy > .status-message.busy,
.status-group.error > .status-message.busy,
.status-group.success > .status-message.busy,
.status-group.updating > .status-message.busy,
.status-group.updating > .status-message.updating,
.status-group.error > .status-message.error,
.status-group.success > .status-message.success,
.status-group.updated > .status-message.success,
.status-group.updated > .status-message.updated {
    display: flex;
}

.status-group.updating > .status-message.busy,
.status-group.error > .status-message.busy,
.status-group.success > .status-message.busy,
.status-group.updated > .status-message.success {
    color: var(--done-status-color);
    opacity: 0;
}

#status-loading_analytics_data > .updating::after,
#status-loading_analytics_data > .updated::after {
    display: block;
    margin-left: 5px;
}

#status-loading_analytics_data > .updating::after {
    content: attr(data-progress);
}

#status-loading_analytics_data > .updated::after {
    content: attr(data-last-updated);
}

.status-message::before {
    content: '';
    display: block;
    margin-right: 5px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

@keyframes pulse {
    0% {
        transform: scale(0.9);
        opacity: 0.6;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.6;
    }
}

.status-message.busy::before,
.status-message.updating::before {
    background-color: var(--busy-status-color);
    animation: pulse 2s infinite ease-in-out;
}

.status-group.updating > .status-message.busy::before,
.status-group.error > .status-message.busy::before,
.status-group.success > .status-message.busy::before,
.status-group.updated > .status-message.success::before {
    background-color: var(--done-status-color);
    animation: none;
}

.status-message.error::before {
    background-color: var(--error-status-color);
}

.status-message.success::before {
    background-color: var(--success-status-color);
}

.status-message.updated::before {
    background-color: var(--fresh-status-color);
}

.app-content {
    position: fixed;
    top: 80px;
    right: 0;
    left: 0;
    bottom: 0;
    overflow: auto;
    padding: 0 0 16px;
}

.content-header {
    padding: 16px 32px;
}

.title {
    font-weight: 400;
    margin: 0 0 16px;
}

.view-title {
    font-size: 20px;
    font-weight: 300;
    text-transform: uppercase;
    margin: 0;
}

.grid {
    display: grid;
    padding: 16px 32px 32px;
    font-size: 13px;
    box-sizing: border-box;
}

.configure-grid {
    grid-template-columns: 4fr 1fr 2fr 2fr 2fr 2fr 2fr 2fr 0.5fr 1.5fr 1fr;
}

.report-grid {
    grid-template-columns: 300px 75px 175px 350px 450px 350px 450px 450px 450px;
    min-width: fit-content;
}

.grid > .cell {
    display: grid;
    grid-template-rows: max-content 1fr;
    row-gap: 10px;
    box-sizing: border-box;
    padding: 16px 8px;
}

.configure-grid > div:nth-child(12n - 11) {
    padding-left: 0;
}

.configure-grid > div:nth-child(12n - 1) {
    padding-right: 0;
}

.report-grid > div:nth-child(10n - 9) {
    padding-left: 0;
}

.report-grid > div:nth-child(10n - 1) {
    padding-right: 0;
}

.grid > .row-drawer {
    padding: 0;
    border-bottom: 1px solid var(--grid-border-color);
    background: var(--drawer-bg-color);
}

.report-grid > .row-drawer:has(.inner-drawer.kpi-graph.is-open) {
    border-top: 1px solid var(--grid-border-color);
    background: #fff;
}

.configure-grid > .row-drawer {
    grid-column: 1 / span 11;
}

.report-grid > .row-drawer {
    grid-column: 1 / span 9;
}

.grid > .row-drawer > .inner-drawer {
    height: 0;
    overflow: hidden;
}

.grid > .row-drawer > .inner-drawer.is-open {
    height: auto;
}

.configure-grid > .has-open-drawer {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20fill%3D%22%23eee%22%20width%3D%22150px%22%20height%3D%2275px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20150%2075%22%3E%3Cpolygon%20points%3D%220%2C75%2075%2C0%20150%2C75%22%3E%3C%2Fpolygon%3E%3C%2Fsvg%3E%0A');
    background-repeat: no-repeat;
    background-size: 16px auto;
    background-position: left 16px bottom 0;
}

.configure-grid > .has-open-drawer.has-alias-drawer {
    background-position: right 30px bottom 0;
}

.configure-grid > .has-open-drawer.has-segment-drawer {
    background-position: left 30px bottom 0;
}

.report-grid .has-open-drawer.has-report-drawer,
.report-grid .label:has(.graph-icon.has-open-drawer) + .field {
    position: relative;
}

.report-grid .has-open-drawer.has-report-drawer::after,
.report-grid .label:has(.graph-icon.has-open-drawer) + .field::after {
    content: '';
    position: absolute;
    bottom: -17px;
    left: calc(50% - 8px);
    display: block;
    width: 16px;
    height: 16px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20fill%3D%22%23eee%22%20width%3D%22150px%22%20height%3D%2275px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20150%2075%22%3E%3Cpolygon%20points%3D%220%2C75%2075%2C0%20150%2C75%22%3E%3C%2Fpolygon%3E%3C%2Fsvg%3E%0A');
    background-repeat: no-repeat;
    background-size: 16px auto;
    background-position: center bottom 0;
}

.grid .label {
    font-size: 11px;
    font-weight: 300;
    color: var(--secondary-color);
    text-transform: uppercase;
    display: block;
    width: 100%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.grid .inner-drawer .label {
    margin-bottom: 10px;
}

.grid .label-experiment-id:before {
    content: '|';
    color: #ddd;
    display: inline-block;
    margin: 0 6px;
}

.configure-grid .field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.report-grid .advice-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 1em;
}

.report-grid .advice-label .warning {
    color: var(--error-status-color);
}

.grid .experiment-name,
.grid .experiment-status,
.grid .experiment-runtime {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.6;
    min-height: 30px;
}

.grid .experiment-name-field {
    overflow: hidden;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.experiment-name-button-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    column-gap: 8px;
    box-sizing: border-box;
    width: 100%;
}

.grid .experiment-name {
    font-weight: 500;
}

.grid .experiment-name[data-alias] {
    font-style: italic;
    font-weight: 300;
}

.grid .experiment-name:before {
    content: attr(data-alias);
    color: var(--text-color);
    font-style: normal;
    font-weight: 500;
}

.grid .experiment-status {
    text-transform: capitalize;
}

.configure-grid .experiment-edit,
.configure-grid .experiment-segment {
    padding: 4px 6px;
    min-width: 60px;
    border-radius: 4px;
}

.configure-grid .experiment-edit:after,
.configure-grid .experiment-segment:after {
    content: attr(data-action);
}

.configure-grid > .row-drawer > .inner-drawer {
    display: flex;
    justify-content: center;
}

.configure-grid > .row-drawer > .segment > .segment-wrapper {
    display: flex;
    flex-direction: column;
    row-gap: 16px;
}

.configure-grid > .row-drawer > .segment .segment-top-section {
    display: flex;
    flex-direction: row;
}

.configure-grid > .row-drawer > .segment .segment-bottom-section {
    display: grid;
    grid-template-columns: 1fr max-content;
    column-gap: 32px;
    padding: 8px 0;
    background-color: rgba(0, 0, 0, 0.1);
}

.configure-grid > .row-drawer > .segment .segment-row {
    display: flex;
    flex-direction: row;
}

.configure-grid > .row-drawer > .segment .segment-row-operator::before {
    content: attr(data-operator);
    display: block;
    text-align: center;
    text-transform: uppercase;
    margin: 8px 0;
}

.configure-grid > .row-drawer > .segment .segment-container-grouping {
    padding: 10px 16px;
    position: relative;
}

.configure-grid > .row-drawer > .inner-drawer > div,
.configure-grid > .row-drawer > .segment .segment-top-section > div,
.configure-grid > .row-drawer > .segment .segment-row > div {
    padding: 10px 8px;
}

.configure-grid > .row-drawer > .alias > div:first-child,
.configure-grid > .row-drawer > .segment .segment-top-section > div:first-child,
.configure-grid > .row-drawer > .segment .segment-row > div:first-child {
    padding-left: 16px;
}

.configure-grid > .row-drawer > .alias > div:last-child,
.configure-grid > .row-drawer > .segment .segment-top-section > div:last-child,
.configure-grid > .row-drawer > .segment .segment-row > div:last-child {
    padding-right: 16px;
}

.configure-grid .variant-alias-inputs {
    display: flex;
    column-gap: 16px;
}

.configure-grid input,
.configure-grid select {
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.configure-grid input[type='text'] {
    border: 1px solid #ddd;
    min-width: 200px;
}

.configure-grid input[type='date'] {
    width: 100%;
}

.configure-grid select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    width: 100%;
    padding-right: 24px;
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20fill%3D%22%23ddd%22%20width%3D%22150px%22%20height%3D%2275px%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20150%2075%22%3E%3Cpolygon%20points%3D%220%2C0%2075%2C75%20150%2C0%22%3E%3C%2Fpolygon%3E%3C%2Fsvg%3E');
    background-repeat: no-repeat;
    background-position: right 8px top 50%;
    background-size: 8px auto;
}

.experiment-runtime {
    min-width: max-content;
}

.report-grid .experiment-started,
.report-grid .experiment-daysweeks {
    display: block;
}

.report-grid .experiment-visitors,
.report-grid .experiment-kpi,
.report-grid .experiment-advice {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    border: 1px solid var(--cell-border-color);
}

.report-grid .experiment-advice:empty {
    border-color: transparent;
}

.report-grid .experiment-kpi,
.report-grid .experiment-advice {
    display: grid;
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
    border: 1px solid var(--cell-border-color);
}

.report-grid .experiment-visitors > div,
.report-grid .experiment-kpi > div,
.report-grid .experiment-advice > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-right: 1px solid var(--cell-border-color);
}

.report-grid .experiment-visitors > div:last-child,
.report-grid .experiment-kpi > div:last-child,
.report-grid .experiment-advice > div:last-child {
    border-right: 0;
}

.report-grid .variant-header {
    padding: 5px;
    background: var(--variant-header-bg-color);
    border-bottom: 1px solid var(--cell-border-color);
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
}

.report-grid .variant-name {
    font-weight: 500;
    cursor: help;
}

.report-grid .variant-data {
    min-height: 60px;
    box-sizing: border-box;
}

.report-grid .experiment-visitors .variant-data {
    display: flex;
    flex-direction: column;
}

.report-grid .experiment-kpi .variant-kpi {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.report-grid .experiment-kpi .variant-data > div:first-child {
    display: flex;
    justify-content: center;
    align-items: center;
}

.report-grid .experiment-kpi .control-kpi > div:first-child {
    height: 100%;
}

.report-grid .experiment-kpi .variant-kpi-impact.is-positive {
    background-color: var(--kpi-impact-positive-bg-color);
}

.report-grid .experiment-kpi .variant-kpi-impact.is-negative {
    background-color: var(--kpi-impact-negative-bg-color);
}

.report-grid .experiment-advice .variant-data {
    display: flex;
    justify-content: center;
    align-items: center;
}

.report-grid .experiment-visitors .variant-data span,
.report-grid .experiment-kpi .variant-data span,
.report-grid .experiment-advice .variant-data span {
    display: block;
    padding: 5px;
    line-height: 1.5;
    text-align: center;
}

.report-grid .experiment-visitors .variant-data span,
.report-grid .experiment-kpi .variant-data span {
    min-width: max-content;
}

.report-grid .variant-allocation,
.report-grid .variant-kpi-impact {
    border-bottom: 1px solid var(--cell-border-color);
}

.report-grid .variant-kpi > div:first-child {
    border-right: 1px solid var(--cell-border-color);
}

.report-grid .error {
    background: var(--error-bg-color);
}

.report-grid .experiment-visitors .has-report-drawer .variant-data {
    cursor: pointer;
}

.kpi-label {
    color: var(--text-color);
    font-weight: bold;
}

.graph-icon {
    float: right;
    display: block;
    height: 13px;
    width: 13px;
    cursor: pointer;
}

.graph-icon > svg {
    height: 13px;
    width: 13px;
    fill: #0056b3;
}

.graph-icon.waiting > svg {
    fill: #ddd;
}

.report-grid .experiment-advice .variant-data.is-noadvice {
    background-color: var(--advice-none-bg-color);
}

.report-grid .experiment-advice .variant-data.is-pause {
    background-color: var(--advice-pause-bg-color);
}

.report-grid .experiment-advice .variant-data.is-call-positive {
    background-color: var(--advice-call-positive-bg-color);
}

.report-grid .experiment-advice .variant-data.is-run-positive {
    background-color: var(--advice-run-positive-bg-color);
}

.report-grid .experiment-advice .variant-data.is-call-negative {
    background-color: var(--advice-call-negative-bg-color);
}

.report-grid .experiment-advice .variant-data.is-run-negative {
    background-color: var(--advice-run-negative-bg-color);
}

.srm-segments-container {
    padding: 16px;
    display: flex;
    justify-content: center;
    max-width: calc(100vw - 80px);
}

.srm-segments-table {
    display: inline-grid;
    grid-template-columns: auto repeat(4, minmax(0, 1fr));
}

.srm-segments-table > div {
    padding: 5px;
    border-bottom: 1px solid var(--cell-border-color);
}

.srm-segments-table > .srm-segment-header {
    border-bottom-width: 2px;
}

.srm-segment-header > span {
    font-weight: bold;
}

.srm-segments-table > div.control,
.srm-segments-table > div.variant,
.srm-segments-table > div.impact,
.srm-segments-table > div.ctbc {
    text-align: right;
}

.srm-segments-table > div:nth-child(10n + 6):not(.error),
.srm-segments-table > div:nth-child(10n + 6) + div:not(.error),
.srm-segments-table > div:nth-child(10n + 6) + div + div:not(.error),
.srm-segments-table > div:nth-child(10n + 6) + div + div + div:not(.error),
.srm-segments-table > div:nth-child(10n + 6) + div + div + div + div:not(.error) {
    background: rgba(255, 255, 255, 0.5);
}

.inner-drawer.kpi-graph,
.kpi-graph-wrapper {
    display: flex;
    justify-content: center;
}

.kpi-graph-wrapper {
    width: 90vw;
    height: 60vh;
    max-width: 1500px;
    max-height: 750px;
    padding: 32px;
    position: relative;
}

.clear-segment-container {
    text-align: center;
    position: absolute;
    bottom: 10px;
    right: 16px;
}

.clear-segment-button {
    padding: 5px 10px;
    background-color: #fff;
    border: 2px solid black;
}

.tooltip {
    position: relative;
}

.tooltip .tooltip-button {
    display: flex;
    align-items: center;
    justify-content: center;
}

.tooltip .tooltip-button:hover + .tooltip-bubble-container {
    display: flex;
}

.tooltip .tooltip-bubble-container {
    background-color: white;
    display: none;
    justify-content: center;
    position: absolute;
    z-index: 100;
    width: 230px;
    left: 50%;
    transform: translateX(-50%);
    bottom: 2rem;
}

.tooltip .tooltip-bubble {
    background-color: var(--color-white);
    color: var(--text-color-gray);
    box-shadow: 0px 2px 7px 0px #0000001f;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    padding: 0.75rem;
    width: 100%;
}

.tooltip .tooltip-bubble-container::after {
    content: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='16' viewBox='0 0 21 16' fill='none'%3E%3Cpath d='M12.3397 15C11.5699 16.3333 9.64544 16.3333 8.87564 15L0.215393 0L21 0L12.3397 15Z' fill='white'/%3E%3C/svg%3E");
    position: absolute;
    height: 1rem;
    bottom: -1rem;
}

.segment-value-wrapper {
    display: flex;
    column-gap: 10px;
}
