* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    flex-direction: column;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    color: #172b4d;
    background: #f4f5f7;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: #ff8200;
    color: #fff;
}

.title {
    font-weight: 600;
    font-size: 16px;
}

.link-button {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 4px;
    color: #fff;
    padding: 4px 10px;
    cursor: pointer;
}

.messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 8px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.message p {
    margin: 0 0 6px;
}

.message p:last-child {
    margin-bottom: 0;
}

.message ul {
    margin: 4px 0;
    padding-left: 20px;
}

.message ul ul {
    margin: 2px 0;
}

.message h4 {
    margin: 14px 0 4px;
    font-size: 14px;
}

.message h4:first-child {
    margin-top: 0;
}

.message hr {
    border: none;
    border-top: 1px solid #dfe1e6;
    margin: 12px 0;
}

.message .table-wrap {
    overflow-x: auto;
    margin: 6px 0;
}

.message table {
    border-collapse: collapse;
    font-size: 13px;
}

.message th, .message td {
    border: 1px solid #dfe1e6;
    padding: 3px 8px;
    text-align: left;
    vertical-align: top;
    overflow-wrap: normal;
    word-break: normal;
}

.message th {
    background: #f4f5f7;
}

.message .nowrap {
    white-space: nowrap;
}

/* answers with a table may use the full width of the window */
.assistant:has(table) {
    max-width: 100%;
}

.user {
    align-self: flex-end;
    background: #ffe2c4;
    white-space: pre-wrap;
}

.assistant {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #dfe1e6;
}

.error {
    align-self: flex-start;
    background: #ffebe6;
    border: 1px solid #ffbdad;
}

.status {
    padding: 4px 16px;
    color: #6b778c;
    font-style: italic;
}

.composer {
    display: flex;
    gap: 8px;
    padding: 10px 16px;
    background: #fff;
    border-top: 1px solid #dfe1e6;
}

.composer textarea {
    flex: 1;
    resize: none;
    font: inherit;
    padding: 8px;
    border: 1px solid #c1c7d0;
    border-radius: 4px;
}

.composer button {
    background: #ff8200;
    border: none;
    border-radius: 4px;
    color: #fff;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
}

.composer button:disabled {
    background: #c1c7d0;
    cursor: default;
}

.disclaimer {
    padding: 4px 16px 8px;
    font-size: 11px;
    color: #6b778c;
    background: #fff;
}
