
:root {
    --html-font-size: 16px;
    --font-size-base: 14px;
    --body-font-size: round(calc(var(--font-size-base) / var(--html-font-size) * 1rem), 1px);

    --theme-font: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    --theme-font-alt: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    --theme-font-mono: 'Roboto Mono', 'Noto Sans Mono', 'Courier New', Courier, monospace;
    --theme-font-sans: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    
    --theme-foreground: #222;
    --theme-background: #fcfaf9;
    --theme-accent-primary: #00aaa6;
    --theme-accent-secondary: #00dad6;
    --theme-accent-3: #FF7100;
    --theme-accent-4: #1347B7;
    --theme-accent-5: #0BD600;
    --theme-accent-6: #FD0006;

    --theme-border: #d9d9d980;
    --theme-card-background: #fefefe;
    --theme-muted-text: gray;
    --theme-link-color: var(--accent-primary);

        /* Chips */
    --chip-bg: light-dark(color-mix(in oklab, var(--bg-primary) 20%, transparent), color-mix(in oklab, var(--bg-primary) 35%, transparent));
    --chip-border: light-dark(#00000078, #ffffff9e);
    --chip-fg: light-dark(var(--accent-primary), #e7feff);
    --chip-hover: light-dark(color-mix(in oklab, var(--accent-secondary) 80%, white), color-mix(in oklab, var(--bg-primary) 80%, transparent));
    --chip-hoverborder: light-dark(var(--accent-primary), var(--accent-secondary));



    color-scheme: light dark;
    --bg-primary: light-dark(var(--theme-background), color-mix(in oklab, var(--theme-background) 21%, black));
    --text-primary: light-dark(var(--theme-foreground), color-mix(in oklab, var(--theme-foreground) 10%, white));
    --accent-primary: light-dark(color-mix(in oklab, var(--theme-accent-primary) 75%, black), color-mix(in oklab, var(--theme-accent-primary) 100%, black));
    --accent-secondary: light-dark(color-mix(in oklab, var(--theme-accent-secondary) 85%, black), color-mix(in oklab, var(--theme-accent-secondary) 90%, black));
    --accent-tertiary: light-dark(var(--theme-accent-tertiary), color-mix(in oklab, var(--theme-accent-tertiary) 90%, black));
    --accent-3: light-dark(var(--theme-accent-3), color-mix(in oklab, var(--theme-accent-3) 90%, black));
    --accent-4: light-dark(var(--theme-accent-4), color-mix(in oklab, var(--theme-accent-4) 90%, black));
    --accent-5: light-dark(var(--theme-accent-5), color-mix(in oklab, var(--theme-accent-5) 90%, black));
    --accent-6: light-dark(var(--theme-accent-6), color-mix(in oklab, var(--theme-accent-6) 90%, black));
    --border-primary: light-dark(var(--theme-border), color-mix(in oklab, var(--theme-border) 80%, black));
    --card-bg: light-dark(var(--theme-card-background), color-mix(in oklab, var(--theme-card-background) 25%, black));
    --muted-text: light-dark(var(--theme-muted-text), color-mix(in oklab, var(--theme-muted-text) 60%, white));
    --link-color: light-dark(var(--theme-link-color), color-mix(in oklab, var(--theme-link-color) 50%, white));
    --transition-speed: 0.2s;
    --border-radius: 0.45rem;
    --border-radius: 12px;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-hover: 0 4px 6px rgba(0, 0, 0, 0.08);

    --threeJS-band: color-mix(in oklab, var(--theme-accent-primary) 90%, black);
    

    --plot-marker-primary: var(--accent-primary);
    --plot-marker-secondary: #ff6b6b;
    /* --plot-text: var(--theme-foreground);  always black since plotly doesn't support variables  */
    --plot-text: var(--text-primary) !important; 
    --plot-muted-text: var(--muted-text);
    --plot-background: var(--theme-background); /* always white since plotly doesn't support variables */
    --plot-link-color: var(--link-color);

    /* for Klaro */
    --green1: var(--accent-primary);
    --green2: var(--accent-primary);
    --blue1: var(--accent-tertiary);
}

/* for Klaro */
/* html, body { height: 100%; margin: 0; padding: 0; overflow-x: hidden; } */

body {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.klaro .cookie-modal .cookie-bar {
    position: sticky;
    left: 0;
    right: 1em;
    bottom: -1em;
    z-index: 9999;
    width: 100vw;
    scale: 1;
}

#cookieConsent .cookieScreen,
#cookieConsent .klaro {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important; /* Higher than your container's z-index */
    scale: 1 !important; /* Prevent inheriting any scale */
}

body.klaro-open #cookieConsent .cookieScreen,
body.klaro-open #cookieConsent .klaro:not(.cookie-bar) {
    display: block !important;
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 10000 !important;
    background: rgba(0,0,0,0.4); /* If not already Klaro's default */
    pointer-events: all !important;
}

#cookieConsent .klaro {
    display: none !important;
    pointer-events: none !important;
}
#cookieConsent .klaro #klaro-cookie-notice,
#cookieConsent .klaro #cookieScreen {
    pointer-events: auto !important;
}


/* classes to force scheme via button */
body.force-light { color-scheme: light; }
body.force-dark  { color-scheme: dark; }

a {
  color: var(--accent-secondary);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  /* color: var(--accent-primary); */
  color: color-mix(in oklab, var(--accent-primary) 90%, #000);
}

::selection {
  background: light-dark(var(--accent-primary), color-mix(in oklab, var(--accent-primary) 6%, transparent));
  color: light-dark(var(--bg-primary), var(--accent-secondary));
}

html {
  scroll-behavior: smooth;
}

body {
    font-family: ubuntu;
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif;
    font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    /* padding: 0 clamp(0.2rem, 0.5vw, 30px); */
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background var(--transition-speed), color var(--transition-speed);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-size: var(--body-font-size);
    /* content-visibility: auto;  <-- Problem with footnote Tooltip Positioning */
}

body::before {
    display: none;
    content: "";
    /* background-color: #ffffff00; */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 600 600'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23a)'/%3E%3C/svg%3E");
    background-size: 500px;
    opacity: 0.18;
    top: 0;
    left: 0;
    position: fixed;
    filter: saturate(0.2);
    /* mix-blend-mode: darken; */
    width: 100%;
    height: 100%;
    background-attachment: fixed;
    /* filter: brightness(0.5); */
    z-index: 0;
    pointer-events: none;
}


/* For Three-JS */
    #bg, .bg { 
      position: absolute;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      z-index: -1;
      pointer-events: none;
      background: transparent !important;
      transition: filter 4s ease, visibility 4s ease, transform 4s cubic-bezier(0.8, 0.04, 0.58, 1), opacity 2s ease;
      filter: blur(0px);
      opacity: 0;
      /* animation: bgFadeIn 4s ease-out forwards; */
      animation-delay: 1s;
      transform: scale(1);
      visibility: visible;
    }

    #bg.bg-visible, .bg.bg-visible {
      filter: blur(0px);
      opacity: 1;
      /* ggf. filter, transform ... */
    }
    .bgWrapper {
      position: relative;
      height: 20em;
    }

    @keyframes bgFadeIn {
      to {
        opacity: 1;
      }
    }

    #bg.bg-hidden, .bg.bg-hidden { filter:blur(50px); opacity:0; transform:scale(1); visibility:hidden;}

    #bg, .bg {
        -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
        mask-image: linear-gradient(to bottom, transparent 0%, black 20%, black 80%, transparent 100%);
    }

    #scene2-bg {
      position: relative;
      top: 0; left: 0;
      width: 100vw; height: 100vh;
      z-index: -1;
      pointer-events: none;
      background: transparent !important;
      transition: filter 4s ease, visibility 4s ease, transform 4s cubic-bezier(0.8, 0.04, 0.58, 1), opacity 2s ease;
      filter: blur(0px);
      opacity: 1;
      /* animation: bgFadeIn 4s ease-out forwards; */
      animation-delay: 1s;
      transform: scale(1);
      visibility: visible;
    }

  address {
    font-style: normal;
  }

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* margin: 0 clamp(0.5rem, 2vw, 0.2rem) auto; */
    margin-bottom: clamp(1rem, 3vw, 2rem);
    /* border-bottom: 1px solid var(--border-primary); */
    padding: 0 clamp(0.5rem, 0.5vw, 30px);
    /* padding-bottom: 0.75rem; */
    position: sticky;
    top: 0;
    z-index: 50;
}

@media (max-width: 1230px) {
    header {
        background: var(--bg-primary);
        position: relative;
        z-index: 100;
    }
}

  #legal-content, #help-content {
    max-width: 70ch;
    padding: 3em 1em;
    margin: auto;
    line-height: 1.75;
    font-size: 1.25em;
    word-break: break-word;
    overflow-wrap: break-word;
  }
  #legal-content p, #legal-content ul, #legal-content ol, #help-content p, #help-content ul, #help-content ol {
    margin-bottom: 2em;
    font-family: sans-serif;
  }

.logo {
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.2em;
    flex-direction: row;
    user-select: none; 
}

.logo-img {
    height: auto;
    width: 3em;
    display: flex;
    align-items: center;
    align-content: center;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1em;
    margin-bottom: 1em;
    scale: 1.2;
}

.logo-text {
    /* font-family: 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif; */
    font-family: 'ubuntu', 'Inter', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif !important;
    font-weight: 600;
    /* font-size: clamp(1.2rem, 3vw, 1.4rem); */
    margin: 0;
    line-height: 1.2;
    opacity: 1;
    visibility: visible;
    transition: opacity 1s linear, visibility 1s linear, max-width 1s linear 1s;
}

body.logo-center-active header .logo-text {
  opacity: 0 !important;
  pointer-events: none;
  visibility: hidden !important;
  max-width: 0 !important;
}

.logo-img svg path {
    fill: var(--accent-primary);
}

#logo-center {
    display: none;
    /* top: calc(100vh - clamp(60vh, 35.8rem, 67vh)); */
    position: relative;
    height: fit-content;
    /* left: 50%; */
    margin-left: 0;
    /* transform: translate(-50%, -50%); */
    font-size: 1.4em;
    flex-direction: row;
    margin-bottom: 0.7rem;
    flex-wrap: nowrap;
}

#logo-center.visible {
    display: flex;
    margin: 0 auto 1.5rem auto;
    text-align: center;
    max-width: 340px;
    justify-content: center;
    align-items: center;
}

h1:not(.logo *) {
  font-weight: 600;
  font-size: clamp(1.8rem, 5.8vw, 2.5rem);
  /* letter-spacing: -0.03em; */
  margin: 0;
}

h2 {
  font-weight: 600;
  font-size: clamp(1.5rem, 5vw, 2rem);
  letter-spacing: -0.03em;
  margin: 0;
}

main {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    min-height: 90vh;
}

.search-container-wrapper {
    display: flex;
    flex-direction: column;
    /* flex: 1; */
    align-items: center;
    justify-content: center;
    align-content: center;
    flex-wrap: wrap;
}

#tos-banner {
    position: relative;
    margin-top: auto;
    margin-left: auto;
    margin-right: auto;
    background: transparent;
    color: var(--text-primary);
    z-index: 9999;
    font-size: 0.8em;
    /* padding: 1em; */
    display: flex;
    align-items: center;
    text-align: center;
    opacity: 0.95;
    gap: 1em;
    animation: banner-in 0.3s;
    border-radius: var(--border-radius);
}
#tos-banner .close-btn {
  display: none;
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-size: 1em;
    border: none;
    border-radius: 9px;
    padding: .25em .8em;
    cursor: pointer;
    margin-left: auto;
}
@keyframes banner-in { from {opacity:0;transform:translateY(40px);} to{opacity:1;transform:translateY(0);} }

.search-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  position: sticky;
  bottom: 1em;
  z-index: 200;
}

#tos-banner a {
    font-weight: 600;
}

.search-container:not(.centered):before {
    content: "";
    background: var(--bg-primary);
    background: linear-gradient(0deg, var(--bg-primary) 1.5em, transparent);
    width: 100vw;
    height: 100%;
    position: absolute;
    margin-bottom: -2em;
}

.search-bar {
  position: relative;
  flex: 1 1 340px;
  min-width: 200px;
  display: flex;
  align-items: center;
  align-items: flex-end;
  justify-content: flex-end;
  cursor: text;
}

.search-bar textarea {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 0.8rem 1rem 0.8rem 2.5rem; /* leave room for icon */
  border: 1px solid var(--border-primary, #ccc);
  border-radius: 1.4em;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #222);
  font-size: clamp(1.25rem, 3vw, 1.25rem);
  box-shadow: var(--shadow, none);
  margin: 0;
  resize: none;
  overflow: hidden;
  line-height: 1.4;
  transition: box-shadow var(--transition-speed, 0.3s), border var(--transition-speed, 0.3s), color var(--transition-speed, 0.3s), background var(--transition-speed, 0.3s);
  max-height: 30vh;
  min-height: 5em;
}

.centered textarea {
      background: light-dark(
 color-mix(in oklab, var(--theme-card-background) 90%, transparent), 
 color-mix(in oklab, transparent 20%, black));
}

.textarea-footer {
    display: flex;
    align-items: center;
    position: absolute;
    min-width: 225px;
    min-height: 60px;
    width: 100%;
    height: auto;
    justify-content: flex-end;
}

#mic-btn.active {
  color: var(--accent-primary);
  background: var(--accent-secondary);
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--accent-primary);
}

#search-btn:hover, #mic-btn:hover {
    background:  color-mix(in oklab, var(--accent-primary) 90%, #000) !important;
}

#search-btn:disabled, #search-btn[disabled] {
  cursor: not-allowed;
  opacity: 0.7;
}

button#search-btn, button#mic-btn {
    display: flex;
    position: relative;
    align-items: center;
    justify-content: center;
    background: var(--accent-primary, #337ab7);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    max-width: 2em;
    max-height: 2em;
    width: 48px;
    height: 48px;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s;
    padding: 0;
    min-width: unset;
    margin: 0;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
    /* margin-left: 0.5rem; */
    margin-right: 0.75rem;

}
button#search-btn svg {
    width: 28px;
    height: 28px;
    display: block;
}
button#search-btn:active {
    transform: scale(0.97);
}

textarea {
  font-family: inherit
}

.search-bar textarea:focus {
    outline: none;
    border-color: var(--accent-secondary);
    /* box-shadow: 0 0 3px 2px var(--border-primary); */
}

textarea::placeholder {
  color: var(--muted-text);
}

.search-icon {
  position: absolute;
  left: 0.8rem;
    top: 0.8rem;
  pointer-events: none;
  display: flex;
  color: var(--muted-text);
  z-index: 2;
}

#search-container.centered {
     /* top: 50vh; */
    position: relative; 
    height: fit-content;
    display: flex;
    /* left: 50%; */
    margin-left: 0;
    /* transform: translate(-50%, -50%); */
    /* width: 100%; */
    /* max-width: 480px; */
    z-index: 50;
    box-shadow: 0 4px 40px #0003;
    border-radius: 1.4em;
    padding: 0em 35%;
    transition: all .35s cubic-bezier(.77,0,.18,1);
    backdrop-filter: blur(6px);
    justify-content: center;
    align-items: center;
}

@media (max-width: 600px) {
  #search-container.centered { max-width: 99vw; padding: 0em;}
}

#search-container.centered:focus-within {
    padding: 0em;
}

.chip-suggestion-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .7em;
    margin: 1.5em auto 0 auto;
    margin-top: 7em;
    max-width: 620px;
    justify-content: center;
    flex: 1 0 auto;
    align-content: flex-start;
    margin-top: 0.7rem;
    justify-content: center;
}

.chip-suggestion {
    background: var(--chip-bg);
    border: 1px solid var(--border-primary);
    border-color: lightdark(
        #ffffff9e, 
        var(--border-primary)
    );
    color: currentColor;
    border-radius: 99px;
    padding: 0.45em 1.0em;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, border 0.15s, opacity 0.15s;
    margin: 0;
    opacity: 0.8;
    display: flex;
    align-items: flex-end;
}
.chip-suggestion:hover, .chip-suggestion:focus {
    background: var(--chip-hover);
    /* border-color: transparent; */
    opacity: 1;
    /* background: light-dark(
 color-mix(in oklab, var(--theme-card-background) 90%, transparent), 
 color-mix(in oklab, transparent 20%, black)); */
}

.chip-suggestion svg {
    width: auto;
    height: 1.2em;
    margin-right: 0.35rem;
    vertical-align: text-top;
    stroke: var(--accent-primary);
    /* stroke: var(--accent-secondary); */
}

button {
  flex: 0 0 auto;
  background: var(--accent-primary, #337ab7);
  color: white;
  border: none;
  border-radius: var(--border-radius, 5px);
  padding: 0.8rem 2rem;
  cursor: pointer;
  font-weight: 500;
  /* font-size: clamp(0.95rem, 3vw, 1.07rem); */
  font-size: 1em;
  transition: background var(--transition-speed, 0.3s), transform 0.1s;
  margin: auto;
}

/* Corrects issues with vertical alignment around the expanding textarea */
.search-bar, .search-bar textarea, .search-icon {
  height: 100%;
}

/* Just for accessibility */
.visually-hidden {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden; 
}

.hidden {
  display: none !important;
}

.search-type-group {
  display: flex;
  flex-direction: row-reverse;
  /* gap: 0.5em; */
  align-items: center;
  margin-left: 0.5rem;
  margin-right: 0.5rem;
  /* margin-bottom: 0.5rem; */
  border-radius: var(--border-radius);
  position: relative;
  background: var(--bg-primary);
  background: light-dark(color-mix(in oklab, var(--accent-secondary) 28%, transparent), var(--bg-primary));

}

.search-type-btn {
    position: relative;
    border: 0;
    background: transparent;
    padding: 0.3em 0.35em;
    min-width: 2em;
    max-width: 2em;
    cursor: pointer;
    transition: box-shadow 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    /* border-radius: 0; */
    transition: background var(--transition-speed), color var(--transition-speed), box-shadow var(--transition-speed);
}

.search-type-btn:not(.selected):hover,
.search-type-btn:not(.selected):focus,
.search-type-btn:not(.selected):focus-visible {
  background: color-mix(in oklab, var(--accent-secondary) 10%, transparent);
  color: var(--accent-secondary);
  box-shadow: inset 0 0 0 2px color-mix(in oklab, var(--accent-secondary) 30%, transparent);
  /* border: 2px solid var(--accent-secondary); */
  border-radius: var(--border-radius);
}

.search-type-btn.selected:hover,
.search-type-btn.selected:focus,
.search-type-btn.selected:focus-visible {
  background: transparent;
  /* color: var(--accent-primary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-secondary) 40%, transparent); */
}

.search-type-btn.selected, .search-type-btn:focus-visible {
  /* background: #122732; */
  /* box-shadow: 0 0 0 2px var(--accent-secondary); */
  border-radius: var(--border-radius);
  /* border: 2px solid var(--accent-secondary); */
  box-shadow: 0 0 0px 2px color-mix(in oklab, var(--accent-secondary) 80%, transparent);
  background: var(--card-bg) !important;
}

.search-type-btn svg,
.search-type-btn * {
  display: block;
  stroke: var(--muted-text) !important;
}

.search-type-btn.selected svg,
.search-type-btn.selected * {
  stroke: var(--accent-secondary) !important;
}

/* Science button needs fill */
/* #sci-btn.selected svg, #sci-btn.selected * {
    stroke: var(--accent-secondary) !important;
    fill: var(--accent-secondary) !important;
} */


/* Tooltip styling */
.search-type-btn .tooltip {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 0.9em;
    padding: 6px 12px;
    border-radius: 5px;
    position: absolute;
    top: 120%;
    right: 0;
    z-index: 10;
    white-space: nowrap;
    transition: opacity 0.18s;
    right: calc(-1 * clamp(0%, 3vw, 250%));
}

.search-type-btn.show-tooltip .tooltip {
  visibility: visible;
  opacity: 1;
}



input[type="text"] {
  flex: 1 1 200px;
  min-width: min(15rem, 100%);
  max-width: 100%;
  padding: 0.8rem;
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: clamp(0.95rem, 3vw, 1.1rem);
  box-shadow: var(--shadow);
  margin: 0;
  transition: box-shadow var(--transition-speed), border var(--transition-speed), color var(--transition-speed), background var(--transition-speed);
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--accent-secondary);
  box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent-secondary) 30%, transparent);
}

/* button:hover {
  background: color-mix(in oklab, var(--accent-primary) 90%, #000);
}

button:active {
  transform: translateY(0);
} */


.highlight-answer { background: #ffffb3; transition: background 1s; }

.answer-footer {
    margin-bottom: 3em;
    text-align: right;
    display: flex;
    flex-direction: row;
    width: 100%;
    justify-content: flex-end;
  }

.answer-footer-btns {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    width: 100%;
    gap: 1.2em;
}

.answer-footer-btns svg {
    /* color: var(--muted-text); */
    width: 20px;
}

.answer-footer-btns button, .answer-footer-btns .export-dropdown {
    background: none;
    border: none;
    cursor: pointer;
    /* font-size: 1.3em; */
    padding: 5px;
    font-family: var(--theme-font-sans), sans-serif;
    color: var(--accent-primary);
    transition: all var(--transition-speed);
    display: flex;
    align-items: center;
    margin: 0;
    flex-direction: row;
    justify-content: center;
    gap: 0.2em;
}

.answer-footer-btns { container-type: inline-size; }
@container (max-width: 680px) {
  .answer-footer-btns button span { display: none; }
}

.export-dropdown {
    display: none;
    /* right: 0; */
    /* top: 115%; */
    /* min-width: 140px; */
    background: var(--card-bg, #fff) !important;
    border-radius: var(--border-radius, 12px);
    box-shadow: var(--shadow-hover, 0 2px 16px rgba(0, 0, 0, 0.07));
    border: 1px solid var(--border-primary, #e2e2e2);
    z-index: 1000 !important;
    padding: 0.2em 0;
}

.export-dropdown button {
    display: flex;
    width: 100%;
    padding: 0.5em 1em;
    background: none;
    border: none;
    color: var(--text-primary, #222);
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
}

.export-dropdown button:hover, .export-dropdown button:focus {
    background:  color-mix(in oklab, var(--accent-secondary, #c6e0fc) 10%, transparent);
    color: var(--accent-primary, #1976d2);
    outline: none;
}


.answer-footer-btns > *:hover {
    background: inherit;
    color: var(--accent-secondary);
}

.share-link-btn:active { color: var(--accent-primary); }

.tts-btn {
  margin-right: 8px;
  background: #eef3fe;
  border: 1px solid #ccd9f2;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 1.1em;
  cursor: pointer;
  transition: background 0.15s;
}
.tts-btn[disabled] {
  opacity: 0.68;
  cursor: not-allowed;
}


h4 {
  font-weight: 500;
  font-size: clamp(1.5rem, 3vw, 1.8rem);
  margin-bottom: 1.2rem;
  color: var(--muted-text);
  letter-spacing: 0.02em;
}

.sticky-headline, .user-question {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--bg-primary, white);
    border-bottom: 1px solid var(--border-primary, #ccc);
    width: 100%;
    left: 0;
    right: 0;
    /* padding-bottom: .2rem; */
    box-sizing: border-box;
}

.question-headline {
    white-space: normal;
    font-size: 1em;
    color: var(--text-primary);
    transition: white-space 0s;
    animation-name: collapse-headline;
    animation-timeline: scroll();
    animation-range: cover 600px cover 100%;
    animation-duration: 1s;
    animation-fill-mode: both;
    line-height: 1.25em;
    max-height: 10em;
    overflow: visible;
    text-overflow: initial;
    animation-timeline: view();
    /* animation-range: entry 0% entry 100%; */
}

/* Collapsed styles as fallback for Firefox (JS controlled) */
.user-question.collapsed .question-headline {
    font-size: 0.72em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100vw;
}

@keyframes collapse-headline {
from {
    font-size: 1em;
    color: var(--text-primary);
    max-height: 10em;
    opacity: 1;
    text-overflow: initial;
    overflow: visible;
    white-space: normal;
    letter-spacing: inherit;
}
5% {
    font-size: 1em;
    color: var(--text-primary);
    max-height: 10em;
    opacity: 1;
    text-overflow: initial;
    overflow: visible;
    white-space: normal;
    letter-spacing: inherit;
}
50% {
    font-size: 0.75em;
    color: var(--accent-primary);
    max-height: 1.275em;
    opacity: 0.9;
    text-overflow: initial;
    overflow: hidden;
    white-space: normal;
    letter-spacing: -1px;
    word-spacing: -1px;
}
90% {
    font-size: 0.75em;
    color: var(--accent-primary);
    max-height: 1.275em;
    opacity: 0.9;
    text-overflow: initial;
    overflow: hidden;
    white-space: normal;
    letter-spacing: -1px;
    word-spacing: -1px;
}
98% {
    font-size: 0.75em;
    color: var(--accent-primary);
    max-height: 1.275em;
    opacity: 0.9;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: -1px;
    word-spacing: -1px;
}
to {
    font-size: 0.75em;
    color: var(--accent-primary);
    max-height: 1.275em;
    opacity: 0.9;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
    letter-spacing: -1px;
    word-spacing: -1px;
}
}

/* 1. Use a selector hack to apply white-space:nowrap when at the end of the timeline: */
.question-headline:where(:not(:is(:active,:focus))) {
  /* nothing, just keeping specificity low for :where */
}

.output-wrapper, .sticky-headline {
  width: 100%;
  box-sizing: border-box;
  transition: margin-left var(--transition-speed) ease, max-width var(--transition-speed) ease;
}


.output-wrapper {
    /*flex: 1 1 auto; */
    flex: 0.45;
    /* display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center; */
}

/* Only add extra left margin on large screens */
@media (min-width: 1000px) {
  .output-wrapper, .search-container {
    max-width: 800px;
    /* margin-left: 20%; */
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 999px) {
  .search-container {
    position: relative;
  }
}

#conversation {
    margin: 0.2em;
}

.ai-answer._noanimation *:not(.loader, .loader *, .search-results, .search-results *) {
  animation: none !important;
  filter: none !important;
  opacity: 1 !important;
}

.ai-answer *:not(.loader, .loader *, .search-results, .search-results *) {
    animation: StreamFadeIn 1.8s ease-out forwards;
    opacity: 0;
    /* transform: translateY(4px); */
    /* filter: blur(8px); */
  }

  @keyframes StreamFadeIn {
    from {
      opacity: 0;
      /* transform: translateY(4px); */
      /* filter: blur(2px); */
    }
    to {
      opacity: 1;
      /* transform: translateY(0); */
      /* filter: blur(0px); */
    }
  }


/* Code block styling */


pre {
    margin-top: 0 !important;
    padding: 0.6em !important;
    /* font-size: 0.9em !important; */
}

.codeblock {
    position: relative;
}

.code-header * {
    stroke: var(--theme-card-background);
}

.code-header {
    display: flex;
    align-items: center;
    background:  color-mix(in oklab, var(--text-primary), var(--bg-primary) 55%);
    color: var(--theme-card-background);
    padding: 0.4em;
    font-size: 0.9em;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    place-content: center space-between;
    z-index: 5;
    position: sticky !important;
    top: 4.4em !important;
}
/* .code-header .code-lang {
    font-weight: bold;
    opacity: 0.8;
} */

span.code-lang {
    font-family: var(--theme-font-alt) !important;
    margin-left: 0.5em;
}

.code-buttons {
    display: flex;
    gap: 1em;
    flex-direction: row-reverse;
}

.codeCopy-btn, .codeDownload-btn {
    background: none;
    border: 1px solid var(--theme-border);
    cursor: pointer;
    font-size: 1em;
    /* padding: 2px 8px; */
    margin-right: 0;
    padding: 0.1em !important;
    margin: 0 !important;
    min-width: 1em !important;
    max-width: 3em !important;
    display: flex;
    justify-content: center;
}

button.codeCopy-btn, button.codeDownload-btn {
    float: inline-end;
}

.llm-fallback-info {
    position: relative;
    z-index: 10001;
    left: 50%;
    top: 36px;
    transform: translateX(-50%);
    background: var(--card-bg, rgba(244, 244, 244, .96));
    color: var(--plot-text);
    padding: 0.75em 1.5em 0.75em 1.2em;
    border: 1px solid #ddd;
    border: var(--border-primary);
    border-radius: var(--border-radius);
    max-width: 95vw;
    min-width: 180px;
    max-width: 650px;
    box-shadow: 0 1.5px 9px rgba(0, 0, 0, 0.07);
    font-size: 1.09em;
    transition: opacity var(--transition-speed) ease;
    opacity: 0.95;
}
.llm-fallback-info[hidden], .llm-fallback-info:not([style*="display: block"]){
  opacity: 0;
  pointer-events: none;
}

button#llm-fallback-close {
    color: var(--text-primary);
    padding: 0;
    margin: -1em;
    min-width: 1em;
    position: absolute;
    top: 1em;
    right: 1em;
    font-size: 1.5em;
}

@media(max-width:600px){ .llm-fallback-info { top: 7px; font-size:0.98em; } }

#output {
    flex: 1;
    display: flex;
    flex-direction: column;
}

div#search-results {
    max-width: 800px;
    display: flex;
    flex-direction: column;
    font-family: inherit;
}

.result-block {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: clamp(1rem, 3vw, 1.3rem);
    margin-bottom: clamp(0.8rem, 3vw, 1.2rem);
    line-height: 1.2em;
    /* box-shadow: var(--shadow); */
    border: 1px solid var(--border-primary);
    animation: fadeIn 0.4s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
    transition: all var(--transition-speed);
}

#results-hidden {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.5s cubic-bezier(.4,0,.2,1);
  opacity: 0;
  pointer-events: none;
}

#results-hidden.expanded {
  max-height: 2000px; /* Large enough for the max result-height. Adjust if needed! */
  opacity: 1;
  pointer-events: auto;
  transition: max-height 0.5s cubic-bezier(.4,0,.2,1), opacity 0.3s;
}



@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-block > div:first-child {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.result-title a {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    /* font-size: 2.6em; */

    font-family: Arial, sans-serif;
    font-size: 20px;
    font-weight: 400 !important;
}

.result-title {
    align-items: center;
    margin-bottom: 0.5rem;
    display: flex;
    overflow: hidden;
    white-space:nowrap;
}

.favicon {
    width: 26px;
    height: 26px;
    background-size: contain;
    display: inline-block;
    margin-right: 0.5rem;
    border-radius: 50%;
    background-repeat: no-repeat;
    vertical-align: middle;
}

.result-block a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-speed);
}

.result-block a:hover {
  color: var(--accent-secondary);
  /* text-decoration: underline; */
}

.result-body {
    font-size: clamp(1rem, 3vw, 1.1rem);
    /* line-height: 1.5; */
    font-size: 0.85em;
    /* max-height: 3em; */
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    box-orient: vertical;
}

.ai-answer, .search-results {
    margin: clamp(1.5rem, 4vw, 2rem) 0;
    font-size: clamp(1rem, 4vw, 1.1rem);
    white-space: normal;
    min-height: 9em; 
    /* margin-top: 5em;  */
}

.search-results {
    animation: fadeIn 0.5s 0.2s ease-out forwards;
    opacity: 0;
}

.sources {
  color: var(--muted-text);
  font-size: clamp(0.85rem, 3vw, 0.95rem);
  line-height: 1.5;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-primary);
  margin-top: 1rem;
}

.amz-aff-info {
  font-size: 90%;
  color: var(--muted-text);
  margin-left: 6px;
  cursor: help;
}

#toggle-sources-btn {
  margin: 1em auto 0 auto;
  display: block;
  padding: 0.5em 1em;
  font-size: 1em;
  cursor: pointer;
}

.loading {
  animation: pulse 1.5s infinite;
  color: var(--muted-text);
  padding: 1rem;
  text-align: center;
  border-radius: var(--border-radius);
  background: color-mix(in oklab, var(--border-primary) 20%, transparent);
}

@keyframes pulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 0.4; }
}

.anna-link {
    color: var(--link-color);
    margin-left: 0.7rem;
    font-size: 2.6em;
    contain: size;
    overflow: visible !important;
    max-height: 1em;
    display: flex !important;
    transition: all var(--transition-speed) !important;
    align-content: center;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
}

.anna-link:hover {
  opacity: 0.8;
  transform: scale(1.05);
}

.followup-box { margin-top:1rem; }
.followup-chip {
  margin:4px; padding:4px 8px;
  border:1px solid #999; border-radius:14px;
  background:#f5f5f5; cursor:pointer;
}
.followup-chip:hover { background:#e2e2e2; }


/* Container aligns buttons top-right and vertically center */
.buttons {
  display: flex;
  align-items: center;     /* vertical centering */
  gap: 0.75rem;            /* space between buttons */
}

/* Each button sits flush, with no unwanted stretch/growth */
.button-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}

.donate-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted-text, #757575);
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    max-width: 40px;
    max-height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    outline: none;
    transition: background 0.15s, color 0.15s;
}

.donate-button svg {
  transition:
    transform 0.2s cubic-bezier(.4,2,.6,1),
    stroke 0.2s,
    fill 0.3s;
  stroke: var(--muted-text);
  fill: transparent;
  will-change: transform, stroke, fill;
}

.donate-button:hover svg,
.donate-button:focus-visible svg {
  transform: scale(1.2);
  stroke: #b73333; 
  fill: #b73333; 
  animation: pulse-heart 0.6s;
}

@keyframes pulse-heart {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.35); }
  50%  { transform: scale(1.1); }
  70%  { transform: scale(1.22);}
  100% { transform: scale(1.2);}
}

/* Universal style for round icon buttons */
.theme-toggle,
.lang-switch-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-text, #757575);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;           /* Perfect icon centering */
  place-items: center;
  /* transition: background 0.15s, color 0.15s, box-shadow 0.15s; */
  outline: none;
}

/* Visual feedback for both normal and keyboard navigation */
.theme-toggle:hover,
.theme-toggle:focus-visible,
.lang-switch-btn:hover,
.lang-switch-btn:focus-visible {
    background: initial;
    color: var(--accent-primary, #1976d2);
}

/* Shrink the span letter */
.theme-toggle .current-mode {
  display: block;
  font-size: 1rem;
  margin-top: 2px;
  color: inherit;
  text-align: center;
}

/* Ensures SVGs are same size and centered */
.theme-toggle svg,
.lang-switch-btn svg {
  width: 22px;
  height: 22px;
  display: block;
  pointer-events: none;
}

/* Fix dropdown position */
.lang-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 115%;
  min-width: 140px;
  background: var(--card-bg, #fff);
  border-radius: var(--border-radius, 12px);
  box-shadow: var(--shadow-hover, 0 2px 16px rgba(0,0,0,0.07));
  border: 1px solid var(--border-primary, #e2e2e2);
  z-index: 1000;
  padding: 0.2em 0;
  overflow: hidden;
}

.lang-menu.open {
  display: block;
}

.lang-menu button, .user-info-dropdown button {
  display: flex;
  width: 100%;
  padding: 0.5em 1em;
  background: none;
  border: none;
  color: var(--text-primary, #222);
  text-align: left;
  cursor: pointer;
  font-size: 1em;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
}

.lang-menu button:hover,
.lang-menu button:focus {
  background: color-mix(in oklab, var(--accent-secondary, #c6e0fc) 10%, transparent);
  color: var(--accent-primary, #1976d2);
  outline: none;
}

.lang-menu button.selected {
  font-weight: bold;
  color: var(--accent-primary, #1976d2);
}

/* .login-menu button {
    display: flex;
    width: 100%;
    padding: 0.5em 1em;
    background: none;
    border: none;
    color: var(--text-primary, #222);
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    flex-direction: row;
    gap: 0.5em;
} */

/* Make sure no parent is imposing width on .lang-switch-btn */
.button-wrapper,
.lang-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  width: auto;
  background: none;
  box-shadow: none;
}

/* Perfect circle, prevent oval/wide selection */
.theme-toggle,
.lang-switch-btn, .login-switch-btn {
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  color: var(--muted-text, #757575);
  box-shadow: none;
  outline: none;
}

#theme-btn {
  padding: 0;
}

/* Remove any width inheritance from ancestor */
.lang-switch-btn  {
  width: 40px !important;
  height: 40px !important;
}

/* Focus/hover: strictly within the button itself */
.theme-toggle:focus-visible,
.lang-switch-btn:focus-visible,
.theme-toggle:hover,
.lang-switch-btn:hover,
.login-switch-btn:hover,
.login-switch-btn:focus-visible {
  background: color-mix(in oklab, var(--accent-secondary, #c6e0fc) 18%, transparent);
  color: var(--accent-primary, #1976d2);
  outline: 2px solid var(--accent-primary, #1976d2);
  outline-offset: 2px;
}

/* Remove focus/selected/hover state from .lang-switch */
.lang-switch,
.lang-switch:focus-within,
.lang-switch:active {
  background: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.theme-menu {
  display: none;
  position: absolute;
  right: 0;
  top: 115%;
  min-width: 140px;
  background: var(--card-bg, #fff);
  border-radius: var(--border-radius, 12px);
  box-shadow: var(--shadow-hover, 0 2px 16px rgba(0,0,0,0.07));
  border: 1px solid var(--border-primary, #e2e2e2);
  z-index: 1000;
  padding: 0.2em 0;
  overflow: hidden;
}
.theme-menu.open { display: block; }
.theme-menu button {
    display: flex;
    width: 100%;
    padding: 0.5em 1em;
    background: none;
    border: none;
    color: var(--text-primary, #222);
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    align-items: center;
    flex-direction: column;
    justify-content: center;
}
.theme-menu button:hover,
.theme-menu button:focus {
  background: color-mix(in oklab, var(--accent-secondary, #c6e0fc) 10%, transparent);
  color: var(--accent-primary, #1976d2);
  outline: none;
}
.theme-menu button.selected {
  font-weight: bold;
  color: var(--accent-primary, #1976d2);
}
.theme-symbol {
  font-size: 1.25em;
  line-height: 1;
  pointer-events: none;
  user-select: none;
  display: block;
  text-align: center;
  width: 100%;
  color: var(--muted-text);
  max-width: 1.5em;
}
.theme-switch-btn, .login-switch-btn {
  /* replicate .lang-switch-btn CSS */
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted-text, #757575);
  width: 40px;
  height: 40px;
  min-width: 40px;
  min-height: 40px;
  max-width: 40px;
  max-height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  outline: none;
  transition: background 0.15s, color 0.15s;
}
.theme-switch-btn:hover,
.theme-switch-btn:focus-visible {
  background: color-mix(in oklab, var(--accent-secondary, #c6e0fc) 18%, transparent);
  color: var(--accent-primary, #1976d2);
  outline: 2px solid var(--accent-primary, #1976d2);
  outline-offset: 2px;
}

.themeIcon {
    width: 1.5em;
    height: 1.5em;
  display: block;
  pointer-events: none;
}

.themeIcon * {
    display: block;
    fill: var(--muted-text) !important;
}

.login-menu {
    display: none;
    width: 100%;
    max-width: 400px;
    display: none;
    position: absolute;
    right: 0;
    top: 115%;
}

.login-menu.open {
  display: block;
}

.user-menu {
    position: absolute;
    right: 0;
    top: 115%;
}

.tab-bar{
    display: flex;
    /* gap: 8px; */
    /* margin: 8px 0 4px; */
    /* border-bottom: 1px solid var(--border-primary); */
    flex-direction: row;
    flex-wrap: nowrap;
    animation: fadeIn 0.5s 0.2s ease-out forwards;
}

.tab-btn svg {
    width: 1.2em;
    height: 1.2em;
    vertical-align: sub;
    /* margin-right: 0.4em; */  
    stroke: currentColor;
    display: inline-block;
    margin-left: -0.2em;
}

/* .tab-bar .active svg {
    stroke: var(--accent-primary);
} */

/* Logo braucht fill auf path */
.tab-btn .tab-bar-logo path {
    fill: currentColor;
}
.tab-bar .active .tab-bar-logo path {
    fill: var(--accent-primary) !important;
}

.tab-bar._visible {
  animation: fadeIn 0.4s ease-out forwards;
  opacity: 1;
  pointer-events: all;
}

.tab-btn{
    appearance: none;
    background: none;
    border: none;
    border-radius: 0;
    /* font-family: -webkit-body; */
    padding: 6px 10px;
    /* padding: 0 0 10px 0; */
    cursor: pointer;
    font: inherit;
    margin: inherit;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--muted-text);
    transition: all var(--transition-speed, 0.3s), transform 0.1s;
    display: flex;
    gap: 0.2em;
    align-items: center;
}
.tab-btn.active{
    color: var(--text-primary);
    border-bottom-color: var(--accent-primary);
    /* font-weight: 600; */
    border-bottom: solid;
}

.tab-btn:hover{
    background:  color-mix(in oklab, var(--accent-primary) 10%, transparent);
}

.tab-content {
  display: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.tab-content.active {
  display: block;
  opacity: 1;
}
.tab-content._fadeout {
  opacity: 0;
}


.footnote-ref {
    display: inline-block;
    background:  color-mix(in oklab, var(--accent-primary) 30%, transparent);
    color: var(--text-primary);
    border-radius: var(--border-radius);
    width: 1rem;
    height: 1rem;
    /* font-weight: bold; */
    text-align: center;
    margin-left: 0.08rem;
    cursor: pointer;
    position: relative;
    font-size: 0.85rem;
    line-height: normal;
    vertical-align: text-top;
    /* box-shadow: 0 2px 4px rgba(0, 0, 0, 0.10); */
    transition: all var(--transition-speed) ease;
}

.footnote-ref:focus {
    background: var(--accent-primary);
}

.footnote-ref:hover,
.footnote-ref:focus {
    background: var(--accent-primary);
    color: var(--bg-primary);
    font-weight: bold;
}

.footnote-tooltip {
    position: absolute;
    z-index: 10000;
    min-width: 220px;
    max-width: 320px;
    background: var(--card-bg, #f9f9fc);
    color: var(--text-primary, #222);
    border-radius: var(--border-radius, 6px);
    box-shadow: var(--shadow, 0 2px 12px rgba(40,40,80,0.24));
    padding: 0.75em 1em;
    font-size: 0.95em;
    line-height: 1.4;
    pointer-events: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-speed, 0.18s) ease-in-out, visibility var(--transition-speed, 0.18s) ease-in-out;
    text-align: left;
}

.footnote-tooltip._active,
.footnote-ref:hover .footnote-tooltip,
.footnote-ref:focus .footnote-tooltip {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.footnote-tooltip-title {
    font-weight: bold;
    margin-bottom: 0.3em;
    display: block;
    color: var(--accent-primary, #2a31aa);
}

.footnote-tooltip-url {
    display: block;
    font-size: 0.8em;
    word-break: break-all;
    margin-top: 0.6em;
    color: var(--accent-primary, #2a31aa);
}

/* Responsive */
@media (max-width: 540px) {
    .footnote-tooltip {
        max-width: 90vw;
        min-width: 0;
        font-size: 0.95em;
    }
}



table {
    width: 100%;
    border-collapse: collapse;
    font-family: system-ui, -apple-system, sans-serif;
    font-family: inherit;
    font-size: medium;
    overflow: hidden;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

thead {
    position: sticky;
    top: 4em;
    background:  color-mix(in oklab, var(--accent-primary), var(--bg-primary) 50%);
    z-index: 1;
}

th, td {
  padding: 1rem 1.25rem;
  text-align: left;
  border-bottom: 1px solid var(--border-primary);
  transition: background 0.2s ease;
}

/* th {
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 0.85em;
} */

td {
  padding: 0.85rem 1.25rem;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  background: color-mix(in oklab, var(--bg-primary), transparent 98%);
}

tbody tr:nth-child(even) {
  background: color-mix(in oklab, var(--bg-primary), transparent 95%);
}

tbody tr:hover {
  background:  color-mix(in oklab, var(--bg-primary), var(--accent-primary) 14%);
}

td:first-child {
  font-weight: 600;
  position: relative;
}

td:first-child::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 1px;
  background: var(--border-primary);
}

/* Responsive adaptations */
/* Only for small screens: */
@media only screen and (max-width: 760px) {
  table, thead, tbody { width: 100%; display: block; }
  .aspect-card {
        margin-bottom: 0.8em;
        background: var(--card-bg);
        border-radius: var(--border-radius);
        box-shadow: 0 1px 3px var(--shadow);
        /* padding: 0.5em 0.7em; */
        border: 1px solid var(--border-primary);
  }
  .aspect-title {
        /* font-weight: bold; */
        font-size: 1.1em;
        margin-bottom: 0.5em;
        background:  color-mix(in oklab, var(--accent-primary), transparent 50%);
        border-radius: 4px 4px 0 0;
        padding: 0.3em 0.2em;
        display: block;
  }
  .aspect-entry {
        margin-bottom: 0.35em;
        margin-left: 0.3em;
  }
  .aspect-label {
        font-weight: 600;
        /* color: #718096; */
        font-size: 0.92em;
        margin-bottom: 0.05em;
        font-weight: 800;
  }
  .aspect-value {
        font-size: 1em;
        margin-left: 0.8em;
        white-space: pre-line;
  }
}


.plot-container.plotly {
    /* opacity: 0;
    transform: translateY(10px); */
    animation: plotFadeIn ease var(--transition-speed) forwards;
}

@keyframes plotFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
        filter: blur(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
        filter: blur(0);
    }
}

/* Plotly, remove symbol */
.js-plotly-plot g#symbol {
    display: none;
}

.plot-container.plotly * {
    font-family: 'Montserrat', 'Helvetica Neue', Arial, sans-serif !important;
}

.js-plotly-plot .plotly .main-svg {
    position: absolute;
    top: 0px;
    left: 0px;
    background: transparent !important;
    pointer-events: none;
}

.main-svg .bg {
    fill: var(--bg-primary) !important;
}

.js-plotly-plot .plotly .main-svg text {
    fill: var(--text-primary) !important;
}


.plotly-placeholder{
  /* make sure it has some space even before Plotly runs          */
  width:100%;
  /* aspect-ratio:16/10;   */
  min-height: 20em;

  position:relative;
  overflow:hidden;
}

/* 1) basic bars + grid, visible *only while the div is empty* --- */
.plotly-placeholder:empty{
    background-color: var(--accent-secondary);
    background-image: url('data:image/svg+xml,<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v15a1 1 0 0 0 1 1h15M8 16l2.5-5.5 3 3L17.273 7 20 9.667"/></svg>');
    mask-image: url('data:image/svg+xml,<svg class="w-6 h-6 text-gray-800 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v15a1 1 0 0 0 1 1h15M8 16l2.5-5.5 3 3L17.273 7 20 9.667"/></svg>');
    background-size: 100% 100%, 18% 100%;
    background-repeat: no-repeat;
    pointer-events: none;
    mask-position: 0px;
    animation: maskshift 40s infinite linear;
}


@keyframes maskshift{
  0%   { mask-position: 0% 0;
          opacity: 0; }
  1%  { opacity: .5; }
  99%  { opacity: .5 }
  100% { mask-position: 100% 0;
          opacity: 0; }
}


/* 2) shimmering overlay for a “loading” feel -------------------- */
.plotly-placeholder:empty::after{
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0) 0%, rgb(255 255 255 / 0%) 50%, rgba(255, 255, 255, 0) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 2s infinite;
    background-image: linear-gradient(to right, #f6f7f800 0%, #ffffff52 20%, #f6f7f869 40%, #f6f7f800 100%);
    background-repeat: no-repeat;
}

@keyframes skeleton-shimmer{
  0%   { background-position:-200% 0;
          opacity: 0; }
  4%  { opacity: 1; }
  96%  { opacity: 1 }
  100% { background-position: 200% 0; 
          opacity: 0; }
}

.plotly-error {
  color: var(--plot-marker-primary, #b60000);
  font-weight: 600;
  margin-top: 1em;
}

.js-plotly-plot,
.js-plotly-plot .plotly,
.js-plotly-plot .plot-container,
.js-plotly-plot .main-svg {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100vw !important;
}


.site-footer {
    color: var(--text-primary, #222);
    background: var(--card-bg, #fafbfc);
    box-shadow: var(--shadow, 0 1px 8px rgba(20, 20, 20, .07));
    /* border-radius: 0 0 var(--border-radius, 14px) var(--border-radius, 14px); */
    padding-bottom: 1.2rem;
    padding-top: 5rem;
    margin-top: 1.2em;
    font-size: 1rem;
    line-height: 0.8rem;
    color-scheme: dark;
}



.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 2rem;
  max-width: 1050px;
  margin: 0 auto;
  padding: 0 2vw;
}

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

.footer-title {
  font-size: 1.09em;
  letter-spacing: .5px;
  margin-bottom: 0.8em;
  font-weight: 600;
  color: var(--text-primary, #222);
  padding: 1rem 0;
}

.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75em;
}

.footer-link, .footer-link-cta {
    color: var(--link-color, #00aaa6);
    text-decoration: none;
    transition: color .16s, background .2s;
    border-radius: 3px;
    padding: 0.5em 0.1em;
    font-size: 1em;
    display: inline-block;
    padding-left: 1rem;
}
.footer-link:focus,
.footer-link:hover,
.footer-link-cta:focus,
.footer-link-cta:hover {
    color: var(--accent-primary, #0051a8);
    /* background: var(--card-bg); */
    outline: none;
    text-decoration: underline;
}
.footer-link-cta img {
  display: block;
  pointer-events: none;
  border-radius: 4px;
  box-shadow: 0 2px 8px #0001;
}
.footer-bottom {
  margin-top: 2.5em;
  text-align: center;
  color: var(--muted-text, #888);
  font-size: 0.97em;
}

/* Responsive für kleinere Screens */
@media (max-width: 700px){
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.8rem;
  }
  .footer-col {
    align-items: flex-start;
  }
  .footer-title {
    margin-bottom: 0.5em;
  }
  .footer-bottom {
    margin-top: 1.5em;
    font-size: 0.95em;
  }
}



#lang-switch {
  background: var(--card-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-primary);
  border-radius: var(--border-radius);
  font-size: 1em;
  padding: 0.07em 0.6em;
}

@media (max-width: 650px) {
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 1rem;
    gap: 0.2em;
  }
  .footer-meta {
    gap: 1.2em;
    margin-top: 0.7em;
  }
}

.loader {
  position: absolute;
  width: 120px; height: 120px;
  /* top: 80px;  */
  top: 0;
  left: 50%;
  margin: -60px 0 0 -60px;
  transform: rotate(45deg);
  background: transparent !important;
  background: none !important;
  /* opacity: 0; */
  z-index: 50;
  /* visibility: hidden; */
  backdrop-filter: blur(3px);
  border-radius: 50%;
  transition: transform 1.8s cubic-bezier(.25,.8,.25,1);
  will-change: transform;
}

.loader-text {
    display: flex;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 2px;
    left: 6px;
    justify-content: center;
    align-items: center;
}

.loader-text {
  span {
    animation: loader-text-animation 1.8s ease-in-out infinite alternate;
  }
    :nth-child(1) { animation-delay: 0.2s; }
    :nth-child(2) { animation-delay: 0.4s; }
    :nth-child(3) { animation-delay: 0.6s; }
    :nth-child(4) { animation-delay: 0.8s; }
    :nth-child(5) { animation-delay: 1.0s; }
    :nth-child(6) { animation-delay: 1.2s; }
    :nth-child(7) { animation-delay: 1.4s; }
    :nth-child(8) { animation-delay: 1.6s; }
    :nth-child(9) { animation-delay: 1.8s; }
    :nth-child(10) { animation-delay: 2.0s; }
    :nth-child(11) { animation-delay: 2.2s; }
  }
@keyframes loader-text-animation {
  0% {
      filter: blur(0);
      opacity: 1;
      font-size: 1em;
  }
  50% {
      filter: blur(0);
      opacity: 1;
      font-size: 1em;
  }
  100% {
      filter: blur(12px);
      opacity: .02;
      font-size: .3em;
  }
}


.loader-core {
  width: 100%; height: 100%;
  transform: rotate(-45deg);
}
.band1, .band2, .band3 {
    position: absolute;
    display: block;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    overflow: visible;
    clip-path: border-box;
    border-width: 2px;
    border-style: dotted;
    border-radius: 100%;
    /* opacity: .9; */
    /* mix-blend-mode: color-burn; */
    /* background: light-dark( color-mix(in oklab, var(--accent-secondary) 1%, transparent), var(--accent-primary)); */
}

.band1 {
    /* border-style: dashed; */
    border-color: var(--muted-text);
    animation: loader-top-animation 6s ease-in-out infinite;
    /* mix-blend-mode: color-burn; */
    background:  color-mix(in oklab, var(--accent-secondary) 4%, transparent);
    /* border-style: solid; */
    rotate: 9deg;
}
  .band2 {
        /* border-style: dotted; */
    border-color: var(--accent-primary);
    animation: loader-center-animation 3s ease-in-out infinite;
  }
  .band3 {
        /* border-style: solid; */
    border-color: var(--accent-secondary);
    animation: loader-bottom-animation 1.5s ease-in-out infinite;
  }



@keyframes loader-center-animation {
  0%   {transform: rotateY(0deg)}
  40%  {filter:blur(0); opacity: 1}
  50%  {transform: rotateY(90deg); filter:blur(12px); opacity: 0}
  60%  {filter:blur(0); opacity: 1}
  100% {transform: rotateY(360deg)}
}
@keyframes loader-top-animation {
0% {
    transform: rotateY(0deg);
    scale: 1.1;
}
40% {
    filter: blur(0);
    opacity: 1;
}
50% {
    transform: rotateY(90deg);
    filter: blur(12px);
    opacity: 0;
    scale: 1;
}
60% {
    filter: blur(0);
    opacity: 1;
}
100% {
    transform: rotateY(360deg);
    scale: 1.1;
}
}
@keyframes loader-bottom-animation {
0% {
    transform: rotateY(0deg) rotateX(0deg);
    scale: 0.9;
}
40% {
    filter: blur(0);
    opacity: 1;
}
50% {
    transform: rotateY(90deg) rotateX(-45deg);
    filter: blur(12px);
    opacity: 0;
    scale: 1;
}
60% {
    filter: blur(0);
    opacity: 1;
}
100% {
    transform: rotateY(360deg) rotateX(0deg);
    scale: 0.9;
}
}