@font-face {
  font-family: "Departure Mono";
  src: url("/fonts/dmr.woff2") format("woff2");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

@font-face {
  font-family: "Silkscreen";
  src: url("/fonts/silkscreen.otf") format("opentype");
  font-display: swap;
  font-style: normal;
  font-weight: 400;
}

:root {
  --kbw-primary: var(--primary, #0798ff);
  --kbw-primary-lighter: var(--primaryLighter, #aadcff);
  --kbw-primary-lightest: var(--primaryLightest, #eaf7ff);
  --kbw-page: var(--pageBackground, #fff);
  --kbw-input: var(--inputBackground, #fff);
  --kbw-header-background: var(--kbw-primary-lightest);
  --kbw-header-foreground: #000;
  --kbw-user-background: #c8f2ff;
  --kbw-user-foreground: #000;
  --kbw-control-foreground: #000;
  --kbw-surface-foreground: #000;
  --kbw-page-foreground: #222;
  --kbw-ink: #000;
  --kbw-cyan: #00aeef;
  --kbw-gold: #ffc928;
  --kbw-yellow: #fff200;
  --kbw-source: #fff0a8;
  --kbw-green: #006b4f;
  --kbw-submit-background: var(--kbw-yellow);
  --kbw-submit-foreground: #000;
  --kbw-pixel-font: "Departure Mono", "Courier New", monospace;
  --kbw-label-font: "Silkscreen", "Departure Mono", monospace;
}

html.theme_yellow,
html.theme_purple,
html.theme_pico8,
html.theme_black,
html.theme_brown,
html.theme_yellow_dark,
html.theme_purple_dark {
  --kbw-control-foreground: #fff;
}

html.theme_dark,
html.theme_green_dark,
html.theme_purple_dark,
html.theme_pico8_dark,
html.theme_black_dark,
html.theme_brown_dark {
  --kbw-surface-foreground: #fff;
}

html.theme_dark,
html.theme_yellow_dark,
html.theme_pink_dark,
html.theme_green_dark,
html.theme_purple_dark,
html.theme_pico8_dark,
html.theme_black_dark,
html.theme_brown_dark {
  --kbw-page-foreground: #fff;
  --kbw-ink: #fff;
  --kbw-header-background: var(--kbw-primary);
  --kbw-header-foreground: var(--kbw-control-foreground);
  --kbw-submit-background: var(--kbw-green);
  --kbw-submit-foreground: #fff;
}

#kirupabot-widget,
#kirupabot-widget *,
#kirupabot-widget *::before,
#kirupabot-widget *::after {
  box-sizing: border-box;
}

#kirupabot-widget [hidden] {
  display: none !important;
}

#kirupabot-widget {
  position: relative;
  z-index: 190;
  color: var(--kbw-page-foreground);
  font-family: var(--kbw-pixel-font);
}

#kirupabot-widget .kbw-visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

#kirupabot-widget .kbw-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 192;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 3px solid var(--kbw-ink);
  border-radius: 0;
  outline: 0;
  background: var(--kbw-primary);
  box-shadow: 6px 6px 0 var(--kbw-cyan);
  color: var(--kbw-control-foreground);
  cursor: pointer;
  transition: box-shadow .14s steps(2, end), transform .14s steps(2, end);
}

#kirupabot-widget .kbw-launcher:hover {
  border-color: var(--kbw-ink);
  box-shadow: 3px 3px 0 var(--kbw-cyan);
  transform: translate(3px, 3px);
}

#kirupabot-widget .kbw-launcher:focus-visible {
  outline: 3px solid var(--kbw-gold);
  outline-offset: 4px;
}

#kirupabot-widget .kbw-launcher-icon,
#kirupabot-widget .kbw-launcher-icon svg {
  display: block;
  width: 30px;
  height: 30px;
}

#kirupabot-widget .kbw-launcher-icon svg {
  shape-rendering: crispEdges;
}

#kirupabot-widget .kbw-launcher-close {
  display: none;
  font-family: var(--kbw-label-font);
  font-size: 25px;
  line-height: 1;
}

#kirupabot-widget[data-open="true"] .kbw-launcher-icon {
  display: none;
}

#kirupabot-widget[data-open="true"] .kbw-launcher-close {
  display: inline;
}

#kirupabot-widget .kbw-launcher-label {
  position: absolute;
  right: calc(100% + 12px);
  padding: 7px 9px;
  border: 2px solid var(--kbw-ink);
  background: var(--kbw-page);
  box-shadow: 3px 3px 0 var(--kbw-cyan);
  color: var(--kbw-page-foreground);
  font-family: var(--kbw-label-font);
  font-size: 9px;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translateX(5px);
  will-change: opacity, transform;
  transition: opacity .22s ease-out, transform .24s cubic-bezier(.2, .8, .2, 1);
}

#kirupabot-widget .kbw-launcher:hover .kbw-launcher-label,
#kirupabot-widget .kbw-launcher:focus-visible .kbw-launcher-label {
  opacity: 1;
  transform: translateX(0);
}

#kirupabot-widget[data-open="true"] .kbw-launcher-label {
  display: none;
}

#kirupabot-widget .kbw-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: calc(max(18px, env(safe-area-inset-bottom)) + 76px);
  z-index: 191;
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 36px));
  height: min(570px, calc(100dvh - 112px));
  min-height: 360px;
  overflow: hidden;
  visibility: hidden;
  border: 3px solid var(--kbw-ink);
  border-radius: 0;
  background: var(--kbw-page);
  box-shadow: 8px 8px 0 var(--kbw-cyan);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px);
  transform-origin: bottom right;
  transition: opacity .18s steps(3, end), transform .18s steps(3, end), visibility .18s;
}

#kirupabot-widget[data-open="true"] .kbw-panel {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

#kirupabot-widget .kbw-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  gap: 12px;
  padding: 9px 10px 9px 13px;
  border-bottom: 3px solid var(--kbw-ink);
  background: var(--kbw-header-background);
  color: var(--kbw-header-foreground);
}

#kirupabot-widget .kbw-heading {
  min-width: 0;
}

#kirupabot-widget .kbw-title {
  display: block;
  margin: 0;
  color: inherit;
  font-family: var(--kbw-label-font);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.25;
  text-transform: uppercase;
}

#kirupabot-widget .kbw-status {
  display: block;
  max-width: 235px;
  margin-top: 4px;
  overflow: hidden;
  color: inherit;
  font-family: var(--kbw-pixel-font);
  font-size: 10px;
  line-height: 1.2;
  opacity: .85;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#kirupabot-widget .kbw-header-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 7px;
  align-items: center;
}

#kirupabot-widget .kbw-full-chat,
#kirupabot-widget .kbw-close {
  margin: 0;
  appearance: none;
  border: 2px solid currentColor;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  font-family: var(--kbw-label-font);
  font-weight: 400;
  text-decoration: none;
  cursor: pointer;
}

#kirupabot-widget .kbw-full-chat {
  display: grid;
  place-items: center;
  height: 34px;
  padding: 0 7px;
  font-size: 8px;
  line-height: 1.25;
  text-transform: uppercase;
}

#kirupabot-widget .kbw-close {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

#kirupabot-widget .kbw-full-chat:hover,
#kirupabot-widget .kbw-close:hover {
  border-color: currentColor;
  background: rgba(255, 255, 255, .18);
  color: inherit;
  text-decoration: none;
  transform: translate(1px, 1px);
}

#kirupabot-widget .kbw-full-chat:focus-visible,
#kirupabot-widget .kbw-close:focus-visible {
  outline: 3px solid var(--kbw-gold);
  outline-offset: 2px;
}

#kirupabot-widget .kbw-messages {
  flex: 1 1 auto;
  min-height: 0;
  padding: 15px 13px 12px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: var(--kbw-page);
  background-image:
    linear-gradient(rgba(127, 127, 127, .08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(127, 127, 127, .08) 1px, transparent 1px);
  background-size: 16px 16px;
  scroll-behavior: smooth;
}

#kirupabot-widget .kbw-message {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-bottom: 14px;
  animation: kbw-message-in .18s steps(3, end);
}

#kirupabot-widget .kbw-message.kbw-user {
  grid-template-columns: minmax(0, 1fr) 28px;
}

#kirupabot-widget .kbw-avatar {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--kbw-ink);
  background: var(--kbw-primary-lightest);
  color: var(--kbw-surface-foreground);
  box-shadow: 2px 2px 0 var(--kbw-cyan);
}

#kirupabot-widget .kbw-avatar img {
  width: 16px;
  height: 16px;
  image-rendering: pixelated;
}

#kirupabot-widget .kbw-user .kbw-avatar {
  grid-column: 2;
  background: var(--kbw-gold);
  border-color: #000;
  box-shadow: 2px 2px 0 #000;
  color: #000;
  font-family: var(--kbw-label-font);
  font-size: 7px;
}

#kirupabot-widget .kbw-message-content {
  min-width: 0;
  max-width: 100%;
}

#kirupabot-widget .kbw-user .kbw-message-content {
  grid-column: 1;
  grid-row: 1;
  justify-self: end;
}

#kirupabot-widget .kbw-bubble {
  display: inline-block;
  max-width: 100%;
  padding: 10px 11px;
  border: 2px solid var(--kbw-surface-foreground);
  background: var(--kbw-primary-lightest);
  box-shadow: 3px 3px 0 var(--kbw-cyan);
  color: var(--kbw-surface-foreground);
  font-family: var(--kbw-pixel-font);
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

#kirupabot-widget .kbw-user .kbw-bubble {
  border-color: #000;
  background: var(--kbw-user-background);
  box-shadow: 3px 3px 0 var(--kbw-gold);
  color: var(--kbw-user-foreground);
}

#kirupabot-widget .kbw-bubble p {
  margin: 0 0 9px;
  padding: 0;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

#kirupabot-widget .kbw-bubble p:last-child {
  margin-bottom: 0;
}

#kirupabot-widget .kbw-bubble strong {
  color: inherit;
}

#kirupabot-widget .kbw-bubble code {
  padding: 1px 3px;
  border: 1px solid currentColor;
  background: rgba(127, 127, 127, .14);
  color: inherit;
  font-family: var(--kbw-pixel-font);
  font-size: .9em;
}

#kirupabot-widget .kbw-bubble pre {
  max-width: 100%;
  margin: 10px 0;
  padding: 10px;
  overflow-x: auto;
  border: 2px solid #000;
  background: #000;
  box-shadow: 3px 3px 0 var(--kbw-gold);
  color: #fff;
  text-align: left;
  white-space: pre;
}

#kirupabot-widget .kbw-bubble pre code {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font-size: 12px;
  line-height: 1.45;
}

#kirupabot-widget .kbw-answer-list {
  margin: 5px 0 9px;
  padding-left: 20px;
}

#kirupabot-widget .kbw-answer-list:last-child {
  margin-bottom: 0;
}

#kirupabot-widget .kbw-answer-list li {
  margin-bottom: 5px;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}

#kirupabot-widget .kbw-citation {
  display: inline-block;
  margin: 0 2px;
  padding: 1px 4px;
  border: 1px solid #000;
  background: var(--kbw-source);
  color: #000;
  font-family: var(--kbw-label-font);
  font-size: 8px;
  line-height: 1.4;
  vertical-align: 1px;
}

#kirupabot-widget .kbw-sources,
#kirupabot-widget .kbw-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

#kirupabot-widget .kbw-source-link,
#kirupabot-widget .kbw-copy-button {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 5px 7px;
  appearance: none;
  border: 2px solid #000;
  border-radius: 0;
  box-shadow: 2px 2px 0 #000;
  color: #000;
  font-family: var(--kbw-pixel-font);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .12s steps(2, end), transform .12s steps(2, end);
}

#kirupabot-widget .kbw-source-link {
  background: var(--kbw-source);
}

#kirupabot-widget .kbw-copy-button {
  background: var(--kbw-gold);
  font-family: var(--kbw-label-font);
  font-size: 8px;
  font-weight: 400;
  text-transform: uppercase;
}

#kirupabot-widget .kbw-source-link:hover,
#kirupabot-widget .kbw-copy-button:hover {
  border-color: #000;
  box-shadow: none;
  color: #000;
  text-decoration: none;
  transform: translate(2px, 2px);
}

#kirupabot-widget .kbw-source-link:focus-visible,
#kirupabot-widget .kbw-copy-button:focus-visible {
  outline: 3px solid var(--kbw-cyan);
  outline-offset: 2px;
}

#kirupabot-widget .kbw-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 1px 0 13px 36px;
}

#kirupabot-widget .kbw-suggestion {
  margin: 0;
  padding: 6px 8px;
  appearance: none;
  border: 2px solid var(--kbw-ink);
  border-radius: 0;
  background: var(--kbw-primary);
  box-shadow: 2px 2px 0 var(--kbw-ink);
  color: var(--kbw-control-foreground);
  font-family: var(--kbw-label-font);
  font-size: 8px;
  line-height: 1.4;
  text-transform: uppercase;
  cursor: pointer;
}

#kirupabot-widget .kbw-suggestion:hover {
  border-color: var(--kbw-ink);
  box-shadow: none;
  color: var(--kbw-control-foreground);
  transform: translate(2px, 2px);
}

#kirupabot-widget .kbw-suggestion:focus-visible {
  outline: 3px solid var(--kbw-gold);
  outline-offset: 2px;
}

#kirupabot-widget .kbw-typing {
  display: flex;
  gap: 4px;
  align-items: center;
  min-height: 20px;
}

#kirupabot-widget .kbw-typing-label {
  margin-right: 3px;
  color: inherit;
  font-family: var(--kbw-label-font);
  font-size: 8px;
  line-height: 1.3;
  text-transform: uppercase;
}

#kirupabot-widget .kbw-typing-dot {
  width: 7px;
  height: 7px;
  border: 1px solid currentColor;
  background: var(--kbw-cyan);
  animation: kbw-dot 1s steps(2, end) infinite;
}

#kirupabot-widget .kbw-typing-dot:nth-child(3) {
  background: var(--kbw-gold);
  animation-delay: .12s;
}

#kirupabot-widget .kbw-typing-dot:nth-child(4) {
  background: var(--kbw-primary);
  animation-delay: .24s;
}

#kirupabot-widget .kbw-error .kbw-bubble {
  border-color: #000;
  background: #fff0f0;
  box-shadow: 3px 3px 0 #ec008c;
  color: #7c1d1d;
}

#kirupabot-widget .kbw-composer-area {
  flex: 0 0 auto;
  padding: 10px;
  border-top: 3px solid var(--kbw-ink);
  background: var(--kbw-primary-lightest);
  color: var(--kbw-surface-foreground);
}

#kirupabot-widget .kbw-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 48px;
  align-items: end;
  border: 2px solid var(--kbw-ink);
  background: var(--kbw-input);
  box-shadow: 4px 4px 0 var(--kbw-primary-lighter);
}

#kirupabot-widget .kbw-input {
  width: 100%;
  min-height: 46px;
  max-height: 100px;
  margin: 0;
  padding: 12px;
  resize: none;
  overflow-y: auto;
  appearance: none;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  box-shadow: none;
  color: var(--kbw-page-foreground);
  font-family: var(--kbw-pixel-font);
  font-size: 14px;
  line-height: 1.4;
}

#kirupabot-widget .kbw-input::placeholder {
  color: var(--kbw-page-foreground);
  opacity: .62;
}

#kirupabot-widget .kbw-send {
  display: grid;
  place-items: center;
  width: 48px;
  height: 46px;
  margin: 0;
  padding: 0;
  appearance: none;
  border: 0;
  border-left: 2px solid var(--kbw-ink);
  border-radius: 0;
  background: var(--kbw-submit-background);
  box-shadow: none;
  color: var(--kbw-submit-foreground);
  font-family: var(--kbw-label-font);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

#kirupabot-widget .kbw-send:hover {
  border-left-color: var(--kbw-ink);
  background: var(--kbw-submit-background);
  color: var(--kbw-submit-foreground);
  transform: translate(1px, 1px);
}

#kirupabot-widget .kbw-send:focus-visible {
  outline: 3px solid var(--kbw-cyan);
  outline-offset: -5px;
}

#kirupabot-widget .kbw-send:disabled {
  background: var(--kbw-submit-background);
  color: var(--kbw-submit-foreground);
  cursor: not-allowed;
  opacity: .45;
}

#kirupabot-widget .kbw-composer-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 7px;
  padding: 0 1px;
  color: var(--kbw-surface-foreground);
  font-family: var(--kbw-label-font);
  font-size: 8px;
  line-height: 1.35;
  text-transform: uppercase;
}

#kirupabot-widget .kbw-composer-meta span {
  color: inherit;
  font: inherit;
}

@keyframes kbw-message-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes kbw-dot {
  0%,
  35% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
  65%,
  100% {
    transform: translateY(0);
  }
}

@media (max-width: 600px) {
  html.kbw-widget-open {
    overflow: hidden;
  }

  #kirupabot-widget .kbw-launcher {
    right: max(12px, env(safe-area-inset-right));
    bottom: max(12px, env(safe-area-inset-bottom));
    width: 58px;
    height: 58px;
    box-shadow: 5px 5px 0 var(--kbw-cyan);
  }

  #kirupabot-widget[data-open="true"] .kbw-launcher {
    display: none;
  }

  #kirupabot-widget .kbw-launcher-label {
    display: none;
  }

  #kirupabot-widget .kbw-panel {
    top: max(8px, env(safe-area-inset-top));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    width: auto;
    height: auto;
    min-height: 0;
    max-height: none;
    box-shadow: 5px 5px 0 var(--kbw-cyan);
    transform: translateY(8px);
  }

  #kirupabot-widget[data-open="true"] .kbw-panel {
    transform: translateY(0);
  }

  #kirupabot-widget .kbw-header {
    min-height: 56px;
    padding-left: 11px;
  }

  #kirupabot-widget .kbw-status {
    max-width: 190px;
  }

  #kirupabot-widget .kbw-messages {
    padding: 13px 11px 10px;
  }

  #kirupabot-widget .kbw-bubble {
    padding: 9px 10px;
    font-size: 14px;
  }

  #kirupabot-widget .kbw-suggestions {
    margin-left: 36px;
  }

  #kirupabot-widget .kbw-composer-area {
    padding: 9px;
  }

  #kirupabot-widget .kbw-input {
    font-size: 16px;
  }
}

@media (max-width: 380px) {
  #kirupabot-widget .kbw-full-chat {
    display: none;
  }

  #kirupabot-widget .kbw-status {
    max-width: 210px;
  }
}

@media (max-height: 500px) and (min-width: 601px) {
  #kirupabot-widget .kbw-panel {
    height: calc(100dvh - 104px);
    min-height: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  #kirupabot-widget .kbw-launcher,
  #kirupabot-widget .kbw-launcher-label,
  #kirupabot-widget .kbw-panel,
  #kirupabot-widget .kbw-source-link,
  #kirupabot-widget .kbw-copy-button {
    transition: none;
  }

  #kirupabot-widget .kbw-message,
  #kirupabot-widget .kbw-typing-dot {
    animation: none;
  }

  #kirupabot-widget .kbw-messages {
    scroll-behavior: auto;
  }
}

@media print {
  #kirupabot-widget {
    display: none !important;
  }
}
