
.mode-toggle {
  display: inline-flex;
  gap: 2px;
  background: rgba(255, 255, 255, 0.15);
  padding: 3px;
  border-radius: var(--ds-radius-8, 8px);
  margin-top: 20px;
}

.mode-btn {
  position: relative;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  font: 700 13px/1 var(--ds-font-display, sans-serif);
  padding: 8px 18px;
  border-radius: 6px;
  cursor: pointer;
}
.mode-btn:disabled {
  opacity: 0.45;
  cursor: default;
}
.mode-btn.active {
  background: var(--ds-color-white, #fff);
  color: var(--ds-color-navy, #002244);
}
#modeAskBtn.active {
  background: #f0b429;
  color: #3a2a00;
}
.ai-badge {
  position: relative;
  display: inline-block;
  margin-left: 7px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0b429;
  color: #3a2a00;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  vertical-align: middle;
}
#modeAskBtn.active .ai-badge,
.ask-search button .ai-badge {
  background: #3a2a00;
  color: #f0b429;
}
.ask-search button .ai-badge { font-size: 12px; }
@media (prefers-reduced-motion: no-preference) {
  #modeAskBtn:not(:disabled):not(.active) .ai-badge {
    animation: ai-shimmer 2.6s ease-in-out infinite;
  }
}
@keyframes ai-shimmer {
  0%, 100% { box-shadow: 0 0 0 0 rgba(240, 180, 41, 0); }
  50% { box-shadow: 0 0 7px 2px rgba(240, 180, 41, .6); }
}
#modeAskBtn:not(:disabled):not(.active) .ai-badge::after {
  content: '';
  position: absolute;
  top: -3px;
  right: -3px;
  width: 8px;
  height: 8px;
  background: #3a2a00;
  box-shadow: 0 0 0 1.5px #fff;
  clip-path: polygon(50% 0%, 61% 36%, 100% 50%, 61% 64%, 50% 100%, 39% 64%, 0% 50%, 39% 36%);
  pointer-events: none;
}
@media (prefers-reduced-motion: no-preference) {
  #modeAskBtn:not(:disabled):not(.active) .ai-badge::after {
    animation: spark-twinkle 2.2s ease-in-out infinite;
  }
}
@keyframes spark-twinkle {
  0%, 100% { opacity: .55; transform: scale(.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.15) rotate(8deg); }
}

.connect-search { position: relative; max-width: 640px; margin-top: 20px; }
.connect-search[hidden] { display: none; }
.connect-inline {
  display: flex; align-items: center; gap: 12px;
  background: var(--ds-color-white, #fff);
  border-radius: var(--ds-radius-12, 12px);
  padding: 4px 4px 4px 15px;
  box-shadow: 0 12px 34px rgba(0, 10, 25, .30);
  text-decoration: none;
}
.ci-ic {
  flex: 0 0 auto; width: 30px; height: 30px;
  border-radius: var(--ds-radius-10, 10px);
  background: var(--ds-color-wb-blue, #003087);
  color: #fff;
  display: grid; place-items: center;
}
.ci-ic svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ci-txt {
  flex: 1; min-width: 0;
  font-size: var(--ds-text-15, 15px);
  font-weight: 700;
  color: var(--ds-color-navy, #002244);
  font-family: var(--ds-font-display, sans-serif);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ci-go {
  flex: 0 0 auto;
  background: var(--ds-color-wb-blue, #003087);
  color: #fff;
  border-radius: var(--ds-radius-8, 8px);
  padding: 8px 18px;
  font-size: var(--ds-text-14, 14px); font-weight: 700;
  font-family: var(--ds-font-display, sans-serif);
}

.ask-search { position: relative; max-width: 640px; margin-top: 20px; }
.ask-search[hidden] { display: none; }
.ask-search form {
  display: flex; align-items: center; gap: 8px;
  background: var(--ds-color-white, #fff);
  border-radius: var(--ds-radius-12, 12px);
  padding: 4px 4px 4px 15px;
  box-shadow: 0 0 0 2px #f0b429, 0 12px 34px rgba(0, 10, 25, .30);
}
.ask-search .si { flex: 0 0 auto; color: var(--ds-color-text-muted, #627288); display: flex; align-items: center; }
.ask-search input {
  flex: 1; min-width: 0; border: 0; outline: 0;
  font-size: var(--ds-text-16, 16px);
  background: transparent;
  color: var(--ds-color-text-heading, #1a2433);
  font-family: var(--ds-font-sans, sans-serif);
}
.ask-search input::placeholder { color: #667381; }
.ask-search button {
  flex: 0 0 auto;
  background: #f0b429;
  color: #3a2a00; border: 0; border-radius: var(--ds-radius-8, 8px);
  padding: 8px 18px; font-size: var(--ds-text-14, 14px); font-weight: 700;
  cursor: pointer; font-family: var(--ds-font-display, sans-serif);
}
.ask-search button:hover { background: #dca21c; }
.ask-search button:disabled { opacity: .6; cursor: not-allowed; }

.ask-search .ask-panel-section {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
}
.ask-panel-section[hidden] { display: none; }

.ask-panel {
  width: 100%;
  margin: 0 auto;
  background: var(--ds-color-white, #fff);
  border: 1px solid rgba(0, 34, 68, .12);
  border-radius: var(--ds-radius-12, 12px);
  box-shadow: 0 18px 44px rgba(0, 10, 25, .22);
  padding: 18px 20px;
  text-align: left;
  color: var(--ds-color-text-heading, #1a2433);
  font-size: 16px;
  line-height: 1.55;
  max-height: 60vh;
  overflow-y: auto;
}

.ask-turn + .ask-turn { margin-top: 18px; padding-top: 18px; border-top: 1px solid #e5e9ee; }
.ask-question { font-weight: 700; color: var(--ds-color-navy, #002244); margin-bottom: 8px; }
.ask-answer a { color: var(--ds-color-text-accent-link, #0a6bb0); font-weight: 600; text-decoration: underline; }
.ask-answer p { margin: 0 0 10px; }
.ask-answer p:last-child { margin-bottom: 0; }
.ask-answer ul { margin: 0 0 10px; padding-left: 22px; }
.ask-answer li { margin-bottom: 4px; }
.ask-answer li:last-child { margin-bottom: 0; }

.ask-status {
  display: flex; align-items: center; gap: 10px;
  color: var(--ds-color-text-muted, #627288);
  font-size: 14px; font-weight: 600;
  margin-top: 8px;
}
.ask-status[hidden] { display: none; }
.ask-status .dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #009fda;
  animation: ask-pulse 1.1s ease-in-out infinite;
}
@keyframes ask-pulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }

.ask-disclaimer {
  color: var(--ds-color-text-muted, #627288);
  font-size: 12px;
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px solid #eef1f4;
}

.ask-charts:not(:empty) { margin-top: 10px; }
.ask-chart-link {
  display: inline-block;
  margin-top: 10px;
  padding: 8px 14px;
  border: 1px solid #00a651;
  color: #00a651;
  border-radius: var(--ds-radius-8, 8px);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
}
.ask-chart-link:hover { background: #00a651; color: #fff; }

.ask-notice {
  color: var(--ds-color-text-muted, #627288);
  font-size: 14px;
  margin-top: 8px;
}

.ask-restart-link {
  display: inline-block;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ds-color-text-accent-link, #0a6bb0);
  font-size: 13px;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.ask-verify {
  display: flex;
  justify-content: center;
  margin: 10px 0 4px;
  padding: 14px 12px;
  background: var(--ds-color-surface-muted, #f5f8fa);
  border: 2px solid var(--ds-color-accent, #1b6ec2);
  border-radius: 8px;
}
.ask-verify[hidden] { display: none; }

.ask-verify-prompt {
  color: var(--ds-color-text, #1b2733);
  font-size: 16px;
  font-weight: 700;
  margin-top: 14px;
  margin-bottom: 0;
}

@media (max-width: 768px) {
  .ask-search { margin-top: 16px; }
  .ask-search button { padding: 8px 14px; }
  .ask-panel { max-height: 50vh; }
  .connect-search { margin-top: 16px; }
  .connect-inline { padding: 6px 6px 6px 12px; gap: 10px; align-items: center; }
  .ci-txt { white-space: normal; text-overflow: clip; font-size: var(--ds-text-14, 14px); line-height: 1.25; }
  .ci-ic { width: 28px; height: 28px; }
  .ci-ic svg { width: 15px; height: 15px; }
  .ci-go { padding: 9px 13px; font-size: var(--ds-text-13, 13px); }
}

.hero-search button, .ask-search button, .ci-go {
  height: 33px; padding-top: 0; padding-bottom: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; line-height: 1;
}

.ask-search .ask-panel-section { border-radius: 16px; box-shadow: 0 22px 48px rgba(0, 10, 25, .38), 0 4px 12px rgba(0, 10, 25, .2); }
.ask-search .ask-panel {
  border: 2px solid #f0b429;
  box-shadow: none;
  border-radius: 16px;
  clip-path: inset(0 round 16px);
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 34, 68, .28) transparent;
}
.ask-search .ask-panel::-webkit-scrollbar { width: 8px; }
.ask-search .ask-panel::-webkit-scrollbar-track { background: transparent; margin: 14px 0; }
.ask-search .ask-panel::-webkit-scrollbar-thumb { background: rgba(0, 34, 68, .28); border-radius: 8px; }

@media (max-width: 768px) {
  .hero-search, .ask-search, .connect-search { min-height: 47px; }
  .ci-txt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
}
