:root {
  --bs-border-radius: 0.625rem;
  --bs-border-radius-lg: 1.5rem;

  /* bill.line main.css palette */
  --shades-50: #f7f9fa;
  --shades-150: #e8ebed;
  --shades-200: #dcdee0;
  --shades-250: #bec1c4;
  --shades-300: #999c9e;
  --shades-400: #717375;
  --shades-600: #1f2021;
  --danger-500: #e04f5b;
  --success-500: #7ac668;
  --primary-blue-50: #e1f0ff;
  --primary-blue-100: #c3e1fe;
  --primary-blue-200: #a3d1fd;
  --primary-blue-400: #1989fa;
  --primary-blue-500: #0268ce;
  --primary-50: var(--primary-blue-50);
  --primary-100: var(--primary-blue-100);
  --primary-400: var(--primary-blue-400);
  --primary-500: var(--primary-blue-500);
  --primary-600: #0154a3;
  --ink: var(--primary-600);
  --sidebar-bg: var(--primary-blue-500);
  --sidebar-gradient: linear-gradient(165deg, #0268ce 0%, #5f7ce6 48%, #9681ff 100%);
  --white: #ffffff;
  --default-border-radius: 1.5rem;
  --default-gradient: linear-gradient(45deg, #0268ce 0%, #9681ff 100%);

  /* App layout (non-color) */
  --nav-stripe-image: url('../resources/bg-gradient.svg');
  --logo-filter: none;
  --font-family: 'Onest', sans-serif;
  /* 1rem = current html scale (0.875rem mobile ≈14px, 1.125rem desktop ≈18px at 16px UA default) */
  --font-size-base: 1rem;
  --chat-round-btn-size: 2.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Heroicons (inline SVG, replaces Font Awesome) */
.hicon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.hicon svg,
svg.hicon-svg {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

.hicon-spin svg,
svg[data-spin="true"] {
  animation: hicon-spin 1s linear infinite;
}

@keyframes hicon-spin {
  to {
    transform: rotate(360deg);
  }
}

.hicon.me-1 {
  margin-right: 0.25rem;
}

.hicon.me-2 {
  margin-right: 0.5rem;
}

html {
  height: 100%;
  min-height: 100%;
  font-family: var(--font-family);
}

button,
input,
textarea,
select,
optgroup {
  font-family: inherit;
}

body {
  background: var(--shades-50);
  min-height: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  font-size: var(--font-size-base);
  color: var(--shades-600);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  transition: background-color 0.3s, color 0.3s;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#main-app.app-shell {
  --sidebar-width: 320px;
  --sidebar-rail-width: 4rem;
  width: 100%;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: 100%;
  box-sizing: border-box;
  overflow: hidden;
  padding: 0;
}

#main-app:not(.app-shell) {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 0.625rem;
  box-sizing: border-box;
}

.logo {
  display: block;
  height: 2.25rem;
  width: auto;
  flex-shrink: 0;
}

.title-container .logo:not(img) {
  width: 2.5rem;
  height: 3.4375rem;
  background: url(../resources/logo.svg) no-repeat center;
  background-size: contain;
  transition: filter 0.3s;
}

.logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}

.main-title {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--shades-600);
  text-align: center;
  margin: 0;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.title-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 1rem 0 0.75rem 0;
}

.subtitle {
  font-size: 1rem;
  font-weight: 300;
  color: var(--shades-400);
  text-align: center;
  margin-bottom: 1rem;
}

/* —— Cards (form-block / default-info-card) —— */
.ui-card,
.chat-container,
.login-card,
.csat-card,
.csat-modal,
.category-selection-card,
.clarifying-question-card,
.copy-toast,
.modal-content {
  background: var(--white);
  border: none;
  border-radius: var(--default-border-radius);
  box-shadow: 0 1rem 2.5rem rgba(61, 62, 64, 0.08);
}

/* —— Buttons: filled (gradient) + outline (dark border) —— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.625rem 1.25rem;
  min-height: 2.5rem;
  border: 0.1875rem solid transparent;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition: border-color 0.35s ease, background 0.35s ease, color 0.35s ease, filter 0.35s ease;
}

.btn-filled {
  background-color: var(--primary-blue-500);
  background-image: none;
  color: var(--white);
  border-color: transparent;
  border-radius: 2.5rem;
}

.btn-filled:hover:not(:disabled) {
  filter: brightness(1.08);
}

.btn-filled:disabled {
  background-color: var(--shades-400);
  background-image: none;
  opacity: 0.6;
  cursor: not-allowed;
  filter: none;
}

/* blog.css .blog__card-link */
.btn-outline {
  background: transparent;
  color: var(--shades-600);
  border: 0.0625rem solid var(--shades-600);
  border-radius: 2.5rem;
  padding: 0.9375rem 1.5rem;
  min-width: 9.375rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.286;
  transition: all 0.35s ease-in-out;
}

.btn-outline:hover:not(:disabled) {
  background: var(--shades-600);
  color: var(--white);
}

.btn-outline:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  padding: 0.75rem;
  min-width: 2.5rem;
}

.btn-round {
  width: var(--chat-round-btn-size);
  height: var(--chat-round-btn-size);
  min-width: var(--chat-round-btn-size);
  min-height: var(--chat-round-btn-size);
  padding: 0;
  border-radius: 50%;
}

.btn-outline.btn-icon {
  min-width: auto;
  padding: 0.75rem;
}

.btn-outline.btn-round,
.btn-filled.btn-round {
  min-width: var(--chat-round-btn-size);
  padding: 0;
  border-radius: 50%;
}

.btn-sm {
  padding: 0.8125rem 0.9375rem;
  min-height: auto;
  font-size: 0.875rem;
  line-height: 1.375;
}

.btn-outline.btn-sm {
  min-width: auto;
}

.btn-block {
  width: 100%;
}

/* blog.css .search__wrapper / .search__input */
.ui-input,
.form-control {
  padding: 0.875rem 1.1875rem;
  border: 0.0625rem solid #e5e5e5;
  border-radius: 2.5rem;
  color: var(--shades-600);
  background: transparent;
  box-shadow: none;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.375;
  transition: border-color 0.35s ease-in-out, color 0.35s ease-in-out;
}

.csat-feedback textarea,
.category-clarification textarea {
  padding: 0.875rem 1.1875rem;
  border: 0.0625rem solid #e5e5e5;
  border-radius: 1rem;
  color: var(--shades-600);
  background: transparent;
  box-shadow: none;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.375;
  transition: border-color 0.35s ease-in-out;
}

.ui-input::placeholder,
.form-control::placeholder,
.csat-feedback textarea::placeholder,
.category-clarification textarea::placeholder {
  color: #aaaaaa;
}

.ui-input:focus,
.form-control:focus,
.csat-feedback textarea:focus,
.category-clarification textarea:focus {
  outline: none;
  border-color: var(--shades-600);
  box-shadow: none;
  background: transparent;
}

.nav-tabs {
  background-color: var(--primary-blue-500);
  background-image: var(--nav-stripe-image);
  background-repeat: no-repeat;
  background-position: center center;
  background-size: cover;
  display: flex;
  gap: 0;
  justify-content: space-between;
  align-items: center;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
}

.nav-tabs > * {
  flex: 0 0 auto;
}

.nav-tabs-selectors {
  display: flex;
  align-items: stretch;
  gap: 0.5rem;
  margin-left: auto;
  align-self: stretch;
  height: 100%;
}

.nav-tabs .nav-tabs-selectors .localization-dropdown.--dropdown {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  height: 100%;
}

.nav-tab {
  padding: 0.9375rem 1.5625rem;
  background: transparent;
  border: none;
  border-bottom: 0.1875rem solid transparent;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--white) 88%, transparent);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

.nav-tab:hover {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 12%, transparent);
}

.nav-tab.active {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 16%, transparent);
  border-bottom-color: var(--white);
}

.content-area {
  padding: 1rem 1rem 0rem 1rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
  width: 0.5rem;
  height: 0.5rem;
}

::-webkit-scrollbar-track {
  background: var(--primary-blue-50);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb {
  background: var(--shades-200);
  border-radius: 0.25rem;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue-500);
}

/* Localization dropdown */

.localization-dropdown.--dropdown {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: 100%;
}

.localization-dropdown.--dropdown,
.localization-dropdown.--dropdown * {
  line-height: 120%;
}

.localization-dropdown.--dropdown .language-button.--dropdown__value {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  user-select: none;
  cursor: pointer;
}

.localization-dropdown__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  min-width: 1rem;
  aspect-ratio: 1 / 1;
  margin-right: 0.5rem;
  color: inherit;
}

.localization-dropdown__icon i {
  font-size: 1rem;
  color: inherit;
}

.localization-dropdown__icon-img {
  display: block;
  width: 1rem;
  height: 1rem;
}

.nav-tabs .localization-dropdown__icon-img {
  filter: brightness(0) invert(1);
  opacity: 0.92;
}

.nav-tabs .language-button:hover .localization-dropdown__icon-img {
  opacity: 1;
}

.refresh-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.refresh-btn__icon {
  display: block;
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}

.localization-dropdown__label {
  flex: 0 1 auto;
  min-width: 0;
  text-align: left;
}

.localization-dropdown__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  margin-left: 0.25rem;
  color: inherit;
  transition: transform 0.4s ease;
}

.localization-dropdown__arrow i {
  font-size: 0.625rem;
  color: inherit;
  transition: transform 0.4s ease;
}

.localization-dropdown.-active .localization-dropdown__arrow {
  transform: rotate(180deg);
}

.localization-dropdown.--dropdown .language-dropdown.--dropdown__list {
  position: fixed;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 0.625rem;
  margin: 0;
  padding: 1rem;
  min-width: 10rem;
  width: max-content;
  max-width: min(20rem, calc(100vw - 1.5rem));
  background-color: var(--white);
  border-radius: 0.5rem;
  filter: drop-shadow(0 0.5rem 1rem rgba(61, 62, 64, 0.3));
  border: none;
  box-shadow: none;
  z-index: 10002;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow: visible;
}

.localization-dropdown.--dropdown .language-dropdown.--dropdown__list::before {
  content: '';
  position: absolute;
  top: -0.3125rem;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 0.625rem;
  height: 0.625rem;
  background-color: var(--white);
  pointer-events: none;
  z-index: 0;
}

.localization-dropdown.--dropdown.-active .language-dropdown.--dropdown__list {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.localization-dropdown.--dropdown .language-option.--dropdown__list-item {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0.25rem 0;
  margin: 0;
  background: transparent;
  text-align: left;
  transition: color 0.4s ease;
}

/* Language Selector Styles */
#languageSelectorContainer {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  position: relative;
}

/* When inside nav-tabs, style like nav-tab but with accent color */
.nav-tabs .language-button {
  padding: 0.9375rem 1.5625rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: color-mix(in srgb, var(--white) 92%, transparent);
  transition: all 0.2s ease;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  align-self: stretch;
  height: 100%;
  min-height: 100%;
  box-sizing: border-box;
}

.nav-tabs .language-button:hover {
  color: var(--white);
  background: color-mix(in srgb, var(--white) 12%, transparent);
}

.nav-tabs .language-button i,
.nav-tabs .language-button .hicon {
  color: color-mix(in srgb, var(--white) 92%, transparent);
}

.nav-tabs .language-button:hover i,
.nav-tabs .language-button:hover .hicon {
  color: var(--white);
}

/* Make dropdown overlay, not expand navbar */
.nav-tabs #languageSelectorContainer {
  position: relative;
}

.nav-tabs .language-dropdown {
  position: fixed !important;
  z-index: 10002;
  top: unset;
  right: unset;
  left: unset;
}

/* Standalone language selector (for login page) */
.language-button {
  background: color-mix(in srgb, var(--white) 20%, transparent);
  color: var(--white);
  border: 0.0625rem solid color-mix(in srgb, var(--white) 30%, transparent);
  padding: 0.5rem 1rem;
  border-radius: var(--bs-border-radius);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
  backdrop-filter: blur(0.625rem);
}

.language-button:hover {
  background: color-mix(in srgb, var(--white) 30%, transparent);
  border-color: color-mix(in srgb, var(--white) 50%, transparent);
}

.language-option {
  width: 100%;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--shades-250);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: color 0.2s ease;
}

.language-option:hover {
  color: var(--shades-600);
}

.language-option.active {
  color: var(--shades-600);
}

.language-option i.fa-check {
  font-size: 0.75rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.language-option.active i.fa-check {
  opacity: 1;
}

/* Animation for smooth transitions */
#main-app, #login-overlay {
  transition: opacity 0.3s ease-in-out;
}

/* Footer Styles */
.site-footer {
  width: 100%;
  height: 2.7rem;
  text-align: center;
  padding: 0.9375rem 1.25rem;
  background: var(--shades-50);
  color: var(--shades-300);
  font-size: 0.8125rem;
  z-index: 100;
  margin-top: auto;
}

.site-footer p {
  margin: 0;
  padding: 0;
}

.chat-container {
  width: 100%;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@media (max-width: 768px) {
  .nav-tab {
    white-space: nowrap;
  }

  .language-dropdown {
    min-width: 8.75rem;
  }

  .language-option {
    padding: 0.625rem 0.875rem;
    font-size: 0.8125rem;
  }

  .main-title {
    font-size: 1rem;
  }

  .title-container {
    /* Leave enough room on both sides so centered logo+title clears the fixed auth button */
    padding: 0.5rem 4rem 0.5rem 4rem;
    gap: 0.5rem;
  }

  .title-container .logo {
    height: 1.75rem;
  }

  .site-footer {
    font-size: 0.75rem;
    padding: 0.625rem;
  }

  /* Push subtitle text away from the fixed auth button (top-left, right-edge ~4.375rem).
     Symmetric padding keeps the text visually centred. */
  .subtitle {
    font-size: 0.875rem;
    padding-left: 4rem;
    padding-right: 4rem;
  }

}
