html,
body {
    height: 100%;
    margin: unset;
    color: var(--primary-text-color);
    font-size: 14px;
    font-family: 'Roboto', 'Helvetica Neue', sans-serif !important;
}

body {
    --primary-color: #06a04a;
    --link-color: #1976d2;
    --error-color: #EF5350;

    --red: #EF5350;
    --orange: #FF9800;
    --yellow: #FDD835;
    --green: #9CCC65;
    --purple: #AB47BC;
    --blue: #42A5F5;
    --brown: #8D6E63;
    --grey: #BDBDBD;
    --light-grey: #E0E0E0;
    --empty: #EEEEEE;
    --empty-light: #FAFAFA;
    --empty-dark: #BDBDBD;
    --empty-teal: #E7F1F0;

    /* Faceted test-picker taxonomy palette (test_picker_taxonomy.js). Deep, saturated hues tuned
       for light backgrounds; overridden with lighter, higher-contrast variants in dark mode below. */
    --facet-crimson: #9F1239;
    --facet-blue: #1E40AF;
    --facet-amber: #B45309;
    --facet-purple: #6B21A8;
    --facet-rust: #7C2D12;
    --facet-teal: #0E5F4F;
    --facet-bronze: #92400E;
    --facet-indigo: #312E81;
    --facet-orange: #C75D2C;
    --facet-emerald: #1B7C68;
    --facet-grey: #6A6F7E;

    --primary-text-color: #000000de;
    --secondary-text-color: #0000008a;
    --disabled-text-color: #00000042;
    --caption-text-color: rgba(49, 51, 63, 0.6); /* Match Streamlit's caption color */
    --form-field-color: rgb(240, 242, 246); /* Match Streamlit's form field color */
    --border-color: rgba(0, 0, 0, .12);
    --tooltip-color: #333d;
    --tooltip-text-color: #fff;
    --dk-card-background: #fff;
    --dk-dialog-background: #fff;
    --selected-item-background: #06a04a17;

    --sidebar-background-color: white;
    --sidebar-item-hover-color: #f5f5f5;
    --sidebar-active-item-color: #f5f5f5;
    --sidebar-active-item-border-color: #b4e3c9;

    --field-underline-color: #9e9e9e;

    --button-hover-state-opacity: 0.12;
    --button-generic-background-color: #ffffff;

    --button-basic-background: transparent;
    --button-basic-text-color: rgba(0, 0, 0, .87);
    --button-basic-hover-state-background: rgba(0, 0, 0, .54);

    --button-basic-flat-text-color: rgba(0, 0, 0);
    --button-basic-flat-background: rgba(0, 0, 0, .87);

    --button-basic-stroked-text-color: rgba(0, 0, 0, .87);
    --button-basic-stroked-background: transparent;

    --button-primary-background: transparent;
    --button-primary-text-color: var(--primary-color);
    --button-primary-hover-state-background: var(--primary-color);

    --button-primary-flat-text-color: rgba(255, 255, 255);
    --button-primary-flat-background: var(--primary-color);

    --button-primary-stroked-text-color: var(--primary-color);
    --button-primary-stroked-background: transparent;
    --button-stroked-border: 1px solid var(--border-color);

    --button-warn-background: transparent;
    --button-warn-text-color: var(--red);
    --button-warn-hover-state-background: var(--red);

    --button-warn-flat-text-color: rgba(255, 255, 255);
    --button-warn-flat-background: var(--red);

    --button-warn-stroked-text-color: var(--red);
    --button-warn-stroked-background: transparent;

    --portal-background: white;
    --portal-box-shadow: rgba(0, 0, 0, 0.16) 0px 4px 16px;
    --select-hover-background: rgb(240, 242, 246);

    --app-background-color: #f8f9fa;

    --table-hover-color: #ecf0f1;
    --table-selection-color: rgba(0,145,234,.28);
    --table-header-background: var(--dk-card-background);
}

@media (prefers-color-scheme: dark) {
    body {
        --empty: #424242;
        --empty-light: #212121;
        --empty-dark: #757575;
        --empty-teal: #242E2D;

        /* Lighter, higher-contrast facet hues for dark backgrounds (chip text + facet dots). */
        --facet-crimson: #FB7185;
        --facet-blue: #60A5FA;
        --facet-amber: #FBBF24;
        --facet-purple: #C084FC;
        --facet-rust: #F4845F;
        --facet-teal: #2DD4BF;
        --facet-bronze: #D9A05B;
        --facet-indigo: #A5B4FC;
        --facet-orange: #FB923C;
        --facet-emerald: #34D399;
        --facet-grey: #9CA3AF;

        --primary-text-color: rgba(255, 255, 255);
        --secondary-text-color: rgba(255, 255, 255, .7);
        --disabled-text-color: rgba(255, 255, 255, .5);
        --caption-text-color: rgba(250, 250, 250, .6); /* Match Streamlit's caption color */
        --form-field-color: rgb(38, 39, 48); /* Match Streamlit's form field color */
        --border-color: rgba(255, 255, 255, .25);
        --tooltip-color: #eee;
        --tooltip-text-color: #000;
        --dk-card-background: #14181f;
        --dk-dialog-background: #0e1117;

        --sidebar-background-color: #14181f;
        --sidebar-item-hover-color: #10141b;
        --sidebar-active-item-color: #10141b;
        --sidebar-active-item-border-color: #b4e3c9;
        --dk-text-value-background: unset;

        --button-generic-background-color: rgb(38, 39, 48);

        --button-basic-background: transparent;
        --button-basic-text-color: rgba(255, 255, 255);
        --button-basic-hover-state-background: rgba(255, 255, 255, .54);

        --button-basic-flat-text-color: rgba(255, 255, 255);
        --button-basic-flat-background: rgba(255, 255, 255, .54);

        --button-basic-stroked-text-color: rgba(255, 255, 255, .87);
        --button-basic-stroked-background: transparent;

        --button-stroked-border: 1px solid var(--border-color);

        --portal-background: #14181f;
        --portal-box-shadow: rgba(0, 0, 0, 0.95) 0px 4px 16px;
        --select-hover-background: rgb(38, 39, 48);

        --app-background-color: rgb(14, 17, 23);

        --table-hover-color: rgb(38, 39, 48);
        --table-selection-color: rgba(0,145,234,.28);
        --table-header-background: var(--dk-card-background);
    }
}

.clickable {
    cursor: pointer !important;
}

.hidden {
    display: none !important;
}

.invisible {
    visibility: hidden !important;
}

.dot {
    font-size: 10px;
    font-style: normal;
}

.dot::before {
    content: '⬤';
}

/* Table styles */
.table {
    background-color: var(--dk-card-background);
    border: var(--button-stroked-border);
    border-radius: 8px;
    padding: 16px;
    box-sizing: border-box;
}

.table-row {
    padding: 8px 0;
}

.table.hoverable .table-row:hover {
    background-color: var(--select-hover-background);
}

.table-row:not(:last-child) {
    border-bottom: var(--button-stroked-border);
}

.table-header {
    border-bottom: var(--button-stroked-border);
    padding: 0 0 8px 0;
    font-size: 12px;
    color: var(--caption-text-color);
    text-transform: uppercase;
}

.table-header > *,
.table-row > * {
    box-sizing: border-box;
    padding: 0 4px;
}
/*  */

/* Text utilities */
.text-primary {
    color: var(--primary-text-color);
}

.text-secondary {
    color: var(--secondary-text-color);
}

.text-disabled {
    color: var(--disabled-text-color);
}

.text-bold {
    font-weight: 500;
}

.text-small {
    font-size: 13px;
}

.text-large {
    font-size: 16px;
}

.text-caption {
    font-size: 12px;
    color: var(--caption-text-color);
}

.text-error {
    color: var(--error-color);
}

.text-warning {
    color: var(--orange);
}

.text-green {
    color: var(--primary-color);
}

.text-purple {
    color: var(--purple);
}

.text-orange {
    color: var(--orange);
}

.text-brown {
    color: var(--brown);
}

.text-capitalize {
    text-transform: capitalize;
}

.text-code {
    font-family:'Courier New', Courier, monospace;
    line-height: 1.5;
    white-space: pre-wrap;
}
/*  */

/* Flex utilities */
.flex-row {
    display: flex;
    flex-direction: row;
    align-items: center;
}

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

.fx-flex {
    flex: 1 1 0%;
}

.fx-flex-wrap {
    flex-wrap: wrap;
}

.fx-align-flex-center {
    align-items: center;
}

.fx-align-flex-start {
    align-items: flex-start;
}

.fx-align-flex-end {
    align-items: flex-end;
}

.fx-align-baseline {
    align-items: baseline;
}

.fx-align-stretch {
    align-items: stretch;
}

.fx-justify-flex-end {
    justify-content: flex-end;
}

.fx-justify-content-flex-end {
    justify-content: flex-end;
}

.fx-justify-flex-start {
    justify-content: flex-start;
}

.fx-justify-center {
    justify-content: center;
}

.fx-justify-space-between {
    justify-content: space-between;
}

.fx-flex-align-content {
    align-content: flex-start;
}

.fx-gap-1 {
    gap: 4px;
}

.fx-gap-2 {
    gap: 8px;
}

.fx-gap-3 {
    gap: 12px;
}

.fx-gap-4 {
    gap: 16px;
}

.fx-gap-5 {
    gap: 24px;
}

.fx-gap-6 {
    gap: 32px;
}

.fx-gap-7 {
    gap: 40px;
}

/*  */

/* Whitespace utilities */
.mt-0 {
    margin-top: 0;
}

.mt-1 {
    margin-top: 4px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mt-5 {
    margin-top: 24px;
}

.mt-6 {
    margin-top: 32px;
}

.mt-7 {
    margin-top: 40px;
}

.mr-0 {
    margin-right: 0;
}

.mr-1 {
    margin-right: 4px;
}

.mr-2 {
    margin-right: 8px;
}

.mr-3 {
    margin-right: 12px;
}

.mr-4 {
    margin-right: 16px;
}

.mr-5 {
    margin-right: 24px;
}

.mr-6 {
    margin-right: 32px;
}

.mr-7 {
    margin-right: 40px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-1 {
    margin-bottom: 4px;
}

.mb-2 {
    margin-bottom: 8px;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mb-5 {
    margin-bottom: 24px;
}

.mb-6 {
    margin-bottom: 32px;
}

.mb-7 {
    margin-bottom: 40px;
}

.ml-0 {
    margin-left: 0;
}

.ml-1 {
    margin-left: 4px;
}

.ml-2 {
    margin-left: 8px;
}

.ml-3 {
    margin-left: 12px;
}

.ml-4 {
    margin-left: 16px;
}

.ml-5 {
    margin-left: 24px;
}

.ml-6 {
    margin-left: 32px;
}

.ml-7 {
    margin-left: 40px;
}

.p-0 {
    padding: 0;
}

.p-1 {
    padding: 4px;
}

.p-2 {
    padding: 8px;
}

.p-3 {
    padding: 12px;
}

.p-4 {
    padding: 16px;
}

.p-5 {
    padding: 24px;
}

.p-6 {
    padding: 32px;
}

.p-7 {
    padding: 40px;
}

.pt-0 {
    padding-top: 0;
}

.pt-1 {
    padding-top: 4px;
}

.pt-2 {
    padding-top: 8px;
}

.pt-3 {
    padding-top: 12px;
}

.pt-4 {
    padding-top: 16px;
}

.pt-5 {
    padding-top: 24px;
}

.pt-6 {
    padding-top: 32px;
}

.pt-7 {
    padding-top: 40px;
}

.pr-0 {
    padding-right: 0;
}

.pr-1 {
    padding-right: 4px;
}

.pr-2 {
    padding-right: 8px;
}

.pr-3 {
    padding-right: 12px;
}

.pr-4 {
    padding-right: 16px;
}

.pr-5 {
    padding-right: 24px;
}

.pr-6 {
    padding-right: 32px;
}

.pr-7 {
    padding-right: 40px;
}

.pb-0 {
    padding-bottom: 0;
}

.pb-1 {
    padding-bottom: 4px;
}

.pb-2 {
    padding-bottom: 8px;
}

.pb-3 {
    padding-bottom: 12px;
}

.pb-4 {
    padding-bottom: 16px;
}

.pb-5 {
    padding-bottom: 24px;
}

.pb-6 {
    padding-bottom: 32px;
}

.pb-7 {
    padding-bottom: 40px;
}

.pl-0 {
    padding-left: 0;
}

.pl-1 {
    padding-left: 4px;
}

.pl-2 {
    padding-left: 8px;
}

.pl-3 {
    padding-left: 12px;
}

.pl-4 {
    padding-left: 16px;
}

.pl-5 {
    padding-left: 24px;
}

.pl-6 {
    padding-left: 32px;
}

.pl-7 {
    padding-left: 40px;
}
/*  */

code {
    position: relative;
    border-radius: 0.5rem;
    display: block;
    margin: 0px;
    overflow: auto;
    padding: 24px 16px;
    color: var(--primary-text-color);
    background-color: var(--empty-light);
}

code > .tg-icon {
    position: absolute;
    top: 21px;
    right: 16px;
    color: var(--secondary-text-color);
    cursor: pointer;
    opacity: 0;
}

code > .tg-icon:hover {
    opacity: 1;
}

.accent-primary {
    accent-color: var(--primary-color);
}

.border {
    border: var(--button-stroked-border);
}

.border-radius-1 {
    border-radius: 4px;
}

.border-radius-2 {
    border-radius: 8px;
}

input {
    line-height: normal !important;
}

input::-ms-reveal,
input::-ms-clear {
    display: none;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.text-center {
    text-align: center;
}

.visible-overflow {
    overflow: visible;
}

.anomaly-tag {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    border-radius: 18px;
    background: var(--green);
    height: 20px;
    width: 20px;
    box-sizing: border-box;
}

.anomaly-tag > .material-symbols-rounded {
    color: var(--empty-light);
    font-size: 20px;
}

.anomaly-tag.has-anomalies {
    padding: 1px 5px;
    border-radius: 10px;
    background: var(--error-color);
    color: var(--empty-light);
    width: auto;
    min-width: 20px;
}

.anomaly-tag.has-errors {
    position: relative;
    background: transparent;
}

.anomaly-tag.has-errors > .material-symbols-rounded {
    color: var(--orange);
    font-size: 22px;
}

.anomaly-tag.is-training {
    position: relative;
    background: transparent;
    border: 2px solid var(--blue);
}

.anomaly-tag.is-training > .material-symbols-rounded {
    color: var(--blue);
}

.anomaly-tag.is-pending {
    background: none;
    color: var(--primary-text-color);
}

.notifications--empty.tg-empty-state {
    margin-top: 0;
}

.display-table-cell {
    display: table-cell !important;
}

/* Base Styles - Using standard system fonts for that Material feel */
.display, .headline, .title, .body, .label {
  margin: 0;
  padding: 0;
}

/* --- Display: For prominent, large-scale text --- */
.display { font-weight: 400; letter-spacing: -0.25px; }
.display.l { font-size: 57px; line-height: 64px; }
.display.m { font-size: 45px; line-height: 52px; }
.display.s { font-size: 36px; line-height: 44px; }

/* --- Headline: High-emphasis, shorter text --- */
.headline { font-weight: 400; }
.headline.l { font-size: 32px; line-height: 40px; }
.headline.m { font-size: 28px; line-height: 36px; }
.headline.s { font-size: 24px; line-height: 32px; }

/* --- Title: Medium-emphasis, usually for UI headers --- */
.title { font-weight: 400; } /* Title Large is 400, M/S are 500 */
.title.l { font-size: 22px; line-height: 28px; }
.title.m { font-size: 16px; line-height: 24px; font-weight: 500; letter-spacing: 0.15px; }
.title.s { font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0.1px; }

/* --- Body: For extended reading and long-form content --- */
.body { font-weight: 400; }
.body.l { font-size: 16px; line-height: 24px; letter-spacing: 0.5px; }
.body.m { font-size: 14px; line-height: 20px; letter-spacing: 0.25px; }
.body.s { font-size: 12px; line-height: 16px; letter-spacing: 0.4px; }

/* --- Label: For small functional text (buttons, captions) --- */
.label { font-weight: 500; }
.label.l { font-size: 14px; line-height: 20px; letter-spacing: 0.1px; }
.label.m { font-size: 12px; line-height: 16px; letter-spacing: 0.5px; }
.label.s { font-size: 11px; line-height: 16px; letter-spacing: 0.5px; }
