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

:root {
  --bg: #1A1A24;
  --banner-bg: #1A1924;
  --banner-text: #FDE401;
  --panel: #232332;
  --panel-2: #2b2b3d;
  --border: #3a3a52;
  --text: #f2f2f7;
  --muted: #b9b9c9;
  --accent: #FFE600;
  --danger: #ff7d7d;
  --success: #85d7a2;
  --research-query-progress-1: #015EF5;
  --research-query-progress-2: #0BB0EB;
  --research-query-progress-3: #C7E4EF;
  --research-query-progress-4: #DFEEF1;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Helvetica", "Arial", sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cursor behavior: text cursor only for real text inputs */
body :not(input):not(textarea):not([contenteditable="true"]):not([contenteditable=""]) {
  caret-color: transparent;
}

input,
textarea,
motif-input::part(input),
motif-textarea::part(textarea) {
  cursor: text;
  caret-color: auto;
}

motif-button,
motif-button::part(button),
.tool-card-link,
.search-suggest-item,
.common-topics-topic-item,
.topic-option {
  cursor: pointer;
}

motif-select,
motif-select-option,
motif-checkbox,
motif-tag {
  cursor: pointer;
}

.app-header {
  width: 100%;
}

.app-header-left-components,
.app-header-right-components {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
}

.ey-logo-img {
  display: block;
  height: 34px;
  width: auto;
  max-width: 100px;
}

.app-header-subtitle {
  color: var(--text-colors-default-secondary);
  font-size: 12px;
  line-height: 1.5;
  padding: 0 16px 8px 16px;
  max-width: 1200px;
}

.app-header .banner-user,
.app-header .sign-out-btn,
.app-header .user-name-text,
.app-header .user-avatar {
  color: var(--text-colors-default-primary);
}

.banner-user {
  display: none;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
}

.sign-out-btn {
  display: inline-flex;
}

.content-container {
  flex: 1;
  display: flex;
  min-height: 0;
}

.navigation-pane {
  position: relative;
  width: 220px;
  min-width: 220px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  padding: 16px 0;
}

.navigation-pane.collapsed {
  display: none;
}

.navigation-pane ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.navigation-pane li {
  margin-bottom: 10px;
}

.nav-button {
  width: 100%;
  display: block;
}

.nav-button::part(button) {
  width: 100%;
  justify-content: flex-start;
  border-radius: 0;
}

.nav-collapse-toggle {
  position: absolute;
  top: 14px;
  right: -13px;
  width: 26px;
  z-index: 3;
}

.nav-collapse-toggle::part(button) {
  width: 26px;
  min-height: 34px;
  border-radius: 8px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.window-expand-toggle {
  position: fixed;
  top: 176px;
  left: 0;
  width: 26px;
  height: 34px;
  z-index: 1250;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-8px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.window-expand-toggle.visible {
  opacity: 0.94;
  pointer-events: auto;
  transform: translateX(0);
}

.window-expand-toggle::part(button) {
  width: 26px;
  min-height: 34px;
  border-radius: 8px;
  padding: 0;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.window-expand-toggle:hover::part(button),
.window-expand-toggle:focus-within::part(button) {
  border-color: rgba(255, 255, 255, 0.42);
  background: rgba(52, 57, 79, 0.68);
}

.dock-bar {
  position: fixed;
  top: 172px;
  left: 44px;
  width: 70px;
  z-index: 1200;
  padding: 8px 8px 10px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 31, 45, 0.12);
  backdrop-filter: blur(0px);
  opacity: 0;
  transform: translateY(-4px);
  pointer-events: none;
  user-select: none;
  transition:
    opacity 280ms ease,
    background-color 280ms ease,
    border-color 280ms ease,
    backdrop-filter 280ms ease,
    transform 220ms ease;
}

.dock-bar.visible {
  opacity: 0.18;
  pointer-events: auto;
  transform: translateY(0);
}

.dock-bar.visible:hover,
.dock-bar.visible:focus-within,
.dock-bar.dragging {
  opacity: 0.92;
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(35, 37, 52, 0.48);
  backdrop-filter: blur(14px);
}

.dock-drag-handle {
  width: 28px;
  height: 4px;
  border-radius: 999px;
  margin: 2px auto 9px;
  background: rgba(255, 255, 255, 0.28);
}

.dock-nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dock-nav-button {
  width: 100%;
  display: block;
}

.dock-nav-button::part(button) {
  width: 100%;
  min-height: 44px;
  padding: 5px 0;
  justify-content: center;
  border-radius: 12px;
  background: transparent;
  transition: background-color 220ms ease, opacity 220ms ease;
}

.dock-bar.visible .dock-nav-button::part(button) {
  opacity: 0.45;
}

.dock-bar.visible:hover .dock-nav-button::part(button),
.dock-bar.visible:focus-within .dock-nav-button::part(button),
.dock-bar.dragging .dock-nav-button::part(button) {
  opacity: 1;
}

.dock-nav-button.active::part(button) {
  background: rgba(255, 255, 255, 0.16);
}

.dock-icon-shell {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.12);
}

.dock-icon-circle {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
}

.dock-icon-circle svg {
  color: rgba(255, 255, 255, 0.95);
}

.dock-expand-button {
  margin-top: 10px;
  width: 26px;
  margin-left: auto;
  margin-right: auto;
  display: block;
}

.dock-expand-button::part(button) {
  width: 26px;
  min-height: 34px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.main-panel {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  background: var(--bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.main-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.main-panel:hover {
  scrollbar-width: thin;
}

.main-panel:hover::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.main-panel:hover::-webkit-scrollbar-thumb {
  background: #4b4b66;
  border-radius: 999px;
}

.main-panel:hover::-webkit-scrollbar-track {
  background: transparent;
}

.content-section {
  display: none;
}

.content-section.active {
  display: block;
}

#browse-section {
  will-change: transform;
}

#browse-section.rubberbanding {
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.content-section h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

.main-panel p,
.agent-description {
  color: var(--muted);
}

.browse-shell,
.response-area,
.query-response-pair,
.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
}

.browse-shell {
  padding: 16px;
}

.browse-filter-bar {
  margin: 16px 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 0;
}

.browse-filter-label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  min-height: var(--filter-control-height, 44px);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topic-filter {
  position: relative;
}

.search-filter {
  position: relative;
  margin-left: auto;
}

.filter-button,
.sort-select,
.submit-button,
.clear-button {
  display: block;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #fff;
  align-items: center;
  justify-content: center;
}

.auth-overlay-text {
  font-size: 1.1rem;
  color: #555;
}

.rendered-diagram-img {
  max-width: 100%;
  border: 1px solid #ddd;
  border-radius: 4px;
  margin: 8px 0;
}

.filter-button,
.sort-select {
  min-height: 40px;
}

.filter-button::part(button) {
  width: 100%;
  justify-content: flex-start;
  padding-left: 14px;
  padding-right: 14px;
  min-height: var(--filter-control-height, 2.8571428571rem);
  height: var(--filter-control-height, 2.8571428571rem);
  color: #A4A3B1;
  font-weight: 300;
}

.search-input {
  display: block;
  width: 220px;
  --input-height: var(--filter-control-height, 2.8571428571rem);
  --input-group-input-padding-horizontal: 0;
}

.search-suggest-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 100%;
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  padding: 6px;
  z-index: 30;
}

.search-suggest-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
}

.search-suggest-item:hover {
  background: var(--panel-2);
}

.search-suggest-item.selected {
  background: var(--panel-2);
  color: var(--accent);
}

.filter-button {
  cursor: pointer;
  text-align: left;
}

.sort-select {
  min-width: 180px;
  display: block;
  --input-height: var(--filter-control-height, 2.8571428571rem);
  --input-group-input-padding-horizontal: 14px;
}

.filter-button:focus-visible,
.search-input:focus-visible,
.sort-select:focus-visible,
.submit-button:focus-visible,
.clear-button:focus-visible,
motif-textarea:focus-visible,
.nav-button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.topic-filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 320px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
  padding: 8px;
  z-index: 30;
}

.topic-option {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  padding: 6px;
  color: var(--text);
}

.topic-option:hover {
  background: var(--panel-2);
}

.topic-option motif-checkbox[disabled] {
  opacity: 0.55;
}

.browse-summary {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 10px;
}

.common-topics-bar {
  margin: 0 0 12px;
  padding: 5px 20px;
  border-top: 2px solid #FFE600;
  border-bottom: 2px solid #FFE600;
  background: #1A1A24;
  display: none;
  align-items: center;
  gap: 12px;
  min-height: 38px;
}

.common-topics-label {
  color: #FFE600;
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.common-topics-list {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 14px;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.common-topics-topic-item {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  flex: 0 0 auto;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #FFFFFF;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.3;
  padding: 2px 0;
  border-radius: 4px;
  text-align: left;
}

.common-topics-topic-item:hover {
  color: #FFE600;
}

.common-topics-topic-item:focus-visible {
  outline: 2px solid #FFE600;
  outline-offset: 2px;
}

.common-topics-topic-item.selected {
  color: #FFE600;
}

.common-topics-more {
  position: relative;
  margin-left: auto;
  flex: 0 0 auto;
}

.common-topics-more-button {
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #FFFFFF;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  line-height: 1.3;
  padding: 2px 0;
  border-radius: 4px;
  text-transform: lowercase;
}

.common-topics-more-button:hover,
.common-topics-more-button.selected {
  color: #FFE600;
}

.common-topics-more-button:focus-visible {
  outline: 2px solid #FFE600;
  outline-offset: 2px;
}

.common-topics-more-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 180px;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #FFE600;
  border-radius: 8px;
  background: #1A1A24;
  padding: 8px 10px;
  display: none;
  z-index: 35;
}

.common-topics-more-item {
  display: block;
  width: 100%;
  border: 0;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  color: #FFFFFF;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  line-height: 1.35;
  padding: 4px 0;
}

.common-topics-more-item:hover,
.common-topics-more-item.selected {
  color: #FFE600;
}

.browse-list {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}

.browse-file-list {
  list-style: none;
}

.browse-file-item {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.browse-file-item:last-child {
  border-bottom: none;
}

.file-name,
.file-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  display: block;
  width: 100%;
}

.file-title {
  justify-content: flex-start;
}

.file-title::part(button),
.file-summary::part(button) {
  width: 100%;
  height: auto;
  min-height: 0;
  text-align: left;
  justify-content: flex-start;
  align-items: flex-start;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  cursor: pointer;
  user-select: none;
}

.file-title::part(button) {
  font-size: var(--motif-font-size-lg, 1rem);
  font-weight: var(--motif-font-weight-medium, 600);
  color: #FFE600;
}

.file-title:hover::part(button),
.file-title:focus-within::part(button) {
  color: #FFE600;
}

.file-summary {
  display: block;
  width: 100%;
  justify-content: flex-start;
  line-height: 1.5;
}

.file-summary::part(button) {
  font-size: var(--motif-font-size-sm, 0.875rem);
  font-weight: var(--motif-font-weight-normal, 400);
  color: var(--motif-color-neutral-100, #f2f2f7);
  line-height: 1.5;
}

.file-summary:hover::part(button),
.file-summary:focus-within::part(button) {
  color: var(--motif-color-neutral-100, #ffffff);
}

.file-meta {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  font-size: 12px;
  color: var(--muted);
}

.topic-pill {
  display: inline-flex;
  background: #1A1924;
  border: 1px solid #FFE600;
  border-radius: 999px;
  --chip-tags-text-color: #FFE600 !important;
  --chip-tags-border-color: #FFE600 !important;
  --chip-tags-border-width: 1px !important;
  --chip-tags-background-color: #1A1924 !important;
  --chip-tags-button-focus-border-color: transparent !important;
  --chip-tags-button-focus-border-width: 0 !important;
  --chip-tags-border-radius: 999px !important;
}

.info_ribbon {
  --share-button-height: 24px;
  --share-button-width: 36px;
  gap: 15px;
}

.share-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.copy_reader_link::part(button),
.open_reader_in_new_tab::part(button) {
  width: var(--share-button-width, 36px);
  height: var(--share-button-height, 24px);
  min-height: var(--share-button-height, 24px);
  min-width: var(--share-button-width, 36px);
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: background-color 3s ease, border-color 3s ease;
}

.copy_reader_link::part(button):hover,
.open_reader_in_new_tab::part(button):hover {
  background: rgba(255, 255, 255, 0.32);
  border-color: rgba(255, 255, 255, 0.45);
}

.copy_reader_link svg,
.open_reader_in_new_tab svg {
  pointer-events: none;
}

.copy_reader_link.copied::part(button) {
  animation: shareButtonToIdle 3s ease forwards;
}

.copy_reader_link.copy-failed::part(button) {
  background: rgba(255, 107, 107, 0.26);
  border-color: rgba(255, 107, 107, 0.9);
}

.copy-link-popup {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 240px;
  max-width: 320px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.3;
  color: #ffffff;
  text-align: center;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  z-index: 45;
}

.copy-link-popup.visible {
  animation: copyLinkPopupFade 3s ease forwards;
}

@keyframes shareButtonToIdle {
  0% {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(255, 255, 255, 0.95);
  }
  100% {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.28);
  }
}

@keyframes copyLinkPopupFade {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(-2px);
  }
  15% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  70% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(-2px);
  }
}

.reader-page-shell {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.preview-modal-title {
  color: #fff;
}

.preview-modal-body {
  max-height: min(70vh, 720px);
  overflow: auto;
  background: #1A1A24 !important;
  color: #fff;
  line-height: 1.65;
}

.reader-title {
  color: #fff;
  margin-bottom: 12px;
}

.reader-body {
  overflow: auto;
  color: #fff;
  line-height: 1.65;
  max-height: calc(100vh - 280px);
}

.reader-body p,
.reader-body li,
.preview-modal-body p,
.preview-modal-body li {
  color: #fff;
}

.reader-body pre,
.preview-modal-body pre {
  background: #12121a;
  border: 1px solid #323248;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.preview-modal-body code {
  background: rgba(175, 184, 193, 0.2);
  color: #ffffff;
  border-radius: 6px;
  padding: 0.15em 0.35em;
}

.preview-modal-body pre code {
  display: block;
  padding: 0;
  margin: 0;
  background: transparent;
  color: #e6edf3;
  border-radius: 0;
  white-space: pre;
}

.preview-modal-body table {
  display: block;
  overflow-x: auto;
}

.preview-modal-body table,
.preview-modal-body thead,
.preview-modal-body tbody,
.preview-modal-body tfoot,
.preview-modal-body tr,
.preview-modal-body th,
.preview-modal-body td {
  background-color: #1A1A24;
  color: #ffffff;
}

.preview-modal-body blockquote {
  color: var(--muted);
  border-left-color: #5b6076;
}

.preview-modal-body hr {
  border-bottom-color: #3d4258;
}

.browse-load-indicator {
  margin-top: 10px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}

.back-to-top-btn {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 40;
  display: block;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition-property: opacity, visibility;
  transition-timing-function: ease, linear;
  transition-duration: 2s, 0s;
  transition-delay: 0s, 2s;
}

.back-to-top-btn.visible {
  visibility: visible;
  opacity: 0.3;
  pointer-events: auto;
  transition-duration: 0.2s, 0s;
  transition-delay: 0s, 0s;
}

.back-to-top-btn.visible:hover {
  opacity: 0.85;
}

.back-to-read-btn {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  z-index: 41;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 2s ease, visibility 0s linear 2s;
}

.back-to-read-btn.visible {
  opacity: 0.9;
  visibility: visible;
  pointer-events: auto;
  transition: opacity 2s ease, visibility 0s linear 0s;
}

.back-to-read-btn.visible:hover {
  opacity: 1;
}

.prompt-interface {
  margin-top: 14px;
}

.prompt-interface motif-textarea {
  width: 100%;
  min-height: 120px;
}

.query-progress-shell {
  position: relative;
  border-radius: 8px;
}

.query-progress-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid var(--research-query-progress-1);
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  z-index: 2;
  transition: opacity 3.5s ease;
}

.query-progress-shell.query-progress-active::after {
  opacity: 1;
  animation: queryProgressBorderCycle 7.5s ease-in-out infinite;
}

.query-progress-shell.query-progress-active motif-textarea {
  --text-area-padding-right: 44px;
}

.query-progress-shell.query-submitted motif-textarea {
  --text-area-border-color: transparent;
  --text-area-hover-border-color: transparent;
  --text-area-focus-border-color: transparent;
  --text-area-border-width: 0px;
  --text-area-hover-border-width: 0px;
  --text-area-focus-border-width: 0px;
}

.query-progress-clock {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 20px;
  height: 20px;
  border: 1.4px solid var(--research-query-progress-2);
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(14, 20, 39, 0.95) 0%, rgba(7, 16, 36, 0.98) 62%, rgba(1, 94, 245, 0.32) 100%);
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
  z-index: 3;
  transition: opacity 3.5s ease, transform 3.5s ease;
  overflow: hidden;
}

.query-progress-shell.query-progress-active .query-progress-clock {
  opacity: 1;
  transform: scale(1);
}

.query-progress-clock::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(
    from 0deg,
    rgba(1, 94, 245, 0.06) 0deg,
    rgba(1, 94, 245, 0.16) 56deg,
    rgba(1, 94, 245, 0.38) 132deg,
    rgba(11, 176, 235, 0.58) 212deg,
    rgba(116, 210, 245, 0.78) 292deg,
    rgba(218, 244, 255, 0.92) 340deg,
    rgba(255, 255, 255, 0.99) 358deg,
    rgba(1, 94, 245, 0.06) 360deg
  );
  animation: queryRadarDiscSweep 2.2s linear infinite;
}

.query-progress-clock::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
  transform-origin: 50% 100%;
  transform: translate(-50%, -100%) rotate(0deg);
  box-shadow: 0 0 6px rgba(255, 255, 255, 0.8);
  animation: queryRadarLineSweep 2.2s linear infinite;
}

@keyframes queryRadarDiscSweep {
  to {
    transform: rotate(360deg);
  }
}

@keyframes queryRadarLineSweep {
  to {
    transform: translate(-50%, -100%) rotate(360deg);
  }
}

@keyframes queryProgressBorderCycle {
  0% {
    border-color: var(--research-query-progress-1);
  }
  16.67% {
    border-color: var(--research-query-progress-2);
  }
  33.33% {
    border-color: var(--research-query-progress-3);
  }
  50% {
    border-color: var(--research-query-progress-4);
  }
  66.67% {
    border-color: var(--research-query-progress-3);
  }
  83.33% {
    border-color: var(--research-query-progress-2);
  }
  100% {
    border-color: var(--research-query-progress-1);
  }
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.submit-button,
.clear-button {
  display: block;
}

.submit-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.response-area {
  margin-top: 16px;
  padding: 14px;
}

.query-response-pair {
  padding: 16px;
  margin-bottom: 14px;
}

.query-section {
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.query-header,
.response-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.query-text {
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px;
  color: var(--text);
  white-space: pre-wrap;
}

.model-badge {
  background: rgba(255, 230, 0, 0.16);
  border: 1px solid rgba(255, 230, 0, 0.35);
  color: var(--accent);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
}

.response-body {
  color: #fff;
  line-height: 1.65;
}

.response-body.streaming-response {
  white-space: pre-wrap;
}

.response-body p,
.response-body li {
  color: #fff;
}

.response-body code {
  background: #171720;
  border: 1px solid #323248;
  border-radius: 4px;
  padding: 1px 5px;
}

.response-body pre {
  background: #12121a;
  border: 1px solid #323248;
  border-radius: 8px;
  padding: 12px;
  overflow-x: auto;
}

.response-body .markdown-body .code-block {
  position: relative;
}

.response-body .markdown-body .code-copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: 1px solid #4b4f64;
  border-radius: 6px;
  background: #1b1f2b;
  color: #f2f5ff;
  padding: 0;
  cursor: pointer;
}

.response-body .markdown-body .code-copy-button:hover {
  background: #252a3a;
}

.response-body .markdown-body .code-block .code-block-pre {
  margin-top: 0;
  padding-top: 38px;
}

.response-body .markdown-body .code-block .code-block-code {
  display: block;
}

.response-body .markdown-body .code-block .code-line {
  display: grid;
  grid-template-columns: minmax(2ch, auto) 1fr;
  column-gap: 12px;
}

.response-body .markdown-body .code-block .code-line-number {
  color: #8f98b2;
  text-align: right;
  user-select: none;
}

.response-body .markdown-body .code-block .code-line-text {
  white-space: pre;
}

.response-body .markdown-body .code-block .code-line-text:empty::before {
  content: ' ';
}

.response-body .mermaid-code-details {
  margin-top: 8px;
}

.response-body .mermaid-code-summary {
  cursor: pointer;
  color: #FFE600;
  margin-bottom: 8px;
}

.response-body .mermaid-code-details:not([open]) > *:not(summary) {
  display: none;
}

.reference-link {
  display: inline-block;
  margin-left: 2px;
  font-size: 0.75em;
  line-height: 1;
  vertical-align: super;
  color: #FFE600;
  text-decoration: none;
  cursor: pointer;
}

.reference-link:hover {
  text-decoration: underline;
}

.reference-target {
  scroll-margin-top: 88px;
}

.reference-target-inner {
  display: inline;
}

.reference-title {
  margin-right: 6px;
}

.reference-url-anchor {
  display: none;
  margin-right: 6px;
  font-size: 0.72rem;
  color: #9ecbff;
  text-decoration: underline;
  word-break: break-all;
}

.reference-url-anchor.is-visible {
  display: inline;
}

.reference-button {
  display: inline-flex;
  vertical-align: baseline;
}

.reference-button.is-hidden {
  display: none;
}

.reference-button::part(button) {
  background: transparent;
  color: var(--color-blue-400, #188CE5);
  border: none;
  padding: 1px 4px;
  font-size: 0.7rem;
  min-height: 0;
  line-height: 1.4;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.reference-button::part(button):hover {
  background: transparent;
  color: var(--color-yellow-400, #FFE600);
}

.reference-button::part(button):active {
  background: transparent;
}

@keyframes referenceGlowPulse {
  0%, 100% { background-color: transparent; }
  50% { background-color: rgba(255, 230, 0, 0.45); }
}

.reference-glow {
  animation: referenceGlowPulse 0.55s ease-in-out 2;
}

.loading {
  display: flex;
  align-items: center;
  gap: 10px;
}

.spinner {
  width: 18px;
  height: 18px;
  border: 3px solid #3b3b4f;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error-message {
  background: rgba(255, 125, 125, 0.12);
  border: 1px solid rgba(255, 125, 125, 0.45);
  color: var(--danger);
  border-radius: 8px;
  padding: 10px;
}

.success-message {
  background: rgba(133, 215, 162, 0.12);
  border: 1px solid rgba(133, 215, 162, 0.45);
  color: var(--success);
  border-radius: 8px;
  padding: 10px;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.tool-card {
  height: 100%;
}

.tool-card::part(card) {
  height: 100%;
  overflow: hidden;
}

.tool-card-link {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  gap: 0;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tool-card-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 10px;
}

.tool-thumbnail {
  --tool-accent-rgb: 89, 101, 164;
  position: relative;
  height: 170px;
  background: rgba(var(--tool-accent-rgb), 0.14);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  isolation: isolate;
}

.tool-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgba(var(--tool-accent-rgb), 0.26) 0%,
    rgba(var(--tool-accent-rgb), 0.12) 30%,
    rgba(var(--tool-accent-rgb), 0.12) 70%,
    rgba(var(--tool-accent-rgb), 0.26) 100%
  );
  z-index: 0;
}

.tool-thumbnail-frost {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(24px) saturate(115%);
  opacity: 0.38;
  transform: scale(1.1);
  z-index: 0;
}

.tool-thumbnail-image-frame {
  position: relative;
  z-index: 1;
  width: min(74%, 132px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 10%;
  background: rgba(var(--tool-accent-rgb), 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.tool-thumbnail img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  object-position: center;
  border-radius: 0;
  transition: transform 180ms ease-in-out;
}

.tool-card-link:hover .tool-thumbnail img,
.tool-card-link:focus-visible .tool-thumbnail img {
  transform: scale(1.06);
}

@media (prefers-reduced-motion: reduce) {
  .tool-thumbnail img {
    transition: none;
  }

  .tool-card-link:hover .tool-thumbnail img,
  .tool-card-link:focus-visible .tool-thumbnail img {
    transform: none;
  }
}

.tool-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tool-content h3 {
  color: var(--text);
  font-family: var(--font-family-primary, "EyInterstate"), sans-serif;
  font-size: calc(var(--font-size-16, 1.143rem) * 1.2);
  font-weight: var(--font-weight-regular, 400);
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0;
}

.tool-description {
  color: var(--muted);
  font-family: var(--font-family-secondary, "noto_sans"), sans-serif;
  font-size: calc(var(--font-size-14, 1rem) * 0.9);
  font-weight: var(--font-weight-light, 300);
  font-style: normal;
  line-height: 1.45;
  margin: 0;
}

.loading-message {
  padding: 18px;
  color: var(--muted);
}

.timestamp {
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .content-container {
    flex-direction: column;
  }

  .navigation-pane {
    width: 100%;
    min-width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .navigation-pane ul {
    display: flex;
    gap: 8px;
  }

  .navigation-pane li {
    margin-bottom: 0;
    flex: 1;
  }

  .nav-collapse-toggle,
  .dock-bar,
  .window-expand-toggle {
    display: none;
  }

  .topic-filter-menu {
    width: min(92vw, 320px);
  }

  .search-input {
    width: min(92vw, 220px);
  }

  .common-topics-bar {
    padding-left: 12px;
    padding-right: 12px;
    gap: 8px;
  }

  .app-header-subtitle {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ── Research Toolbar ── */
.research-toolbar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1150;
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(30, 31, 45, 0.72);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0.78;
  overflow: hidden;
  width: 52px;
  transition: width 280ms ease, opacity 220ms ease;
}

.research-toolbar.visible {
  display: flex;
}

.research-toolbar:hover,
.research-toolbar:focus-within {
  opacity: 0.92;
}

.research-toolbar.expanded {
  width: 110px;
}

.research-toolbar.expanded .print-button {
  display: inline-flex !important;
}

.rtb-toggle,
.print-button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.92);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 180ms ease;
}

.rtb-toggle:hover,
.print-button:hover {
  background: rgba(255, 255, 255, 0.22);
}

.rtb-toggle svg,
.print-button svg {
  pointer-events: none;
}

.research-toolbar.expanded .rtb-toggle svg {
  transform: rotate(45deg);
  transition: transform 220ms ease;
}

.research-toolbar.collapsed .rtb-toggle svg {
  transform: rotate(0deg);
  transition: transform 220ms ease;
}
