/* =============================================================================
   Staff Hub in AM Navy, presence status (18 Oct 2026)

   Loaded after hr.css, so these rules win over the Staff Hub's original look.
   Status colours come from DEX.Features.HR.Presence through --presence.
   ============================================================================= */

/* ---- The avatar dot ------------------------------------------------------ */
.header-user-avatar__status--presence { background: var(--presence, #12b76a); }
.header-user-avatar__status--out { background: #98a2b3; }

/* ---- The status picker in the Staff Hub header (on the navy header) ------- */
.presence-picker { position: relative; }
.presence-picker__button {
    display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 10px 0 12px;
    border: 1px solid rgba(255, 255, 255, .18); border-radius: var(--am-radius, 4px);
    background: rgba(255, 255, 255, .08); color: #fff; font: inherit; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.presence-picker__button:hover { background: rgba(255, 255, 255, .14); }
.presence-picker__button:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(255, 255, 255, .35); }
.presence-picker__button .icon { opacity: .8; }
.presence-picker__dot {
    flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%;
    background: var(--presence, #12b76a); box-shadow: 0 0 0 2px rgba(255, 255, 255, .9);
}
.presence-picker__menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 220px; padding: 6px;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
    background: #fff; box-shadow: 0 12px 32px rgba(16, 22, 42, .18);
}
.presence-picker__menu[hidden] { display: none; }
.presence-picker__option {
    display: flex; align-items: center; gap: 10px; width: 100%; min-height: 38px; padding: 0 10px;
    border: 0; border-radius: var(--am-radius, 4px); background: none; cursor: pointer;
    font: inherit; font-size: 13px; color: var(--am-blue, #19213b); text-align: left;
}
.presence-picker__option:hover:not(:disabled) { background: var(--am-blue-tint, #f4f5fa); }
.presence-picker__option:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }
.presence-picker__option[aria-checked="true"] { font-weight: 700; }
.presence-picker__option:disabled { cursor: default; opacity: .55; }
.presence-picker__option .presence-picker__dot { box-shadow: none; }
.presence-picker__label { flex: 1 1 auto; display: flex; flex-direction: column; line-height: 1.25; }
.presence-picker__hint { font-size: 11px; font-weight: 500; color: #6b7285; }
.presence-picker__tick { display: inline-flex; color: var(--am-blue, #19213b); }

/* ---- Staff Hub body in AM Navy ------------------------------------------- */
.clock-panel { gap: 16px; }
.clock-record-tabs { margin: 0; }
.clock-menu { margin-bottom: 4px; }
.clock-menu__item {
    border-color: var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
    color: var(--am-blue, #19213b);
}
.clock-menu__item:hover { background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b); }
.clock-menu__item--danger { color: var(--am-red-ink, #b42318); }
.clock-menu__item--danger:hover { background: var(--am-red-soft, #fee4e2); border-color: transparent; color: var(--am-red-ink, #b42318); }

.clock-panel__status {
    border: 0; border-radius: var(--am-radius, 4px); background: var(--am-blue-tint, #f4f5fa); padding: 22px 16px;
}
.clock-panel__time { color: var(--am-blue, #19213b); }
.clock-panel__state { color: #5b6275; }
.clock-panel__status--active { background: #ecfdf3; }
.clock-panel__status--active .clock-panel__time { color: #027a48; }
.clock-panel__status--active .clock-panel__state { color: #027a48; }
.clock-panel__status--break { background: #fffaeb; }
.clock-panel__status--break .clock-panel__time { color: #b54708; }
.clock-panel__status--break .clock-panel__state { color: #b54708; }

.clock-panel__actions { gap: 8px; }
.clock-panel__next-shift:empty { display: none; }
.clock-panel__action { justify-content: center; }

.clock-panel__section { border-top-color: var(--am-blue-soft, #e6e9f2); }
.clock-panel__section-glyph { color: var(--am-blue, #19213b); }
.clock-panel__section-title { color: var(--am-blue, #19213b); font-weight: 700; }
.clock-panel__next-shift, .clock-today, .clock-leave, .clock-shift, .clock-holiday {
    border-color: var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
}
.clock-today__label, .clock-leave__label, .clock-shift__date, .clock-holiday__name { color: var(--am-blue, #19213b); }
.clock-today--empty, .clock-leave--empty, .clock-shift--empty, .clock-holiday--empty {
    border-color: var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
}
.clock-leave-form { border-radius: var(--am-radius, 4px); }
.clock-leave-form__field input, .clock-leave-form__field select { border-radius: var(--am-radius, 4px); }
.clock-leave-form__field input:focus, .clock-leave-form__field select:focus {
    outline: none; border-color: var(--am-blue, #19213b); box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22));
}
.clock-shift__act { border-radius: var(--am-radius, 4px); }

/* ---- Settings > Users & Roles > Status ----------------------------------- */
.presence-card {
    /* The page header sits 24px in; the card lines up with it. */
    margin: var(--content-gap-top) 24px 32px;
    max-width: 860px; padding: 18px 20px; border: 1px solid var(--am-blue-soft, #e6e9f2);
    border-radius: var(--am-radius, 4px); background: #fff;
    /* .page-surface is a fixed-height column that clips: a long list scrolls
       inside the card instead of running off the page. */
    flex: 0 1 auto; min-height: 0; overflow-y: auto;
}
@media (max-width: 900px) { .presence-card { overflow-y: visible; } }
.presence-card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.presence-card__title { margin: 0; font-size: 14px; font-weight: 700; color: var(--am-blue, #19213b); }
.presence-list { margin: 0; padding: 0; list-style: none; }
.presence-row {
    display: flex; align-items: center; gap: 14px; padding: 14px 4px;
    border-bottom: 1px solid var(--am-blue-soft, #e6e9f2);
}
.presence-row:last-child { border-bottom: 0; }
.presence-row__dot {
    flex: 0 0 14px; width: 14px; height: 14px; border-radius: 50%; background: var(--presence);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--presence) 18%, transparent);
}
.presence-row__text { flex: 1 1 auto; min-width: 0; }
.presence-row__name { font-size: 14px; font-weight: 700; color: var(--am-blue, #19213b); }
.presence-row__desc { margin-top: 2px; font-size: 13px; color: #5b6275; }
.presence-row__facts { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.presence-pill {
    display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px;
    border-radius: var(--am-radius, 4px); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.presence-pill--ok { background: #ecfdf3; color: #027a48; }
.presence-pill--no { background: var(--am-red-soft, #fee4e2); color: var(--am-red-ink, #b42318); }
.presence-pill--muted { background: var(--am-blue-tint, #f4f5fa); color: #5b6275; }
.presence-notes { display: grid; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--am-blue-soft, #e6e9f2); }
.presence-note { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: #3b4256; line-height: 1.5; }
.presence-note p { margin: 0; }
.presence-note__icon {
    flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px;
    border-radius: var(--am-radius, 4px); background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b);
}

@media (max-width: 640px) {
    .presence-card { margin: var(--content-gap-top) 16px 24px; padding: 14px 14px; }
    .presence-row { flex-wrap: wrap; }
    .presence-row__facts { width: 100%; justify-content: flex-start; padding-left: 28px; }
    .presence-picker__current { max-width: 96px; overflow: hidden; text-overflow: ellipsis; }
}

/* ---- Staff Hub: Team and All Staff (19 Oct 2026) ------------------------ */
.clock-record-tabs { overflow-x: auto; scrollbar-width: none; }
.clock-record-tabs::-webkit-scrollbar { display: none; }
.clock-record-tabs .record-tab { white-space: nowrap; }

.staff-hub-list { display: flex; flex-direction: column; gap: 14px; }
.staff-hub-muted { margin: 0; font-size: 13px; color: #6b7285; }
.staff-hub-count { font-size: 12px; font-weight: 600; color: #6b7285; text-transform: uppercase; letter-spacing: .04em; }

.staff-hub-search {
    position: relative; display: flex; align-items: center; margin-bottom: 12px;
}
.staff-hub-search__icon { position: absolute; left: 11px; display: inline-flex; color: #6b7285; pointer-events: none; }
.staff-hub-search__input {
    width: 100%; height: 38px; padding: 0 12px 0 36px; font: inherit; font-size: 14px; color: var(--am-blue, #19213b);
    border: 1px solid var(--am-outline, #d3d6e0); border-radius: var(--am-radius, 4px); background: #fff;
}
.staff-hub-search__input:focus { outline: none; border-color: var(--am-blue, #19213b); box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }

.staff-team { display: flex; flex-direction: column; gap: 8px; }
.staff-team__head { display: flex; align-items: center; gap: 8px; }
.staff-team__icon {
    display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
    border-radius: var(--am-radius, 4px); background: var(--am-blue, #19213b); color: #fff;
}
.staff-team__name { margin: 0; flex: 1 1 auto; font-size: 14px; font-weight: 700; color: var(--am-blue, #19213b); }
.staff-team__count { font-size: 12px; color: #6b7285; }

.staff-rows { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.staff-row {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: 5px; background: #fff;
}
.staff-row__face { position: relative; flex: 0 0 38px; width: 38px; height: 38px; }
.staff-row__avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; overflow: hidden;
    border-radius: 50%; background: var(--am-blue-soft, #e6e9f2); color: var(--am-blue, #19213b);
    font-size: 13px; font-weight: 700;
}
.staff-row__avatar .avatar-photo { width: 100%; height: 100%; object-fit: cover; }
.staff-row__dot {
    position: absolute; right: -1px; bottom: -1px; width: 12px; height: 12px; border-radius: 50%;
    background: var(--presence); box-shadow: 0 0 0 2px #fff;
}
.staff-row__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.staff-row__name {
    font-size: 14px; font-weight: 600; color: var(--am-blue, #19213b);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-row__you, .staff-row__lead {
    display: inline-block; margin-left: 4px; padding: 1px 6px; border-radius: 4px; vertical-align: 1px;
    font-size: 10.5px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.staff-row__you { background: var(--am-blue-tint, #f4f5fa); color: #5b6275; }
.staff-row__lead { background: var(--am-blue, #19213b); color: #fff; }
.staff-row__meta {
    display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 12.5px; color: #5b6275;
}
.staff-row__status { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; color: #3b4256; }
.staff-row__status::before {
    content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--presence);
}
.staff-row__status--none { color: #98a2b3; font-weight: 500; }
.staff-row__status--none::before { background: #d0d5dd; }
.staff-row__ext {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 9px;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px); background: var(--am-blue-tint, #f4f5fa);
    color: var(--am-blue, #19213b); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer;
    font-variant-numeric: tabular-nums;
}
.staff-row__ext:hover:not(:disabled) { background: var(--am-blue-soft, #e6e9f2); }
.staff-row__ext:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }
.staff-row__ext:disabled { cursor: default; opacity: .7; }

.staff-hub-empty {
    display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 16px; text-align: center;
    border: 1px dashed var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
}
.staff-hub-empty__icon {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
    border-radius: 50%; background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b);
}
.staff-hub-empty__title { margin: 4px 0 0; font-size: 14px; font-weight: 700; color: var(--am-blue, #19213b); }

/* ---- Staff Hub: header icons (19 Oct 2026) ------------------------------ */
.staff-hub-header-action { display: inline-flex; align-items: center; justify-content: center; }
.staff-hub-header-action--danger:hover { color: #fda29b; }

/* ---- Staff Hub: Chat (19 Oct 2026) -------------------------------------- */
.staff-chat-tab-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px;
    margin-left: 4px; border-radius: 9px; background: var(--am-blue); color: var(--text-on-dark); /* the bell's blue */
    font-size: 11px; font-weight: 700; line-height: 1; vertical-align: 1px;
}
.header-user-avatar { position: relative; }
/* Looks like the bell's badge (.notification-badge); sits top right, the status dot stays bottom right. */
.header-user-avatar__chat { top: -2px; right: -3px; z-index: 1; pointer-events: none; }
.header-user-avatar__chat[hidden] { display: none; }

.staff-chat { display: flex; flex-direction: column; gap: 12px; }
.staff-chat__toolbar { display: flex; align-items: center; gap: 8px; }
.staff-chat__toolbar .staff-chat__search { flex: 1 1 auto; margin: 0; }
.staff-chat__toolbar .am-btn { flex: 0 0 auto; white-space: nowrap; }
.staff-chat__section {
    margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em;
}
.staff-chat__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.staff-chat__item {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 12px; text-align: left; cursor: pointer;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: 5px; background: var(--surface-panel); font: inherit;
}
.staff-chat__item:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__item:focus-visible, .staff-chat__pick:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }
.staff-chat__item-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.staff-chat__item-top, .staff-chat__item-bottom { display: flex; align-items: center; gap: 8px; min-width: 0; }
.staff-chat__item-title {
    flex: 1 1 auto; min-width: 0; font-size: 14px; font-weight: 600; color: var(--am-blue, #19213b);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-chat__item-time { flex: 0 0 auto; font-size: 12px; color: var(--text-muted); }
.staff-chat__item-preview {
    flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-chat__item--unread .staff-chat__item-title, .staff-chat__item--unread .staff-chat__item-preview { font-weight: 700; color: var(--am-blue, #19213b); }
.staff-chat__unread {
    flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 6px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 10px; background: var(--am-blue, #19213b); color: var(--text-on-dark); font-size: 11px; font-weight: 700;
}
.staff-chat__group-face {
    flex: 0 0 38px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--am-blue-soft, #e6e9f2); color: var(--am-blue, #19213b);
}
.staff-chat__group-face--team { background: var(--am-blue, #19213b); color: var(--text-on-dark); }

/* Picker */
.staff-chat__head { display: flex; align-items: center; gap: 10px; }
.staff-chat__back, .staff-chat__leave {
    flex: 0 0 34px; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px); background: var(--surface-panel); color: var(--am-blue, #19213b);
}
.staff-chat__back:hover, .staff-chat__leave:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__leave:hover { color: var(--am-red-ink, #b42318); }
.staff-chat__head-text { flex: 1 1 auto; min-width: 0; }
.staff-chat__head-title {
    font-size: 15px; font-weight: 700; color: var(--am-blue, #19213b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.staff-chat__head-sub { font-size: 12.5px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-chat__field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--am-blue, #19213b); }
.staff-chat__field .staff-chat__name { padding-left: 12px; }
.staff-chat__pick { width: 100%; text-align: left; cursor: pointer; font: inherit; color: var(--am-blue, #19213b); }
.staff-chat__pick:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__pick--on { border-color: var(--am-blue, #19213b); background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__check {
    flex: 0 0 22px; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--am-outline, #d3d6e0); border-radius: 5px; background: var(--surface-panel); color: var(--text-on-dark);
}
.staff-chat__pick--on .staff-chat__check { border-color: var(--am-blue, #19213b); background: var(--am-blue, #19213b); }
.staff-chat__picker-actions {
    position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 0 4px; background: var(--surface-panel); border-top: 1px solid var(--am-blue-soft, #e6e9f2);
}

/* One conversation */
.staff-chat--open { gap: 0; height: calc(100vh - 290px); min-height: 360px; }
.staff-chat--open .staff-chat__head { padding-bottom: 12px; border-bottom: 1px solid var(--am-blue-soft, #e6e9f2); }
.staff-chat__messages {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 2px; display: flex; flex-direction: column; gap: 6px;
    overscroll-behavior: contain;
}
.staff-chat__earlier {
    align-self: center; padding: 5px 12px; border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: 14px;
    background: var(--surface-panel); color: var(--am-blue, #19213b); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.staff-chat__empty { margin: auto; font-size: 13px; color: var(--text-muted); }
.staff-chat__day {
    align-self: center; margin: 8px 0 4px; padding: 3px 10px; border-radius: 11px;
    background: var(--am-blue-tint, #f4f5fa); color: var(--text-secondary); font-size: 11.5px; font-weight: 600;
}
.staff-chat__msg { display: flex; align-items: flex-end; gap: 8px; max-width: 86%; }
.staff-chat__msg--mine { align-self: flex-end; flex-direction: row-reverse; }
.staff-chat__msg-face { flex: 0 0 28px; width: 28px; align-self: flex-start; }
.staff-chat__avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; overflow: hidden;
    border-radius: 50%; background: var(--am-blue-soft, #e6e9f2); color: var(--am-blue, #19213b); font-size: 11px; font-weight: 700;
}
.staff-chat__avatar .avatar-photo { width: 100%; height: 100%; object-fit: cover; }
.staff-chat__bubble-wrap { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.staff-chat__msg--mine .staff-chat__bubble-wrap { align-items: flex-end; }
.staff-chat__sender { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.staff-chat__bubble {
    display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; max-width: 100%;
    border-radius: 14px 14px 14px 4px; background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b);
}
.staff-chat__msg--mine .staff-chat__bubble { border-radius: 14px 14px 4px 14px; background: var(--am-blue, #19213b); color: var(--text-on-dark); }
.staff-chat__text { font-size: 14px; line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.staff-chat__removed { font-size: 13px; font-style: italic; opacity: .75; }
.staff-chat__meta { font-size: 11px; color: var(--text-muted); }
.staff-chat__remove {
    padding: 0; border: 0; background: none; color: var(--text-muted); font: inherit; font-size: 11px; cursor: pointer;
}
.staff-chat__remove:hover { color: var(--am-red-ink, #b42318); text-decoration: underline; }
.staff-chat__image {
    display: block; padding: 0; border: 0; border-radius: 10px; overflow: hidden; background: rgba(0, 0, 0, .06); cursor: zoom-in;
}
.staff-chat__image img { display: block; max-width: 240px; max-height: 220px; min-width: 80px; min-height: 60px; object-fit: cover; }
.staff-chat__attachment {
    display: flex; align-items: center; gap: 10px; min-width: 200px; max-width: 280px; padding: 8px 10px; cursor: pointer;
    border: 1px solid rgba(25, 33, 59, .12); border-radius: 8px; background: var(--surface-panel); color: var(--am-blue, #19213b);
    font: inherit; text-align: left;
}
.staff-chat__msg--mine .staff-chat__attachment { border-color: rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .1); color: var(--text-on-dark); }
.staff-chat__attachment-icon {
    flex: 0 0 30px; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 6px; background: var(--am-blue-soft, #e6e9f2); color: var(--am-blue, #19213b);
}
.staff-chat__attachment-text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.staff-chat__attachment-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.staff-chat__attachment-size { font-size: 11.5px; opacity: .75; }

/* Composer */
.staff-chat__composer { flex: 0 0 auto; padding-top: 10px; border-top: 1px solid var(--am-blue-soft, #e6e9f2); }
.staff-chat__file {
    display: flex; align-items: center; gap: 8px; margin-bottom: 8px; padding: 6px 8px;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: 6px; background: var(--am-blue-tint, #f4f5fa); font-size: 13px;
}
.staff-chat__file[hidden] { display: none; }
.staff-chat__file .staff-chat__attachment-icon { flex-basis: 24px; width: 24px; height: 24px; }
.staff-chat__file .staff-chat__attachment-name { flex: 1 1 auto; min-width: 0; color: var(--am-blue, #19213b); }
.staff-chat__file-clear {
    flex: 0 0 24px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 4px; background: none; color: var(--text-secondary); cursor: pointer;
}
.staff-chat__file-clear:hover { background: var(--am-blue-soft, #e6e9f2); }
.staff-chat__compose-row { display: flex; align-items: flex-end; gap: 8px; }
.staff-chat__attach, .staff-chat__send {
    flex: 0 0 40px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border-radius: var(--am-radius, 4px);
}
.staff-chat__attach { border: 1px solid var(--am-outline, #d3d6e0); background: var(--surface-panel); color: var(--am-blue, #19213b); }
.staff-chat__attach:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__send { border: 0; background: var(--am-blue, #19213b); color: var(--text-on-dark); }
.staff-chat__send:hover:not(:disabled) { filter: brightness(1.15); }
.staff-chat__send:disabled { opacity: .55; cursor: default; }
.staff-chat__input {
    flex: 1 1 auto; min-height: 40px; max-height: 140px; padding: 9px 12px; resize: none;
    border: 1px solid var(--am-outline, #d3d6e0); border-radius: var(--am-radius, 4px); background: var(--surface-panel);
    font: inherit; font-size: 14px; line-height: 1.45; color: var(--am-blue, #19213b);
}
.staff-chat__input:focus { outline: none; border-color: var(--am-blue, #19213b); box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }
.staff-chat__hint { margin-top: 6px; font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 640px) {
    .staff-chat__toolbar { flex-wrap: wrap; }
    .staff-chat__toolbar .staff-chat__search { flex-basis: 100%; }
    .staff-chat--open { height: calc(100vh - 240px); }
    .staff-chat__msg { max-width: 94%; }
    .staff-chat__hint { display: none; }
}

/* ---- Team / All Staff: Message beside the extension (19 Oct 2026) ------- */
.staff-row__actions { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; }
.staff-row__msg {
    width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border: 1px solid var(--am-blue-soft, #e6e9f2); border-radius: var(--am-radius, 4px);
    background: var(--surface-panel); color: var(--am-blue, #19213b);
}
.staff-row__msg:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-row__msg:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }

/* The open chat's height is set to fill the panel (staff-chat.js); no fixed guess. */
.staff-chat--open { height: auto; min-height: 320px; }

/* ---- New message pop-up, bottom right (19 Oct 2026) --------------------- */
.chat-popup-stack {
    position: fixed; right: var(--gutter, 24px); bottom: calc(var(--gutter, 24px) + var(--chat-popup-lift, 0px));
    z-index: 300; display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.chat-popup {
    pointer-events: auto; position: relative; display: flex; align-items: center; gap: 12px;
    width: 320px; max-width: calc(100vw - 32px); padding: 12px 38px 12px 14px; cursor: pointer;
    border: 1px solid var(--border-default); border-left: 3px solid var(--am-blue, #19213b); border-radius: 8px;
    background: var(--surface-panel); box-shadow: 0 18px 40px -18px rgba(16, 24, 40, .55);
    transform: translateX(16px); opacity: 0; transition: transform .22s ease, opacity .22s ease;
}
.chat-popup--visible { transform: translateX(0); opacity: 1; }
.chat-popup:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)), 0 18px 40px -18px rgba(16, 24, 40, .55); }
.chat-popup__face { position: relative; flex: 0 0 40px; width: 40px; height: 40px; }
.chat-popup__avatar {
    display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; overflow: hidden;
    border-radius: 50%; background: var(--am-blue-soft, #e6e9f2); color: var(--am-blue, #19213b); font-size: 13px; font-weight: 700;
}
.chat-popup__avatar .avatar-photo { width: 100%; height: 100%; object-fit: cover; }
.chat-popup__icon {
    position: absolute; right: -3px; bottom: -3px; width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center;
    border-radius: 50%; background: var(--am-blue); color: var(--text-on-dark); box-shadow: 0 0 0 2px var(--surface-panel);
}
.chat-popup__text { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.chat-popup__name {
    font-size: 13.5px; font-weight: 700; color: var(--am-blue, #19213b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chat-popup__where { font-weight: 500; color: var(--text-muted); }
.chat-popup__body { font-size: 13px; color: var(--text-secondary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-popup__close {
    position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center;
    border: 0; border-radius: 4px; background: none; color: var(--text-muted); cursor: pointer;
}
.chat-popup__close:hover { background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b); }
@media (prefers-reduced-motion: reduce) { .chat-popup { transform: none; transition: opacity .15s ease; } }
@media (max-width: 640px) { .chat-popup-stack { right: 16px; left: 16px; } .chat-popup { width: auto; } }

/* ---- Chat toolbar: icon buttons, soft, as tall as the search (19 Oct 2026) */
.staff-chat__tool {
    flex: 0 0 38px; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
    border: 0; border-radius: var(--am-radius, 4px); background: var(--am-blue-tint, #f4f5fa); color: var(--am-blue, #19213b);
}
.staff-chat__tool:hover { background: var(--am-blue-soft, #e6e9f2); }
.staff-chat__tool:focus-visible { outline: none; box-shadow: var(--am-focus, 0 0 0 3px rgba(25, 33, 59, .22)); }
.staff-chat__toolbar { flex-wrap: nowrap; }
.staff-chat__pick .staff-row__msg { flex: 0 0 30px; }
@media (max-width: 640px) { .staff-chat__toolbar .staff-chat__search { flex-basis: auto; } }

/* ---- Agent Meeko pinned in Chat (19 Oct 2026) --------------------------- */
.staff-chat__list--pinned { margin-bottom: 2px; }
.staff-chat__item--meeko {
    border-color: color-mix(in srgb, var(--am-blue) 28%, var(--am-blue-soft));
    background: linear-gradient(135deg, var(--am-blue-tint) 0%, var(--surface-panel) 70%);
}
.staff-chat__item--meeko:hover { background: var(--am-blue-soft); }
.staff-chat__group-face--meeko {
    /* Black, so the mark's own colours show (24 Oct 2026). */
    background: var(--surface-meeko-mark); color: var(--text-on-dark);
}
.staff-chat__pin { flex: 0 0 auto; display: inline-flex; color: var(--accent); }

/* The Meeko chat itself moves in here; it fills what is left of the panel. */
.staff-chat--meeko .staff-chat__head { padding-bottom: 12px; border-bottom: 1px solid var(--am-blue-soft, #e6e9f2); }
.staff-chat__meeko-host { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.staff-chat__meeko-host .agent-meeko__thread { padding-left: 2px; padding-right: 2px; }

/* ---- Avatars: 6px corners, not circles (19 Oct 2026) ----------------------
   People, groups, teams and Agent Meeko in Chat, Team, All Staff and the
   message pop-up. Status dots stay round. */
.staff-row__avatar,
.staff-chat__avatar,
.staff-chat__group-face,
.chat-popup__avatar { border-radius: 6px; }
.staff-row__avatar .avatar-photo,
.staff-chat__avatar .avatar-photo,
.chat-popup__avatar .avatar-photo { border-radius: 6px; }

/* ---- @mentions (19 Oct 2026) ------------------------------------------ */
.staff-chat__mention {
    padding: 0 3px; border-radius: 3px; font-weight: 600;
    background: color-mix(in srgb, var(--am-blue) 12%, transparent); color: var(--accent);
}
.staff-chat__msg--mine .staff-chat__mention { background: rgba(255, 255, 255, .18); color: var(--text-on-dark); }
.staff-chat__mention--me { background: var(--status-warning-tint); color: var(--status-warning); }
.staff-chat__msg--mentions-me .staff-chat__bubble { box-shadow: inset 3px 0 0 #f5b400; }

.staff-chat__compose-row { position: relative; }
.staff-chat__mentions {
    position: absolute; left: 48px; right: 48px; bottom: calc(100% + 6px); z-index: 5;
    max-height: 220px; overflow-y: auto; margin: 0; padding: 4px; list-style: none;
    border: 1px solid var(--border-default); border-radius: 8px; background: var(--surface-panel);
    box-shadow: 0 12px 28px -12px rgba(16, 24, 40, .35);
}
.staff-chat__mentions[hidden] { display: none; }
.staff-chat__mention-option {
    width: 100%; display: flex; align-items: center; gap: 10px; padding: 6px 8px; cursor: pointer; text-align: left;
    border: 0; border-radius: var(--am-radius, 4px); background: none; font: inherit; font-size: 13.5px; color: var(--am-blue, #19213b);
}
.staff-chat__mention-option[aria-selected="true"], .staff-chat__mention-option:hover { background: var(--am-blue-tint, #f4f5fa); }
.staff-chat__mention-option .staff-chat__avatar { width: 26px; height: 26px; font-size: 10.5px; }
.staff-chat__mention-option small { margin-left: auto; color: var(--text-muted); font-size: 12px; }
