/* ===== Inteq Customer Portal ===== */

:root {
    --inteq-yellow: #f2c200;
    --inteq-yellow-light: #fef9e7;
    --inteq-yellow-dark: #b8960a;
    --inteq-black: #1a1a1a;
    --inteq-dark-grey: #2d2d2d;
    --inteq-white: #ffffff;
    --inteq-warm-grey: #f5f5f3;
    --inteq-border: #ebebeb;
    --inteq-text-primary: #1a1a1a;
    --inteq-text-secondary: #6b6b6b;
    --inteq-text-tertiary: #999999;
    --inteq-status-red: #dc2626;
    --inteq-status-amber: #d97706;
    --inteq-status-green: #16a34a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif);
    color: var(--inteq-text-primary);
    background: var(--inteq-warm-grey);
}

/* While an Edit Dialog is open the page behind it stays put (docs/edit-dialog.md). */
body:has(.edit-dialog-backdrop) { overflow: hidden; }

/* Remove focus outlines on headings (Blazor FocusOnNavigate targets h1) */
h1:focus, h2:focus, h3:focus, h4:focus, h5:focus, h6:focus {
    outline: none;
}

.portal-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    font-size: 1rem;
    color: var(--inteq-text-tertiary);
}

/* ===== Layout ===== */

.portal-layout {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.portal-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.portal-content {
    flex: 1;
    padding: 2rem;
    overflow-y: auto;
    background: var(--bg);
}

/* Pages sized to the viewport subtract the ticket activity strip when it is shown at the top
   (measured by ticket-activity.js; 45px is the collapsed one-line strip). */
.portal-layout:has(.activity-top) {
    --activity-top-height: var(--activity-top-measured, 45px);
}

/* The page column: the ticket activity strip (when placed at the top) above the scrolling page. */
.portal-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.portal-main > .portal-content {
    min-height: 0;
}

/* Arrows that stand in for a scroll bar (portalScrollCues in scroll-cues.js). Each sticks to an edge of its scrolling
   parent, takes no space, and shows only while there is more that way. Hovering scrolls; clicking moves a page. */
.scroll-cue {
    display: none;
    position: sticky;
    z-index: 1;
    width: 100%;
    height: 22px;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    color: #999;
    font-size: 10px;
    cursor: pointer;
}

.scroll-cue-up {
    top: 0;
    margin-bottom: -22px;
    background: linear-gradient(var(--scroll-cue-bg, var(--panel, #fff)) 45%, transparent);
}

.scroll-cue-down {
    bottom: 0;
    margin-top: -22px;
    background: linear-gradient(transparent, var(--scroll-cue-bg, var(--panel, #fff)) 55%);
}

.scroll-cue:hover {
    color: #b8960a;
}

[data-cue~="up"] > .scroll-cue-up,
[data-cue~="down"] > .scroll-cue-down {
    display: flex;
}

/* Shown once after the feed is switched off from inside itself, so the user knows how to get it back. */
.activity-off-notice {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    max-width: min(440px, calc(100vw - 48px));
    padding: 10px 12px 10px 16px;
    background: var(--inteq-black);
    color: var(--inteq-white);
    border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    font-size: 13px;
}

.activity-off-notice button {
    border: 0;
    border-radius: 5px;
    padding: 5px 10px;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}

.activity-off-notice .activity-off-on {
    background: var(--inteq-yellow);
    color: var(--inteq-black);
}

.activity-off-notice .activity-off-dismiss {
    background: transparent;
    color: #cfcfcf;
}

/* ===== Brand Bar ===== */

.brand-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    padding: 0 1.5rem;
    background: var(--inteq-yellow);
    flex-shrink: 0;
}

.brand-bar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-wordmark {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--inteq-black);
    letter-spacing: -0.5px;
}

.brand-divider {
    width: 1px;
    height: 24px;
    background: rgba(0, 0, 0, 0.2);
}

.brand-portal-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--inteq-black);
}

.brand-bar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-customer-name {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--inteq-black);
}

.brand-user-name {
    font-size: 0.85rem;
    color: var(--inteq-black);
}

.brand-user-avatar {
    font-size: 1.4rem;
    color: var(--inteq-black);
}

.brand-logout {
    font-size: 1rem;
    color: var(--inteq-black);
    text-decoration: none;
    opacity: 0.6;
}

.brand-logout:hover { opacity: 1; }

.brand-settings,
.brand-bug {
    font-size: 1.1rem;
    color: var(--inteq-black);
    text-decoration: none;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    line-height: 1;
}

.brand-settings:hover,
.brand-bug:hover {
    opacity: 0.7;
}

.brand-bug:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* Brand bar customer picker — blend Telerik dropdown with yellow bar */
.brand-bar-picker .k-input-inner {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--inteq-black);
    background: transparent;
}
.brand-bar-picker.k-dropdownlist {
    background: rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}
.brand-bar-picker.k-dropdownlist:hover,
.brand-bar-picker.k-dropdownlist.k-focus {
    background: rgba(0, 0, 0, 0.1);
    border-color: rgba(0, 0, 0, 0.2);
}
/* The popup renders outside the brand bar, so it carries its own class. One line per customer. */
.brand-bar-picker-popup .k-list-item {
    font-size: 0.8rem;
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}
.brand-bar-picker-popup .k-list-item-text {
    min-width: 0;
    overflow: hidden;
}
.brand-bar-picker-item {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-bar-picker .k-button {
    color: var(--inteq-black);
    background: transparent;
    border: none;
}

/* ===== Side Nav ===== */

.side-nav {
    width: 252px;
    background: var(--inteq-white);
    border-right: 1px solid var(--inteq-border);
    padding: 1rem 0;
    overflow-y: auto;
    flex-shrink: 0;
}

.nav-section {
    margin-bottom: 0.5rem;
}

.nav-section-label {
    display: block;
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--inteq-text-tertiary);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
    color: var(--inteq-text-secondary);
    text-decoration: none;
    border-right: 3px solid transparent;
    transition: all 0.15s ease;
}

.nav-item:hover {
    background: var(--inteq-warm-grey);
    color: var(--inteq-text-primary);
}

.nav-item.active {
    background: var(--inteq-yellow-light);
    color: var(--inteq-yellow-dark);
    border-right-color: var(--inteq-yellow);
    font-weight: 500;
}

.nav-icon {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
    color: var(--inteq-text-tertiary);
}

.nav-item.active .nav-icon {
    color: var(--inteq-yellow-dark);
}

.nav-item .status-badge {
    margin-left: auto;
}

/* Inteq staff viewing a feature that is only in internal preview */
.internal-preview-banner {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0.75rem;
    background: var(--inteq-yellow-light);
    border: 1px solid var(--inteq-border);
    border-radius: 6px;
    color: var(--inteq-text-secondary);
    font-size: 0.85rem;
}

.internal-preview-banner i {
    color: var(--inteq-text-tertiary);
}

/* ===== Impersonation Banner ===== */

.impersonation-banner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.5rem;
    background: var(--inteq-status-amber);
    color: white;
    font-size: 0.85rem;
    font-weight: 500;
}

.impersonation-stop {
    margin-left: auto;
    padding: 0.25rem 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.impersonation-stop:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== Page Header ===== */

.page-header {
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--inteq-text-primary);
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--inteq-text-secondary);
    margin-top: 0.25rem;
}

/* ===== Stat Cards ===== */

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
}

.stat-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: var(--inteq-yellow-light);
    border-radius: 8px;
    color: var(--inteq-yellow-dark);
    font-size: 1.1rem;
}

.stat-card-body {
    display: flex;
    flex-direction: column;
}

.stat-card-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--inteq-text-primary);
    line-height: 1.2;
}

.stat-card-loading {
    display: inline-block;
    width: 48px;
    height: 1.5rem;
    background: linear-gradient(90deg, var(--inteq-border) 25%, var(--inteq-warm-grey) 50%, var(--inteq-border) 75%);
    background-size: 200% 100%;
    animation: stat-shimmer 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes stat-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.stat-card-label {
    font-size: 0.8rem;
    color: var(--inteq-text-secondary);
}

/* ===== Status Badges ===== */

.status-badge {
    display: inline-block;
    padding: 0.15rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.status-badge-red { background: #fef2f2; color: var(--inteq-status-red); }
.status-badge-amber { background: #fffbeb; color: var(--inteq-status-amber); }
.status-badge-green { background: #f0fdf4; color: var(--inteq-status-green); }
.status-badge-default { background: var(--inteq-warm-grey); color: var(--inteq-text-secondary); }

/* ===== Dashboard ===== */

.recent-ticket-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--inteq-border);
    text-decoration: none;
    color: var(--inteq-text-primary);
    font-size: 0.85rem;
}

.recent-ticket-item:hover { background: var(--inteq-warm-grey); }
.recent-ticket-id { color: var(--inteq-text-tertiary); font-weight: 500; min-width: 50px; }
.recent-ticket-subject { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.dashboard-view-all {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--inteq-yellow-dark);
    text-decoration: none;
}

.dashboard-view-all:hover { text-decoration: underline; }

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1rem;
}

.dashboard-card {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.dashboard-card h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.dashboard-card-dark {
    background: var(--inteq-black);
    color: white;
    border-color: var(--inteq-dark-grey);
}

.dashboard-card-dark a { color: var(--inteq-yellow); }

/* ===== Ticket Tabs ===== */

.ticket-tabs, .news-categories {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1rem;
}

.ticket-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--inteq-border);
    background: var(--inteq-white);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--inteq-text-secondary);
    transition: all 0.15s ease;
}

.ticket-tab:hover { background: var(--inteq-warm-grey); }
.ticket-tab.active {
    background: var(--inteq-yellow-light);
    border-color: var(--inteq-yellow);
    color: var(--inteq-yellow-dark);
    font-weight: 500;
}

/* ===== Ticket Detail ===== */

.ticket-detail-header { margin-bottom: 1rem; }

.back-link {
    color: var(--inteq-text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover { color: var(--inteq-text-primary); }

.ticket-detail {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
}

.ticket-detail-main {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.5rem;
}

.ticket-detail-main h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.ticket-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ticket-meta-item { font-size: 0.8rem; color: var(--inteq-text-tertiary); }

.ticket-description, .ticket-conversations { margin-top: 1.5rem; }
.ticket-description h3, .ticket-conversations h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.conversation-entry {
    border-top: 1px solid var(--inteq-border);
    padding: 1rem 0;
}

.conversation-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.conversation-date { font-size: 0.8rem; color: var(--inteq-text-tertiary); }
.conversation-body { font-size: 0.875rem; line-height: 1.6; }

/* ===== Comment cards (ticket conversation) ===== */

.comment-card {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 0.9rem 1rem;
    margin-bottom: 0.75rem;
    overflow: hidden;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.comment-avatar {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--inteq-yellow);
    color: var(--inteq-black);
    font-weight: 700;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 0.02em;
}

.comment-meta {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.comment-meta strong { font-size: 0.9rem; color: var(--inteq-text-primary); }

.comment-meta time {
    font-size: 0.75rem;
    color: var(--inteq-text-tertiary);
}

.comment-body {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--inteq-text-primary);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.comment-body p { margin: 0 0 0.6rem; }
.comment-body p:last-child { margin-bottom: 0; }

.comment-body blockquote {
    margin: 0.5rem 0;
    padding: 0.5rem 0.9rem;
    border-left: 3px solid var(--inteq-border);
    color: var(--inteq-text-secondary);
    background: var(--inteq-warm-grey);
    border-radius: 0 4px 4px 0;
}

.comment-body pre {
    background: var(--inteq-warm-grey);
    padding: 0.6rem 0.8rem;
    border-radius: 4px;
    overflow-x: auto;
    font-size: 0.8rem;
}

.comment-body code {
    background: var(--inteq-warm-grey);
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-size: 0.85em;
}

/* Constrain images inside any ticket-scoped content so mobile/wide screenshots don't break layout */
.ticket-description img,
.comment-body img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
    margin: 0.5rem 0;
}

.ticket-description table,
.comment-body table {
    max-width: 100%;
    display: block;
    overflow-x: auto;
}

.ticket-detail-sidebar {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.25rem;
    height: fit-content;
}

.ticket-detail-sidebar h4 { font-size: 0.95rem; margin-bottom: 1rem; }
.ticket-detail-sidebar dl { font-size: 0.85rem; }
.ticket-detail-sidebar dt { color: var(--inteq-text-tertiary); margin-top: 0.75rem; }
.ticket-detail-sidebar dd { font-weight: 500; }

.ticket-view-link {
    color: var(--inteq-text-tertiary);
    text-decoration: none;
}
.ticket-view-link:hover { color: var(--inteq-yellow-dark); }

/* ===== News ===== */

.news-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1rem;
}

.news-card {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.news-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.news-card h3 { font-size: 1rem; margin-bottom: 0.5rem; }
.news-card h3 a { color: var(--inteq-text-primary); text-decoration: none; }
.news-card h3 a:hover { color: var(--inteq-yellow-dark); }
.news-excerpt { font-size: 0.85rem; color: var(--inteq-text-secondary); }
.news-date { font-size: 0.8rem; color: var(--inteq-text-tertiary); }
.news-author { font-size: 0.8rem; color: var(--inteq-text-tertiary); }

.news-detail { max-width: 800px; }
.news-detail h1 { font-size: 1.5rem; margin: 1rem 0; }
.news-detail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.news-content {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.5rem;
    line-height: 1.7;
    font-size: 0.925rem;
}

/* ===== Documents ===== */

.file-type-icon { color: var(--inteq-text-tertiary); font-size: 1.1rem; }
.download-link { color: var(--inteq-text-tertiary); text-decoration: none; }
.download-link:hover { color: var(--inteq-yellow-dark); }

/* ===== Training ===== */

.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.training-card {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    overflow: hidden;
}

.training-thumbnail {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.training-card-body { padding: 1rem; }
.training-card-body h3 { font-size: 1rem; margin: 0.5rem 0; }
.training-card-body h3 a { color: var(--inteq-text-primary); text-decoration: none; }
.training-card-body h3 a:hover { color: var(--inteq-yellow-dark); }
.training-desc { font-size: 0.85rem; color: var(--inteq-text-secondary); margin-bottom: 0.5rem; }
.training-meta { font-size: 0.8rem; color: var(--inteq-text-tertiary); display: flex; gap: 1rem; }

.training-progress {
    height: 6px;
    background: var(--inteq-border);
    border-radius: 3px;
    margin-top: 0.75rem;
    overflow: hidden;
}

.training-progress-bar {
    height: 100%;
    background: var(--inteq-yellow);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.training-progress-label { font-size: 0.75rem; color: var(--inteq-text-tertiary); }

/* ===== Training Documents ===== */

.training-documents-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    align-items: start;
}
.training-documents-layout:has(> .training-documents-main:only-child) {
    grid-template-columns: 1fr;
}

.training-documents-sidebar {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 0.75rem;
}
.training-documents-sidebar h4 {
    margin: 0 0 0.5rem;
    font-size: 0.85rem;
    color: var(--inteq-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.training-documents-folder-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.training-documents-folder-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    background: transparent;
    border: 0;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--inteq-text-primary);
    cursor: pointer;
    text-align: left;
}
.training-documents-folder-btn:hover { background: var(--inteq-warm-grey); }
.training-documents-folder-btn.active {
    background: var(--inteq-yellow-light);
    color: var(--inteq-yellow-dark);
    font-weight: 600;
}
.training-documents-folder-btn .folder-count {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--inteq-text-tertiary);
}

.training-documents-main { min-width: 0; }

.training-documents-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
}
.training-documents-breadcrumb .breadcrumb-segment {
    background: transparent;
    border: 0;
    padding: 0.2rem 0.4rem;
    color: var(--inteq-text-primary);
    cursor: pointer;
    border-radius: 4px;
}
.training-documents-breadcrumb .breadcrumb-segment:hover {
    background: var(--inteq-warm-grey);
    color: var(--inteq-yellow-dark);
}
.training-documents-breadcrumb .breadcrumb-sep {
    color: var(--inteq-text-tertiary);
    padding: 0 0.1rem;
}

.training-documents-row-link {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--inteq-text-primary);
    cursor: pointer;
    text-align: left;
    font: inherit;
}
.training-documents-row-link:hover { color: var(--inteq-yellow-dark); text-decoration: underline; }

/* Admin variant */
.training-documents-admin-toolbar {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.training-documents-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.55rem;
    background: var(--inteq-warm-grey);
    border: 1px solid var(--inteq-border);
    border-radius: 999px;
    font-size: 0.75rem;
    color: var(--inteq-text-secondary);
}
.training-documents-chip .chip-remove {
    background: transparent;
    border: 0;
    color: var(--inteq-text-tertiary);
    cursor: pointer;
    padding: 0;
    font-size: 0.8rem;
}
.training-documents-chip .chip-remove:hover { color: var(--inteq-status-red); }

.training-documents-dropzone {
    position: relative;
    border: 2px dashed transparent;
    border-radius: 8px;
    transition: border-color 0.15s ease, background 0.15s ease;
    padding: 2px;
}
.training-documents-dropzone.is-drag-over {
    border-color: var(--inteq-yellow);
    background: var(--inteq-yellow-light);
}
.training-documents-dropzone-hint {
    display: none;
    position: absolute;
    inset: 0;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(254, 249, 231, 0.85);
    color: var(--inteq-yellow-dark);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: 8px;
    pointer-events: none;
    z-index: 10;
}
.training-documents-dropzone.is-drag-over .training-documents-dropzone-hint {
    display: flex;
}
.training-documents-dropzone-hint i { font-size: 1.4rem; }

/* ===== Video Player ===== */

.video-player-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 1.5rem;
}

.video-element {
    width: 100%;
    border-radius: 8px;
    background: black;
}

/* Caption overlay on the video */
/* Caption overlay on the video */
.video-caption-overlay {
    position: absolute;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 10;
    padding: 0 2rem;
}

/* Position variants (default: bottom) */
.video-caption-overlay.video-caption-bottom { bottom: 60px; }
.video-caption-overlay.video-caption-top { top: 1.5rem; }
.video-caption-overlay.video-caption-center { top: 50%; transform: translateY(-50%); }

.video-caption-text {
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    line-height: 1.5;
    max-width: 80%;
    text-align: center;
    backdrop-filter: blur(4px);
}

/* Font size variants (default: medium) */
.video-caption-text.video-caption-small { font-size: 0.8rem; padding: 0.35rem 1rem; }
.video-caption-text.video-caption-medium { font-size: 1rem; }
.video-caption-text.video-caption-large { font-size: 1.3rem; padding: 0.6rem 1.5rem; }
.video-caption-text.video-caption-x-large { font-size: 1.7rem; padding: 0.75rem 1.75rem; }

.video-caption-text p { margin: 0; }
.video-caption-text strong { color: var(--inteq-yellow); }

/* Caption timeline bar (instruction editor) */
.caption-timeline {
    position: relative;
    height: 28px;
    background: #2d2d2d;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    cursor: pointer;
}

.caption-timeline-segment {
    position: absolute;
    top: 2px;
    bottom: 2px;
    background: var(--inteq-yellow);
    border-radius: 3px;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.15s;
    min-width: 4px;
}

.caption-timeline-segment:hover {
    opacity: 0.85;
    z-index: 2;
}

.caption-timeline-segment.has-audio {
    border-bottom: 2px solid var(--inteq-status-green);
}

.caption-timeline-label {
    display: block;
    padding: 0 4px;
    font-size: 0.6rem;
    line-height: 24px;
    color: var(--inteq-black);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
}

.caption-timeline-playhead {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #fff;
    z-index: 5;
    pointer-events: none;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}

.video-list { margin-top: 1rem; }

.video-list-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-bottom: 1px solid var(--inteq-border);
    text-decoration: none;
    color: var(--inteq-text-primary);
    font-size: 0.875rem;
}

.video-list-item:hover { background: var(--inteq-warm-grey); }
.video-title { flex: 1; }
.video-duration { color: var(--inteq-text-tertiary); font-size: 0.8rem; }

.video-sidebar { background: var(--inteq-white); border: 1px solid var(--inteq-border); border-radius: 8px; padding: 1rem; height: fit-content; }
.video-sidebar h4 { font-size: 0.95rem; margin-bottom: 0.75rem; }

.video-sidebar-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--inteq-text-secondary);
    font-size: 0.85rem;
}

.video-sidebar-item:hover { background: var(--inteq-warm-grey); }
.video-sidebar-item.active { background: var(--inteq-yellow-light); color: var(--inteq-yellow-dark); font-weight: 500; }

.instructions-panel {
    margin-top: 1.5rem;
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1.25rem;
}

.instructions-panel h3 { font-size: 0.95rem; margin-bottom: 0.75rem; }

.instruction-item {
    display: flex;
    gap: 1rem;
    padding: 0.75rem;
    border-top: 1px solid var(--inteq-border);
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.instruction-item:hover { background: var(--inteq-warm-grey); }
.instruction-item.active { background: var(--inteq-yellow-light); border-left: 3px solid var(--inteq-yellow); }

.instruction-timestamp {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--inteq-yellow-dark);
    white-space: nowrap;
    min-width: 40px;
}

.instruction-content { font-size: 0.875rem; line-height: 1.6; }

/* ===== Upgrades ===== */

.upgrade-list { display: flex; flex-direction: column; gap: 0.75rem; }

.upgrade-card {
    display: flex;
    gap: 1rem;
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1rem;
}

.upgrade-vote { display: flex; flex-direction: column; align-items: center; min-width: 50px; }

.vote-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem;
    border: 1px solid var(--inteq-border);
    border-radius: 6px;
    background: var(--inteq-white);
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--inteq-text-secondary);
    transition: all 0.15s ease;
}

.vote-btn:hover { border-color: var(--inteq-yellow); }
.vote-btn.voted { background: var(--inteq-yellow-light); border-color: var(--inteq-yellow); color: var(--inteq-yellow-dark); }
.vote-btn i { font-size: 1.2rem; }

.upgrade-body { flex: 1; }
.upgrade-header { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 0.25rem; }
.upgrade-header h3 { font-size: 1rem; margin: 0; }
.upgrade-desc { font-size: 0.85rem; color: var(--inteq-text-secondary); margin: 0.25rem 0; }
.upgrade-meta { font-size: 0.8rem; color: var(--inteq-text-tertiary); display: flex; gap: 1rem; }

/* ===== Buttons ===== */

.btn-primary {
    padding: 0.5rem 1rem;
    background: var(--inteq-yellow);
    color: var(--inteq-black);
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-primary:hover { background: var(--inteq-yellow-dark); color: white; }

.btn-secondary {
    padding: 0.5rem 1rem;
    background: var(--inteq-white);
    color: var(--inteq-text-secondary);
    border: 1px solid var(--inteq-border);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-secondary:hover { background: var(--inteq-warm-grey); }

/* User management grid — clickable rows */
.user-grid-clickable .k-grid-content tr {
    cursor: pointer;
}
.user-grid-clickable .k-grid-content tr:hover td {
    background: var(--inteq-yellow-light, #fef9e7);
}

/* Feature flags grid — parent/child tree */
.flag-tree .flag-name {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.flag-tree .flag-root {
    font-weight: 600;
}
.flag-tree .flag-branch {
    color: var(--inteq-text-tertiary);
    font-size: 0.75rem;
}
.flag-tree .flag-blocked {
    color: var(--inteq-text-tertiary);
    font-size: 0.75rem;
    font-style: italic;
}

.btn-danger-sm {
    padding: 0.2rem 0.5rem;
    background: transparent;
    color: var(--inteq-status-red);
    border: 1px solid var(--inteq-status-red);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-danger-sm:hover { background: var(--inteq-status-red); color: #fff; }

.btn-secondary-sm {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.6rem;
    background: var(--inteq-warm-grey);
    color: var(--inteq-text-primary);
    border: 1px solid var(--inteq-border);
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
}
.btn-secondary-sm:hover { background: var(--inteq-yellow-light); }

.hero-upload-cell {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    align-items: flex-start;
}
.hero-upload-thumb {
    width: 96px;
    height: 54px;
    object-fit: cover;
    border: 1px solid var(--inteq-border);
    border-radius: 4px;
    background: var(--inteq-warm-grey);
}
.hero-upload-empty {
    font-size: 0.75rem;
    color: var(--inteq-text-tertiary);
    font-style: italic;
}
.hero-upload-actions {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}
.hero-upload-error {
    font-size: 0.7rem;
    color: var(--inteq-status-red);
}

.placeholder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 0.75rem;
}
.placeholder-tile {
    position: relative;
    border: 1px solid var(--inteq-border);
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--inteq-warm-grey);
}
.placeholder-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.placeholder-tile .btn-danger-sm {
    position: absolute;
    top: 0.4rem;
    right: 0.4rem;
    background: rgba(255,255,255,0.9);
}

.form-group { margin-bottom: 0.75rem; }
.form-group label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 0.25rem; }

/* ===== Custom Dashboards ===== */

.widget-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    gap: 0.5rem;
    color: var(--inteq-text-tertiary);
    font-size: 0.85rem;
}

.widget-placeholder i { font-size: 1.5rem; }

.widget-content { padding: 0.5rem; height: 100%; overflow: auto; }

.widget-stat-row {
    display: flex;
    justify-content: space-around;
    align-items: center;
    height: 100%;
}

.widget-stat { text-align: center; }
.widget-stat-value { display: block; font-size: 1.8rem; font-weight: 700; color: var(--inteq-text-primary); }
.widget-stat-label { font-size: 0.7rem; color: var(--inteq-text-tertiary); text-transform: uppercase; }

/* ===== Settings ===== */

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1rem;
}

.settings-dl { font-size: 0.875rem; }
.settings-dl dt { color: var(--inteq-text-tertiary); margin-top: 0.75rem; }
.settings-dl dd { font-weight: 500; }

.settings-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--inteq-border);
    font-size: 0.875rem;
}

.settings-tab-nav {
    display: flex;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}
.settings-tab-pill {
    padding: 0.35rem 0.85rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid var(--inteq-border);
    background: var(--inteq-white);
    color: var(--inteq-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}
.settings-tab-pill:hover {
    background: var(--inteq-warm-grey);
    border-color: var(--inteq-text-tertiary);
    color: var(--inteq-text-primary);
}
.settings-tab-pill.active {
    background: var(--inteq-black);
    border-color: var(--inteq-black);
    color: var(--inteq-yellow);
}

/* ===== Utilities ===== */

.text-muted { color: var(--inteq-text-tertiary); font-size: 0.875rem; }

/* ===== Error UI ===== */

#blazor-error-ui {
    background: var(--inteq-status-red);
    color: white;
    padding: 0.75rem 1.5rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    z-index: 1000;
    display: none;
}

#blazor-error-ui .reload { color: white; font-weight: 600; }
#blazor-error-ui .dismiss { cursor: pointer; margin-left: 1rem; }

.blazor-error-boundary {
    background: #b32121;
    padding: 1rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred.";
}

/* ===== AI Analysis ===== */

.ai-badge {
    display: inline-block;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 0.65rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    vertical-align: middle;
    margin-left: 0.5rem;
}

.ai-input-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.ai-chips {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.ai-chip {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 0.8rem;
    color: var(--inteq-text-secondary);
    cursor: pointer;
    transition: all 0.15s ease;
}

.ai-chip:hover {
    border-color: var(--inteq-yellow);
    background: var(--inteq-yellow-light);
    color: var(--inteq-text-primary);
}

.ai-loading { margin: 2rem 0; }

.ai-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
}

.ai-chart-card {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-border);
    border-radius: 8px;
    padding: 1rem;
}

.ai-chart-card h4 {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    color: var(--inteq-text-primary);
}

.ai-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

.ai-table th {
    text-align: left;
    padding: 8px 12px;
    background: var(--inteq-warm-grey);
    font-weight: 600;
    color: var(--inteq-text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--inteq-border);
}

.ai-table td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--inteq-border);
    color: var(--inteq-text-primary);
}

.ai-insights {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
}

.ai-insights li {
    padding: 6px 0 6px 20px;
    position: relative;
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--inteq-text-primary);
}

.ai-insights li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 8px;
    background: var(--inteq-yellow);
    border-radius: 50%;
}

/* ===== Shared Chat Bubble Styles ===== */

.chat-bubble {
    display: flex;
    gap: 10px;
    max-width: 85%;
}

.chat-user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.chat-ai {
    align-self: flex-start;
}

.chat-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--inteq-yellow-light);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--inteq-yellow-dark);
    font-size: 0.85rem;
}

.chat-content {
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.chat-ai .chat-content {
    background: var(--inteq-warm-grey);
    color: var(--inteq-text-primary);
    border-bottom-left-radius: 4px;
}

.chat-user .chat-content {
    background: var(--inteq-yellow);
    color: var(--inteq-black);
    border-bottom-right-radius: 4px;
}

.chat-content p {
    margin: 0;
    white-space: pre-wrap;
}

.chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-left: 42px;
}

.chat-option-btn {
    background: var(--inteq-white);
    border: 1px solid var(--inteq-yellow);
    color: var(--inteq-text-primary);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.15s;
}

.chat-option-btn:hover:not(:disabled) {
    background: var(--inteq-yellow-light);
    border-color: var(--inteq-yellow-dark);
}

.chat-option-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-typing {
    color: var(--inteq-text-tertiary);
    font-style: italic;
}

.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 2px;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--inteq-text-tertiary);
    animation: chat-typing-bounce 1.2s infinite;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes chat-typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

.chat-error {
    padding: 8px 16px;
    color: var(--inteq-status-red);
    font-size: 0.85rem;
}

/* Entrance effect for newly appended AI/assistant chat bubbles.
   Applied explicitly per message, cleared once the animation ends. */
.ai-bubble-pop {
    animation: ai-bubble-pop 350ms cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes ai-bubble-pop {
    0% { transform: scale(0.92); opacity: 0; }
    60% { transform: scale(1.02); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

/* Reduced motion: no movement, but still a completing animation so animationend
   fires and the one-shot entrance state is cleared. */
@media (prefers-reduced-motion: reduce) {
    .ai-bubble-pop { animation: ai-bubble-pop-static 1ms linear both; }
}

@keyframes ai-bubble-pop-static {
    from { opacity: 1; }
    to { opacity: 1; }
}

/* ── James Report ── */

.report-filter-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.year-pills {
    display: flex;
    gap: 0.35rem;
}

.year-pill {
    padding: 0.35rem 0.85rem;
    border: 1px solid var(--inteq-border);
    border-radius: 16px;
    background: var(--inteq-white);
    color: var(--inteq-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s;
}

.year-pill:hover {
    border-color: var(--inteq-yellow);
}

.year-pill.active {
    background: var(--inteq-yellow);
    color: var(--inteq-black);
    border-color: var(--inteq-yellow);
    font-weight: 600;
}

.report-date-pickers {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.group-toggle {
    display: flex;
    border: 1px solid var(--inteq-border);
    border-radius: 6px;
    overflow: hidden;
    margin-left: auto;
}

.group-toggle button {
    padding: 0.4rem 0.85rem;
    border: none;
    background: var(--inteq-white);
    color: var(--inteq-text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s;
}

.group-toggle button:first-child {
    border-right: 1px solid var(--inteq-border);
}

.group-toggle button:hover {
    background: var(--inteq-warm-grey);
}

.group-toggle button.active {
    background: var(--inteq-yellow);
    color: var(--inteq-black);
    font-weight: 600;
}

/* Priority cells in statistics table */
.priority-cell-urgent {
    color: #dc2626;
    font-weight: 600;
}

.priority-cell-high {
    color: #d97706;
    font-weight: 600;
}

.priority-cell-medium {
    color: #16a34a;
    font-weight: 600;
}

.priority-cell-low {
    color: #3b82f6;
    font-weight: 600;
}

/* Totals row below grid */
.report-totals-row {
    background: var(--inteq-yellow);
    padding: 0.6rem 1rem;
    border-radius: 0 0 8px 8px;
    margin-top: -1px;
}

.report-totals-grid {
    display: grid;
    grid-template-columns: 120px repeat(11, 1fr);
    gap: 0.5rem;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--inteq-black);
}

.report-totals-label {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Grid styling overrides for report */
.analytics-report-grid .k-grid-header {
    font-size: 0.8rem;
}

.analytics-report-grid .k-table-td {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}

/* TreeView icon spacing — Telerik renders icons as span.k-icon */
.k-treeview .k-treeview-leaf > .k-icon {
    margin-right: 0.5rem;
    color: var(--inteq-text-tertiary);
}

/* ===== Shimmer / Loading Placeholders ===== */

.shimmer-text {
    display: inline-block;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--inteq-border) 25%, #f5f5f3 50%, var(--inteq-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    color: transparent !important;
}

.shimmer-block {
    background: linear-gradient(90deg, var(--inteq-border) 25%, #f5f5f3 50%, var(--inteq-border) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== Blazor Reconnect Overlay ===== */

#components-reconnect-modal {
    display: none;
}

#components-reconnect-modal.components-reconnect-show {
    display: flex;
}

.portal-reconnect-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(26, 26, 26, 0.7);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.portal-reconnect-dialog {
    background: var(--inteq-white, #fff);
    border-radius: 12px;
    padding: 2rem 2.5rem;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    overflow: hidden;
}

.portal-reconnect-bar {
    height: 3px;
    background: var(--inteq-yellow, #f2c200);
    border-radius: 2px;
    margin-bottom: 1.5rem;
    animation: reconnect-bar 2s infinite;
}

@keyframes reconnect-bar {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 0; margin-left: 100%; }
}

.portal-reconnect-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--inteq-text-primary, #1a1a1a);
    margin-bottom: 0.5rem;
}

.portal-reconnect-sub {
    font-size: 0.85rem;
    color: var(--inteq-text-secondary, #6b6b6b);
}

.portal-reconnect-link {
    color: var(--inteq-yellow-dark, #b8960a);
    text-decoration: underline;
}

/* Also handle the rejected state (connection could not be re-established) */
#components-reconnect-modal.components-reconnect-rejected,
#components-reconnect-modal.components-reconnect-failed {
    display: flex;
}

#components-reconnect-modal.components-reconnect-rejected .portal-reconnect-text,
#components-reconnect-modal.components-reconnect-failed .portal-reconnect-text {
    color: var(--inteq-status-red, #dc2626);
}

#components-reconnect-modal.components-reconnect-rejected .portal-reconnect-bar,
#components-reconnect-modal.components-reconnect-failed .portal-reconnect-bar {
    background: var(--inteq-status-red, #dc2626);
    animation: none;
    width: 100%;
}
