:root {
  --ecount-blue: #0A7CC1;
  --ecount-dark-blue: #1A3F6F;
  --ecount-light-blue: #E8F4FC;
}

.ecount-navbar {
  background-color: var(--ecount-blue);
}

.ecount-navbar .nav-link {
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 4px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.ecount-navbar .nav-link:hover,
.ecount-navbar .nav-link:focus {
  color: #fff;
  background-color: rgba(255, 255, 255, 0.12);
}

.search-hero {
  background: var(--ecount-light-blue);
  padding: 3rem 1rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 2rem;
}

.search-hero h1 {
  color: var(--ecount-dark-blue);
}

.search-box {
  max-width: 600px;
  margin: 1.5rem auto 0;
}

.search-box .input-group {
  position: relative;
}

.search-box .search-icon {
  position: absolute;
  left: 0.9rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ecount-blue);
  pointer-events: none;
  z-index: 5;
}

.search-box .search-icon.search-spinner {
  display: none;
}

.search-box.is-loading .search-icon.search-static {
  display: none;
}

.search-box.is-loading .search-icon.search-spinner {
  display: inline-block;
}

/* Bootstrap's own .spinner-border is a pure CSS (border + animation) component bundled in the
   self-hosted bootstrap.min.css - unlike an icon-font glyph, it can never render as a blank/broken
   "tofu" box if a web font is slow to load or briefly unavailable. */
.search-icon.search-spinner {
  width: 1rem;
  height: 1rem;
  color: var(--ecount-blue);
}

.search-box input[type="search"] {
  padding-left: 2.3rem;
}

/* Search-as-you-type suggestion dropdown */
#search-suggestions {
  width: 100%;
  margin-top: 0.35rem;
  border: 1px solid #e7ecf1;
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  overflow: hidden;
  max-height: 320px;
  overflow-y: auto;
}

#search-suggestions:empty {
  display: none;
  border: none;
  box-shadow: none;
}

#search-suggestions a.list-group-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-align: left;
  border: none;
  border-bottom: 1px solid #f0f2f5;
  padding: 0.65rem 0.9rem;
}

#search-suggestions a.list-group-item:last-child {
  border-bottom: none;
}

#search-suggestions a.list-group-item:hover {
  background: var(--ecount-light-blue);
}

#search-suggestions a.list-group-item i {
  color: var(--ecount-blue);
}

.btn-ecount {
  background-color: var(--ecount-blue);
  border-color: var(--ecount-blue);
  color: #fff;
}

.btn-ecount:hover {
  background-color: var(--ecount-dark-blue);
  border-color: var(--ecount-dark-blue);
  color: #fff;
}

.module-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--ecount-light-blue);
  color: var(--ecount-dark-blue);
  padding: 0.45rem 1rem;
  border-radius: 20px;
  margin: 0.25rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.15s ease, transform 0.1s ease;
}

.module-chip:hover {
  background: var(--ecount-blue);
  color: #fff;
  transform: translateY(-1px);
}

.breadcrumb-module {
  color: var(--ecount-dark-blue);
}

.text-ecount-blue {
  color: var(--ecount-blue);
}

/* Shared article list/card style - used on Search, related-articles, homepage, etc. so every
   listing of articles on the site looks the same instead of each page inventing its own markup. */
.article-card-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.article-card {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.9rem 1rem;
  border: 1px solid #e7ecf1;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  text-align: left;
  transition: box-shadow 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

.article-card:hover {
  box-shadow: 0 4px 14px rgba(10, 124, 193, 0.12);
  border-color: var(--ecount-blue);
  transform: translateY(-1px);
}

.article-card-icon {
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--ecount-light-blue);
  color: var(--ecount-blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.article-card-body {
  flex: 1;
  min-width: 0;
}

.article-card-title {
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--ecount-dark-blue);
}

.article-card-meta .badge {
  font-weight: 500;
}

.related-sidebar a {
  display: block;
  padding: 0.5rem 0;
  border-bottom: 1px solid #eee;
}

.footer-ecount {
  background: #f8f9fb;
  border-top: 1px solid #e7ecf1;
  margin-top: 3rem;
}

.footer-ecount a {
  color: var(--ecount-dark-blue);
  text-decoration: none;
}

.footer-ecount a:hover {
  text-decoration: underline;
}

/* FAQ accordion - shared look between the standalone /faqs page and the in-article FAQ section. */
.faq-accordion .accordion-item {
  border: 1px solid #e7ecf1;
  border-radius: 8px !important;
  margin-bottom: 0.6rem;
  overflow: hidden;
}

.faq-accordion .accordion-button {
  font-weight: 600;
  color: var(--ecount-dark-blue);
}

.faq-accordion .accordion-button:not(.collapsed) {
  background-color: var(--ecount-light-blue);
  color: var(--ecount-dark-blue);
}

.faq-accordion .accordion-button:focus {
  box-shadow: none;
}

#chat-widget {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 1050;
}

#chat-toggle-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--ecount-blue);
  color: #fff;
  border: none;
  font-size: 1.6rem;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  cursor: pointer;
}

#chat-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.25rem;
  width: 380px;
  height: 640px;
  max-height: calc(100vh - 7rem);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width 0.25s ease, height 0.25s ease, top 0.25s ease, bottom 0.25s ease,
              right 0.25s ease, border-radius 0.25s ease;
}

#chat-panel.chat-fullscreen {
  top: 1rem;
  bottom: 1rem;
  right: 1rem;
  left: 1rem;
  width: auto;
  height: auto;
  max-height: none;
  border-radius: 12px;
}

@media (max-width: 576px) {
  #chat-panel {
    top: 1rem;
    bottom: 1rem;
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    height: auto;
    max-height: none;
  }
}

#chat-header {
  background: var(--ecount-dark-blue);
  color: #fff;
  padding: 0.8rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

#chat-header span {
  flex: 1;
  font-weight: 600;
  font-size: 1rem;
}

#chat-header button {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.2rem 0.35rem;
  border-radius: 4px;
  line-height: 1;
}

#chat-header button:hover {
  background: rgba(255, 255, 255, 0.15);
}

#chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  /* Explicit px (not rem) so the bump is a real +2px regardless of the page's responsive root
     font-size (14px mobile / 16px desktop) - "at least 2px more" than the previous 14px/16px. */
  font-size: 16px;
  line-height: 1.5;
  background: #fafbfc;
}

@media (min-width: 768px) {
  #chat-messages {
    font-size: 18px;
  }
}

.chat-msg {
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.9rem;
  border-radius: 10px;
  max-width: 88%;
}

.chat-msg-text {
  white-space: pre-wrap;
}

.chat-msg-user {
  background: var(--ecount-blue);
  color: #fff;
  margin-left: auto;
  border-bottom-right-radius: 2px;
}

.chat-msg-assistant {
  background: #fff;
  border: 1px solid #e7ecf1;
  border-bottom-left-radius: 2px;
}

/* "Related Articles" disclosure under an assistant reply - a single clearly-labeled toggle instead
   of a run-together line of links, expanding into a proper one-per-line list when clicked. */
.chat-sources-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin-top: 0.5rem;
  background: none;
  border: 1px solid var(--ecount-blue);
  color: var(--ecount-blue);
  font-size: 0.82rem;
  padding: 0.25rem 0.65rem;
  border-radius: 14px;
  cursor: pointer;
}

.chat-sources-toggle:hover {
  background: var(--ecount-light-blue);
}

.chat-sources-list {
  margin-top: 0.4rem;
  display: flex;
  flex-direction: column;
  border: 1px solid #e7ecf1;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.chat-sources-list a {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: var(--ecount-dark-blue);
  text-decoration: none;
  border-bottom: 1px solid #f0f2f5;
}

.chat-sources-list a:last-child {
  border-bottom: none;
}

.chat-sources-list a:hover {
  background: var(--ecount-light-blue);
}

#chat-loading {
  padding: 0 1rem 0.5rem;
  font-size: 0.9rem;
  color: #666;
}

#chat-form {
  display: flex;
  border-top: 1px solid #eee;
  padding: 0.65rem;
  gap: 0.5rem;
}

#chat-input {
  flex: 1;
  border: 1px solid #ccc;
  border-radius: 20px;
  padding: 0.5rem 1rem;
  font-size: 1rem;
}

#chat-form button[type="submit"] {
  background: var(--ecount-blue);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  flex: none;
  font-size: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  #chat-panel, #chat-toggle-btn {
    transition: none !important;
  }
}

html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}