/* Override for dark mode */
.dark {
  --name: default;
  --primary-50: #fff7ed;
  --primary-100: #ffedd5;
  --primary-200: #fed7aa;
  --primary-300: #fdba74;
  --primary-400: #fb923c;
  --primary-500: #f97316;
  --primary-600: #ea580c;
  --primary-700: #c2410c;
  --primary-800: #9a3412;
  --primary-900: #7c2d12;
  --primary-950: #6c2e12;
  --secondary-50: #eff6ff;
  --secondary-100: #dbeafe;
  --secondary-200: #bfdbfe;
  --secondary-300: #93c5fd;
  --secondary-400: #60a5fa;
  --secondary-500: #3b82f6;
  --secondary-600: #2563eb;
  --secondary-700: #1d4ed8;
  --secondary-800: #1e40af;
  --secondary-900: #1e3a8a;
  --secondary-950: #1d3660;
  --neutral-50: #f9fafb;
  --neutral-100: #f3f4f6;
  --neutral-200: #e5e7eb;
  --neutral-300: #d1d5db;
  --neutral-400: #9ca3af;
  --neutral-500: #6b7280;
  --neutral-600: #4b5563;
  --neutral-700: #374151;
  --neutral-800: #1f2937;
  --neutral-900: #111827;
  --neutral-950: #0b0f19;
  --spacing-xxs: 1px;
  --spacing-xs: 2px;
  --spacing-sm: 4px;
  --spacing-md: 6px;
  --spacing-lg: 8px;
  --spacing-xl: 10px;
  --spacing-xxl: 16px;
  --radius-xxs: 1px;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-xxl: 22px;
  --text-xxs: 9px;
  --text-xs: 10px;
  --text-sm: 12px;
  --text-md: 14px;
  --text-lg: 16px;
  --text-xl: 22px;
  --text-xxl: 26px;
  --font: 'Source Sans Pro', 'ui-sans-serif', 'system-ui', sans-serif;
  --font-mono: 'IBM Plex Mono', 'ui-monospace', 'Consolas', monospace;
  --body-background-fill: var(--background-fill-primary);
  --body-text-color: var(--neutral-300);
  /*Headers*/
  --body-text-size: var(--text-md);
  --body-text-weight: 400;
  --embed-radius: var(--radius-lg);
  --color-accent: var(--primary-500);
  --color-accent-soft: var(--primary-50);
  --background-fill-primary: var(--neutral-900);
  /*File explorer background*/
  --background-fill-secondary: var(--neutral-500);
  /*Dropdown hover*/
  --border-color-accent: var(--primary-300);
  --border-color-primary: var(--neutral-200);
  --link-text-color: var(--secondary-600);
  --link-text-color-active: var(--secondary-600);
  --link-text-color-hover: var(--secondary-700);
  --link-text-color-visited: var(--secondary-500);
  --body-text-color-subdued: var(--neutral-400);
  --shadow-drop: rgba(0, 0, 0, 0.05) 0px 1px 2px 0px;
  --shadow-drop-lg: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-inset: rgba(0, 0, 0, 0.05) 0px 2px 4px 0px inset;
  --shadow-spread: 3px;
  --block-background-fill: var(--background-fill-primary);
  --block-border-color: var(--border-color-primary);
  --block-border-width: 1px;
  --block-info-text-color: var(--body-text-color-subdued);
  --block-info-text-size: var(--text-sm);
  --block-info-text-weight: 400;
  --block-label-background-fill: var(--background-fill-primary);
  --block-label-border-color: var(--border-color-primary);
  --block-label-border-width: 1px;
  --block-label-shadow: var(--block-shadow);
  --block-label-text-color: var(--neutral-50);
  /*the small labels in corners*/
  --block-label-margin: 0;
  --block-label-padding: var(--spacing-sm) var(--spacing-lg);
  --block-label-radius: calc(var(--radius-lg) - 1px) 0 calc(var(--radius-lg) - 1px) 0;
  --block-label-right-radius: 0 calc(var(--radius-lg) - 1px) 0 calc(var(--radius-lg) - 1px);
  --block-label-text-size: var(--text-sm);
  --block-label-text-weight: 400;
  --block-padding: var(--spacing-xl) calc(var(--spacing-xl) + 2px);
  --block-radius: var(--radius-lg);
  --block-shadow: var(--shadow-drop);
  --block-title-background-fill: none;
  --block-title-border-color: none;
  --block-title-border-width: 0px;
  --block-title-text-color: var(--neutral-50);
  --block-title-padding: 0;
  --block-title-radius: none;
  --block-title-text-size: var(--text-md);
  --block-title-text-weight: 400;
  --container-radius: var(--radius-lg);
  --form-gap-width: 1px;
  --layout-gap: var(--spacing-xxl);
  --panel-background-fill: var(--background-fill-secondary);
  --panel-border-color: var(--border-color-primary);
  --panel-border-width: 0;
  --section-header-text-size: var(--text-md);
  --section-header-text-weight: 400;
  --border-color-accent-subdued: var(--primary-200);
  --chatbot-code-background-color: var(--neutral-100);
  --checkbox-background-color: white;
  --checkbox-background-color-focus: var(--checkbox-background-color);
  --checkbox-background-color-hover: var(--checkbox-background-color);
  --checkbox-background-color-selected: var(--secondary-600);
  --checkbox-border-color: var(--neutral-300);
  --checkbox-border-color-focus: var(--secondary-500);
  --checkbox-border-color-hover: var(--neutral-300);
  --checkbox-border-color-selected: var(--secondary-600);
  --checkbox-border-radius: var(--radius-sm);
  --checkbox-border-width: var(--input-border-width);
  --checkbox-label-background-fill: var(--background-fill-primary);
  /*linear-gradient(to top, var(--neutral-50), white);*/
  --checkbox-label-background-fill-hover: var(--neutral-500);
  /*linear-gradient(to top, var(--neutral-100), white);*/
  --checkbox-label-background-fill-selected: var(--checkbox-label-background-fill);
  --checkbox-label-border-color: var(--border-color-primary);
  --checkbox-label-border-color-hover: var(--checkbox-label-border-color);
  --checkbox-label-border-width: var(--input-border-width);
  --checkbox-label-gap: var(--spacing-lg);
  --checkbox-label-padding: var(--spacing-md) calc(2 * var(--spacing-md));
  --checkbox-label-shadow: var(--shadow-drop);
  --checkbox-label-text-size: var(--text-md);
  --checkbox-label-text-weight: 400;
  --checkbox-check: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e");
  --radio-circle: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='8' cy='8' r='3'/%3e%3c/svg%3e");
  --checkbox-shadow: var(--input-shadow);
  --checkbox-label-text-color: var(--body-text-color);
  --checkbox-label-text-color-selected: var(--checkbox-label-text-color);
  --error-background-fill: #fef2f2;
  --error-border-color: #b91c1c;
  --error-border-width: 1px;
  --error-text-color: #b91c1c;
  --error-icon-color: #b91c1c;
  --input-background-fill: var(--background-fill-primary);
  --input-background-fill-focus: var(--secondary-500);
  --input-background-fill-hover: var(--input-background-fill);
  --input-border-color: var(--border-color-primary);
  --input-border-color-focus: var(--secondary-300);
  --input-border-color-hover: var(--input-border-color);
  --input-border-width: 1px;
  --input-padding: var(--spacing-xl);
  --input-placeholder-color: var(--neutral-400);
  --input-radius: var(--radius-lg);
  --input-shadow: 0 0 0 var(--shadow-spread) transparent, var(--shadow-inset);
  --input-shadow-focus: 0 0 0 var(--shadow-spread) var(--secondary-50), var(--shadow-inset);
  --input-text-size: var(--text-lg);
  --input-text-weight: 400;
  --loader-color: var(--color-accent);
  --prose-text-size: var(--text-md);
  --prose-text-weight: 400;
  --prose-header-text-weight: 600;
  --slider-color: #2563eb;
  --stat-background-fill: linear-gradient(to right, var(--primary-400), var(--primary-200));
  --table-border-color: var(--neutral-300);
  --table-even-background-fill: white;
  --table-odd-background-fill: var(--neutral-50);
  --table-radius: var(--radius-lg);
  --table-row-focus: var(--color-accent-soft);
  --button-border-width: var(--input-border-width);
  --button-cancel-background-fill: linear-gradient(to bottom right, #fee2e2, #fecaca);
  --button-cancel-background-fill-hover: linear-gradient(to bottom right, #fee2e2, #fee2e2);
  --button-cancel-border-color: #fecaca;
  --button-cancel-border-color-hover: var(--button-cancel-border-color);
  --button-cancel-text-color: #dc2626;
  --button-cancel-text-color-hover: var(--button-cancel-text-color);
  --button-large-padding: var(--spacing-lg) calc(2 * var(--spacing-lg));
  --button-large-radius: var(--radius-lg);
  --button-large-text-size: var(--text-lg);
  --button-large-text-weight: 600;
  --button-primary-background-fill: linear-gradient(to bottom right, var(--primary-100), var(--primary-300));
  --button-primary-background-fill-hover: linear-gradient(to bottom right, var(--primary-100), var(--primary-200));
  --button-primary-border-color: var(--primary-200);
  --button-primary-border-color-hover: var(--button-primary-border-color);
  --button-primary-text-color: var(--primary-600);
  --button-primary-text-color-hover: var(--button-primary-text-color);
  --button-secondary-background-fill: linear-gradient(to bottom right, var(--neutral-100), var(--neutral-200));
  --button-secondary-background-fill-hover: linear-gradient(to bottom right, var(--neutral-100), var(--neutral-100));
  --button-secondary-border-color: var(--neutral-200);
  --button-secondary-border-color-hover: var(--button-secondary-border-color);
  --button-secondary-text-color: var(--neutral-700);
  --button-secondary-text-color-hover: var(--button-secondary-text-color);
  --button-shadow: var(--shadow-drop);
  --button-shadow-active: var(--shadow-inset);
  --button-shadow-hover: var(--shadow-drop-lg);
  --button-small-padding: var(--spacing-sm) calc(2 * var(--spacing-sm));
  --button-small-radius: var(--radius-lg);
  --button-small-text-size: var(--text-md);
  --button-small-text-weight: 400;
  --button-transition: none;
}

/* Up here is the override for dark mode */
/* Now comes our custom CSS */

h1 {
  font-size: 2.5rem !important;
  opacity: 0.9 !important;
  margin-top: 32px !important;
}

h2 {
  font-size: 2rem !important;
  opacity: 0.8 !important;
  margin-top: 32px !important;
}

.monospace-box * {
  font-family: monospace;
  font-size: 12px !important;
  line-height: 13px !important;
  box-shadow: none !important;
  border-radius: 0.375rem !important;
  border: 0px !important;
  white-space: pre !important;
}

.no-border {
  border-width: 0px !important;
}

/* Hides Gradio footer */
footer {
  visibility: hidden;
}

/* Hides the plotly menu */
.modebar {
  display: none;
}

/* No shadow by default */
.block * {
  box-shadow: none !important;
}

/* Bootstrap border radius */
.block {
  border-radius: 0.375rem !important;
}

.svelte-jigama {
  display: flex !important;
  gap: 8px !important;
  box-shadow: none !important;
  border-radius: 0.375rem !important;
  padding-left: 0px !important;
  padding-right: 0px !important;
  transition: all 0.15s !important;
}

/* Input */
input[type="number" i] {
  width: 64px !important;
}

input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Checkbox */
input[type="checkbox"] {
  filter: hue-rotate(-10deg);
  opacity: 0.7;
  transition: all 0.15s !important;
}

/* Sliders */

input[type="range"] {
  opacity: 0.7;
  transition: all 0.15s !important;
}


input[type="range"]::-webkit-slider-thumb {
  cursor: pointer;
  /* Cursor on hover */
}


/* Adjustments for the file object */
.file-preview-holder {
  display: flex;
  align-items: flex-end;
}

.file-preview {
  margin-top: 12px;
  margin-bottom: 12px;
}

/* Border for the file input */
.file-input {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
}

.svelte-116rqfv {
  box-shadow: inset 0 0 16px rgba(25, 135, 84, 0.06) !important;
  border-style: solid !important;
  border-width: 1px !important;
  border-color: rgba(25, 135, 84, 1) !important;
  border-radius: 0.375rem !important;
  transition: all 0.6s !important;
  animation-timing-function: ease-out;
}

.svelte-116rqfv:hover {
  box-shadow: inset 0 0 32px rgba(25, 135, 84, 0.2) !important;
  border-color: rgba(25, 135, 84, 1) !important;
}

/* File output */
.file-output {
  /* display: flex !important;
  flex-direction: column; */
  /* align-items: center !important;
  justify-content: center !important; */
  overflow: hidden !important;
}

.svelte-xrr240 {
  width: auto !important;
}

/* Buttons */
.btn-html {
  position: sticky;
  /* display: flex; */
  justify-content: center;
  background: white !important;
  border-color: #6c757d !important;
  color: #6c757d !important;
  border: solid 1px;
  padding: 8px;
  border-radius: 0.375rem;
  text-decoration: none !important;
  font-size: 16px !important;
  width: 100% !important;
  font-weight: normal !important;

}

.btn-html:hover {
  background: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
}

.btn-spinner {
  background: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
  font-weight: normal !important;
  text-align: left !important;
}

.btn-spinner::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  right: 16px;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;

}

.btn-run {
  background: white !important;
  border-color: #198754 !important;
  color: #198754 !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
  border-radius: 0.375rem !important;
  font-weight: normal !important;
}

.btn-run:hover {
  background: #198754 !important;
  border-color: #198754 !important;
  color: white !important;
}

.btn {
  height: 100% !important;
  font-weight: normal !important;

}

/* .btn:active::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: auto;
  border: 4px solid transparent;
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: button-loading-spinner 1s ease infinite;
} */

@keyframes button-loading-spinner {
  from {
    transform: rotate(0turn);
  }

  to {
    transform: rotate(1turn);
  }
}

.btn-clear {
  background: white !important;
  border-color: #6c757d !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
  border-radius: 0.375rem !important;
  font-weight: normal !important;
}

.btn-clear:hover {
  background: #dc3545 !important;
  border-color: #dc3545 !important;
  color: white !important;
}

.gallery-item {
  background: white !important;
  border-color: #6c757d !important;
  transition: all 0.15s !important;
  box-shadow: none !important;
  border-radius: 0.375rem !important;
  font-weight: normal !important;
}

.gallery-item:hover {
  background: #6c757d !important;
  border-color: #6c757d !important;
  color: white !important;
}

.gallery-item:focus {
  background: #198754 !important;
  border-color: #198754 !important;
  color: white !important;
}


/* Hide Examples label */
.label.svelte-13hsdno {
  display: none !important;
}

.rounded img {
  border-radius: 0.375rem !important;
}

/* Gradio badge title for plots */
span.svelte-1frtwj3 {
  visibility: hidden !important;
  margin-right: 0 !important;
  width: 0 !important;
}

div.svelte-1frtwj3 {
  border-top-left-radius: 0.3rem !important;

  border: 0px !important;
  box-shadow: none !important;
}

/* Hide icons from outputs */
.icon.svelte-1u5vjgs {
  visibility: hidden !important;
}

/* Size shortcuts */
.h-1024 {
  height: 1024px !important;
}

.h-768 {
  height: 768px !important;
}

.h-512 {
  height: 512px !important;
}

.h-480 {
  height: 480px !important;
}

.h-320 {
  height: 320px !important;
}

.w-320 {
  width: 320px !important;
}


.h-256 {
  height: 256px !important;
}

.w-256 {
  width: 256px !important;
}

.h-128 {
  height: 128px !important;
}

.w-128 {
  width: 128px !important;
}

.h-64 {
  height: 64px !important;
}

.w-64 {
  width: 64px !important;
  min-width: 64px !important;

}

.h-36 {
  height: 36px !important;

}

.w-36 {
  width: 36px !important;
  min-width: 36px !important;

}

.h-32 {
  height: 32px !important;

}

.w-32 {
  width: 32px !important;
  min-width: 32px !important;

}

.h-16 {
  height: 16px !important;
}

.w-16 {
  width: 16px !important;
  min-width: 16px !important;
}

.h-0 {
  height: 0px !important;
}

.w-0 {
  width: 0px !important;
}

.options {
  border: 1px solid #bababa !important;
  box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.15) !important;

}

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

.mt-48 {
  margin-top: 48px;
}

.mt-64 {
  margin-top: 64px;
}

.mt-128 {
  margin-top: 128px;
}

.hide-overflow {
  overflow: hidden !important;
}


.wrap.default {
  visibility: hidden !important;
}


/* Annotation tool CSS */

.no-interpolation {
  image-rendering: pixelated !important;
}

.annotation-tool {
  image-rendering: pixelated !important;
}


.annotation-tool:not(.no-img) .source-wrap {
  display: none !important;
}

.annotation-tool button[title="Clear canvas"] {
  display: none !important;
}

/* For backward and forward buttons in Annotation tool CSS */
.annotation-tool .row-wrap {
  justify-content: center !important;
}

.annotation-tool .controls-wrap {
  justify-content: center !important;

  top: -8px !important;
  left: 0px !important;

}

.annotation-tool .controls-wrap .small {
  width: 20px !important;
  height: 20px !important;
}

.annotation-tool .controls-wrap .padded {
  padding: 8px !important;
  border: 0px !important;
  background-color: rgba(255, 255, 255, 0.8);
}

/*controls gr.File in Annotation tool CSS */
.annotation-tool .download {
  min-width: 4rem !important;
  width: 10%;
  white-space: nowrap;
  text-align: right;
}

.annotation-tool .stage-wrap canvas {
  min-width: 512px !important;
  max-height: 100% !important;
}