html, body {
    background: #f6f7f9;
    color: #1f2933;
    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.5rem;
    padding-bottom: 2rem;
}

.panel {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    box-shadow: 0 10px 24px rgba(31, 41, 51, 0.06);
    padding: 1.25rem;
}

.auth-shell {
    align-items: center;
    display: flex;
    justify-content: center;
    min-height: calc(100vh - 8rem);
}

.auth-panel {
    max-width: 440px;
    width: 100%;
}

.metric {
    background: #fff;
    border: 1px solid #dde3ea;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-height: 7rem;
    padding: 1.2rem;
}

.metric span {
    color: #667085;
    font-size: 0.92rem;
}

.metric strong {
    color: #111827;
    font-size: 1.45rem;
}

.install-code {
    background: #111827;
    border-radius: 8px;
    color: #e5e7eb;
    font-size: 0.9rem;
    margin-bottom: 0;
    overflow-x: auto;
    padding: 1rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.table code,
.install-code code {
    color: inherit;
}

.table-url {
    max-width: 20rem;
}

.site-detail-layout {
    align-items: start;
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(0, 1fr) minmax(20rem, 28rem);
}

.site-detail-main,
.site-detail-side {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.site-settings-panel,
.site-side-panel,
.quick-reply-panel {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.settings-section {
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 1.25rem;
}

.settings-section:last-of-type {
    border-bottom: 0;
    padding-bottom: 0;
}

.settings-section-header {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

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

.site-form-grid.compact {
    grid-template-columns: 1fr;
}

.site-form-full {
    grid-column: 1 / -1;
}

.theme-color-control {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: auto minmax(0, 1fr);
}

.setting-switch-row {
    align-items: center;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    min-height: 4rem;
    padding: 0.75rem 0.9rem;
}

.setting-switch-row .form-check {
    margin-bottom: 0;
    white-space: nowrap;
}

.settings-actions {
    display: flex;
    justify-content: flex-end;
}

.settings-actions .btn {
    min-width: 8rem;
}

.lead-field-heading {
    align-items: center;
    display: flex;
    font-weight: 700;
    gap: 0.75rem;
    justify-content: space-between;
}

.site-meta-list {
    display: grid;
    gap: 0.45rem 0.75rem;
    grid-template-columns: 6rem minmax(0, 1fr);
    margin-bottom: 0;
}

.site-meta-list dt {
    color: #667085;
    font-weight: 700;
}

.site-meta-list dd {
    margin-bottom: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.customer-card-list {
    display: none;
}

.customer-mobile-card {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.customer-mobile-card:first-child {
    border-top: 0;
    padding-top: 0;
}

.customer-mobile-card:last-child {
    padding-bottom: 0;
}

.customer-mobile-header {
    align-items: flex-start;
    display: flex;
    gap: 0.75rem;
    justify-content: space-between;
}

.customer-mobile-name,
.customer-mobile-contact {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.customer-mobile-detail {
    display: grid;
    gap: 0.45rem 0.75rem;
    grid-template-columns: 4.5rem minmax(0, 1fr);
    margin: 0.8rem 0 0;
}

.customer-mobile-detail dt {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 700;
}

.customer-mobile-detail dd {
    margin-bottom: 0;
    min-width: 0;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.min-w-0 {
    min-width: 0;
}

.detail-list {
    display: grid;
    gap: 0.6rem 1rem;
    grid-template-columns: minmax(5rem, 7rem) 1fr;
}

.detail-list dt {
    color: #667085;
    font-weight: 600;
}

.detail-list dd {
    margin-bottom: 0;
}

.break-all {
    word-break: break-all;
}

.note-item,
.conversation-item {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 0;
}

.note-item:last-child,
.conversation-item:last-child {
    padding-bottom: 0;
}

.message-line {
    align-items: baseline;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 4rem 1fr auto;
    padding: 0.35rem 0;
}

.message-sender {
    color: #475467;
    font-size: 0.86rem;
    font-weight: 700;
}

.chat-workspace {
    display: grid;
    gap: 1rem;
    grid-template-columns: minmax(18rem, 23rem) minmax(0, 1fr) minmax(18rem, 24rem);
}

.conversation-list {
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
}

.conversation-button {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 0.75rem;
    padding: 0.85rem;
    text-align: left;
    width: 100%;
}

.conversation-title-row {
    align-items: center;
    display: flex;
    gap: 0.5rem;
    justify-content: space-between;
}

.conversation-button.active,
.conversation-button:hover {
    border-color: #1b6ec2;
    box-shadow: 0 0 0 3px rgba(27, 110, 194, 0.12);
}

.conversation-meta {
    align-items: center;
    color: #667085;
    display: flex;
    font-size: 0.8rem;
    gap: 0.5rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.priority-pill {
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1;
    padding: 0.32rem 0.5rem;
    white-space: nowrap;
}

.priority-normal {
    background: #eef2f7;
    color: #475467;
}

.priority-high {
    background: #fff4d6;
    color: #8a4b00;
}

.priority-urgent {
    background: #ffe4e6;
    color: #b42318;
}

.chat-thread {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-height: 34rem;
}

.customer-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-height: calc(100vh - 11rem);
    overflow-y: auto;
}

.sidebar-section {
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-bottom: 1rem;
}

.sidebar-section:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.sidebar-detail-list {
    display: grid;
    gap: 0.45rem 0.8rem;
    grid-template-columns: 4.5rem 1fr;
    margin-bottom: 0;
}

.sidebar-detail-list dt {
    color: #667085;
    font-size: 0.86rem;
    font-weight: 700;
}

.sidebar-detail-list dd {
    font-size: 0.9rem;
    margin-bottom: 0;
}

.thread-header,
.thread-assist,
.message-compose {
    align-items: center;
    display: flex;
    gap: 1rem;
    justify-content: space-between;
}

.thread-assist {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    flex-wrap: wrap;
    padding: 0.8rem;
}

.quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.tag-list.compact {
    gap: 0.3rem;
}

.tag-chip {
    align-items: center;
    background: #edf7f6;
    border: 1px solid #b8ddda;
    border-radius: 999px;
    color: #245c5a;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 700;
    gap: 0.25rem;
    min-height: 1.65rem;
    padding: 0.25rem 0.55rem;
}

.tag-chip.removable {
    cursor: pointer;
}

.tag-chip.removable:hover {
    background: #dff1ef;
}

.note-stack,
.assignment-log {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.note-entry,
.assignment-entry {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.7rem;
}

.message-feed {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 18rem;
    overflow-y: auto;
    padding: 1rem;
}

.chat-bubble {
    border-radius: 8px;
    max-width: min(42rem, 88%);
    padding: 0.75rem 0.9rem;
}

.chat-bubble.agent {
    align-self: flex-end;
    background: #dbeafe;
}

.chat-bubble.customer {
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e5e7eb;
}

.chat-bubble.ai {
    align-self: flex-start;
    background: #ecfdf3;
}

.chat-bubble.system {
    align-self: center;
    background: #f3f4f6;
    color: #475467;
}

.chat-bubble-meta {
    color: #667085;
    font-size: 0.78rem;
    margin-bottom: 0.3rem;
}

.empty-thread {
    align-items: center;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.quick-reply-form {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.lead-field-settings {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.lead-field-row {
    align-items: center;
    display: grid;
    gap: 0.75rem;
    grid-template-columns: minmax(8rem, 1fr) minmax(6rem, 8rem) auto auto;
}

@media (max-width: 640px) {
    .content {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .panel,
    .metric {
        padding: 1rem;
    }

    .customer-table-wrap {
        display: none;
    }

    .customer-card-list {
        display: block;
    }

    .detail-list,
    .message-line {
        grid-template-columns: 1fr;
    }

    .site-detail-layout,
    .site-form-grid,
    .site-meta-list {
        grid-template-columns: 1fr;
    }

    .setting-switch-row,
    .settings-actions,
    .lead-field-heading {
        align-items: stretch;
        flex-direction: column;
    }

    .settings-actions .btn,
    .lead-field-heading .btn {
        width: 100%;
    }

    .chat-workspace {
        grid-template-columns: 1fr;
    }

    .conversation-list {
        max-height: none;
    }

    .customer-sidebar {
        max-height: none;
    }

    .thread-header,
    .thread-assist,
    .message-compose {
        align-items: stretch;
        flex-direction: column;
    }

    .message-compose .btn {
        width: 100%;
    }

    .chat-bubble {
        max-width: 100%;
    }

    .lead-field-row {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}

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;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}
