:root {
    color-scheme: light;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
}

.loading-shell {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #616161;
}

#blazor-error-ui {
    background: #ffefef;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.app-shell {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.app-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.side-nav {
    display: flex;
    flex-direction: column;
    width: 200px;
    flex: 0 0 200px;
    background: #0f3b5c;
    color: #ffffff;
    padding: 0.75rem 0.5rem;
    box-sizing: border-box;
}

.side-nav-brand {
    display: flex;
    flex-direction: column;
    padding: 0.25rem 0.5rem 0.75rem 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    margin-bottom: 0.5rem;
}

.side-nav-items {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.side-nav-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.side-nav-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: inherit;
    font-size: 0.9rem;
    text-align: left;
    cursor: pointer;
}

.side-nav-item:hover {
    background: rgba(255, 255, 255, 0.12);
}

.side-nav-active {
    background: rgba(255, 255, 255, 0.2);
    font-weight: 600;
}

.side-nav-icon {
    flex: 0 0 auto;
}

.side-nav-label {
    flex: 1;
}

.demo-banner {
    background: #b00020;
    color: #ffffff;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 0.3rem 0.5rem;
    letter-spacing: 0.02em;
}

.top-bar-title {
    display: flex;
    flex-direction: column;
}

.product-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.product-tagline {
    font-size: 0.75rem;
    opacity: 0.8;
}

.account-picker {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.account-button {
    --neutral-foreground-rest: #ffffff;
}

.account-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.account-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex: 0 0 auto;
}

.account-text {
    display: inline-flex;
    flex-direction: column;
    line-height: 1.1;
}

.account-name {
    font-size: 0.85rem;
    font-weight: 600;
}

.account-affiliation {
    font-size: 0.7rem;
    opacity: 0.85;
}

.nav-content {
    flex: 1;
    overflow: auto;
    padding: 1rem;
    min-width: 0;
}

.session-status {
    font-size: 0.8rem;
    margin-right: 0.4rem;
}

.status-running {
    color: #1f7a1f;
}

.status-unread {
    color: #b85c00;
}

.status-dormant {
    color: #9e9e9e;
}

.chat-tab {
    display: flex;
    gap: 1rem;
    height: 100%;
}

.session-list {
    width: 240px;
    border-right: 1px solid #e0e0e0;
    padding-right: 0.5rem;
}

.session-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.session-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.4rem;
    border-radius: 4px;
    cursor: pointer;
}

.session-select {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    cursor: pointer;
    overflow: hidden;
}

.session-item:hover {
    background: #f0f4f8;
}

.session-active {
    background: #e3eef7;
}

.session-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.transcript {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: auto;
}

.campaign-entry {
    border: 1px dashed #b0bec5;
    border-radius: 6px;
    padding: 1rem;
}

.campaign-entry-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.messages {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.message {
    border-radius: 6px;
    padding: 0.6rem 0.8rem;
}

.message-user {
    background: #eef2f6;
}

.message-assistant {
    background: #f6f9fb;
    border: 1px solid #e0e8ef;
}

.message-role {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: #607d8b;
    margin-bottom: 0.25rem;
}

.tool-call-card {
    margin: 0.25rem 0;
}

.report-actions,
.composer-buttons,
.config-actions,
.campaign-entry-buttons {
    display: flex;
    gap: 0.5rem;
}

.composer {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border-top: 1px solid #e0e0e0;
    padding-top: 0.5rem;
}

.model-picker {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.transcript-error,
.config-import-message {
    color: #b00020;
}

.config-saved {
    color: #1f7a1f;
    align-self: center;
}

.config-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-width: 720px;
}

.config-demo-mode {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.config-hint {
    font-size: 0.75rem;
    color: #607d8b;
}

.config-entra-ids {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.config-import-export {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.75rem;
}

.artifact-cards {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.artifact-card {
    padding: 0.75rem;
}

.artifact-card-header {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 0.85rem;
}

.artifact-tool {
    font-weight: 600;
}

.artifact-timestamp,
.artifact-version {
    color: #607d8b;
}

.artifact-summary {
    margin: 0.4rem 0;
}

.artifact-content {
    background: #1e1e1e;
    color: #e0e0e0;
    padding: 0.75rem;
    border-radius: 4px;
    max-height: 320px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.artifacts-empty,
.transcript-empty {
    color: #607d8b;
}

.help-document {
    margin: 1rem 0;
    max-width: 760px;
}

.help-screenshot img {
    max-width: 100%;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.help-excerpt {
    color: #607d8b;
}

.wiki-browser {
    margin-top: 1.25rem;
    max-width: 880px;
}

.wiki-area {
    margin: 0.25rem 0;
}

.wiki-area > summary {
    cursor: pointer;
    font-weight: 600;
    padding: 0.25rem 0;
}

.wiki-link {
    color: #0f3b5c;
    cursor: pointer;
    text-decoration: underline;
}

.wiki-link:hover {
    color: #1565a8;
}

.wiki-page {
    margin-top: 1rem;
    max-width: 920px;
}

.wiki-page-path {
    color: #607d8b;
    font-size: 0.8rem;
    margin: 0.5rem 0;
}

.wiki-content {
    line-height: 1.5;
}

.wiki-content a {
    color: #0f3b5c;
    cursor: pointer;
    text-decoration: underline;
}

.wiki-content a:hover {
    color: #1565a8;
}

.wiki-toc {
    border: 1px solid #e0e0e0;
    border-left: 3px solid #0f3b5c;
    border-radius: 4px;
    background: #f8fafc;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
    max-width: 520px;
}

.wiki-toc-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #607d8b;
    margin-bottom: 0.25rem;
}

.wiki-toc ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-toc li {
    margin: 0.1rem 0;
}

.wiki-toc-l1 { padding-left: 0; }
.wiki-toc-l2 { padding-left: 0; }
.wiki-toc-l3 { padding-left: 1rem; }
.wiki-toc-l4 { padding-left: 2rem; }
.wiki-toc-l5 { padding-left: 3rem; }
.wiki-toc-l6 { padding-left: 4rem; }

.wiki-tosp {
    border: 1px solid #e0e0e0;
    border-left: 3px solid #2e7d32;
    border-radius: 4px;
    background: #f6faf6;
    padding: 0.5rem 0.75rem;
    margin: 0.75rem 0;
    max-width: 520px;
}

.wiki-tosp-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #4b7b50;
    margin-bottom: 0.25rem;
}

.wiki-tosp ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wiki-tosp li {
    margin: 0.1rem 0;
    padding-left: 0.75rem;
    position: relative;
}

.wiki-tosp li::before {
    content: "\203A";
    position: absolute;
    left: 0;
    color: #4b7b50;
}

.wiki-content img {
    max-width: 100%;
    height: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.wiki-content table {
    border-collapse: collapse;
    margin: 0.5rem 0;
}

.wiki-content table td,
.wiki-content table th {
    border: 1px solid #d0d0d0;
    padding: 0.3rem 0.5rem;
}

.help-badge {
    background: #e3eef7;
    color: #0f3b5c;
    font-size: 0.7rem;
    padding: 0 0.3rem;
    border-radius: 3px;
    margin-left: 0.25rem;
}

.config-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 900;
}

.config-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(760px, 92vw);
    max-height: 88vh;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
    z-index: 901;
    display: flex;
    flex-direction: column;
}

.config-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.config-modal-header h2 {
    margin: 0;
    font-size: 1.1rem;
}

.config-modal-body {
    padding: 1rem;
    overflow: auto;
}

.help-body {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    align-items: flex-start;
}

.help-tree {
    flex: 0 0 280px;
    max-height: 70vh;
    overflow: auto;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 0.5rem;
    font-size: 0.85rem;
}

.help-tree-folder-label {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.15rem 0.25rem;
    border-radius: 4px;
    font-weight: 600;
}

.help-tree-caret-button {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    flex: 0 0 auto;
}

.help-tree-folder-name {
    cursor: pointer;
    flex: 1 1 auto;
    border-radius: 4px;
    padding: 0 0.15rem;
}

.help-tree-folder-name:hover {
    background: #f0f4f8;
}

.help-tree-folder-name.selected {
    background: #cfe3f3;
}

.help-tree-caret {
    flex: 0 0 auto;
    transition: transform 0.1s ease-in-out;
}

.help-tree-caret.expanded {
    transform: rotate(90deg);
}

.help-tree-children {
    margin-left: 0.9rem;
    border-left: 1px solid #eceff1;
    padding-left: 0.35rem;
}

.help-tree-page {
    cursor: pointer;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #0f3b5c;
}

.help-tree-page:hover {
    background: #f0f4f8;
}

.help-tree-page.selected {
    background: #cfe3f3;
    font-weight: 600;
}

.help-content {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 920px;
}

.help-empty {
    color: #607d8b;
}

.help-search {
    position: relative;
    max-width: 480px;
}

.help-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 600px;
    max-width: 90vw;
    z-index: 60;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    max-height: 60vh;
    overflow: auto;
    padding: 0.5rem 0.75rem;
}

