* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(to bottom right, #eff6ff, #ffffff, #fff7ed);
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
    width: 100%;
    margin: 0 auto;
    padding: 0.5rem 2rem;
    display: flex;
    justify-content: flex-start;
    align-items: center;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.icon-container {
    width: 2rem;
    height: 2rem;
    color: #2563eb;
}

.header-icon {
    width: 100%;
    height: 100%;
}

.header-title {
    font-size: 1.35rem;
    font-weight: bold;
    color: #1e293b;
}

.header-subtitle {
    font-size: 0.75rem;
    color: #64748b;
}

.header-logo {
    height: 58px;
    width: auto;
    object-fit: contain;
}

/* Main Container */
.main-container {
    width: 100%;
    margin: 0 auto;
    padding: 2rem;
}

/* Banner */
.banner {
    background: linear-gradient(to right, #2563eb, #1d4ed8);
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 0.9rem 1.25rem;
    margin-bottom: 1.5rem;
    color: white;
    overflow: hidden;
}

.banner-content {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 5rem;
}

.banner-title {
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.banner-description {
    color: #bfdbfe;
    margin-bottom: 0;
    line-height: 1.4;
}

.banner-funding {
    font-size: 0.75rem;
    color: #93c5fd;
    margin-bottom: 1rem;
}

.banner-features {
    display: flex;
    gap: 1.5rem;
    font-size: 0.875rem;
}

.feature {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feature-icon {
    width: 1rem;
    height: 1rem;
}

.banner-img {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    max-height: 76px;
    width: auto;
    opacity: 0.9;
    object-fit: contain;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.history-column {
    display: flex;
    flex-direction: column;
}

.history-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: sticky;
    top: 1.5rem;
    max-height: calc(100vh - 3rem);
}

.new-chat-btn {
    appearance: none;
    border: none;
    background: #0f172a;
    color: white;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    text-align: center;
}

.new-chat-icon {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.new-chat-icon-image {
    width: 1rem;
    height: 1rem;
    display: block;
    object-fit: contain;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.history-title {
    font-size: 0.95rem;
    color: #0f172a;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    overflow-y: auto;
    min-height: 0;
}

.chat-history-item {
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0.75rem;
    padding: 0.35rem;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0.35rem;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.chat-history-item:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    transform: translateY(-1px);
}

.chat-history-item.active {
    border-color: #2563eb;
    background: #dbeafe;
}

.chat-history-trigger {
    appearance: none;
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    padding: 0.5rem 0.55rem;
    text-align: left;
    cursor: pointer;
}

.chat-history-menu {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    flex-shrink: 0;
    margin-left: auto;
}

.chat-history-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.2rem;
}

.chat-history-meta {
    display: block;
    font-size: 0.75rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-menu-button {
    appearance: none;
    border: none;
    background: transparent;
    color: #475569;
    border-radius: 0.6rem;
    min-width: 2.25rem;
    padding: 0 0.7rem;
    font-size: 1.1rem;
    line-height: 1;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
}

.chat-history-menu-button:hover {
    background: rgba(255, 255, 255, 0.75);
}

.chat-history-dropdown {
    position: static;
    min-width: 8rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.14);
    padding: 0.35rem;
    margin-top: 0.35rem;
    display: none;
    flex-direction: column;
    z-index: 10;
}

.chat-history-dropdown.open {
    display: flex;
}

.chat-history-dropdown-item {
    appearance: none;
    border: none;
    background: transparent;
    border-radius: 0.55rem;
    padding: 0.6rem 0.7rem;
    text-align: left;
    font-size: 0.85rem;
    color: #1e293b;
    cursor: pointer;
}

.chat-history-dropdown-item:hover {
    background: #eff6ff;
}

.chat-history-dropdown-item.danger {
    color: #b91c1c;
}

.chat-history-dropdown-item.danger:hover {
    background: #fee2e2;
}

.chat-history-empty {
    font-size: 0.85rem;
    color: #64748b;
    padding: 0.5rem 0.25rem;
}

.main-column {
    display: flex;
    flex-direction: column;
}

.chat-layout {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: calc(100vh - 17rem);
}

.chat-layout.composer-centered {
    justify-content: center;
}

.chat-layout.composer-centered .chat-content {
    display: none;
}

.chat-layout.composer-centered .query-card {
    position: static;
    width: min(100%, 58rem);
    margin: 0 auto;
}

.chat-layout.composer-centered .new-chat-heading {
    display: block;
}

.chat-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    overflow: hidden;
}

/* Query Card */
.query-card {
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    border: 1px solid #dbe7f5;
    border-radius: 1rem;
    box-shadow: 0 18px 40px rgba(37, 99, 235, 0.08);
    padding: 1.35rem;
    position: sticky;
    bottom: 1.5rem;
    z-index: 5;
}

.new-chat-heading {
    display: none;
    margin-bottom: 1rem;
    text-align: center;
    font-size: clamp(2rem, 4vw, 3.15rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    background: linear-gradient(90deg, #1d4ed8 0%, #38bdf8 50%, #1d4ed8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.query-label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.75rem;
}

.query-input-group {
    margin-bottom: 0.75rem;
}

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

.query-composer {
    position: relative;
    background: white;
    border: 1px solid #cfdced;
    border-radius: 1.3rem;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.model-select {
    position: absolute;
    left: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    max-width: 12.75rem;
    height: 2.65rem;
    padding: 0 2rem 0 0.9rem;
    border: 1px solid #dbe2ef;
    border-radius: 9999px;
    background: #f8fafc;
    color: #1e293b;
    font-size: 0.9rem;
    font-weight: 600;
    appearance: none;
    cursor: pointer;
    background-image:
        linear-gradient(45deg, transparent 50%, #64748b 50%),
        linear-gradient(135deg, #64748b 50%, transparent 50%);
    background-position:
        calc(100% - 1rem) calc(50% - 0.12rem),
        calc(100% - 0.72rem) calc(50% - 0.12rem);
    background-size: 0.35rem 0.35rem, 0.35rem 0.35rem;
    background-repeat: no-repeat;
}

.query-input {
    width: 100%;
    min-height: 4.25rem;
    padding: 1.2rem 1rem;
    padding-left: 13.85rem;
    padding-right: 4.6rem;
    border: none;
    border-radius: 1.3rem;
    font-size: 1.08rem;
    line-height: 1.5;
    color: #1e293b;
    background: transparent;
}

.query-input:focus {
    outline: none;
    box-shadow: none;
}

.query-input:disabled {
    background: #f1f5f9;
    cursor: not-allowed;
}

.submit-btn {
    width: 2.95rem;
    height: 2.95rem;
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 9999px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
}

.submit-btn:hover {
    background: #1d4ed8;
}

.submit-btn:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

.btn-icon {
    width: 1.32rem;
    height: 1.32rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-icon svg {
    width: 100%;
    height: 100%;
}

.submit-btn.stop-state {
    background: #0f172a;
}

.submit-btn.stop-state:hover {
    background: #1e293b;
}

/* Error Card */
.error-card {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.error-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #dc2626;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.error-title {
    font-weight: 600;
    color: #7f1d1d;
}

.error-message {
    color: #b91c1c;
    font-size: 0.875rem;
}

/* Results Card */
.results-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.5rem;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.conversation-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.25rem;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: stretch;
}

.message-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #64748b;
}

.message.user .message-label {
    text-align: right;
}

.message-bubble {
    width: 100%;
    border-radius: 0.75rem;
    padding: 1rem;
}

.message.user .message-bubble {
    max-width: 68%;
    background: #2563eb;
    color: white;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.18);
}

.message.assistant .message-bubble {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
}

.message-text {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.6;
}

.result-text h1,
.result-text h2,
.result-text h3,
.result-text h4,
.result-text h5,
.result-text h6 {
    margin: 0 0 0.75rem;
    color: #0f172a;
    line-height: 1.3;
}

.result-text h3 {
    font-size: 1.02rem;
}

.result-text p {
    margin: 0 0 0.95rem;
}

.result-text ul {
    margin: 0 0 1rem 1.2rem;
    padding: 0;
}

.result-text li {
    margin-bottom: 0.35rem;
}

.result-text code {
    background: #e2e8f0;
    color: #0f172a;
    border-radius: 0.35rem;
    padding: 0.12rem 0.35rem;
    font-size: 0.92em;
}

.assistant-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.assistant-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #1e293b;
}

.assistant-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 0.65rem;
    border-radius: 9999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    white-space: nowrap;
}

.process-panel {
    margin-bottom: 1.5rem;
}

.process-heading {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.5rem;
}

.process-heading .section-title {
    margin-bottom: 0;
}

.process-toggle {
    appearance: none;
    border: none;
    background: transparent;
    color: #1d4ed8;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.1rem 0.15rem;
    cursor: pointer;
}

.process-toggle:hover {
    color: #1e40af;
}

.thinking-row {
    display: flex;
    align-items: center;
    min-height: 1.5rem;
    margin-bottom: 0.75rem;
}

.thinking-text {
    font-size: 0.95rem;
    color: #2563eb;
    font-weight: 600;
}

.process-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-height: 24rem;
    overflow-y: auto;
    padding-right: 0.25rem;
}

.process-item {
    background: white;
    border: 1px solid #dbe4f0;
    border-radius: 0.8rem;
    padding: 0.9rem 1rem;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
}

.process-node {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
    margin-bottom: 0.45rem;
}

.process-body {
    color: #334155;
}

.typing-indicator {
    display: inline-flex;
    gap: 0.35rem;
    align-items: center;
}

.typing-indicator span {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 9999px;
    background: #94a3b8;
    animation: bounce 1.2s infinite ease-in-out;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.15s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.3s;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.results-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: #1e293b;
}

.confidence-badge {
    font-size: 0.75rem;
    background: #dcfce7;
    color: #166534;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
}

.synthesis-plan {
    margin-bottom: 1.5rem;
}

.section-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.section-title-normal {
    text-transform: none;
    letter-spacing: 0;
}

.code-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
}

.code-block pre {
  font-family: inherit;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 14px;
}

.steps-container {
    margin-top: 1.5rem;
}

.steps-list,
#stepsList {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.step-item {
    border-left: 4px solid #2563eb;
    background: #eff6ff;
    padding: 0.75rem 1rem;
    border-radius: 0 0.25rem 0.25rem 0;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.step-number {
    font-weight: bold;
    color: #1e40af;
}

.step-badge {
    font-size: 0.75rem;
    background: #bfdbfe;
    color: #1e40af;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}

.step-text {
    color: #334155;
    font-size: 0.875rem;
}

.results-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.75rem;
    color: #64748b;
}

.message-actions {
    margin-top: 1rem;
}

.message-action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.message-action-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: white;
    color: #1e293b;
    border-radius: 9999px;
    padding: 0.55rem 0.95rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.message-action-btn:hover {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.message-action-btn:disabled {
    cursor: default;
    opacity: 0.7;
}

.share-modal {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.share-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
}

.share-modal-dialog {
    position: relative;
    width: min(100%, 40rem);
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 24px 64px rgba(15, 23, 42, 0.24);
}

.share-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.share-modal-title {
    font-size: 1.25rem;
    color: #0f172a;
}

.share-modal-subtitle {
    margin-top: 0.35rem;
    font-size: 0.875rem;
    color: #64748b;
}

.share-modal-close {
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    border-radius: 9999px;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.share-modal-close-icon {
    width: 1rem;
    height: 1rem;
}

.share-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.share-option {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3rem;
    padding: 0.9rem 1rem;
    border-radius: 0.8rem;
    border: 1px solid #dbeafe;
    background: #f8fbff;
    color: #1d4ed8;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.15s, box-shadow 0.15s, background 0.15s;
}

.share-option:hover {
    background: #eff6ff;
    box-shadow: 0 10px 20px rgba(37, 99, 235, 0.12);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 3rem;
    text-align: center;
    color: #64748b;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto 1rem;
    opacity: 0.2;
}

.empty-title {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

.empty-subtitle {
    font-size: 0.875rem;
}

/* Info Cards */
.info-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    padding: 1.25rem;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.card-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: #2563eb;
}

.card-title {
    font-weight: bold;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.info-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #64748b;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: 600;
    color: #334155;
}

/* Metrics */
.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.875rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    color: #64748b;
}

.metric-value {
    font-weight: 600;
    color: #1e293b;
}

.progress-bar {
    width: 100%;
    background: #e2e8f0;
    border-radius: 9999px;
    height: 0.5rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.3s;
}

.progress-fill.green {
    background: #22c55e;
}

.progress-fill.blue {
    background: #3b82f6;
}

.progress-fill.purple {
    background: #a855f7;
}

.metrics-footer {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Citation Card */
.citation-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1.25rem;
}

.card-title-sm {
    font-weight: bold;
    color: #1e293b;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.citation-text {
    font-size: 0.75rem;
    color: #64748b;
    line-height: 1.5;
}

.citation-source {
    font-style: italic;
}

/* Team */
.team-list {
    font-size: 0.75rem;
    color: #334155;
}

.team-member {
    margin-bottom: 0.5rem;
}

.member-name {
    font-weight: 600;
}

.member-role {
    color: #64748b;
}

.member-focus {
    color: #64748b;
}

.team-section {
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.team-section-title {
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.5rem;
}

.team-members-list {
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.team-member-sm {
    margin-bottom: 0.25rem;
}

.member-name-sm {
    font-weight: 500;
}

.member-focus-sm {
    color: #64748b;
}

.team-footer {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

/* Footer */
.footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-container {
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-main {
    margin-bottom: 0.5rem;
}

.footer-link {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

.footer-contact {
    margin-bottom: 0.4rem;
}

.footer-disclaimer {
    font-size: 0.75rem;
}

.settings-launcher {
    position: fixed;
    left: 1rem;
    bottom: 1.5rem;
    z-index: 25;
}

.settings-info-btn {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: rgba(255, 255, 255, 0.96);
    color: #0f172a;
    border-radius: 9999px;
    min-width: 12.5rem;
    padding: 0.85rem 1.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.14);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 700;
    text-align: center;
    padding-left: 0.95rem;
    padding-right: 1.2rem;
}

.settings-info-icon {
    width: 1rem;
    height: 1rem;
}

.settings-panel {
    position: fixed;
    inset: 0;
    z-index: 35;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    padding: 1.5rem;
}

.settings-panel-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.3);
}

.settings-panel-dialog {
    position: relative;
    width: min(100%, 28rem);
    max-height: min(78vh, 52rem);
    background: white;
    border-radius: 1rem;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.settings-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1rem 0.85rem;
    border-bottom: 1px solid #e2e8f0;
}

.settings-panel-title {
    font-size: 1rem;
    color: #0f172a;
}

.settings-panel-close {
    appearance: none;
    border: 1px solid #cbd5e1;
    background: white;
    color: #334155;
    border-radius: 9999px;
    width: 2.3rem;
    height: 2.3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.settings-panel-close-icon {
    width: 1rem;
    height: 1rem;
}

.settings-panel-content {
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-link {
    color: #1d4ed8;
    text-decoration: underline;
    text-underline-offset: 0.15rem;
}

/* Utilities */
.hidden {
    display: none !important;
}

/* Loading Animation */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    40% {
        transform: translateY(-0.2rem);
        opacity: 1;
    }
}

.loading {
    animation: spin 1s linear infinite;
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem 0.85rem 5.5rem;
    }

    .content-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .history-card {
        position: static;
        max-height: none;
        padding: 0.85rem;
        gap: 0.75rem;
    }

    .chat-layout {
        min-height: auto;
        gap: 0.75rem;
    }

    .chat-content {
        overflow: visible;
    }

    .query-card {
        position: static;
        bottom: auto;
        padding: 1rem;
        border-radius: 1.1rem;
    }

    .results-card {
        min-height: 18rem;
        padding: 1rem;
    }

    .settings-launcher {
        left: 1rem;
        right: 1rem;
        bottom: 0.85rem;
    }

    .settings-panel {
        padding: 0.75rem;
    }

    .settings-panel-dialog {
        width: 100%;
        max-height: 82vh;
    }

    .share-options {
        grid-template-columns: 1fr;
    }

    .header-container {
        padding: 0.4rem 0.85rem;
    }

    .header-left {
        gap: 0.6rem;
    }

    .header-logo {
        height: 44px;
    }

    .header-title {
        font-size: 1rem;
        line-height: 1.25;
    }

    .banner {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .banner-content {
        min-height: auto;
        display: block;
        text-align: left;
    }

    .banner-img {
        display: none;
    }

    .banner-title {
        font-size: 1.08rem;
        line-height: 1.3;
    }

    .banner-description {
        font-size: 0.86rem;
        line-height: 1.45;
    }

    .new-chat-btn {
        width: 100%;
    }

    .history-title {
        font-size: 0.9rem;
    }

    .chat-history-list {
        gap: 0.45rem;
    }

    .chat-history-item {
        padding: 0.3rem;
    }

    .model-select {
        position: static;
        transform: none;
        max-width: none;
        width: 100%;
        margin-bottom: 0.65rem;
        height: 2.75rem;
    }

    .query-input {
        min-height: 3.65rem;
        padding: 1rem 4rem 1rem 1rem;
        font-size: 1rem;
    }

    .query-label {
        margin-bottom: 0.6rem;
    }

    .query-composer {
        border-radius: 1rem;
        padding: 0.7rem;
    }

    .submit-btn {
        right: 0.7rem;
        width: 2.6rem;
        height: 2.6rem;
    }

    .btn-icon {
        width: 1.1rem;
        height: 1.1rem;
    }

    .new-chat-heading {
        font-size: 1.8rem;
        margin-bottom: 0.85rem;
    }

    .empty-state {
        padding: 1.5rem 1rem;
    }

    .assistant-meta {
        align-items: flex-start;
    }

    .message.user .message-bubble {
        max-width: 86%;
    }

    .settings-info-btn {
        width: 100%;
        min-width: 0;
        justify-content: center;
    }

    .settings-panel-content {
        padding: 0.85rem;
    }

    .info-card,
    .citation-card {
        padding: 1rem;
    }
}


.member-name a, .member-name-sm a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(0,0,0,0.3);
}
.member-name a:hover, .member-name-sm a:hover {
    text-decoration-color: currentColor;
}


