/* ============================================================
   Jolu Design System — Components
   Built from material-web v0.192 token specs
   ============================================================ */

/* ── Buttons ── */
.md-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 24px;
    border: none;
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-full);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    line-height: var(--md-sys-typescale-label-large-line-height);
    letter-spacing: 0.00625rem;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized),
        background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-linear);
    position: relative;
    overflow: hidden;
    text-decoration: none;
}

.md-button:disabled,
.md-button[aria-disabled="true"] {
    cursor: not-allowed;
    opacity: 0.38;
    pointer-events: none;
}

.md-button .material-symbols-outlined {
    font-size: 18px;
}

/* Filled */
.md-button--filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.md-button--filled:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

/* Filled Tonal */
.md-button--tonal {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.md-button--tonal:hover {
    box-shadow: var(--md-sys-elevation-level1);
}

/* Elevated */
.md-button--elevated {
    background: var(--md-sys-color-surface-container-low);
    color: var(--md-sys-color-primary);
    box-shadow: var(--md-sys-elevation-level1);
}

.md-button--elevated:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

/* Outlined */
.md-button--outlined {
    background: transparent;
    color: var(--md-sys-color-primary);
    border: 1px solid var(--md-sys-color-outline);
}

.md-button--outlined:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

/* Text */
.md-button--text {
    background: transparent;
    color: var(--md-sys-color-primary);
    padding: 0 12px;
}

.md-button--text:hover {
    background: color-mix(in srgb, var(--md-sys-color-primary) 8%, transparent);
}

/* ── FAB ── */
.md-fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border: none;
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-large);
    background: var(--md-sys-color-primary-container);
    color: var(--md-sys-color-on-primary-container);
    box-shadow: var(--md-sys-elevation-level3);
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
}

.md-fab:hover {
    box-shadow: var(--md-sys-elevation-level4);
}

.md-fab .material-symbols-outlined {
    font-size: 24px;
}

.md-fab--small {
    width: 40px;
    height: 40px;
    border-radius: var(--md-sys-shape-corner-medium);
}

.md-fab--large {
    width: 96px;
    height: 96px;
    border-radius: var(--md-sys-shape-corner-extra-large);
}

.md-fab--large .material-symbols-outlined {
    font-size: 36px;
}

.md-fab--extended {
    width: auto;
    padding: 0 16px;
    gap: 12px;
    border-radius: var(--md-sys-shape-corner-large);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
}

/* ── Cards ── */
.md-card {
    border-radius: var(--md-sys-shape-corner-medium);
    overflow: hidden;
    transition: box-shadow var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-emphasized);
}

.md-card--elevated {
    background: var(--md-sys-color-surface-container-low);
    --md-text-field-label-bg: var(--md-sys-color-surface-container-low);
    box-shadow: var(--md-sys-elevation-level1);
}

.md-card--elevated:hover {
    box-shadow: var(--md-sys-elevation-level2);
}

.md-card--filled {
    background: var(--md-sys-color-surface-container-highest);
    --md-text-field-label-bg: var(--md-sys-color-surface-container-highest);
    box-shadow: none;
}

.md-card--outlined {
    background: var(--md-sys-color-surface);
    --md-text-field-label-bg: var(--md-sys-color-surface);
    border: 1px solid var(--md-sys-color-outline-variant);
}

/* ── Chips ── */
.md-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 32px;
    padding: 0 16px;
    border-radius: var(--md-sys-shape-corner-small);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    border: 1px solid var(--md-sys-color-outline);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-chip--selected {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    border-color: transparent;
}

.md-chip .material-symbols-outlined {
    font-size: 18px;
}

/* ── Switch ──
   52×32 track, 16px handle (unselected) / 24px handle (selected) */
.md-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 52px;
    height: 32px;
    cursor: pointer;
}

.md-switch input {
    opacity: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    cursor: pointer;
    margin: 0;
}

.md-switch__track {
    position: absolute;
    width: 52px;
    height: 32px;
    border-radius: var(--md-sys-shape-corner-full);
    border: 2px solid var(--md-sys-color-outline);
    background: var(--md-sys-color-surface-container-highest);
    transition: all var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-emphasized);
}

.md-switch__handle {
    position: absolute;
    left: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-outline);
    transition: all var(--md-sys-motion-duration-medium1) var(--md-sys-motion-easing-emphasized);
}

.md-switch input:checked~.md-switch__track {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.md-switch input:checked~.md-switch__handle {
    left: 28px;
    width: 24px;
    height: 24px;
    background: var(--md-sys-color-on-primary);
}

/* ── Checkbox ── */
.md-checkbox {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 2px solid var(--md-sys-color-on-surface-variant);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-checkbox--checked {
    background: var(--md-sys-color-primary);
    border-color: var(--md-sys-color-primary);
}

.md-checkbox--checked::after {
    content: '';
    display: block;
    width: 4px;
    height: 8px;
    border: solid var(--md-sys-color-on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}

/* ── Radio ── */
.md-radio {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 2px solid var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-radio--selected {
    border-color: var(--md-sys-color-primary);
}

.md-radio--selected::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-primary);
}

/* ── Text Field ── */
.md-text-field {
    position: relative;
    width: 100%;
}

.md-text-field__input {
    width: 100%;
    height: 56px;
    padding: 20px 16px 4px;
    border: none;
    border-radius: var(--md-sys-shape-corner-extra-small) var(--md-sys-shape-corner-extra-small) 0 0;
    background: var(--md-sys-color-surface-container-highest);
    color: var(--md-sys-color-on-surface);
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
    outline: none;
    transition: border-color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-text-field__input:focus {
    border-bottom: 2px solid var(--md-sys-color-primary);
}

.md-text-field__label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
    pointer-events: none;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-text-field__input:focus~.md-text-field__label,
.md-text-field__input:not(:placeholder-shown)~.md-text-field__label,
.md-text-field__input:-webkit-autofill~.md-text-field__label {
    top: 8px;
    transform: translateY(0);
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-primary);
}

/* Outlined text field */
.md-text-field--outlined .md-text-field__input {
    background: transparent;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-extra-small);
    padding: 16px;
}

.md-text-field--outlined .md-text-field__input:focus {
    border: 2px solid var(--md-sys-color-primary);
    padding: 15px;
}

.md-text-field--outlined .md-text-field__input:focus~.md-text-field__label,
.md-text-field--outlined .md-text-field__input:not(:placeholder-shown)~.md-text-field__label,
.md-text-field--outlined .md-text-field__input:-webkit-autofill~.md-text-field__label {
    top: 0;
    transform: translateY(-50%);
    background: var(--md-text-field-label-bg, var(--md-sys-color-surface));
    padding: 0 4px;
    left: 12px;
}

/* Error state */
.md-text-field--error .md-text-field__input {
    border-color: var(--md-sys-color-error);
}

.md-text-field--error .md-text-field__input:focus {
    border-color: var(--md-sys-color-error);
}

.md-text-field--error .md-text-field__label {
    color: var(--md-sys-color-error);
}

.md-text-field--error .md-text-field__input:focus~.md-text-field__label,
.md-text-field--error .md-text-field__input:not(:placeholder-shown)~.md-text-field__label {
    color: var(--md-sys-color-error);
}

/* Icons */
.md-text-field__icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--md-sys-color-on-surface-variant);
}

.md-text-field__icon--leading {
    left: 12px;
}

.md-text-field__icon--trailing {
    right: 12px;
}

.md-text-field:has(.md-text-field__icon--leading) .md-text-field__input {
    padding-left: 44px;
}

.md-text-field:has(.md-text-field__icon--leading) .md-text-field__label {
    left: 44px;
}

.md-text-field:has(.md-text-field__icon--trailing) .md-text-field__input {
    padding-right: 44px;
}

.md-text-field--error .md-text-field__icon--trailing {
    color: var(--md-sys-color-error);
}

/* Helper text */
.md-text-field__helper {
    display: block;
    margin-top: 4px;
    padding: 0 16px;
    font-family: var(--md-sys-typescale-body-small-font);
    font-size: var(--md-sys-typescale-body-small-size);
    color: var(--md-sys-color-on-surface-variant);
}

.md-text-field--error .md-text-field__helper {
    color: var(--md-sys-color-error);
}

/* ── Dialog ── */
.md-dialog-scrim {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.32);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized),
        visibility var(--md-sys-motion-duration-medium2);
}

.md-dialog-scrim.open {
    opacity: 1;
    visibility: visible;
}

.md-dialog {
    background: var(--md-sys-color-surface-container-high);
    --md-text-field-label-bg: var(--md-sys-color-surface-container-high);
    color: var(--md-sys-color-on-surface);
    border-radius: var(--md-sys-shape-corner-extra-large);
    padding: 24px;
    min-width: 280px;
    max-width: 560px;
    box-shadow: var(--md-sys-elevation-level3);
}

.md-dialog__title {
    font-family: var(--md-sys-typescale-headline-small-font);
    font-size: var(--md-sys-typescale-headline-small-size);
    line-height: var(--md-sys-typescale-headline-small-line-height);
    margin-bottom: 16px;
}

.md-dialog__content {
    font-family: var(--md-sys-typescale-body-medium-font);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
    margin-bottom: 24px;
}

.md-dialog__actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ── Snackbar ── */
.md-snackbar {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    padding: 14px 16px;
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-family: var(--md-sys-typescale-body-medium-font);
    font-size: var(--md-sys-typescale-body-medium-size);
    box-shadow: var(--md-sys-elevation-level3);
    z-index: 200;
    opacity: 0;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized-decelerate);
}

.md-snackbar.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Snackbar acima da bottom-nav no mobile */
@media (max-width: 599px) {
    .md-snackbar {
        bottom: 96px;
    }
}

.md-snackbar__action {
    color: var(--md-sys-color-inverse-primary);
    background: none;
    border: none;
    cursor: pointer;
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    margin-left: 12px;
}

/* ── Segmented Button (Tabs) ── */
.md-segmented-buttons {
    display: inline-flex;
    border: 1px solid var(--md-sys-color-outline);
    border-radius: var(--md-sys-shape-corner-full);
    overflow: hidden;
}

.md-segmented-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 40px;
    padding: 0 16px;
    border: none;
    border-right: 1px solid var(--md-sys-color-outline);
    background: transparent;
    color: var(--md-sys-color-on-surface);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    cursor: pointer;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-segmented-button:last-child {
    border-right: none;
}

.md-segmented-button--selected {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.md-segmented-button .material-symbols-outlined {
    font-size: 18px;
}

/* ── Navigation Rail ── */
.md-nav-rail {
    width: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--md-sys-color-surface);
    border-right: none;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
}

.md-nav-rail__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 0 8px;
    flex-shrink: 0;
}

.md-nav-rail__items {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.md-nav-rail__items::-webkit-scrollbar {
    display: none;
}

.md-nav-rail__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
    width: 100%;
    min-height: 52px;
    flex-shrink: 0;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
}

.md-nav-rail__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 32px;
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-nav-rail__item-label {
    font-family: var(--md-sys-typescale-label-medium-font);
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
    line-height: var(--md-sys-typescale-label-medium-line-height);
    text-align: center;
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-nav-rail__item:hover .md-nav-rail__item-icon {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-nav-rail__item.active {
    color: var(--md-sys-color-on-surface);
}

.md-nav-rail__item.active .md-nav-rail__item-icon {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* ── Navigation Sidebar (collapsible) ── */
.md-nav-sidebar {
    width: 260px;
    display: flex;
    flex-direction: column;
    background: var(--md-sys-color-surface);
    border-right: 1px solid var(--md-sys-color-outline-variant);
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 50;
    transition: width 300ms var(--md-sys-motion-easing-emphasized, cubic-bezier(0.2, 0, 0, 1));
    overflow: hidden;
}

.md-nav-sidebar--collapsed {
    width: 72px;
}

.md-nav-sidebar__logo {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    flex-shrink: 0;
    height: 72px;
    text-decoration: none;
    overflow: hidden;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__logo {
    padding: 20px 12px;
}

.md-nav-sidebar__logo img {
    flex-shrink: 0;
    object-fit: contain;
}

.md-nav-sidebar__items {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--md-sys-color-outline-variant) transparent;
}

.md-nav-sidebar__items::-webkit-scrollbar {
    width: 4px;
}

.md-nav-sidebar__items::-webkit-scrollbar-track {
    background: transparent;
}

.md-nav-sidebar__items::-webkit-scrollbar-thumb {
    background: var(--md-sys-color-outline-variant);
    border-radius: 4px;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__items {
    padding: 8px 8px;
}

.md-nav-sidebar__section-header {
    font-family: var(--md-sys-typescale-label-small-font);
    font-size: var(--md-sys-typescale-label-small-size);
    font-weight: var(--md-sys-typescale-label-small-weight);
    letter-spacing: var(--md-sys-typescale-label-small-tracking, 0.5px);
    text-transform: uppercase;
    color: var(--md-sys-color-on-surface-variant);
    padding: 16px 16px 4px;
    white-space: nowrap;
    overflow: hidden;
    opacity: 1;
    transition: opacity 200ms var(--md-sys-motion-easing-standard);
}

.md-nav-sidebar--collapsed .md-nav-sidebar__section-header {
    opacity: 0;
    height: 0;
    padding: 0;
    margin: 0;
    pointer-events: none;
}

.md-nav-sidebar__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    height: 48px;
    border-radius: var(--md-sys-shape-corner-full);
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    flex-shrink: 0;
    transition: background 200ms var(--md-sys-motion-easing-standard);
}

.md-nav-sidebar--collapsed .md-nav-sidebar__item {
    justify-content: center;
    padding: 0;
}

.md-nav-sidebar__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.md-nav-sidebar__item-label {
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    line-height: var(--md-sys-typescale-label-large-line-height);
    opacity: 1;
    transition: opacity 200ms var(--md-sys-motion-easing-standard);
    overflow: hidden;
    text-overflow: ellipsis;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__item-label {
    opacity: 0;
    width: 0;
    pointer-events: none;
}

.md-nav-sidebar__item:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-nav-sidebar__item.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.md-nav-sidebar__item--locked {
    opacity: 0.38;
    cursor: not-allowed;
}

/* Tooltip for collapsed mode */
.md-nav-sidebar--collapsed .md-nav-sidebar__item[data-tooltip] {
    overflow: visible;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__item[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: calc(100% + 8px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    font-family: var(--md-sys-typescale-body-small-font);
    font-size: var(--md-sys-typescale-body-small-size);
    padding: 4px 8px;
    border-radius: var(--md-sys-shape-corner-extra-small);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transition: opacity 150ms var(--md-sys-motion-easing-standard);
    z-index: 100;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__item[data-tooltip]:hover::after {
    opacity: 1;
}

/* User section */
.md-nav-sidebar__user {
    position: relative;
    flex-shrink: 0;
    border-top: 1px solid var(--md-sys-color-outline-variant);
}

.md-nav-sidebar__user-button {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: background 200ms var(--md-sys-motion-easing-standard);
    text-align: left;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__user-button {
    justify-content: center;
    padding: 12px 0;
}

.md-nav-sidebar__user-button:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-nav-sidebar__user-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--md-sys-shape-corner-full);
    font-size: 14px;
    font-weight: 500;
    flex-shrink: 0;
}

.md-nav-sidebar__user-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 1px;
}

.md-nav-sidebar__user-info span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.md-nav-sidebar--collapsed .md-nav-sidebar__user-info {
    display: none;
}

/* Toggle button */
.md-nav-sidebar__toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border-top: 1px solid var(--md-sys-color-outline-variant);
    transition: background 200ms var(--md-sys-motion-easing-standard);
}

.md-nav-sidebar__toggle:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

/* ── Icon button ── */
.md-icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    border-radius: var(--md-sys-shape-corner-full);
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-linear);
}

.md-icon-button:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface-variant) 8%, transparent);
}

.md-icon-button--filled {
    background: var(--md-sys-color-primary);
    color: var(--md-sys-color-on-primary);
}

.md-icon-button--tonal {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

/* ── Divider ── */
.md-divider {
    height: 1px;
    background: var(--md-sys-color-outline-variant);
    border: none;
}

/* ── List ── */
.md-list {
    list-style: none;
}

.md-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 24px 8px 16px;
    min-height: 56px;
    color: var(--md-sys-color-on-surface);
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    cursor: pointer;
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-linear);
}

.md-list-item:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-list-item__icon {
    color: var(--md-sys-color-on-surface-variant);
}

.md-list-item__supporting {
    font-family: var(--md-sys-typescale-body-medium-font);
    font-size: var(--md-sys-typescale-body-medium-size);
    color: var(--md-sys-color-on-surface-variant);
}

/* ── Badge ── */
.md-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: var(--md-sys-shape-corner-full);
    background: var(--md-sys-color-error);
    color: var(--md-sys-color-on-error);
    font-family: var(--md-sys-typescale-label-small-font);
    font-size: var(--md-sys-typescale-label-small-size);
    font-weight: var(--md-sys-typescale-label-small-weight);
}

/* ── Progress (linear) ── */
.md-progress {
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-corner-full);
    overflow: hidden;
}

.md-progress__bar {
    height: 100%;
    width: 50%;
    background: var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-full);
    transition: width var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

/* ── Slider ── */
.md-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: var(--md-sys-color-surface-container-highest);
    border-radius: var(--md-sys-shape-corner-full);
    outline: none;
}

.md-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: var(--md-sys-color-primary);
    border-radius: var(--md-sys-shape-corner-full);
    cursor: pointer;
    border: none;
}

/* ── Top App Bar ── */
.md-top-app-bar {
    display: flex;
    align-items: center;
    height: 64px;
    padding: 0 4px 0 4px;
    background: var(--md-sys-color-surface);
    color: var(--md-sys-color-on-surface);
    position: sticky;
    top: 0;
    z-index: 40;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.md-top-app-bar--center-aligned .md-top-app-bar__title {
    flex: 1;
    text-align: center;
}

.md-top-app-bar--small .md-top-app-bar__title {
    flex: 1;
    padding-left: 12px;
}

.md-top-app-bar__leading {
    display: flex;
    align-items: center;
}

.md-top-app-bar__title {
    font-family: var(--md-sys-typescale-title-large-font);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: var(--md-sys-typescale-title-large-weight);
    line-height: var(--md-sys-typescale-title-large-line-height);
}

.md-top-app-bar__trailing {
    display: flex;
    align-items: center;
    margin-left: auto;
}

.md-top-app-bar--scrolled {
    box-shadow: var(--md-sys-elevation-level2);
    background: var(--md-sys-color-surface-container);
}

.md-top-app-bar--medium {
    height: 112px;
    flex-wrap: wrap;
    align-content: flex-end;
    padding-bottom: 20px;
}

.md-top-app-bar--medium .md-top-app-bar__title {
    width: 100%;
    padding: 4px 16px 0;
    font-family: var(--md-sys-typescale-headline-small-font);
    font-size: var(--md-sys-typescale-headline-small-size);
    font-weight: var(--md-sys-typescale-headline-small-weight);
}

.md-top-app-bar--large {
    height: 152px;
    flex-wrap: wrap;
    align-content: flex-end;
    padding-bottom: 28px;
}

.md-top-app-bar--large .md-top-app-bar__title {
    width: 100%;
    padding: 4px 16px 0;
    font-family: var(--md-sys-typescale-headline-medium-font);
    font-size: var(--md-sys-typescale-headline-medium-size);
    font-weight: var(--md-sys-typescale-headline-medium-weight);
}

/* ── Mobile Header (minimal) ── */
.md-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    padding: 0 8px;
    background: var(--md-sys-color-surface);
    flex-shrink: 0;
    z-index: 40;
}

/* ── Bottom Navigation Bar ── */
.md-bottom-nav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 80px;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--md-sys-color-surface-container);
    box-shadow: var(--md-sys-elevation-level2);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 50;
}

.md-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 0 16px;
    min-width: 64px;
    text-decoration: none;
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    border: none;
    background: none;
}

.md-bottom-nav__item-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 32px;
    border-radius: var(--md-sys-shape-corner-full);
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-bottom-nav__item-label {
    font-family: var(--md-sys-typescale-label-medium-font);
    font-size: var(--md-sys-typescale-label-medium-size);
    font-weight: var(--md-sys-typescale-label-medium-weight);
}

.md-bottom-nav__item.active {
    color: var(--md-sys-color-on-surface);
}

.md-bottom-nav__item.active .md-bottom-nav__item-icon {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
}

.md-bottom-nav__item.active .md-bottom-nav__item-label {
    font-weight: var(--md-sys-typescale-label-large-weight);
}

/* ── Navigation Drawer ── */
.md-nav-drawer-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized),
        visibility var(--md-sys-motion-duration-medium2);
}

.md-nav-drawer-scrim.open {
    opacity: 1;
    visibility: visible;
}

.md-nav-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 360px;
    background: var(--md-sys-color-surface-container-low);
    z-index: 91;
    padding: 12px;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
    border-radius: 0 var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0;
}

.md-nav-drawer.open {
    transform: translateX(0);
}

.md-nav-drawer--standard {
    position: relative;
    transform: none;
    border-radius: 0;
    z-index: auto;
}

.md-nav-drawer__header {
    padding: 16px 16px 0;
    margin-bottom: 8px;
}

.md-nav-drawer__headline {
    font-family: var(--md-sys-typescale-title-small-font);
    font-size: var(--md-sys-typescale-title-small-size);
    font-weight: var(--md-sys-typescale-title-small-weight);
    color: var(--md-sys-color-on-surface-variant);
}

.md-nav-drawer__item {
    display: flex;
    align-items: center;
    gap: 12px;
    height: 56px;
    padding: 0 24px 0 16px;
    border-radius: var(--md-sys-shape-corner-full);
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    color: var(--md-sys-color-on-surface-variant);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-linear);
}

.md-nav-drawer__item:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-nav-drawer__item.active {
    background: var(--md-sys-color-secondary-container);
    color: var(--md-sys-color-on-secondary-container);
    font-weight: 700;
}

.md-nav-drawer__item .material-symbols-outlined {
    font-size: 24px;
}

.md-nav-drawer__badge {
    margin-left: auto;
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    color: var(--md-sys-color-on-surface-variant);
}

/* ── Tabs ── */
.md-tabs {
    display: flex;
    position: relative;
    border-bottom: 1px solid var(--md-sys-color-surface-variant);
    background: var(--md-sys-color-surface);
}

.md-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 48px;
    padding: 0 16px;
    border: none;
    background: transparent;
    color: var(--md-sys-color-on-surface-variant);
    font-family: var(--md-sys-typescale-title-small-font);
    font-size: var(--md-sys-typescale-title-small-size);
    font-weight: var(--md-sys-typescale-title-small-weight);
    cursor: pointer;
    position: relative;
    transition: color var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-standard);
}

.md-tab:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-tab--active {
    color: var(--md-sys-color-primary);
}

/* Primary tab: full-width indicator at bottom */
.md-tab--active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--md-sys-color-primary);
    border-radius: 3px 3px 0 0;
}

/* Secondary tab: full-width thin indicator */
.md-tabs--secondary .md-tab--active::after {
    height: 2px;
    border-radius: 0;
}

.md-tabs--secondary .md-tab--active {
    color: var(--md-sys-color-on-surface);
}

.md-tab .material-symbols-outlined {
    font-size: 24px;
}

/* With icon */
.md-tab--with-icon {
    height: 64px;
}

/* ── Menu ── */
.md-menu {
    position: absolute;
    min-width: 112px;
    max-width: 280px;
    background: var(--md-sys-color-surface-container);
    border-radius: var(--md-sys-shape-corner-small);
    box-shadow: var(--md-sys-elevation-level2);
    padding: 8px 0;
    z-index: 80;
    opacity: 0;
    visibility: hidden;
    transform: scaleY(0.8);
    transform-origin: top;
    transition: all var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-emphasized);
}

.md-menu.open {
    opacity: 1;
    visibility: visible;
    transform: scaleY(1);
}

.md-menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 44px;
    padding: 0 12px;
    font-family: var(--md-sys-typescale-label-large-font);
    font-size: var(--md-sys-typescale-label-large-size);
    font-weight: var(--md-sys-typescale-label-large-weight);
    color: var(--md-sys-color-on-surface);
    cursor: pointer;
    transition: background var(--md-sys-motion-duration-short2) var(--md-sys-motion-easing-linear);
}

.md-menu-item:hover {
    background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
}

.md-menu-item .material-symbols-outlined {
    color: var(--md-sys-color-on-surface-variant);
    font-size: 24px;
}

.md-menu-item__trailing {
    margin-left: auto;
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface-variant);
}

.md-menu-divider {
    height: 1px;
    background: var(--md-sys-color-surface-variant);
    margin: 8px 0;
}

/* ── Tooltip ── */
.md-tooltip {
    position: absolute;
    padding: 4px 8px;
    background: var(--md-sys-color-inverse-surface);
    color: var(--md-sys-color-inverse-on-surface);
    border-radius: var(--md-sys-shape-corner-extra-small);
    font-family: var(--md-sys-typescale-body-small-font);
    font-size: var(--md-sys-typescale-body-small-size);
    line-height: var(--md-sys-typescale-body-small-line-height);
    white-space: nowrap;
    z-index: 90;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--md-sys-motion-duration-short3) var(--md-sys-motion-easing-linear),
        visibility var(--md-sys-motion-duration-short3);
    pointer-events: none;
}

.md-tooltip.show,
[data-tooltip]:hover .md-tooltip {
    opacity: 1;
    visibility: visible;
}

.md-tooltip--rich {
    padding: 12px 16px;
    min-width: 200px;
    max-width: 312px;
    white-space: normal;
    border-radius: var(--md-sys-shape-corner-medium);
    background: var(--md-sys-color-surface-container);
    color: var(--md-sys-color-on-surface-variant);
    box-shadow: var(--md-sys-elevation-level2);
}

.md-tooltip--rich__title {
    font-family: var(--md-sys-typescale-title-small-font);
    font-size: var(--md-sys-typescale-title-small-size);
    font-weight: var(--md-sys-typescale-title-small-weight);
    color: var(--md-sys-color-on-surface);
    margin-bottom: 4px;
}

/* ── Bottom Sheet ── */
.md-bottom-sheet-scrim {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.32);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized),
        visibility var(--md-sys-motion-duration-medium2);
}

.md-bottom-sheet-scrim.open {
    opacity: 1;
    visibility: visible;
}

.md-bottom-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--md-sys-color-surface-container-low);
    border-radius: var(--md-sys-shape-corner-extra-large) var(--md-sys-shape-corner-extra-large) 0 0;
    padding: 0;
    z-index: 101;
    max-height: 70vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}

.md-bottom-sheet.open {
    transform: translateY(0);
}

.md-bottom-sheet__drag-handle {
    width: 32px;
    height: 4px;
    background: var(--md-sys-color-on-surface-variant);
    border-radius: var(--md-sys-shape-corner-full);
    margin: 22px auto 0;
    opacity: 0.4;
}

.md-bottom-sheet__content {
    padding: 16px 24px 24px;
}

/* ── Search Bar ── */
.md-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 8px 0 16px;
    background: var(--md-sys-color-surface-container-high);
    border-radius: var(--md-sys-shape-corner-full);
    width: 100%;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.md-search-bar__input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--md-sys-typescale-body-large-font);
    font-size: var(--md-sys-typescale-body-large-size);
    color: var(--md-sys-color-on-surface);
}

.md-search-bar__input::placeholder {
    color: var(--md-sys-color-on-surface-variant);
}

.md-search-bar__leading,
.md-search-bar__trailing {
    display: flex;
    align-items: center;
    color: var(--md-sys-color-on-surface-variant);
}

.md-search-bar__avatar {
    width: 30px;
    height: 30px;
    border-radius: var(--md-sys-shape-corner-full);
    object-fit: cover;
}

/* Search View (expanded) */
.md-search-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--md-sys-color-surface-container-high);
    z-index: 85;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.md-search-view.open {
    opacity: 1;
    visibility: visible;
}

.md-search-view__header {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 56px;
    padding: 0 8px 0 4px;
    border-bottom: 1px solid var(--md-sys-color-outline);
}

/* ── Circular Progress ── */
.md-circular-progress {
    width: 48px;
    height: 48px;
    position: relative;
}

.md-circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.md-circular-progress__track {
    fill: none;
    stroke: var(--md-sys-color-surface-container-highest);
    stroke-width: 4;
}

.md-circular-progress__indicator {
    fill: none;
    stroke: var(--md-sys-color-primary);
    stroke-width: 4;
    stroke-linecap: round;
    stroke-dasharray: 126;
    stroke-dashoffset: 63;
    transition: stroke-dashoffset var(--md-sys-motion-duration-medium2) var(--md-sys-motion-easing-emphasized);
}

.md-circular-progress--indeterminate svg {
    animation: md-circular-spin 1.333s linear infinite;
}

.md-circular-progress--indeterminate .md-circular-progress__indicator {
    stroke-dashoffset: 95;
    animation: md-circular-dash 1.333s ease-in-out infinite;
}

@keyframes md-circular-spin {
    100% {
        transform: rotate(270deg);
    }
}

@keyframes md-circular-dash {
    0% {
        stroke-dashoffset: 126;
    }

    50% {
        stroke-dashoffset: 31.5;
    }

    100% {
        stroke-dashoffset: 126;
    }
}

/* ── Side Sheet ── */
.md-side-sheet {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 400px;
    max-width: calc(100vw - 56px);
    background: var(--md-sys-color-surface-container-low);
    z-index: 91;
    padding: 24px;
    overflow-y: auto;
    transform: translateX(100%);
    box-shadow: var(--md-sys-elevation-level1);
    transition: transform var(--md-sys-motion-duration-medium4) var(--md-sys-motion-easing-emphasized);
}

.md-side-sheet.open {
    transform: translateX(0);
}

.md-side-sheet--standard {
    position: relative;
    transform: none;
    z-index: auto;
    box-shadow: none;
    border-left: 1px solid var(--md-sys-color-outline-variant);
}

.md-side-sheet__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.md-side-sheet__title {
    font-family: var(--md-sys-typescale-title-large-font);
    font-size: var(--md-sys-typescale-title-large-size);
    font-weight: var(--md-sys-typescale-title-large-weight);
}

/* ── Carousel ── */
.md-carousel {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px;
}

.md-carousel::-webkit-scrollbar {
    display: none;
}

.md-carousel__item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    border-radius: var(--md-sys-shape-corner-extra-large);
    overflow: hidden;
    position: relative;
    min-height: 200px;
}

.md-carousel__item--large {
    width: 280px;
}

.md-carousel__item--medium {
    width: 200px;
}

.md-carousel__item--small {
    width: 56px;
}

.md-carousel__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.md-carousel__item__label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.6));
    color: #fff;
    font-family: var(--md-sys-typescale-title-medium-font);
    font-size: var(--md-sys-typescale-title-medium-size);
    font-weight: var(--md-sys-typescale-title-medium-weight);
}

/* ── Focus States (Accessibility) ── */
.md-button:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-fab:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-icon-button:focus-visible {
    outline: 2px solid var(--md-sys-color-on-surface-variant);
    outline-offset: 2px;
}

.md-chip:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-tab:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.md-nav-rail__item:focus-visible .md-nav-rail__item-icon {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-bottom-nav__item:focus-visible .md-bottom-nav__item-icon {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-nav-drawer__item:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px;
}

.md-list-item:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px;
    border-radius: var(--md-sys-shape-corner-extra-small);
}

.md-menu-item:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px;
}

.md-segmented-button:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: -2px;
}

.md-search-bar:focus-within {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 0;
}

.md-switch:focus-within .md-switch__track {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-checkbox:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-radio:focus-visible {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

.md-slider:focus-visible::-webkit-slider-thumb {
    outline: 2px solid var(--md-sys-color-primary);
    outline-offset: 2px;
}

/* ============================================================
   Jolu Chat — WhatsApp-style (jc-* components)
   ============================================================ */

/* Layout — flex row (sidebar | conversation | contact) */
.jc-layout {
    display: flex;
    flex-direction: row;
    height: 100%;
    overflow: hidden;
    background: var(--jc-app-bg-color);
    font-family: var(--jc-font);
    position: relative;
}
.jc-layout::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--jc-app-bg);
    z-index: 0;
    pointer-events: none;
}

/* Columns is now display:contents so children flow directly */
.jc-columns {
    display: contents;
}

/* ── Sidebar (inbox) ── */
.jc-inbox {
    width: 400px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: none;
    background: var(--jc-sidebar-bg);
    overflow: hidden;
    box-shadow: var(--jc-shadow-lg);
    z-index: 1;
    position: relative;
}

/* Sidebar header */
.jc-sidebar-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    height: 60px;
    background: var(--jc-sidebar-header-bg);
    flex-shrink: 0;
    gap: 8px;
    border-bottom: none;
}
.jc-sidebar-header__title {
    font-size: 18px;
    font-weight: 700;
    color: var(--jc-text-primary);
    flex: 1;
    white-space: nowrap;
    font-family: var(--jc-font);
    letter-spacing: -0.02em;
}
.jc-sidebar-header__offline {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 11px; color: var(--jc-error);
    padding: 1px 6px; border-radius: 8px;
    background: color-mix(in srgb, var(--jc-error) 12%, transparent);
}
.jc-sidebar-header__offline-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--jc-error); display: inline-block;
}
.jc-sidebar-header__actions {
    display: flex;
    align-items: center;
    gap: 2px;
}
.jc-sidebar-header__btn {
    width: 40px; height: 40px; border: none;
    background: transparent; border-radius: var(--jc-radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary); cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.jc-sidebar-header__btn:hover { background: var(--jc-hover-bg); color: var(--jc-primary); }

/* Sidebar search */
.jc-sidebar-search {
    padding: 6px 14px 4px;
    flex-shrink: 0;
}
.jc-sidebar-search__wrap {
    display: flex; align-items: center; gap: 8px;
    background: var(--jc-input-bg);
    border-radius: var(--jc-radius-full);
    padding: 0 14px; height: 40px;
    border: 1px solid var(--jc-border);
    transition: background 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.jc-sidebar-search__wrap:focus-within {
    border-color: var(--jc-primary);
    box-shadow: 0 0 0 3px var(--jc-primary-light, rgba(99, 102, 241, 0.1));
}
.jc-sidebar-search__wrap .material-symbols-outlined { font-size: 18px; color: var(--jc-text-secondary); }
.jc-sidebar-search__input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 14px; color: var(--jc-text-primary);
    font-family: var(--jc-font);
}
.jc-sidebar-search__input::placeholder { color: var(--jc-text-secondary); }

/* Sidebar filter pills — tabs row */
.jc-sidebar-filters {
    display: flex; align-items: center; gap: 4px;
    padding: 6px 14px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--jc-border);
}
.jc-sidebar-filters::-webkit-scrollbar { display: none; }

/* Secondary row — hidden (filters moved to dropdown) */
.jc-sidebar-filters--secondary {
    display: none;
}

.jc-sidebar-filters__pill {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--jc-radius-full);
    border: none;
    background: transparent;
    color: var(--jc-text-secondary);
    font-size: 12px; font-weight: 500;
    cursor: pointer; white-space: nowrap;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    font-family: var(--jc-font);
    flex: 1;
}
.jc-sidebar-filters__pill:hover { background: var(--jc-hover-bg); }
.jc-sidebar-filters__pill--active {
    background: var(--jc-filter-pill-active-bg);
    color: var(--jc-filter-pill-active-text);
    font-weight: 600;
    box-shadow: var(--jc-shadow-sm);
}
.jc-sidebar-filters__pill-count {
    font-size: 10px; font-weight: 700;
    background: var(--jc-text-secondary); color: var(--jc-sidebar-bg);
    padding: 0 4px; border-radius: 8px; min-width: 14px;
    text-align: center; line-height: 16px;
}
.jc-sidebar-filters__pill--active .jc-sidebar-filters__pill-count {
    background: var(--jc-filter-pill-active-text); color: var(--jc-filter-pill-active-bg);
}

/* Status/channel/sort mini-selects (kept for backwards compat) */
.jc-sidebar-filters__select {
    display: inline-flex; align-items: center; gap: 2px;
    font-size: 12px; font-weight: 500; font-family: var(--jc-font);
    color: var(--jc-text-secondary);
    background: var(--jc-filter-pill-bg);
    border: 1px solid var(--jc-border);
    padding: 3px 20px 3px 8px; border-radius: var(--jc-radius-full);
    cursor: pointer; white-space: nowrap;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23667781'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 5px center;
    transition: background 0.15s, border-color 0.15s;
    max-width: 140px; overflow: hidden; text-overflow: ellipsis;
}
.jc-sidebar-filters__select:hover { background: var(--jc-hover-bg); }

/* Filter dropdown (from header tune button) */
.jc-filter-dropdown {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    width: 280px; padding: 14px; z-index: 50;
    background: var(--jc-sidebar-bg);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-md);
    box-shadow: var(--jc-shadow-lg);
    display: flex; flex-direction: column; gap: 10px;
}
.jc-filter-dropdown__label {
    font-size: 11px; font-weight: 600; color: var(--jc-text-secondary);
    text-transform: uppercase; letter-spacing: 0.04em;
    margin-bottom: 4px;
}
.jc-filter-dropdown__select {
    width: 100%;
    font-size: 13px; font-weight: 500; font-family: var(--jc-font);
    color: var(--jc-text-primary);
    background: var(--jc-filter-pill-bg);
    border: 1px solid var(--jc-border);
    padding: 8px 28px 8px 10px; border-radius: var(--jc-radius-sm);
    cursor: pointer;
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='M7 10l5 5 5-5z' fill='%23667781'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}
.jc-filter-dropdown__divider {
    height: 1px;
    background: var(--jc-border);
    margin: 2px 0;
}
.jc-filter-dropdown__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: var(--jc-font);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-full);
    cursor: pointer;
    background: none;
    color: var(--jc-text-primary);
    transition: background 0.15s;
}
.jc-filter-dropdown__action-btn:hover {
    background: var(--jc-hover-bg);
}
.jc-filter-dropdown__action-btn--clear {
    color: var(--jc-error);
}

/* Has-filter dot indicator on tune button */
.jc-sidebar-header__btn--has-filter {
    position: relative;
}
.jc-sidebar-header__btn--has-filter::after {
    content: '';
    position: absolute; top: 6px; right: 6px;
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--jc-unread-badge);
}

/* Saved Filters dropdown (from sidebar) */
.jc-saved-filters {
    position: absolute; top: 100%; right: 0; margin-top: 4px;
    width: 240px; padding: 10px; z-index: 50;
    background: var(--jc-sidebar-bg);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-md);
    box-shadow: var(--jc-shadow-lg);
}
.jc-saved-filters__input {
    flex: 1; min-width: 0; padding: 4px 8px;
    font-size: 12px; border-radius: 6px;
    border: 1px solid var(--jc-border);
    background: var(--jc-input-bg);
    color: var(--jc-text-primary);
    font-family: inherit; outline: none;
}
.jc-saved-filters__input:focus { border-color: var(--jc-primary); }
.jc-saved-filters__save-btn {
    padding: 4px 8px; font-size: 11px; font-weight: 600;
    border: none; border-radius: 6px; cursor: pointer;
    background: var(--jc-primary);
    color: var(--jc-on-primary);
    white-space: nowrap; font-family: inherit;
}
.jc-saved-filters__save-btn:disabled { opacity: 0.5; cursor: default; }
.jc-saved-filters__list { display: flex; flex-direction: column; gap: 2px; }
.jc-saved-filters__item {
    display: flex; align-items: center; gap: 4px; padding: 4px;
    border-radius: 6px;
}
.jc-saved-filters__item:hover { background: var(--jc-hover-bg); }
.jc-saved-filters__item-name {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 12px; color: var(--jc-text-primary);
}
.jc-saved-filters__item-btn {
    width: 24px; height: 24px; border: none; background: none;
    display: inline-flex; align-items: center; justify-content: center;
    cursor: pointer; border-radius: 4px; flex-shrink: 0;
    color: var(--jc-text-secondary);
}
.jc-saved-filters__item-btn:hover { background: var(--jc-hover-bg); }
.jc-saved-filters__item-btn--delete { color: var(--jc-error); }

/* ── Inbox List ── */
.jc-inbox__list {
    flex: 1;
    overflow-y: auto;
}
/* Scrollbar styling for inbox list */
.jc-inbox__list::-webkit-scrollbar { width: 6px; }
.jc-inbox__list::-webkit-scrollbar-track { background: transparent; }
.jc-inbox__list::-webkit-scrollbar-thumb {
    background: var(--jc-border);
    border-radius: 3px;
}
.jc-inbox__list::-webkit-scrollbar-thumb:hover {
    background: var(--jc-border);
}

/* ── Conversation List Item (WhatsApp-style) ── */
.jc-inbox-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    height: auto;
    min-height: 64px;
    cursor: pointer;
    border: none;
    margin: 2px 6px;
    border-radius: var(--jc-radius-md);
    transition: background 0.15s, box-shadow 0.2s;
    position: relative;
}
.jc-inbox-item:hover { background: var(--jc-hover-bg); }
.jc-inbox-item--active {
    background: var(--jc-surface);
    box-shadow: var(--jc-shadow-md);
    border-left: 3px solid var(--jc-primary);
}
.jc-inbox-item--pending { background: none; }
/* No separator lines — clean M3 list */
.jc-inbox-item::after { display: none; }
.jc-inbox-item:last-child::after { display: none; }

/* Avatar */
.jc-inbox-item__avatar-wrap {
    position: relative;
    flex-shrink: 0;
}
.jc-inbox-item__avatar {
    width: 46px; height: 46px; min-width: 46px;
    border-radius: 50%;
    background: var(--jc-primary-light, rgba(99, 102, 241, 0.1));
    color: var(--jc-primary, #6366F1);
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 600; overflow: hidden;
}
.jc-inbox-item__avatar img { width: 100%; height: 100%; object-fit: cover; }

/* Status badge on avatar */
.jc-inbox-item__status-badge {
    position: absolute; bottom: 0; right: 0;
    width: 14px; height: 14px; border-radius: 50%;
    border: 2px solid var(--jc-sidebar-bg);
    display: flex; align-items: center; justify-content: center; font-size: 8px;
    border-width: 2px;
}
.jc-inbox-item__status-badge--snoozed {
    background: var(--jc-text-secondary); color: var(--jc-surface);
}
.jc-inbox-item__status-badge--pending { background: var(--jc-success); }

/* Body */
.jc-inbox-item__body { flex: 1; min-width: 0; }
.jc-inbox-item__header {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin-bottom: 2px;
}
.jc-inbox-item__name {
    font-size: 14px; font-weight: 600;
    color: var(--jc-text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--jc-font);
}
.jc-inbox-item__time {
    font-size: 12px; color: var(--jc-text-secondary);
    white-space: nowrap; flex-shrink: 0;
}
.jc-inbox-item__preview {
    font-size: 13px; color: var(--jc-text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    line-height: 1.35; margin-top: 1px;
}
.jc-inbox-item__meta {
    display: flex; align-items: center; gap: 4px; margin-top: 3px;
    font-size: 11px; min-height: 18px;
}
.jc-inbox-item__channel {
    display: flex; align-items: center; gap: 2px; font-size: 11px; flex-shrink: 0;
}
.jc-inbox-item__inbox-name {
    font-size: 11px; color: var(--jc-text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px;
}
.jc-inbox-item__labels { display: flex; gap: 6px; flex-wrap: nowrap; overflow: hidden; flex-shrink: 1; min-width: 0; align-items: center; }
.jc-inbox-item__label-chip {
    display: inline-flex; align-items: center; gap: 3px;
    font-size: 11px; font-weight: 500;
    color: var(--jc-text-secondary); white-space: nowrap;
    max-width: 80px; overflow: hidden; text-overflow: ellipsis;
    line-height: 1;
}
.jc-inbox-item__label-chip::before {
    content: '';
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
    background: currentColor;
}
.jc-inbox-item__assignee {
    font-size: 11px; color: var(--jc-text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    max-width: 80px; margin-left: auto;
}
.jc-inbox-item__priority {
    display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.jc-inbox-item__unread {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--jc-unread-badge); flex-shrink: 0;
}

/* Unread count badge */
.jc-inbox-item__unread-badge {
    min-width: 20px; height: 20px; padding: 0 5px;
    border-radius: 10px;
    background: var(--jc-unread-badge); color: var(--jc-on-primary);
    font-size: 11px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* Bulk selection checkbox overlay on avatar */
.jc-inbox-item__check-overlay {
    position: absolute; top: 0; left: 0;
    width: 46px; height: 46px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: color-mix(in srgb, var(--jc-sidebar-bg) 80%, transparent);
    color: var(--jc-text-secondary); cursor: pointer;
    transition: opacity 0.15s; z-index: 1;
    opacity: 0;
}
.jc-inbox-item:hover .jc-inbox-item__check-overlay {
    opacity: 1;
}
.jc-inbox-item__check-overlay:hover {
    background: color-mix(in srgb, var(--jc-primary-light) 70%, transparent);
    color: var(--jc-primary);
}
.jc-inbox-item__check-overlay--checked {
    opacity: 1;
    background: color-mix(in srgb, var(--jc-primary-light) 90%, transparent);
    color: var(--jc-primary);
}

/* Compact view overrides */
.jc-inbox-item--compact {
    min-height: 52px;
    padding: 6px 14px;
    gap: 10px;
}
.jc-inbox-item--compact .jc-inbox-item__avatar { width: 36px; height: 36px; min-width: 36px; font-size: 14px; }
.jc-inbox-item--compact .jc-inbox-item__check-overlay { width: 36px; height: 36px; }
.jc-inbox-item--compact .jc-inbox-item__name { font-size: 14px; }
.jc-inbox-item--compact .jc-inbox-item__preview { font-size: 12px; }
.jc-inbox-item--compact .jc-inbox-item__time { font-size: 11px; }
.jc-inbox-item--compact::after { left: 60px; }

/* Bulk action toolbar */
.jc-inbox__bulk-bar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 6px 12px; background: var(--jc-sidebar-header-bg);
    border-bottom: 1px solid var(--jc-border); gap: 8px; min-height: 40px;
}
.jc-inbox__bulk-left {
    display: flex; align-items: center; gap: 6px; flex: 1; min-width: 0;
}
.jc-inbox__bulk-actions {
    display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}

/* ── Conversation area ── */
.jc-conversation {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--jc-chat-bg);
    position: relative;
    z-index: 1;
}

/* Conversation header */
.jc-conversation__header {
    display: flex; align-items: center; gap: 12px;
    padding: 0 20px; height: 64px;
    background: var(--jc-panel-header-bg);
    border-bottom: none;
    box-shadow: var(--jc-shadow-sm);
    flex-shrink: 0;
    z-index: 2;
    font-family: var(--jc-font);
}
.jc-conversation__header-info { flex: 1; min-width: 0; }
.jc-conversation__header-name {
    font-size: 15px; font-weight: 600; color: var(--jc-text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    font-family: var(--jc-font);
}
.jc-conversation__header-sub {
    font-size: 12px; color: var(--jc-text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.jc-conversation__header-actions {
    display: flex; gap: 2px; flex-shrink: 0; align-items: center;
}

/* Channel bar (merged into subtitle) */
.jc-conversation__channel-bar { display: none; }

/* ── Messages area ── */
.jc-messages-wrapper {
    flex: 1; position: relative;
    display: flex; flex-direction: column; overflow: hidden;
}
.jc-conversation__messages {
    flex: 1; overflow-y: auto; padding: 16px 48px;
    display: flex; flex-direction: column; gap: 3px;
    background: var(--jc-chat-bg);
}
/* Scrollbar */
.jc-conversation__messages::-webkit-scrollbar { width: 6px; }
.jc-conversation__messages::-webkit-scrollbar-track { background: transparent; }
.jc-conversation__messages::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--jc-text-primary) 15%, transparent);
    border-radius: 3px;
}
.jc-conversation__messages::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 25%, transparent);
}

/* Date divider */
.jc-msg-date-divider {
    display: flex; align-items: center; justify-content: center;
    margin: 16px 0 8px;
}
.jc-msg-date-divider span {
    font-size: 11px; font-weight: 500; letter-spacing: 0.02em;
    color: var(--jc-primary, #6366F1);
    background: var(--jc-date-pill-bg);
    padding: 4px 14px;
    border-radius: var(--jc-radius-full);
    font-family: var(--jc-font);
}

/* Scroll to bottom FAB */
.jc-scroll-bottom-btn {
    position: absolute; bottom: 16px; right: 24px;
    width: 40px; height: 40px;
    border-radius: var(--jc-radius-full);
    background: var(--jc-surface);
    color: var(--jc-text-secondary);
    border: none;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--jc-shadow-md);
    z-index: 2; transition: background 0.15s, box-shadow 0.15s, color 0.15s;
}
.jc-scroll-bottom-btn:hover {
    background: var(--jc-surface);
    box-shadow: var(--jc-shadow-lg);
    color: var(--jc-primary);
}

/* ── Message Bubbles — M3 style ── */
.jc-msg {
    display: flex; flex-direction: column; max-width: 65%; gap: 0;
    margin-bottom: 3px;
    padding: 0;
}
.jc-msg--incoming { align-self: flex-start; }
.jc-msg--outgoing { align-self: flex-end; }
.jc-msg--activity { align-self: center; max-width: 90%; margin-bottom: 2px; }

.jc-msg__bubble {
    padding: 10px 14px;
    border-radius: 20px;
    font-size: 14px; line-height: 20px;
    word-break: break-word; white-space: pre-wrap;
    position: relative;
    font-family: var(--jc-font);
}

.jc-msg--incoming .jc-msg__bubble {
    background: var(--jc-incoming-bubble);
    color: var(--jc-incoming-bubble-text);
    border-bottom-left-radius: 6px;
}
/* No tails — clean M3 bubbles */
.jc-msg--incoming .jc-msg__bubble::before { display: none; }
.jc-msg--incoming .jc-msg__bubble.jc-msg__attachments::before,
.jc-msg--incoming .jc-msg__bubble ~ .jc-msg__bubble::before {
    display: none;
}
.jc-msg--outgoing .jc-msg__bubble {
    background: var(--jc-outgoing-bubble);
    color: var(--jc-outgoing-bubble-text);
    border-bottom-right-radius: 6px;
}
.jc-msg--outgoing .jc-msg__bubble::after { display: none; }
.jc-msg--outgoing .jc-msg__bubble.jc-msg__attachments::after,
.jc-msg--outgoing .jc-msg__bubble ~ .jc-msg__bubble::after {
    display: none;
}
.jc-msg--private .jc-msg__bubble {
    background: var(--jc-success-container);
    color: var(--jc-on-success-container);
    border: 1px dashed var(--jc-success);
    border-radius: 18px;
}
.jc-msg--private .jc-msg__bubble::before,
.jc-msg--private .jc-msg__bubble::after {
    display: none;
}
.jc-msg--activity .jc-msg__bubble {
    background: transparent;
    color: var(--jc-text-secondary);
    font-size: 12px;
    text-align: center; padding: 4px 8px;
    box-shadow: none;
}

/* Activity message line */
.jc-msg--activity .jc-msg__activity-line {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; font-weight: 500; color: var(--jc-text-secondary);
    padding: 4px 12px; justify-content: center;
    background: var(--jc-date-pill-bg);
    border-radius: var(--jc-radius-full);
}

.jc-msg__sender {
    font-size: 12px; font-weight: 600;
    color: var(--jc-primary);
    padding: 0 4px 2px;
}
.jc-msg__sender--agent {
    color: var(--jc-text-secondary);
    font-weight: 500;
    font-size: 11px;
    text-align: right;
}

/* Group message layout (avatar + body) */
.jc-msg--group {
    flex-direction: row;
    align-items: flex-end;
    gap: 6px;
}
.jc-msg__avatar {
    width: 28px; height: 28px; border-radius: 50%;
    flex-shrink: 0;
    overflow: hidden;
    background: var(--jc-filter-pill-bg, var(--jc-surface-container));
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 2px;
}
.jc-msg__avatar img {
    width: 100%; height: 100%; object-fit: cover;
}
.jc-msg__avatar span {
    font-size: 12px; font-weight: 600;
    color: var(--jc-text-secondary, var(--jc-text-secondary));
}
.jc-msg__body {
    display: flex; flex-direction: column; gap: 0;
    min-width: 0; max-width: 100%; flex: 1;
}

/* Emoji reaction badges */
.jc-msg__reactions {
    display: flex; gap: 4px; flex-wrap: wrap;
    margin-top: 2px; padding: 0 2px;
}
.jc-msg__reaction-badge {
    display: inline-flex; align-items: center; gap: 2px;
    background: var(--jc-date-pill-bg);
    border: 1px solid var(--jc-border);
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 14px; line-height: 1;
    cursor: default;
    box-shadow: 0 1px 1px rgba(0,0,0,0.06);
}
.jc-msg__reaction-count {
    font-size: 11px; font-weight: 600;
    color: var(--jc-text-secondary);
}

/* ── Hover Action Bar (WhatsApp-style) ── */
.jc-msg__hover-actions {
    position: absolute;
    top: -32px;
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: var(--jc-surface);
    border: none;
    border-radius: var(--jc-radius-full);
    box-shadow: var(--jc-shadow-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 5;
    white-space: nowrap;
}
.jc-msg--incoming .jc-msg__hover-actions { left: 0; }
.jc-msg--outgoing .jc-msg__hover-actions { right: 0; }
.jc-msg__body:hover .jc-msg__hover-actions {
    opacity: 1;
    pointer-events: auto;
}
.jc-msg__hover-actions-divider {
    width: 1px;
    height: 18px;
    background: var(--jc-border);
    margin: 0 2px;
    flex-shrink: 0;
}
.jc-msg__hover-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    color: var(--jc-text-secondary);
    transition: background 0.15s;
    position: relative;
    flex-shrink: 0;
}
.jc-msg__hover-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 10%, transparent);
}
.jc-msg__reaction-btn {
    font-size: 16px;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s, transform 0.1s;
    flex-shrink: 0;
}
.jc-msg__reaction-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 10%, transparent);
    transform: scale(1.2);
}
/* Emoji picker mini grid */
.jc-msg__emoji-picker {
    position: absolute;
    bottom: calc(100% + 4px);
    background: var(--jc-surface);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-md);
    box-shadow: var(--jc-shadow-lg);
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    z-index: 10;
    min-width: 240px;
}
.jc-msg--incoming .jc-msg__emoji-picker { left: 0; }
.jc-msg--outgoing .jc-msg__emoji-picker { right: 0; }
.jc-msg__emoji-picker button {
    font-size: 20px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}
.jc-msg__emoji-picker button:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 10%, transparent);
}

/* ── Unread Separator ── */
.jc-unread-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 0 8px;
    padding: 0 8px;
}
.jc-unread-separator::before,
.jc-unread-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--jc-primary, #6366F1);
    opacity: 0.4;
}
.jc-unread-separator span {
    font-size: 12px;
    font-weight: 600;
    color: var(--jc-primary, #6366F1);
    white-space: nowrap;
    padding: 2px 12px;
    background: var(--jc-date-pill-bg, #EEF2FF);
    border-radius: var(--jc-radius-full);
    font-family: var(--jc-font);
}

/* ── Link Preview Card ── */
.jc-msg__link-preview {
    display: flex;
    gap: 0;
    margin-top: 6px;
    border-radius: var(--jc-radius-xs);
    overflow: hidden;
    background: color-mix(in srgb, var(--jc-text-primary) 5%, transparent);
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
    border: 1px solid color-mix(in srgb, var(--jc-border) 50%, transparent);
}
.jc-msg__link-preview:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 9%, transparent);
}
.jc-msg__link-preview-bar {
    width: 4px;
    flex-shrink: 0;
    background: var(--jc-primary);
}
.jc-msg__link-preview-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 10px;
    min-width: 0;
    flex: 1;
}
.jc-msg__link-preview-domain {
    font-size: 12px;
    font-weight: 600;
    color: var(--jc-primary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.jc-msg__link-preview-url {
    font-size: 11px;
    color: var(--jc-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.jc-msg--outgoing .jc-msg__link-preview {
    background: color-mix(in srgb, var(--jc-outgoing-bubble-text) 8%, transparent);
    border-color: color-mix(in srgb, var(--jc-outgoing-bubble-text) 15%, transparent);
}
.jc-msg--outgoing .jc-msg__link-preview:hover {
    background: color-mix(in srgb, var(--jc-outgoing-bubble-text) 14%, transparent);
}
.jc-msg--outgoing .jc-msg__link-preview-bar {
    background: var(--jc-outgoing-bubble-text);
    opacity: 0.6;
}
.jc-msg--outgoing .jc-msg__link-preview-domain {
    color: var(--jc-outgoing-bubble-text);
}
.jc-msg--outgoing .jc-msg__link-preview-url {
    color: color-mix(in srgb, var(--jc-outgoing-bubble-text) 65%, transparent);
}

/* ── Custom Audio Player (WhatsApp-style) ── */
.jc-audio-player {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 260px;
    padding: 4px 0;
}
.jc-audio-player__play {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--jc-primary);
    color: var(--jc-on-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, transform 0.1s;
}
.jc-audio-player__play:hover {
    background: color-mix(in srgb, var(--jc-primary) 85%, black);
    transform: scale(1.05);
}
.jc-msg--outgoing .jc-audio-player__play {
    background: var(--jc-outgoing-bubble-text);
    color: var(--jc-outgoing-bubble);
}
.jc-audio-player__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.jc-audio-player__waveform {
    display: flex;
    align-items: center;
    gap: 1.5px;
    height: 24px;
    cursor: pointer;
    position: relative;
}
.jc-audio-player__bar {
    width: 3px;
    border-radius: 1.5px;
    background: var(--jc-text-secondary);
    opacity: 0.35;
    transition: opacity 0.1s;
    flex-shrink: 0;
}
.jc-audio-player__bar--played {
    opacity: 1;
    background: var(--jc-primary);
}
.jc-msg--outgoing .jc-audio-player__bar {
    background: var(--jc-outgoing-bubble-text);
}
.jc-msg--outgoing .jc-audio-player__bar--played {
    background: var(--jc-outgoing-bubble-text);
    opacity: 1;
}
.jc-audio-player__time {
    font-size: 11px;
    color: var(--jc-text-secondary);
    font-variant-numeric: tabular-nums;
}
.jc-msg--outgoing .jc-audio-player__time {
    color: color-mix(in srgb, var(--jc-outgoing-bubble-text) 65%, transparent);
}
.jc-audio-player__speed {
    font-size: 10px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: var(--jc-radius-full);
    border: 1px solid var(--jc-border);
    background: transparent;
    color: var(--jc-text-secondary);
    cursor: pointer;
    transition: background 0.15s;
    flex-shrink: 0;
    line-height: 1;
}
.jc-audio-player__speed:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}
.jc-msg--outgoing .jc-audio-player__speed {
    border-color: color-mix(in srgb, var(--jc-outgoing-bubble-text) 30%, transparent);
    color: var(--jc-outgoing-bubble-text);
}

/* ── Custom Video Player ── */
.jc-video-player {
    position: relative;
    border-radius: var(--jc-radius-sm);
    overflow: hidden;
    line-height: 0;
    max-width: 100%;
    background: #000;
}
.jc-video-player video {
    display: block;
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--jc-radius-sm);
}
.jc-video-player__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    cursor: pointer;
    transition: background 0.2s;
    z-index: 1;
}
.jc-video-player__overlay:hover {
    background: rgba(0,0,0,0.45);
}
.jc-video-player__play-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #222;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: transform 0.15s;
}
.jc-video-player__overlay:hover .jc-video-player__play-icon {
    transform: scale(1.08);
}
.jc-video-player__controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    z-index: 2;
    opacity: 0;
    transition: opacity 0.2s;
}
.jc-video-player:hover .jc-video-player__controls,
.jc-video-player--playing .jc-video-player__controls {
    opacity: 1;
}
.jc-video-player__ctrl-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.9;
    transition: opacity 0.15s;
}
.jc-video-player__ctrl-btn:hover {
    opacity: 1;
}
.jc-video-player__progress {
    flex: 1;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}
.jc-video-player__progress-fill {
    height: 100%;
    background: var(--jc-primary);
    border-radius: 2px;
    transition: width 0.1s linear;
}
.jc-video-player__time {
    font-size: 11px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    opacity: 0.85;
}

/* ── SLA Badge (ConversationHeader) ── */
.jc-sla-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 1px 7px;
    border-radius: var(--jc-radius-full);
    font-size: 10px;
    font-weight: 600;
    line-height: 16px;
    white-space: nowrap;
    flex-shrink: 0;
}
.jc-sla-badge--ok {
    background: color-mix(in srgb, var(--jc-success) 15%, transparent);
    color: var(--jc-success);
}
.jc-sla-badge--warning {
    background: color-mix(in srgb, var(--jc-warning) 15%, transparent);
    color: var(--jc-warning);
}
.jc-sla-badge--danger {
    background: color-mix(in srgb, var(--jc-error) 15%, transparent);
    color: var(--jc-error);
}
.jc-sla-badge--violated {
    background: color-mix(in srgb, var(--jc-error) 15%, transparent);
    color: var(--jc-error);
    animation: jc-sla-pulse 2s ease-in-out infinite;
}
@keyframes jc-sla-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Hide hover actions on touch devices */
@media (hover: none) {
    .jc-msg__hover-actions { display: none; }
}

/* Timestamp INSIDE the bubble */
.jc-msg__time {
    float: right;
    margin: 4px 0 -5px 12px;
    font-size: 11px;
    color: var(--jc-text-secondary);
    opacity: 0.7;
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 2px;
}
.jc-msg--outgoing .jc-msg__time {
    color: color-mix(in srgb, var(--jc-outgoing-bubble-text) 55%, transparent);
    opacity: 1;
}
.jc-msg--private .jc-msg__time {
    color: var(--jc-on-success-container);
    opacity: 0.6;
}

/* Clickable link in message */
.jc-msg__link {
    color: var(--jc-primary); text-decoration: underline; word-break: break-all;
}
.jc-msg--outgoing .jc-msg__link { color: var(--jc-primary); text-decoration: underline; }

/* ── Reply area — FinTech Soft UI ── */
.jc-conversation__reply {
    border-top: none;
    background: var(--jc-compose-bg);
    padding: 12px 24px 16px;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.04);
    position: relative;
}

.jc-reply--dragging {
    border: 2px dashed var(--jc-primary);
    border-radius: var(--jc-radius-md);
}

.jc-reply__drag-overlay {
    position: absolute; inset: 0;
    background: color-mix(in srgb, var(--jc-primary) 6%, transparent);
    border-radius: var(--jc-radius-md);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; z-index: 10; pointer-events: none;
    color: var(--jc-primary); font-size: 14px; font-family: var(--jc-font);
}

/* Reply/Private mode toggle — underline tabs */
.jc-reply__tabs {
    display: flex; gap: 0;
    margin-bottom: 10px;
    border-bottom: 1px solid var(--jc-border);
}
.jc-reply__tab {
    padding: 6px 16px; border: none;
    background: transparent;
    font-size: 12px; font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--jc-text-secondary); cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.15s, border-color 0.15s;
    font-family: var(--jc-font);
    display: flex; align-items: center; gap: 5px;
}
.jc-reply__tab:hover {
    color: var(--jc-text-primary);
}
.jc-reply__tab.active {
    color: var(--jc-primary);
    border-bottom-color: var(--jc-primary);
}

/* Textarea input — clean card style */
.jc-reply__input {
    width: 100%;
    min-height: 52px; max-height: 160px;
    resize: none;
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
    padding: 12px 16px;
    font-size: 14px; line-height: 1.55;
    color: var(--jc-text-primary);
    background: var(--jc-surface);
    outline: none;
    font-family: var(--jc-font);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.jc-reply__input:focus {
    border-color: var(--jc-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jc-primary) 10%, transparent);
}
.jc-reply__input::placeholder { color: var(--jc-text-secondary); opacity: 0.6; }

.jc-reply__input--private {
    border: 1.5px dashed var(--jc-warning);
    background: var(--jc-warning-container);
    color: var(--jc-on-warning-container);
}
.jc-reply__input--private:focus {
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jc-warning) 12%, transparent);
}

/* Format toolbar — inline above textarea */
.jc-reply__format-toolbar {
    display: flex; align-items: center; gap: 0;
    padding: 2px 4px; margin-bottom: 6px;
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    background: var(--jc-input-bg);
}
.jc-reply__format-btn {
    display: flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; min-width: 32px;
    border: none; background: transparent;
    color: var(--jc-text-secondary);
    border-radius: 8px; cursor: pointer;
    transition: background 0.12s, color 0.12s;
}
.jc-reply__format-btn:hover {
    background: var(--jc-hover-bg);
    color: var(--jc-primary);
}
.jc-reply__format-btn:active {
    background: var(--jc-active-bg);
}

/* Audio preview */
.jc-reply__audio-preview {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: var(--jc-input-bg);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
}
.jc-reply__audio-preview-btn {
    display: flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; min-width: 36px;
    border: none; background: transparent;
    color: var(--jc-text-primary);
    border-radius: 50%; cursor: pointer;
    transition: background 0.12s;
}
.jc-reply__audio-preview-btn:hover { background: var(--jc-hover-bg); }
.jc-reply__audio-preview-btn--delete { color: var(--jc-text-secondary); }
.jc-reply__audio-preview-btn--delete:hover { background: color-mix(in srgb, var(--jc-error) 10%, transparent); color: var(--jc-error); }
.jc-reply__audio-preview-wave {
    display: flex; align-items: center; gap: 2px; flex: 1;
    height: 32px; overflow: hidden;
}
.jc-reply__audio-preview-bar {
    width: 3px; border-radius: 2px;
    background: var(--jc-primary);
    opacity: 0.5; transition: height 0.15s;
}

/* Toolbar row — spaced actions */
.jc-reply__toolbar {
    display: flex; align-items: center;
    gap: 2px; margin-top: 10px;
}
.jc-reply__toolbar .jc-sidebar-header__btn {
    width: 34px; height: 34px;
    color: var(--jc-text-secondary);
    border-radius: 8px;
}
.jc-reply__toolbar .jc-sidebar-header__btn:hover {
    background: var(--jc-hover-bg);
    color: var(--jc-primary);
}

/* Send button — gradient pill with glow */
.jc-reply__send-btn {
    height: 36px;
    padding: 0 18px;
    border-radius: var(--jc-radius-full);
    background: linear-gradient(135deg, var(--jc-primary), #8B5CF6);
    color: var(--jc-on-primary);
    border: none;
    display: flex; align-items: center; justify-content: center; gap: 6px;
    font-family: var(--jc-font);
    font-size: 13px; font-weight: 600;
    flex-shrink: 0;
    cursor: pointer;
    transition: opacity 0.15s, transform 0.1s, box-shadow 0.15s;
    box-shadow: 0 2px 8px color-mix(in srgb, var(--jc-primary) 35%, transparent);
}
.jc-reply__send-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px color-mix(in srgb, var(--jc-primary) 45%, transparent);
}
.jc-reply__send-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px color-mix(in srgb, var(--jc-primary) 30%, transparent);
}
/* Private mode send button */
.jc-reply__send-btn--private {
    background: linear-gradient(135deg, var(--jc-warning), #D97706);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--jc-warning) 35%, transparent);
}
.jc-reply__send-btn--private:hover:not(:disabled) {
    box-shadow: 0 4px 16px color-mix(in srgb, var(--jc-warning) 45%, transparent);
}

/* Mic button — soft outlined circle */
.jc-reply__mic-btn {
    width: 36px; height: 36px;
    border-radius: var(--jc-radius-full);
    background: var(--jc-input-bg);
    color: var(--jc-text-secondary);
    border: 1px solid var(--jc-border);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}
.jc-reply__mic-btn:hover {
    background: var(--jc-hover-bg);
    color: var(--jc-primary);
    border-color: var(--jc-primary);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--jc-primary) 8%, transparent);
}

/* ============================
   Contact Panel — Chatwoot-style
   ============================ */

/* --- Root container (animated width) --- */
.jc-contact {
    width: 0; overflow: hidden; opacity: 0; flex-shrink: 0;
    background: var(--jc-sidebar-bg);
    display: flex; flex-direction: column;
    border-left: none;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.04);
    transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1),
                opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
}
.jc-layout--panel-open .jc-contact { width: 380px; opacity: 1; }

/* --- Sticky header --- */
.jc-contact__sticky-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 16px;
    background: var(--jc-sidebar-bg);
    border-bottom: 1px solid var(--jc-border);
    position: sticky; top: 0; z-index: 2;
    flex-shrink: 0;
}
.jc-contact__sticky-title {
    font-size: 14px; font-weight: 600;
    color: var(--jc-text-primary);
    font-family: var(--jc-font);
}
.jc-contact__close-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary);
    transition: background 0.12s;
}
.jc-contact__close-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}

/* --- Scrollbar --- */
.jc-contact__scroll { overflow-y: auto; flex: 1; }
.jc-contact__scroll::-webkit-scrollbar { width: 5px; }
.jc-contact__scroll::-webkit-scrollbar-track { background: transparent; }
.jc-contact__scroll::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--jc-text-primary) 12%, transparent);
    border-radius: 3px;
}
.jc-contact__scroll::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 22%, transparent);
}

/* --- Loading state --- */
.jc-contact__loading {
    flex: 1; display: flex; align-items: center; justify-content: center;
}
.jc-contact__center {
    display: flex; justify-content: center; padding: 12px 0;
}

/* --- Profile section (not collapsible) --- */
.jc-contact__profile {
    display: flex; flex-direction: column; align-items: center;
    padding: 20px 16px 16px;
    border-bottom: 1px solid var(--jc-border);
}
.jc-contact__avatar {
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--jc-primary-light, rgba(99, 102, 241, 0.1));
    color: var(--jc-primary, #6366F1);
    display: flex; align-items: center; justify-content: center;
    font-size: 19px; font-weight: 600;
    overflow: hidden; position: relative; flex-shrink: 0;
    box-shadow: var(--jc-shadow-sm);
}
.jc-contact__avatar img { width: 100%; height: 100%; object-fit: cover; }
.jc-contact__availability-dot {
    position: absolute; bottom: 1px; right: 1px;
    width: 12px; height: 12px; border-radius: 50%;
    border: 2px solid var(--jc-sidebar-bg);
}
.jc-contact__name {
    font-size: 15px; font-weight: 600; line-height: 1.3;
    color: var(--jc-text-primary); margin-top: 8px;
    text-align: center; max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jc-contact__availability-text {
    font-size: 12px; margin-top: 2px;
    color: var(--jc-text-secondary);
    text-transform: capitalize;
}

/* --- Contact detail rows --- */
.jc-contact__details {
    width: 100%; margin-top: 12px;
    display: flex; flex-direction: column; gap: 1px;
}
.jc-contact__detail-row {
    display: flex; align-items: center; gap: 8px;
    padding: 5px 6px; min-height: 28px;
    font-size: 13px; color: var(--jc-text-secondary);
    border-radius: 6px; transition: background 0.1s;
    position: relative;
}
.jc-contact__detail-row:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 4%, transparent);
}
.jc-contact__detail-row--error {
    color: var(--jc-error);
}
.jc-contact__detail-row--clickable {
    text-decoration: none; color: var(--jc-text-primary); cursor: pointer;
}
.jc-contact__detail-icon {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
    width: 18px; height: 18px;
    color: var(--jc-text-secondary); opacity: 0.65;
}
.jc-contact__detail-label {
    min-width: 64px; flex-shrink: 0;
    color: var(--jc-text-secondary);
    font-size: 12px; font-weight: 500;
}
.jc-contact__detail-value {
    color: var(--jc-text-primary); word-break: break-word;
    flex: 1; text-align: right; font-size: 13px;
}
.jc-contact__detail-value--truncate {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jc-contact__detail-link {
    color: var(--jc-primary); text-decoration: none;
}
.jc-contact__detail-link:hover { text-decoration: underline; }

/* --- Copy button (appears on hover) --- */
.jc-contact__copy-btn {
    width: 24px; height: 24px; border-radius: 6px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary); opacity: 0;
    transition: opacity 0.12s, background 0.12s;
    flex-shrink: 0;
}
.jc-contact__detail-row:hover .jc-contact__copy-btn { opacity: 0.7; }
.jc-contact__copy-btn:hover {
    opacity: 1; background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}

/* --- Action buttons row --- */
.jc-contact__actions-row {
    display: flex; align-items: center; justify-content: center;
    gap: 6px; margin-top: 12px;
}
.jc-contact__action-btn {
    width: 32px; height: 32px; border-radius: 8px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary);
    transition: background 0.12s, color 0.12s;
}
.jc-contact__action-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
    color: var(--jc-text-primary);
}
.jc-contact__action-btn--danger:hover {
    color: var(--jc-error);
}

/* --- Accordion sections container --- */
.jc-contact__sections {
    display: flex; flex-direction: column;
    gap: 0; padding: 8px 12px 16px;
}

/* --- Single accordion --- */
.jc-contact__accordion {
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid transparent;
    transition: border-color 0.15s;
}
.jc-contact__accordion + .jc-contact__accordion {
    margin-top: 4px;
}
.jc-contact__accordion-header {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; padding: 10px 14px;
    border: none; cursor: pointer;
    background: color-mix(in srgb, var(--jc-text-primary) 4%, transparent);
    border-radius: 8px;
    font-size: 13px; font-weight: 600;
    color: var(--jc-text-primary);
    user-select: none; transition: background 0.12s;
    text-align: left; font-family: inherit;
}
.jc-contact__accordion-header:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 7%, transparent);
}
.jc-contact__accordion-title {
    display: flex; align-items: center; gap: 8px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jc-contact__accordion-trailing {
    display: flex; align-items: center; gap: 2px; flex-shrink: 0;
}
.jc-contact__accordion-chevron {
    display: flex; color: var(--jc-text-secondary);
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.jc-contact__accordion-chevron--open { transform: rotate(180deg); }
.jc-contact__accordion-edit-btn {
    width: 26px; height: 26px; min-width: 26px; border-radius: 6px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary);
    transition: background 0.12s;
}
.jc-contact__accordion-edit-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}
.jc-contact__accordion-body {
    padding: 10px 14px 12px;
    animation: jc-contact-slide-in 0.15s ease-out;
}
@keyframes jc-contact-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --- Label chips (colored dot + text) --- */
.jc-contact__chips-wrap {
    display: flex; flex-wrap: wrap; gap: 6px;
}
.jc-contact__label-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12px; font-weight: 500;
    padding: 4px 10px; border-radius: 6px;
    background: color-mix(in srgb, var(--jc-text-primary) 6%, transparent);
    color: var(--jc-text-primary);
}
.jc-contact__label-chip::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--jc-primary); flex-shrink: 0;
}

/* --- Label toggles (contact labels) --- */
.jc-contact__label-toggle {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 5px 12px; border-radius: 6px;
    border: 1px solid color-mix(in srgb, var(--jc-border) 60%, transparent);
    background: transparent;
    color: var(--jc-text-primary);
    font-size: 12px; font-weight: 500;
    cursor: pointer; transition: all 0.15s;
}
.jc-contact__label-toggle::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%;
    background: var(--jc-border); flex-shrink: 0;
    transition: background 0.15s;
}
.jc-contact__label-toggle:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 5%, transparent);
}
.jc-contact__label-toggle--active {
    border-color: color-mix(in srgb, var(--label-color, var(--jc-primary)) 40%, transparent);
    background: color-mix(in srgb, var(--label-color, var(--jc-primary)) 10%, transparent);
    color: var(--jc-text-primary);
}
.jc-contact__label-toggle--active::before {
    background: var(--label-color, var(--jc-primary));
}

/* Legacy info-row (used by ContactPreviousConvs) */
.jc-contact__info-row {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 6px 0; font-size: 13px;
    color: var(--jc-text-secondary);
}
.jc-contact__info-label {
    min-width: 80px; color: var(--jc-text-secondary);
}
.jc-contact__info-value {
    color: var(--jc-text-primary); word-break: break-word;
}

/* --- Edit form --- */
.jc-contact__edit-form {
    padding: 14px 16px;
    background: color-mix(in srgb, var(--jc-surface-container) 50%, var(--jc-sidebar-bg));
    border-bottom: 1px solid var(--jc-border);
    display: flex; flex-direction: column; gap: 10px;
    animation: jc-contact-slide-in 0.15s ease-out;
}
.jc-contact__edit-error {
    padding: 8px 12px; border-radius: 8px;
    background: var(--jc-error-container);
    color: var(--jc-on-error-container);
    font-size: 12px;
}
.jc-contact__edit-field { display: flex; flex-direction: column; gap: 4px; }
.jc-contact__edit-label {
    font-size: 11px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--jc-text-secondary);
}
.jc-contact__edit-input {
    width: 100%; padding: 8px 12px;
    border: 1px solid var(--jc-border);
    border-radius: 8px;
    background: var(--jc-surface);
    color: var(--jc-text-primary);
    font-size: 13px; box-sizing: border-box;
    outline: none; transition: border-color 0.15s, box-shadow 0.15s;
    font-family: inherit;
}
.jc-contact__edit-input:focus {
    border-color: var(--jc-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--jc-primary) 15%, transparent);
}
.jc-contact__edit-actions {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px;
}
.jc-contact__edit-btn {
    padding: 7px 18px; border-radius: 8px; border: none;
    font-size: 13px; font-weight: 500;
    cursor: pointer; display: flex; align-items: center; gap: 4px;
    transition: opacity 0.12s; font-family: inherit;
}
.jc-contact__edit-btn--cancel {
    background: var(--jc-surface-container);
    color: var(--jc-text-secondary);
}
.jc-contact__edit-btn--save {
    background: var(--jc-primary);
    color: var(--jc-on-primary);
}
.jc-contact__edit-btn--save:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- Custom attribute inputs --- */
.jc-contact__attr-input {
    width: 100%; padding: 4px 8px; font-size: 12px;
    border-radius: 6px;
    border: 1px solid var(--jc-border);
    background: var(--jc-sidebar-bg);
    color: var(--jc-text-primary);
    font-family: inherit; outline: none; box-sizing: border-box;
    transition: border-color 0.15s;
}
.jc-contact__attr-input:focus {
    border-color: var(--jc-primary);
}
.jc-contact__attr-checkbox {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--jc-text-primary);
}

/* --- Notes --- */
.jc-contact__note-input-wrap {
    display: flex; gap: 8px; align-items: flex-end; margin-bottom: 12px;
}
.jc-contact__note-input {
    flex: 1; padding: 8px 12px;
    border: 1px solid var(--jc-border);
    border-radius: 8px;
    background: var(--jc-surface);
    color: var(--jc-text-primary);
    font-size: 13px; resize: none; outline: none;
    font-family: inherit;
    transition: border-color 0.15s;
}
.jc-contact__note-input:focus {
    border-color: var(--jc-primary);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--jc-primary) 15%, transparent);
}
.jc-contact__note-submit {
    width: 34px; height: 34px; border-radius: 8px; border: none;
    background: var(--jc-primary);
    color: var(--jc-on-primary);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity 0.12s;
}
.jc-contact__note-submit:hover:not(:disabled) { opacity: 0.9; }
.jc-contact__note-submit:disabled { opacity: 0.4; cursor: not-allowed; }
.jc-contact__notes-list { display: flex; flex-direction: column; gap: 6px; }
.jc-contact__note-item {
    padding: 10px 12px; border-radius: 8px;
    background: color-mix(in srgb, var(--jc-surface-container) 60%, var(--jc-sidebar-bg));
    border-left: 3px solid var(--jc-primary);
}
.jc-contact__note-content {
    font-size: 13px; color: var(--jc-text-primary);
    white-space: pre-wrap; word-break: break-word;
    margin-bottom: 6px; line-height: 1.5;
}
.jc-contact__note-meta {
    display: flex; align-items: center; gap: 6px;
    font-size: 11px; color: var(--jc-text-secondary);
}
.jc-contact__note-author {
    display: inline-flex; align-items: center; gap: 3px;
    font-weight: 600; color: var(--jc-text-primary);
}
.jc-contact__note-dot { opacity: 0.5; }
.jc-contact__note-delete {
    width: 22px; height: 22px; min-width: 22px; border-radius: 6px; border: none;
    background: transparent; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    margin-left: auto; color: var(--jc-error);
    opacity: 0.6; transition: opacity 0.12s;
}
.jc-contact__note-delete:hover { opacity: 1; }

/* --- Show more button --- */
.jc-contact__show-more {
    display: flex; align-items: center; justify-content: center; gap: 4px;
    width: 100%; padding: 8px; margin-top: 4px;
    border: 1px solid var(--jc-border);
    border-radius: 8px; background: transparent;
    font-size: 13px; font-weight: 500;
    color: var(--jc-text-secondary);
    cursor: pointer; transition: background 0.12s;
    font-family: inherit;
}
.jc-contact__show-more:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 4%, transparent);
}

/* --- Attachments --- */
.jc-contact__attach-tabs {
    display: flex; gap: 4px; margin-bottom: 10px;
}
.jc-contact__attach-tab {
    padding: 4px 10px; border-radius: 6px; border: none;
    cursor: pointer; font-size: 12px; font-weight: 500;
    transition: background 0.12s, color 0.12s;
    font-family: inherit;
}
.jc-contact__attach-tab--inactive {
    background: color-mix(in srgb, var(--jc-text-primary) 6%, transparent);
    color: var(--jc-text-secondary);
}
.jc-contact__attach-tab--active {
    background: var(--jc-primary);
    color: var(--jc-on-primary);
}
.jc-contact__attach-grid {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 4px; margin-bottom: 8px;
}
.jc-contact__attach-thumb {
    display: block; aspect-ratio: 1; overflow: hidden;
    border-radius: 8px; background: var(--jc-surface-container);
}
.jc-contact__attach-thumb img {
    width: 100%; height: 100%; object-fit: cover;
    transition: transform 0.15s;
}
.jc-contact__attach-thumb:hover img { transform: scale(1.06); }
.jc-contact__audio-item { margin-bottom: 6px; }
.jc-contact__audio-player {
    width: 100%; height: 32px; border-radius: 8px;
}

/* --- CSAT --- */
.jc-contact__csat-wrap {
    display: flex; flex-direction: column; gap: 8px;
}
.jc-contact__csat-stars { display: flex; align-items: center; gap: 2px; }
.jc-contact__csat-score {
    font-size: 13px; font-weight: 500; margin-left: 6px;
    color: var(--jc-text-secondary);
}
.jc-contact__csat-feedback {
    font-size: 13px; color: var(--jc-text-primary);
    font-style: italic; padding: 4px 0 0; line-height: 1.5;
}

/* --- Social brand labels --- */
.jc-contact__social-brand {
    width: 20px; height: 20px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 700;
    border-radius: 4px; flex-shrink: 0; color: #fff;
}

/* --- Empty state --- */
.jc-contact__empty {
    font-size: 13px; color: var(--jc-text-secondary);
    padding: 8px 0; text-align: center;
}

/* Search overlay (floating modal) */
.jc-search-overlay {
    position: fixed; inset: 0; z-index: 100;
    background: color-mix(in srgb, var(--jc-scrim) 40%, transparent);
    backdrop-filter: blur(2px);
    display: flex; align-items: flex-start; justify-content: center;
    padding-top: 8vh; opacity: 0; pointer-events: none;
    transition: opacity 300ms ease;
}
.jc-search-overlay--open { opacity: 1; pointer-events: auto; }

.jc-search-modal {
    width: 640px; max-width: 92vw; max-height: 540px;
    background: var(--jc-surface);
    border-radius: var(--jc-radius-lg, 24px);
    box-shadow: var(--jc-shadow-lg);
    display: flex; flex-direction: column; overflow: hidden;
    transform: translateY(-16px) scale(0.96);
    transition: transform 300ms cubic-bezier(0.2, 0, 0, 1);
}
.jc-search-overlay--open .jc-search-modal { transform: translateY(0) scale(1); }

.jc-search-modal__header {
    display: flex; align-items: center; gap: 12px;
    padding: 6px 20px; min-height: 56px;
    background: var(--jc-surface);
    border-bottom: 1px solid var(--jc-border);
    color: var(--jc-text-secondary);
}
.jc-search-modal__header .material-symbols-outlined { font-size: 22px; flex-shrink: 0; }
.jc-search-modal__input {
    flex: 1; border: none; outline: none; background: transparent;
    font-family: var(--jc-font);
    font-size: 15px;
    color: var(--jc-text-primary);
    height: 40px;
}
.jc-search-modal__input::placeholder { color: var(--jc-text-secondary); }
.jc-search-modal__kbd {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 22px; height: 22px; padding: 0 6px;
    border-radius: 4px;
    border: 1px solid var(--jc-border);
    background: var(--jc-surface-container);
    color: var(--jc-text-secondary);
    font-family: var(--jc-font);
    font-size: 11px; font-weight: 500; line-height: 1;
    flex-shrink: 0;
}
.jc-search-modal__close {
    width: 32px; height: 32px; border: none; background: transparent;
    border-radius: var(--jc-radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary); cursor: pointer;
    transition: background 100ms ease;
}
.jc-search-modal__close:hover { background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent); }
.jc-search-modal__close .material-symbols-outlined { font-size: 20px; }

/* Tabs */
.jc-search-modal__tabs {
    display: flex; gap: 0; padding: 0 20px;
    border-bottom: 1px solid var(--jc-border);
}
.jc-search-modal__tab {
    position: relative; padding: 10px 14px; border: none; background: none;
    cursor: pointer; font-family: var(--jc-font);
    font-size: 13px; font-weight: 500; white-space: nowrap;
    color: var(--jc-text-secondary);
    transition: color 100ms ease;
}
.jc-search-modal__tab:hover { color: var(--jc-text-primary); }
.jc-search-modal__tab--active {
    color: var(--jc-primary);
}
.jc-search-modal__tab--active::after {
    content: ''; position: absolute; left: 14px; right: 14px; bottom: 0;
    height: 2px; border-radius: 2px 2px 0 0;
    background: var(--jc-primary);
}
.jc-search-modal__tab-badge {
    display: inline-flex; align-items: center; justify-content: center;
    margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: var(--jc-radius-full);
    background: var(--jc-surface-container);
    font-size: 11px; font-weight: 600; line-height: 1;
    color: var(--jc-text-secondary);
}
.jc-search-modal__tab--active .jc-search-modal__tab-badge {
    background: color-mix(in srgb, var(--jc-primary) 12%, transparent);
    color: var(--jc-primary);
}

.jc-search-modal__body { flex: 1; overflow-y: auto; padding: 4px 8px; }
.jc-search-modal__hint {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 48px 20px; text-align: center;
    font-family: var(--jc-font);
    font-size: 14px;
    color: var(--jc-text-secondary);
}

.jc-search-modal__result {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 12px; border-radius: var(--jc-radius-sm);
    cursor: pointer;
    transition: background 100ms ease;
}
.jc-search-modal__result:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}
.jc-search-modal__result-info {
    flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden;
}
.jc-search-modal__result-meta {
    display: flex; align-items: center; gap: 6px;
    font-family: var(--jc-font);
    font-size: 11px; color: var(--jc-text-secondary);
}
.jc-search-modal__result-meta .material-symbols-outlined { font-size: 14px; }
.jc-search-modal__result-name {
    font-family: var(--jc-font);
    font-size: 14px;
    font-weight: 500; color: var(--jc-text-primary);
}
.jc-search-modal__result-preview {
    font-family: var(--jc-font);
    font-size: 12px;
    color: var(--jc-text-secondary);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.jc-search-modal__result-id {
    font-family: var(--jc-font);
    font-size: 11px; color: var(--jc-text-secondary);
    flex-shrink: 0;
}

/* ── New Conversation Modal (Chatwoot-style stacked form) ── */
.jc-new-conv-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: color-mix(in srgb, var(--jc-scrim) 40%, transparent);
    backdrop-filter: blur(2px);
    display: flex; align-items: center; justify-content: center;
    animation: jc-fade-in 300ms ease;
}
@keyframes jc-fade-in { from { opacity: 0; } to { opacity: 1; } }

.jc-new-conv {
    width: 640px; max-width: 92vw; max-height: 90vh;
    background: var(--jc-chat-bg);
    border-radius: var(--jc-radius-lg);
    box-shadow: var(--jc-shadow-lg);
    display: flex; flex-direction: column; overflow: hidden;
    animation: jc-new-conv-enter 300ms cubic-bezier(0.2, 0, 0, 1);
}
@keyframes jc-new-conv-enter {
    from { opacity: 0; transform: translateY(12px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.jc-new-conv__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 16px;
}
.jc-new-conv__header-title {
    font-family: var(--jc-font);
    font-size: 22px;
    font-weight: 400;
    color: var(--jc-text-primary);
}
.jc-new-conv__close {
    width: 36px; height: 36px; border: none; background: transparent;
    border-radius: var(--jc-radius-full);
    display: flex; align-items: center; justify-content: center;
    color: var(--jc-text-secondary); cursor: pointer;
    transition: background 100ms ease;
}
.jc-new-conv__close:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}

.jc-new-conv__body {
    flex: 1; overflow-y: auto;
    border-top: 1px solid var(--jc-border);
    border-bottom: 1px solid var(--jc-border);
}
.jc-new-conv__row {
    padding: 16px 24px; position: relative;
}
.jc-new-conv__row + .jc-new-conv__row {
    border-top: 1px solid var(--jc-border);
}
.jc-new-conv__label {
    display: block; margin-bottom: 8px;
    font-family: var(--jc-font);
    font-size: 12px;
    font-weight: 500;
    color: var(--jc-text-secondary);
}
.jc-new-conv__input-wrap {
    position: relative; display: flex; align-items: center;
}
.jc-new-conv__input-wrap .material-symbols-outlined {
    position: absolute; left: 12px; font-size: 18px;
    color: var(--jc-text-secondary); pointer-events: none;
}
.jc-new-conv__input {
    width: 100%; padding: 10px 12px 10px 38px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    color: var(--jc-text-primary);
    font-family: var(--jc-font);
    font-size: 14px; outline: none;
    transition: border-color 100ms ease;
}
.jc-new-conv__input:focus {
    border-color: var(--jc-primary);
}
.jc-new-conv__input--no-icon { padding-left: 12px; }
.jc-new-conv__select {
    width: 100%; padding: 10px 12px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    color: var(--jc-text-primary);
    font-family: var(--jc-font);
    font-size: 14px; cursor: pointer; outline: none;
    transition: border-color 100ms ease;
}
.jc-new-conv__select:focus {
    border-color: var(--jc-primary);
}
.jc-new-conv__textarea {
    width: 100%; padding: 10px 12px; min-height: 80px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    color: var(--jc-text-primary);
    font-family: var(--jc-font);
    font-size: 14px; resize: vertical; outline: none;
    transition: border-color 100ms ease;
}
.jc-new-conv__textarea:focus {
    border-color: var(--jc-primary);
}
.jc-new-conv__hint {
    margin-top: 4px;
    font-family: var(--jc-font);
    font-size: 11px; color: var(--jc-text-secondary);
}
.jc-new-conv__dropdown {
    position: absolute; left: 24px; right: 24px; top: 100%; z-index: 10;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    box-shadow: var(--jc-shadow-md);
    max-height: 200px; overflow-y: auto;
}
.jc-new-conv__dropdown-item {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 10px 16px;
    background: none; border: none; cursor: pointer; text-align: left;
    transition: background 100ms ease;
}
.jc-new-conv__dropdown-item:hover {
    background: var(--jc-surface-container);
}
.jc-new-conv__dropdown-empty {
    padding: 12px 16px; color: var(--jc-text-secondary);
    font-size: 14px;
}
.jc-new-conv__avatar {
    width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
    background: var(--jc-warning-container);
    display: flex; align-items: center; justify-content: center;
}
.jc-new-conv__clear {
    position: absolute; right: 8px;
    background: none; border: none; cursor: pointer; padding: 2px;
    color: var(--jc-text-secondary);
    display: flex; align-items: center;
}

.jc-new-conv__footer {
    display: flex; justify-content: flex-end; gap: 8px;
    padding: 16px 24px;
}

@media (max-width: 600px) {
    .jc-new-conv {
        max-width: 100%; max-height: 100%; height: 100%; border-radius: 0;
    }
    .jc-new-conv__row { padding: 14px 16px; }
    .jc-new-conv__header { padding: 16px; }
    .jc-new-conv__footer { padding: 14px 16px; }
    .jc-new-conv__dropdown { left: 16px; right: 16px; }
}

/* Empty / not-configured states */
.jc-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 32px;
    text-align: center;
    background: var(--jc-chat-bg);
}

.jc-empty__hero {
    margin-bottom: 12px;
}

.jc-empty__icon-ring {
    width: 72px; height: 72px;
    border-radius: var(--jc-radius-lg);
    background: var(--jc-primary-light, rgba(99, 102, 241, 0.1));
    color: var(--jc-primary, #6366F1);
    display: flex; align-items: center; justify-content: center;
    position: relative;
}

.jc-empty__icon-ring::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: var(--jc-radius-lg);
    border: 1.5px dashed rgba(99, 102, 241, 0.25);
}

/* Legacy fallback — keep for not-configured states */
.jc-empty__icon {
    width: 48px; height: 48px;
    border-radius: var(--jc-radius-sm);
    background: var(--jc-surface-container);
    color: var(--jc-text-secondary);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 4px;
}

.jc-empty__title {
    font-family: var(--jc-font);
    font-size: 18px; font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--jc-text-primary);
}

.jc-empty__desc {
    font-size: 13px; line-height: 1.5;
    color: var(--jc-text-secondary);
    max-width: 320px;
}

.jc-empty__shortcuts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    margin-top: 20px;
    padding: 16px 20px;
    border-radius: var(--jc-radius-md);
    background: var(--jc-chat-bg);
}

.jc-empty__shortcut {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--jc-text-secondary);
    white-space: nowrap;
}

.jc-empty__shortcut kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border-radius: 4px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    font-family: inherit;
    font-size: 11px;
    font-weight: 500;
    color: var(--jc-text-primary);
    line-height: 1;
    box-shadow: 0 1px 0 var(--jc-border);
}

/* Message attachments */
.jc-msg__attachments {
    display: block;
    padding: 4px !important;
}

.jc-msg__attachments > *:not(.jc-msg__time) + * {
    margin-top: 6px;
}

.jc-msg__image {
    display: block;
    max-width: 100%;
    border-radius: 6px;
    overflow: hidden;
    line-height: 0;
}

.jc-msg__image img {
    display: block;
    width: 100%;
    max-height: 320px;
    border-radius: 6px;
    object-fit: cover;
}

.jc-msg__audio {
    min-width: 240px;
}

.jc-msg__audio audio {
    width: 100%;
    height: 36px;
    border-radius: var(--jc-radius-full);
}

.jc-msg__video {
    max-width: 100%;
    border-radius: var(--jc-radius-sm);
    overflow: hidden;
    line-height: 0;
}

.jc-msg__video video {
    max-width: 100%;
    max-height: 320px;
    border-radius: var(--jc-radius-sm);
}

.jc-msg__file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-radius: var(--jc-radius-xs);
    background: color-mix(in srgb, var(--jc-text-primary) 6%, transparent);
    color: var(--jc-primary);
    font: var(--jc-font);
    text-decoration: none;
    transition: background 150ms;
    word-break: break-all;
}

.jc-msg__file:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 10%, transparent);
}

.jc-msg__location {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--jc-radius-xs);
    background: color-mix(in srgb, var(--jc-text-primary) 6%, transparent);
    color: var(--jc-primary);
    font: var(--jc-font);
    text-decoration: none;
    transition: background 150ms;
}

.jc-msg__location:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 10%, transparent);
}

.jc-msg__sticker {
    line-height: 0;
}

.jc-msg__sticker img {
    max-width: 160px;
    max-height: 160px;
}

/* Outgoing attachment overrides */
.jc-msg--outgoing .jc-msg__file,
.jc-msg--outgoing .jc-msg__location {
    background: color-mix(in srgb, var(--jc-outgoing-bubble-text) 10%, transparent);
    color: var(--jc-outgoing-bubble-text);
}

.jc-msg--outgoing .jc-msg__file:hover,
.jc-msg--outgoing .jc-msg__location:hover {
    background: color-mix(in srgb, var(--jc-outgoing-bubble-text) 18%, transparent);
}

/* Reply attachments preview */
.jc-reply__attachments {
    display: flex;
    gap: 8px;
    padding: 8px 0;
    overflow-x: auto;
    flex-wrap: wrap;
}

.jc-reply__attachment-item {
    position: relative;
    display: inline-flex;
    align-items: center;
    border-radius: var(--jc-radius-xs);
    border: 1px solid var(--jc-border);
    overflow: hidden;
}

.jc-reply__attachment-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
}

.jc-reply__attachment-file {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    font: var(--jc-font);
    color: var(--jc-text-primary);
    max-width: 160px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.jc-reply__attachment-file span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.jc-reply__attachment-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--jc-surface);
    color: var(--jc-text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

/* Emoji picker */
.jc-emoji-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    width: 352px;
    max-height: 340px;
    background: var(--jc-surface);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
    box-shadow: var(--jc-shadow-md);
    z-index: 30;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.jc-emoji-picker__search {
    padding: 8px;
    border-bottom: 1px solid var(--jc-border);
    flex-shrink: 0;
}

.jc-emoji-picker__search input {
    width: 100%;
    padding: 6px 10px;
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    background: var(--jc-surface-container);
    color: var(--jc-text-primary);
    font-size: 13px;
    outline: none;
}

.jc-emoji-picker__search input:focus {
    border-color: var(--jc-primary);
}

.jc-emoji-picker__tabs {
    display: flex;
    border-bottom: 1px solid var(--jc-border);
    padding: 0 4px;
    flex-shrink: 0;
    overflow-x: auto;
}

.jc-emoji-picker__tab {
    flex: 1;
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--jc-text-secondary);
    cursor: pointer;
    border-radius: var(--jc-radius-xs);
    transition: background 150ms, color 150ms;
}

.jc-emoji-picker__tab:hover {
    background: var(--jc-surface-container);
}

.jc-emoji-picker__tab.active {
    color: var(--jc-primary);
    background: color-mix(in srgb, var(--jc-primary) 12%, transparent);
}

.jc-emoji-picker__grid {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
}

.jc-emoji-picker__category-label {
    grid-column: 1 / -1;
    font-size: 11px;
    font-weight: 600;
    color: var(--jc-text-secondary);
    padding: 6px 4px 2px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jc-emoji-picker__item {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: none;
    background: transparent;
    border-radius: var(--jc-radius-xs);
    cursor: pointer;
    transition: background 150ms;
    font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', sans-serif;
}

.jc-emoji-picker__item:hover {
    background: var(--jc-surface-container);
}

/* AI Assist dropdown */
.jc-ai-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    min-width: 220px;
    background: var(--jc-surface);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
    box-shadow: var(--jc-shadow-md);
    z-index: 30;
    padding: 4px 0;
    overflow: hidden;
}

.jc-ai-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    border: none;
    background: transparent;
    color: var(--jc-text-primary);
    font-size: 13px;
    cursor: pointer;
    transition: background 150ms;
    text-align: left;
}

.jc-ai-dropdown__item:hover {
    background: var(--jc-surface-container);
}

.jc-ai-dropdown__item .material-symbols-outlined {
    font-size: 18px;
    color: var(--jc-text-secondary);
}

/* Template dialog */
.jc-template-dialog__list {
    max-height: 300px;
    overflow-y: auto;
    margin: 12px 0;
}

.jc-template-dialog__item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px;
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    margin-bottom: 8px;
    cursor: pointer;
    transition: background 150ms, border-color 150ms;
}

.jc-template-dialog__item:hover {
    background: var(--jc-surface-container);
}

.jc-template-dialog__item.selected {
    border-color: var(--jc-primary);
    background: color-mix(in srgb, var(--jc-primary) 8%, transparent);
}

.jc-template-dialog__item-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--jc-text-primary);
}

.jc-template-dialog__item-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--jc-text-secondary);
}

.jc-template-dialog__preview {
    margin-top: 12px;
    padding: 12px;
    background: var(--jc-surface-container);
    border-radius: var(--jc-radius-xs);
    font-size: 13px;
    color: var(--jc-text-primary);
    white-space: pre-wrap;
    line-height: 1.5;
}

.jc-template-dialog__variables {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.jc-template-dialog__var-field {
    display: flex;
    align-items: center;
    gap: 8px;
}

.jc-template-dialog__var-field label {
    min-width: 48px;
    font-size: 13px;
    font-weight: 600;
    color: var(--jc-text-secondary);
}

.jc-template-dialog__var-field input {
    flex: 1;
    padding: 6px 10px;
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-xs);
    background: var(--jc-surface);
    color: var(--jc-text-primary);
    font-size: 13px;
    outline: none;
}

.jc-template-dialog__var-field input:focus {
    border-color: var(--jc-primary);
}

/* Recording indicator */
.jc-reply__recording {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.jc-reply__recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--jc-error);
    animation: jc-pulse 1s ease-in-out infinite;
}

@keyframes jc-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.jc-reply__recording-time {
    font: var(--jc-font);
    color: var(--jc-text-primary);
    font-variant-numeric: tabular-nums;
}

/* Date divider */
.jc-date-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    font: var(--jc-font);
    color: var(--jc-text-secondary);
}

.jc-date-divider::before,
.jc-date-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--jc-border);
}

/* ── AI Suggestions bar ── */
.jc-ai-suggestions {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    background: var(--jc-warning-container);
    border-bottom: 1px solid var(--jc-border);
    animation: jc-ai-suggest-slide-in 0.25s ease-out;
    flex-shrink: 0;
}
.jc-ai-suggestions__icon {
    color: var(--jc-on-warning-container);
    flex-shrink: 0;
    opacity: 0.7;
    margin-top: 4px;
}
.jc-ai-suggestions__status {
    color: var(--jc-on-warning-container);
    opacity: 0.7;
    white-space: nowrap;
    line-height: 28px;
}
.jc-ai-suggestions__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}
.jc-ai-suggestions__chip {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--jc-radius-md);
    background: var(--jc-surface);
    color: var(--jc-on-warning-container);
    border: 1px solid var(--jc-border);
    cursor: pointer;
    max-width: 280px;
    transition: background 0.15s, box-shadow 0.15s;
    font-family: inherit;
    line-height: 1.35;
}
.jc-ai-suggestions__chip:hover {
    background: var(--jc-warning-container);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}
.jc-ai-suggestions__chip-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    min-width: 0;
}
.jc-ai-suggestions__spacer {
    flex: 1;
    min-width: 4px;
}
.jc-ai-suggestions__action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--jc-on-warning-container);
    opacity: 0.6;
    flex-shrink: 0;
    transition: opacity 0.15s;
    margin-top: 2px;
}
.jc-ai-suggestions__action:hover {
    opacity: 1;
}
.jc-ai-suggestions__action--dismiss {
    opacity: 0.5;
}
.jc-ai-suggestions__action--dismiss:hover {
    opacity: 1;
}
@keyframes jc-ai-suggest-slide-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ── Dark mode overrides for jc-* components ── */
[data-theme="dark"] .jc-msg--outgoing .jc-msg__link {
    color: #A5B4FC; text-decoration: underline;
}
[data-theme="dark"] .jc-conversation__messages::-webkit-scrollbar-thumb,
[data-theme="dark"] .jc-inbox__list::-webkit-scrollbar-thumb,
[data-theme="dark"] .jc-contact__scroll::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.12);
}
[data-theme="dark"] .jc-conversation__messages::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .jc-inbox__list::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .jc-contact__scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.22);
}
/* Dark mode: hover actions */
[data-theme="dark"] .jc-msg__hover-actions {
    background: #1E293B;
    box-shadow: var(--jc-shadow-md);
}
/* Dark mode: active inbox item */
[data-theme="dark"] .jc-inbox-item--active {
    background: #1E293B;
}
/* Dark mode: subtle background pattern */
[data-theme="dark"] .jc-conversation__messages {
    background-image: none;
}
/* Dark mode: tail colors are already inherited via CSS variables -- no extra overrides needed */

/* Responsive: Tablet (600-840px) */
@media (max-width: 840px) {
    .jc-inbox { width: 320px; }
    .jc-sidebar-filters__pill span:not(.jc-sidebar-filters__pill-count) { display: none; }
    .jc-sidebar-filters__select { font-size: 12px; padding: 3px 20px 3px 8px; }
    .jc-layout--panel-open .jc-contact {
        position: absolute; right: 0; top: 0; bottom: 0;
        z-index: 20;
        box-shadow: var(--jc-shadow-lg);
    }
    .jc-conversation__messages { padding: 8px 30px; }
}

/* Responsive: Mobile (<600px) */
@media (max-width: 600px) {
    .jc-layout { flex-direction: column; }
    .jc-inbox { width: 100%; }
    .jc-conversation {
        position: absolute; inset: 0; z-index: 10;
    }
    .jc-layout--panel-open .jc-contact { width: 100%; }
    .jc-msg { max-width: 85%; }
    .jc-conversation__messages { padding: 8px 12px; }
    .jc-sidebar-header__title { font-size: 18px; }
    /* Hide status/assign buttons on mobile — they live in the more-menu instead */
    .jc-header-btn-desktop { display: none !important; }
    /* Contact panel: full-screen on mobile */
    .jc-contact__profile { padding-top: 12px; }
    /* Dropdowns as bottom-sheet on mobile */
    .jc-dropdown,
    .jc-assignment-dropdown,
    .jc-team-dropdown,
    .jc-labels-picker,
    .jc-priority-dropdown,
    .jc-snooze-dropdown,
    .jc-filter-dropdown {
        position: fixed !important;
        left: 12px !important;
        right: 12px !important;
        bottom: 92px !important;
        top: auto !important;
        max-height: 60vh !important;
        overflow-y: auto;
        width: auto !important;
        max-width: none !important;
        border-radius: 20px !important;
        box-shadow: 0 -4px 24px rgba(0,0,0,0.2) !important;
    }
    /* Message images should never overflow the bubble */
    .jc-msg__image img {
        max-width: 100%;
        height: auto;
        max-height: 280px;
    }
    /* AI suggestions: tighter on mobile */
    .jc-ai-suggestions { padding: 6px 10px; gap: 6px; }
    .jc-ai-suggestions__chip { max-width: 220px; }
    /* Reply toolbar wraps gracefully on narrow screens */
    .jc-reply__toolbar {
        flex-wrap: wrap;
        gap: 2px;
    }
    /* Search overlay becomes full-screen on mobile */
    .jc-search-overlay { padding-top: 0; backdrop-filter: none; }
    .jc-search-modal {
        width: 100%;
        max-width: 100%;
        max-height: 100%;
        height: 100%;
        border-radius: 0;
    }
    .jc-search-modal__kbd { display: none; }
}

/* ===== Dropdown (generic for labels, assignment, priority, snooze) ===== */

.jc-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 200;
    min-width: 220px;
    max-width: 300px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
    box-shadow: var(--jc-shadow-md);
    padding: 4px 0;
}

.jc-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid var(--jc-border);
}

.jc-dropdown__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--jc-text-primary);
    transition: background 0.15s;
    text-align: left;
}

.jc-dropdown__item:hover {
    background: var(--jc-surface-container);
}

.jc-dropdown__item .material-symbols-outlined {
    font-size: 18px;
    color: var(--jc-text-secondary);
    flex-shrink: 0;
}

.jc-dropdown__item--active {
    background: color-mix(in srgb, var(--jc-primary) 12%, transparent);
}

/* ===== Canned Response Picker ===== */

.jc-canned-picker {
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    z-index: 200;
    max-height: 240px;
    overflow-y: auto;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm) var(--jc-radius-sm) 0 0;
    box-shadow: var(--jc-shadow-md);
}

.jc-canned-picker__item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.jc-canned-picker__item:hover,
.jc-canned-picker__item.active {
    background: var(--jc-surface-container);
}

.jc-canned-picker__code {
    font-size: 12px;
    font-weight: 600;
    color: var(--jc-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.jc-canned-picker__content {
    font-size: 13px;
    color: var(--jc-text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== Typing Indicator ===== */

.jc-typing-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 12px;
    color: var(--jc-text-secondary);
}

.jc-typing-indicator__dots {
    display: flex;
    gap: 3px;
}

.jc-typing-indicator__dots span {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--jc-text-secondary);
    animation: jc-typing-bounce 1.4s ease-in-out infinite both;
}

.jc-typing-indicator__dots span:nth-child(2) { animation-delay: 0.16s; }
.jc-typing-indicator__dots span:nth-child(3) { animation-delay: 0.32s; }

@keyframes jc-typing-bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ===== Context Menu ===== */

.jc-context-menu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 300;
}

.jc-context-menu {
    position: fixed;
    z-index: 301;
    min-width: 180px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: var(--jc-radius-sm);
    box-shadow: var(--jc-shadow-md);
    padding: 4px 0;
    overflow: hidden;
}

.jc-context-menu__item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 14px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--jc-text-primary);
    transition: background 0.15s;
    text-align: left;
}

.jc-context-menu__item:hover {
    background: var(--jc-surface-container);
}

.jc-context-menu__item--danger {
    color: var(--jc-error);
}

.jc-context-menu__item--danger:hover {
    background: color-mix(in srgb, var(--jc-error) 8%, transparent);
}

/* ================================================
   NOTIFICATION PANEL
   ================================================ */

.jc-notif-panel {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 340px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    z-index: 200;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 440px;
}

.jc-notif-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid var(--jc-border);
    flex-shrink: 0;
    color: var(--jc-text-primary);
}

.jc-notif-panel__mark-all {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: var(--jc-primary);
    padding: 2px 6px;
    border-radius: 4px;
    transition: background 0.15s;
}
.jc-notif-panel__mark-all:hover {
    background: color-mix(in srgb, var(--jc-primary) 8%, transparent);
}

.jc-notif-panel__list {
    overflow-y: auto;
    flex: 1;
}

.jc-notif-panel__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 32px 16px;
    color: var(--jc-text-secondary);
}

/* Notification item */
.jc-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
    border-bottom: 1px solid var(--jc-border);
}
.jc-notif-item:last-child {
    border-bottom: none;
}
.jc-notif-item:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 4%, transparent);
}
.jc-notif-item--unread {
    background: color-mix(in srgb, var(--jc-primary) 4%, transparent);
}
.jc-notif-item--unread:hover {
    background: color-mix(in srgb, var(--jc-primary) 8%, transparent);
}

.jc-notif-item__avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 50%;
    background: var(--jc-primary-light);
    color: var(--jc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    overflow: hidden;
    flex-shrink: 0;
}
.jc-notif-item__avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.jc-notif-item__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
    min-width: 0;
}

.jc-notif-item__text {
    font-size: 13px;
    color: var(--jc-text-primary);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.jc-notif-item__conv {
    font-size: 11px;
    color: var(--jc-primary);
    font-weight: 500;
}

.jc-notif-item__time {
    font-size: 11px;
    color: var(--jc-text-secondary);
}

.jc-notif-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--jc-primary);
    flex-shrink: 0;
    margin-top: 4px;
}

/* ================================================
   KEYBOARD SHORTCUTS DIALOG
   ================================================ */

.jc-shortcuts-overlay {
    position: fixed;
    inset: 0;
    background: color-mix(in srgb, var(--jc-scrim, #000) 40%, transparent);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 300;
    animation: jc-fade-in 0.15s ease;
}

@keyframes jc-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.jc-shortcuts-dialog {
    background: var(--jc-surface-container);
    border-radius: 16px;
    width: 400px;
    max-width: calc(100vw - 32px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.jc-shortcuts-dialog__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--jc-border);
    color: var(--jc-text-primary);
}

.jc-shortcuts-dialog__list {
    padding: 8px 0;
}

.jc-shortcuts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    gap: 16px;
}
.jc-shortcuts-row:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 4%, transparent);
}

.jc-shortcuts-row__desc {
    font-size: 14px;
    color: var(--jc-text-primary);
}

.jc-shortcuts-row__keys {
    display: flex;
    gap: 4px;
    align-items: center;
    flex-shrink: 0;
}

.jc-shortcuts-row__keys kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 8px;
    background: var(--jc-surface-container);
    border: 1px solid var(--jc-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    color: var(--jc-text-secondary);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    min-width: 24px;
}

/* ── Lightbox ── */

.jc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--jc-scrim, #000) 80%, transparent);
    animation: jc-fade-in 0.15s ease-out;
}

.jc-lightbox__toolbar {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 8px;
    z-index: 1001;
}

.jc-lightbox__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: color-mix(in srgb, var(--jc-surface) 90%, transparent);
    color: var(--jc-text-primary);
    cursor: pointer;
    transition: background 0.15s;
    text-decoration: none;
}

.jc-lightbox__btn:hover {
    background: var(--jc-surface);
}

.jc-lightbox__img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: var(--jc-radius-sm);
    object-fit: contain;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Legacy close button (fallback if still used somewhere) */
.jc-lightbox__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: color-mix(in srgb, var(--jc-surface) 90%, transparent);
    color: var(--jc-text-primary);
    cursor: pointer;
}

@keyframes jc-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ===== Chat Reports Panel ===== */

.jc-reports-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--jc-scrim) 40%, transparent);
    animation: jc-fade-in 0.15s ease;
}

.jc-reports-panel {
    width: min(720px, calc(100vw - 32px));
    max-height: calc(100vh - 64px);
    display: flex;
    flex-direction: column;
    border-radius: var(--jc-radius-lg);
    background: var(--jc-surface);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
    overflow: hidden;
}

.jc-reports-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 12px;
    flex-shrink: 0;
}

.jc-reports-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: transparent;
    color: var(--jc-text-secondary);
    cursor: pointer;
    transition: background 0.15s;
}
.jc-reports-close:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 8%, transparent);
}

.jc-reports-periods {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 24px 16px;
    flex-shrink: 0;
}

.jc-reports-period-btn {
    padding: 6px 16px;
    border-radius: var(--jc-radius-full);
    border: 1px solid var(--jc-border);
    background: transparent;
    color: var(--jc-text-secondary);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
}
.jc-reports-period-btn:hover {
    background: color-mix(in srgb, var(--jc-text-primary) 5%, transparent);
}
.jc-reports-period-btn--active {
    background: var(--jc-primary);
    color: var(--jc-on-primary);
    border-color: var(--jc-primary);
}
.jc-reports-period-btn--active:hover {
    background: color-mix(in srgb, var(--jc-primary) 88%, var(--jc-on-primary));
}

.jc-reports-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.jc-reports-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.jc-reports-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 48px 0;
    color: var(--jc-text-secondary);
}

/* Summary cards grid */
.jc-reports-summary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 640px) {
    .jc-reports-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    .jc-reports-panel {
        width: calc(100vw - 16px);
        max-height: calc(100vh - 32px);
        border-radius: var(--jc-radius-md);
    }
    .jc-reports-header {
        padding: 16px 16px 8px;
    }
    .jc-reports-periods {
        padding: 0 16px 12px;
    }
    .jc-reports-content {
        padding: 0 16px 16px;
    }
}

.jc-reports-metric-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 16px 12px;
    gap: 4px;
    text-align: center;
}

.jc-reports-metric-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
}

.jc-reports-metric-value {
    color: var(--jc-text-primary);
    line-height: 1.2;
}

.jc-reports-metric-label {
    color: var(--jc-text-secondary);
    line-height: 1.3;
}

/* Chart card */
.jc-reports-chart-card {
    padding: 16px;
}

/* Legend */
.jc-reports-legend {
    display: flex;
    gap: 16px;
    margin-bottom: 8px;
}
.jc-reports-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--jc-text-secondary);
}
.jc-reports-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Bar chart */
.jc-reports-bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 140px;
    padding-top: 8px;
}
.jc-reports-bar-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}
.jc-reports-bar-pair {
    flex: 1;
    display: flex;
    align-items: flex-end;
    gap: 1px;
    width: 100%;
}
.jc-reports-bar {
    flex: 1;
    min-height: 2px;
    border-radius: 2px 2px 0 0;
    transition: height 0.3s ease;
}
.jc-reports-bar--created {
    background: var(--jc-primary);
}
.jc-reports-bar--resolved {
    background: var(--jc-success);
}
.jc-reports-bar-label {
    color: var(--jc-text-secondary);
    margin-top: 4px;
    white-space: nowrap;
    font-size: 10px;
}

/* Agent table */
.jc-reports-table-wrapper {
    overflow-x: auto;
}
.jc-reports-table {
    width: 100%;
    border-collapse: collapse;
}
.jc-reports-table th {
    color: var(--jc-text-secondary);
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid var(--jc-border);
}
.jc-reports-table td {
    color: var(--jc-text-primary);
    padding: 10px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--jc-border) 50%, transparent);
}
.jc-reports-table tr:last-child td {
    border-bottom: none;
}

/* Inbox breakdown */
.jc-reports-inbox-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.jc-reports-inbox-row {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.jc-reports-inbox-info {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.jc-reports-inbox-bar-bg {
    height: 8px;
    border-radius: 4px;
    background: color-mix(in srgb, var(--jc-border) 30%, transparent);
    overflow: hidden;
}
.jc-reports-inbox-bar-fill {
    height: 100%;
    border-radius: 4px;
    background: var(--jc-primary);
    min-width: 2px;
    transition: width 0.3s ease;
}

/* ================================================================== */
/*  FAQ Learning                                                       */
/* ================================================================== */

.jc-faq-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 599px) {
    .jc-faq-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

.jc-faq-stats__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 12px 8px;
    border-radius: var(--jc-radius-sm);
    background: var(--jc-surface-container);
}

.jc-faq-stats__value {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.2;
}

.jc-faq-stats__label {
    font-size: 11px;
    color: var(--jc-text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.jc-faq-item {
    transition: box-shadow 0.15s ease;
}

.jc-faq-item:hover {
    box-shadow: var(--jc-shadow-sm);
}

.jc-faq-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--jc-radius-full);
    font-weight: 500;
    white-space: nowrap;
}

.jc-faq-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--jc-primary);
    cursor: pointer;
}

.jc-faq-textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--jc-radius-xs);
    border: 1px solid var(--jc-border);
    background: var(--jc-chat-bg);
    color: var(--jc-text-primary);
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s ease;
}

.jc-faq-textarea:focus {
    border-color: var(--jc-primary);
}

.jc-faq-select {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--jc-radius-xs);
    border: 1px solid var(--jc-border);
    background: var(--jc-chat-bg);
    color: var(--jc-text-primary);
    font-family: inherit;
    font-size: 14px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.jc-faq-select:focus {
    border-color: var(--jc-primary);
}