/* Delt chat-layout for sider med .chat-root (Chat, ChatReasoning). Undgår at style andre .container-sider. */
.container:has(.chat-root) {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

.chat-root {
    height: 100vh;
    flex: 1;
    display: flex;
    margin-top: 0;
    margin-bottom: 20px;
    margin-left: 20px;
    margin-right: 20px;
    gap: 5px;
    min-width: 0;
    overflow-x: clip;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    min-width: 0;
    align-items: center;
    background: radial-gradient(108.78% 108.78% at 50.02% 19.78%, #ffffff 57.29%, #eef6fe 100%);
    box-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.14),
        0px 0px 2px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    overflow-y: auto;
    max-height: calc(100vh - 100px);
}

.chat-top-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 24px;
    width: 100%;
    align-self: stretch;
    flex-shrink: 0;
    box-sizing: border-box;
    background-color: #f2f2f2;
    border-bottom: 1px solid #e0e0e0;
}

.chat-top-bar-spacer {
    flex: 1;
}

.chat-top-bar-buttons {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
}

.chat-top-bar-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    background: #f3f2f1;
    border: 1px solid #8a8886;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    text-decoration: none;
}

.chat-top-bar-button:hover {
    background: #edebe9;
}

.chat-top-bar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.chat-top-bar-send-norby {
    color: #ffffff;
    background: radial-gradient(109.81% 107.82% at 100.1% 90.19%, #0F6CBD 33.63%, #2D87C3 70.31%, #8DDDD8 100%);
    border: none;
}

.chat-top-bar-send-norby:hover {
    opacity: 0.95;
}

.chat-empty-state {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.chat-empty-state-title {
    font-style: normal;
    font-weight: 700;
    font-size: 36px;
    display: flex;
    align-items: flex-end;
    text-align: center;
    line-height: 24px;
    margin-top: 36px;
    margin-bottom: 0;
}

.chat-empty-state-subtitle {
    margin-top: 20px;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 150%;
    align-items: flex-end;
    text-align: center;
    letter-spacing: -0.01em;
    color: #616161;
}

.chat-icon {
    height: 62px;
    width: auto;
}

.chat-message-stream {
    flex: 1 1 auto;
    min-height: 0;
    min-width: 0;
    flex-grow: 1;
    max-width: 1028px;
    width: 100%;
    overflow-y: auto;
    padding-left: 24px;
    padding-right: 24px;
    display: flex;
    flex-direction: column;
    margin-top: 24px;
    height: 100%;
}

.chat-message-user {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.chat-message-user-message {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: #edf5fd;
    border-radius: 8px;
    box-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.14),
        0px 0px 2px rgba(0, 0, 0, 0.12);
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
    color: #242424;
    order: 0;
    flex-grow: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-width: 80%;
}

.chat-message-user-text {
    display: block;
}

.chat-message-file-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #b8d4ee;
    border-radius: 999px;
    font-size: 14px;
    color: #0066b3;
    max-width: 100%;
}

.chat-message-file-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: #5a8fb4;
}

.chat-message-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-message-gpt {
    margin-bottom: 12px;
    max-width: 80%;
    display: flex;
}

.answer-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 8px;
    gap: 5px;
    background: #ffffff;
    box-shadow:
        0px 1px 2px rgba(0, 0, 0, 0.14),
        0px 0px 2px rgba(0, 0, 0, 0.12);
    border-radius: 5px;
}

.answer-text {
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #323130;
    flex: none;
    order: 0;
    align-self: stretch;
    flex-grow: 0;
    margin: 11px;
    white-space: normal;
    word-wrap: break-word;
    max-width: 800px;
    overflow-x: auto;
}

/* Markdown: undgå Bootstraps store h1–h6; hold overskrifter tæt på brødtekst (14px). */
.answer-text h1,
.answer-text h2,
.answer-text h3,
.answer-text h4,
.answer-text h5,
.answer-text h6 {
    font-weight: 600;
    line-height: 1.35;
    margin-top: 0.85em;
    margin-bottom: 0.35em;
    color: #242424;
}

.answer-text h1:first-child,
.answer-text h2:first-child,
.answer-text h3:first-child,
.answer-text h4:first-child,
.answer-text h5:first-child,
.answer-text h6:first-child {
    margin-top: 0;
}

.answer-text h1 {
    font-size: 1.35em;
}

.answer-text h2 {
    font-size: 1.2em;
}

.answer-text h3 {
    font-size: 1.1em;
}

.answer-text h4,
.answer-text h5,
.answer-text h6 {
    font-size: 1em;
}

.chat-message-error {
    padding: 20px;
    border-radius: 8px;
    box-shadow:
        rgba(182, 52, 67, 1) 1px 1px 2px,
        rgba(182, 52, 67, 1) 0px 0px 1px;
    color: #242424;
    flex: none;
    order: 0;
    flex-grow: 0;
    max-width: 800px;
    margin-bottom: 12px;
}

.chat-message-error-content {
    font-family: 'Segoe UI';
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 22px;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-personal-rag-warning {
    margin: 8px 24px 0;
    padding: 10px 14px;
    border-radius: 8px;
    background: rgba(200, 160, 0, 0.12);
    border: 1px solid rgba(180, 140, 0, 0.4);
}

.chat-personal-rag-warning-content {
    font-family: 'Segoe UI';
    font-size: 13px;
    line-height: 20px;
    color: rgba(80, 60, 0, 0.95);
}

.chat-input-wrapper {
    position: sticky;
    flex: 0 0 auto;
    padding-top: 12px;
    padding-bottom: 24px;
    padding-left: 24px;
    padding-right: 24px;
    width: 100%;
    max-width: 1028px;
    margin-bottom: 50px;
    margin-top: 8px;
}

.question-input-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.question-input-overlay-host {
    position: relative;
    width: 100%;
}

.chat-input-error-overlay {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-sizing: border-box;
    background: rgba(250, 249, 248, 0.88);
    backdrop-filter: blur(4px);
    border-radius: 8px;
}

.chat-input-error-overlay-card.chat-message-error {
    margin-bottom: 0;
    max-width: min(100%, 720px);
    flex: 0 1 auto;
}

.question-input-left-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.question-input-left-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f2f1;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    box-shadow:
        0px 2px 4px rgba(0, 0, 0, 0.14),
        0px 0px 2px rgba(0, 0, 0, 0.12);
    color: #323130;
}

.question-input-left-btn:hover {
    background: #edebe9;
}

.question-input-left-btn:focus-visible {
    outline: 2px solid #0f6cbd;
    outline-offset: 2px;
}

.question-input-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.question-input-container {
    flex: 1;
    min-width: 0;
    min-height: 72px;
    height: 120px;
    position: relative;
    background: #ffffff;
    box-shadow:
        0px 8px 16px rgba(0, 0, 0, 0.14),
        0px 0px 2px rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
}

.question-input-text-area {
    flex: 1;
    width: 100%;
    min-height: 44px;
    max-height: 104px;
    line-height: 20px !important;
    margin: 0;
    padding: 8px 56px 8px 16px !important;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: system-ui, "Segoe UI", Roboto, sans-serif;
    background: transparent;
    resize: none;
    overflow-y: auto;
    overflow-x: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
    box-sizing: border-box;
    align-self: stretch;
}

.question-input-text-area::placeholder {
    color: #9d9d9d;
}

.question-input-text-area:disabled {
    opacity: 0.7;
}

.question-input-right-icons {
    position: absolute;
    right: 12px;
    bottom: 14px;
    top: auto;
    transform: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.question-input-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    border-radius: 6px;
    color: #605e5c;
    background: none;
    border: none;
}

.question-input-icon-btn:hover {
    background: #f3f2f1;
    color: #323130;
}

.question-input-icon-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.question-input-mic-btn.recording {
    background: #fde7e9;
    color: #a4262c;
}

.question-input-mic-btn.recording:hover {
    background: #f9d6db;
    color: #8f1d22;
}

.question-input-send-button-container {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    cursor: pointer;
    padding: 0;
    border-radius: 6px;
}

.question-input-send-button-container:hover:not(:has(.question-input-send-button-disabled)) {
    background: #f3f2f1;
}

.question-input-send-button,
.question-input-send-button-disabled {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #0f6cbd;
}

.question-input-send-button-disabled {
    color: #424242;
    opacity: 0.6;
    cursor: not-allowed;
}

.question-input-file-hidden {
    position: fixed;
    left: -100vw;
    top: -100vh;
    width: 1px;
    height: 1px;
    opacity: 0;
    overflow: hidden;
    clip-path: inset(50%);
    z-index: -1;
}

.document-pending-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 4px;
}

.document-pending {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #edf5fd;
    border-radius: 8px;
    font-size: 13px;
    color: #323130;
}

.document-pending-label {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.document-pending-remove {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 18px;
    color: #605e5c;
    padding: 0 4px;
    line-height: 1;
}

.document-pending-remove:hover {
    color: #a4262c;
}

.document-pending-clear-all {
    align-self: flex-start;
    font-size: 12px;
    color: #605e5c;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px 0;
}

.document-pending-clear-all:hover {
    color: #a4262c;
    text-decoration: underline;
}

.question-input-bottom-border {
    position: absolute;
    width: 100%;
    height: 4px;
    left: 0;
    bottom: 0;
    background: linear-gradient(90deg, #8dddd8 0%, #0f6cbd 100%);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.chat-dictation-hint {
    margin-top: 8px;
    font-size: 12px;
    line-height: 16px;
    color: #605e5c;
}

.chat-dictation-hint.unsupported {
    color: #a4262c;
}

.length-continuation-notice {
    margin-top: 12px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.45;
    color: #323130;
}

.length-continuation-btn {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: #0f6cbd;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
}

.length-continuation-btn:hover {
    background: #115ea3;
}

@media (max-width: 768px) {
    .chat-container {
        width: 100%;
        min-width: 0;
    }

    .chat-root {
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0;
    }

    .chat-container {
        border-radius: 0;
        max-height: 100vh;
        overflow-x: hidden;
    }

    .chat-top-bar,
    .chat-message-stream,
    .chat-input-wrapper {
        padding-left: 12px;
        padding-right: 12px;
    }

    .chat-input-wrapper {
        margin-bottom: 24px;
    }

    .chat-message-gpt,
    .chat-message-user-message {
        max-width: 100%;
    }

    .answer-container {
        width: 100%;
    }

    .answer-text {
        max-width: none;
        margin: 8px;
    }
}

@media (max-width: 480px) {
    .chat-input-wrapper {
        width: 100%;
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    .chat-top-bar,
    .chat-message-stream {
        padding-left: 8px;
        padding-right: 8px;
    }

    .chat-message-stream {
        margin-top: 16px;
    }

    .chat-empty-state-title {
        line-height: 36px;
    }
}
