html, body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

a, .btn-link {
    color: #006bb7;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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;
}

.content {
    padding-top: 1.1rem;
}

h1:focus {
    outline: none;
}

.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid #e50000;
}

.validation-message {
    color: #e50000;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.darker-border-checkbox.form-check-input {
    border-color: #929292;
}

html, body {
    height: 100%;
    margin: 0;
    overflow: hidden;
}

main {
    height: 100%;
    overflow: hidden;
}

#components-reconnect-modal,
.components-reconnect-modal,
.components-reconnect-show,
.components-reconnect-failed,
.components-reconnect-rejected {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}




.gpt-codeblock {
    margin: 12px 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #f9fafb;
}

.gpt-codeblock-toolbar {
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px 0 12px;
    background: #f3f4f6;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
}

.gpt-codeblock-lang {
    color: #6b7280;
    font-size: 0.76rem;
    line-height: 1;
    user-select: none;
}

.gpt-codeblock-copy {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #4b5563;
    border-radius: 8px;
    padding: 4px 8px;
    font-size: 0.76rem;
    cursor: pointer;
    line-height: 1;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

    .gpt-codeblock-copy:hover {
        background: #e5e7eb;
        border-color: #d1d5db;
        color: #111827;
    }

.gpt-codeblock pre {
    margin: 0;
    padding: 14px 16px;
    overflow-x: auto;
    background: #f9fafb;
    color: #111827;
    box-sizing: border-box;
}

    .gpt-codeblock pre > code {
        display: block;
        background: transparent;
        padding: 0;
        border-radius: 0;
        color: inherit;
        font-family: Consolas, "Courier New", monospace;
        font-size: 0.82rem;
        line-height: 1.55;
        white-space: pre;
    }

:root {
    --app-bg: #ffffff;
    --app-surface: #ffffff;
    --app-surface-subtle: #f7f7f8;
    --app-text: #111827;
    --app-text-muted: #6b7280;
    --app-border: #e5e7eb;
    --app-hover: #f3f4f6;
}

.dark-mode {
    --app-bg: #07110f;
    --app-surface: #0d1a17;
    --app-surface-subtle: #050d0b;
    --app-text: #f3f7f5;
    --app-text-muted: #9fb0aa;
    --app-border: #1f3430;
    --app-hover: #13241f;
}

/* =========================================================
   ITEM AI Assistant ダークモード上書き
   CSS isolation の影響を避けるため app.css に配置
   ========================================================= */

html.dark-mode .gpt-page,
body.dark-mode .gpt-page {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

html.dark-mode .gpt-main,
body.dark-mode .gpt-main,
html.dark-mode .gpt-topbar,
body.dark-mode .gpt-topbar,
html.dark-mode .gpt-chat-shell,
body.dark-mode .gpt-chat-shell,
html.dark-mode .gpt-messages,
body.dark-mode .gpt-messages,
html.dark-mode .gpt-input-shell,
body.dark-mode .gpt-input-shell {
    background: var(--app-bg) !important;
    color: var(--app-text) !important;
}

html.dark-mode .gpt-sidebar,
body.dark-mode .gpt-sidebar {
    background: var(--app-surface-subtle) !important;
    border-right-color: var(--app-border) !important;
    color: var(--app-text) !important;
}

html.dark-mode .gpt-sidebar-brand,
body.dark-mode .gpt-sidebar-brand,
html.dark-mode .gpt-subtitle,
body.dark-mode .gpt-subtitle,
html.dark-mode .gpt-thread-title,
body.dark-mode .gpt-thread-title,
html.dark-mode .gpt-thread-item,
body.dark-mode .gpt-thread-item {
    color: var(--app-text) !important;
}

html.dark-mode .gpt-thread-meta,
body.dark-mode .gpt-thread-meta,
html.dark-mode .gpt-thread-section-title,
body.dark-mode .gpt-thread-section-title,
html.dark-mode .gpt-message-role,
body.dark-mode .gpt-message-role,
html.dark-mode .gpt-input-note,
body.dark-mode .gpt-input-note {
    color: var(--app-text-muted) !important;
}

html.dark-mode .gpt-thread-item:hover,
body.dark-mode .gpt-thread-item:hover,
html.dark-mode .gpt-thread-item.active,
body.dark-mode .gpt-thread-item.active {
    background: var(--app-hover) !important;
}

/* 左サイドバーのRadzenボタン */
html.dark-mode .gpt-sidebar-action-btn,
body.dark-mode .gpt-sidebar-action-btn {
    color: var(--app-text) !important;
    background: transparent !important;
}

    html.dark-mode .gpt-sidebar-action-btn:hover,
    body.dark-mode .gpt-sidebar-action-btn:hover {
        background: var(--app-hover) !important;
        color: var(--app-text) !important;
    }

    html.dark-mode .gpt-sidebar-action-btn .rz-button-text,
    body.dark-mode .gpt-sidebar-action-btn .rz-button-text {
        color: var(--app-text) !important;
    }

    html.dark-mode .gpt-sidebar-action-btn .rz-button-icon-left,
    body.dark-mode .gpt-sidebar-action-btn .rz-button-icon-left {
        background: #1f2937 !important;
        color: #f9fafb !important;
    }

/* 折りたたみ時のアイコンボタン */
html.dark-mode .gpt-sidebar-icon-btn,
body.dark-mode .gpt-sidebar-icon-btn {
    background: transparent !important;
    color: var(--app-text) !important;
}

    html.dark-mode .gpt-sidebar-icon-btn .rz-button-box,
    body.dark-mode .gpt-sidebar-icon-btn .rz-button-box {
        background: #1f2937 !important;
    }

    html.dark-mode .gpt-sidebar-icon-btn .rz-button-icon-left,
    body.dark-mode .gpt-sidebar-icon-btn .rz-button-icon-left,
    html.dark-mode .gpt-sidebar-icon-btn .rz-button-icon,
    body.dark-mode .gpt-sidebar-icon-btn .rz-button-icon {
        color: #f9fafb !important;
    }

html.dark-mode .gpt-textarea,
body.dark-mode .gpt-textarea {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

    html.dark-mode .gpt-textarea::placeholder,
    body.dark-mode .gpt-textarea::placeholder {
        color: #9ca3af !important;
    }

html.dark-mode .gpt-attach-button,
body.dark-mode .gpt-attach-button {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

html.dark-mode .gpt-file-picker:hover .gpt-attach-button,
body.dark-mode .gpt-file-picker:hover .gpt-attach-button {
    background: #2d3748 !important;
    border-color: #4b5563 !important;
}

html.dark-mode .assistant-bubble,
body.dark-mode .assistant-bubble {
    background: #1f2937 !important;
    color: #f9fafb !important;
    border-color: #374151 !important;
}

html.dark-mode .user-bubble,
body.dark-mode .user-bubble {
    background: #243041 !important;
    color: #f9fafb !important;
}


/* =========================================================
   AppHeaderMenu ダークモード対応
   プロフィールアイコン / 右上メニュー
   ========================================================= */

html.dark-mode .user-icon-link,
body.dark-mode .user-icon-link {
    color: var(--app-text-muted) !important;
}

    html.dark-mode .user-icon-link:hover,
    body.dark-mode .user-icon-link:hover {
        background: var(--app-hover) !important;
        color: var(--app-text) !important;
    }

html.dark-mode .user-icon,
body.dark-mode .user-icon {
    color: var(--app-text-muted) !important;
}

html.dark-mode .user-icon-link:hover .user-icon,
body.dark-mode .user-icon-link:hover .user-icon {
    color: var(--app-text) !important;
}

/* ハンバーガーメニューの3本線 */
html.dark-mode .app-menu-simple-line,
body.dark-mode .app-menu-simple-line {
    background: var(--app-text-muted) !important;
}

html.dark-mode .app-menu-button-simple:hover .app-menu-simple-line,
body.dark-mode .app-menu-button-simple:hover .app-menu-simple-line {
    background: var(--app-text) !important;
}

/* メニューボタン自体のhover */
html.dark-mode .app-menu-button-simple:hover,
body.dark-mode .app-menu-button-simple:hover {
    background: var(--app-hover) !important;
    border-radius: 8px;
}


/* 右上メニューのドロップダウン */
html.dark-mode .app-menu-dropdown,
body.dark-mode .app-menu-dropdown {
    background: var(--app-surface) !important;
    border-color: var(--app-border) !important;
    color: var(--app-text) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35) !important;
}

html.dark-mode .app-menu-item,
body.dark-mode .app-menu-item {
    color: var(--app-text) !important;
    background: transparent !important;
}

    html.dark-mode .app-menu-item:hover,
    body.dark-mode .app-menu-item:hover {
        background: var(--app-hover) !important;
        color: var(--app-text) !important;
    }

html.dark-mode .app-menu-logout,
body.dark-mode .app-menu-logout {
    color: #93c5fd !important;
}

/* =========================================================
   サイドバー開閉アイコン ダークモード対応
   ========================================================= */

html.dark-mode .gpt-sidebar-collapse-btn,
body.dark-mode .gpt-sidebar-collapse-btn,
html.dark-mode .gpt-mobile-sidebar-open,
body.dark-mode .gpt-mobile-sidebar-open {
    background: transparent !important;
    color: var(--app-text-muted) !important;
}

    html.dark-mode .gpt-sidebar-collapse-btn:hover,
    body.dark-mode .gpt-sidebar-collapse-btn:hover,
    html.dark-mode .gpt-mobile-sidebar-open:hover,
    body.dark-mode .gpt-mobile-sidebar-open:hover {
        background: var(--app-hover) !important;
        color: var(--app-text) !important;
    }

html.dark-mode .gpt-sidebar-toggle-radzen-icon,
body.dark-mode .gpt-sidebar-toggle-radzen-icon {
    color: var(--app-text-muted) !important;
    background: transparent !important;
}

html.dark-mode .gpt-sidebar-collapse-btn:hover .gpt-sidebar-toggle-radzen-icon,
body.dark-mode .gpt-sidebar-collapse-btn:hover .gpt-sidebar-toggle-radzen-icon,
html.dark-mode .gpt-mobile-sidebar-open:hover .gpt-sidebar-toggle-radzen-icon,
body.dark-mode .gpt-mobile-sidebar-open:hover .gpt-sidebar-toggle-radzen-icon {
    color: var(--app-text) !important;
    background: var(--app-hover) !important;
}

html.dark-mode .gpt-textarea,
body.dark-mode .gpt-textarea {
    background: #0d1a17 !important;
    color: #f3f7f5 !important;
    border-color: #1f3430 !important;
}

html.dark-mode .assistant-bubble,
body.dark-mode .assistant-bubble {
    background: #0d1a17 !important;
    color: #f3f7f5 !important;
    border-color: #1f3430 !important;
}

html.dark-mode .user-bubble,
body.dark-mode .user-bubble {
    background: #13241f !important;
    color: #f3f7f5 !important;
}

html.dark-mode .gpt-attach-button,
body.dark-mode .gpt-attach-button {
    background: #0d1a17 !important;
    color: #f3f7f5 !important;
    border-color: #1f3430 !important;
}

/* =========================================================
   ダークモード：Markdown表
   ========================================================= */

html.dark-mode .gpt-message-text table,
body.dark-mode .gpt-message-text table,
html.dark-mode .chat-message-content table,
body.dark-mode .chat-message-content table {
    background-color: #0d1a17 !important;
    color: #f3f7f5 !important;
    border-color: #1f3430 !important;
}

html.dark-mode .gpt-message-text th,
body.dark-mode .gpt-message-text th,
html.dark-mode .gpt-message-text td,
body.dark-mode .gpt-message-text td,
html.dark-mode .chat-message-content th,
body.dark-mode .chat-message-content th,
html.dark-mode .chat-message-content td,
body.dark-mode .chat-message-content td {
    background-color: #0d1a17 !important;
    color: #f3f7f5 !important;
    border: 1px solid #1f3430 !important;
}

html.dark-mode .gpt-message-text th,
body.dark-mode .gpt-message-text th,
html.dark-mode .chat-message-content th,
body.dark-mode .chat-message-content th {
    background-color: #13241f !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

html.dark-mode .gpt-message-text tbody tr:nth-child(even),
body.dark-mode .gpt-message-text tbody tr:nth-child(even),
html.dark-mode .chat-message-content tbody tr:nth-child(even),
body.dark-mode .chat-message-content tbody tr:nth-child(even) {
    background-color: #10201c !important;
}

    html.dark-mode .gpt-message-text tbody tr:nth-child(even) td,
    body.dark-mode .gpt-message-text tbody tr:nth-child(even) td,
    html.dark-mode .chat-message-content tbody tr:nth-child(even) td,
    body.dark-mode .chat-message-content tbody tr:nth-child(even) td {
        background-color: #10201c !important;
    }