/* Pancake-style UI adjustments */
.chat-member-options {
    max-height: 280px;
    overflow: auto;
    margin: 12px 0;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 8px
}

.content.inbox-page {
    padding: 0;
    max-width: none;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 82px);
}

.content.inbox-page .page-head {
    display: none;
}

.content.inbox-page .toolbar {
    padding: 12px 16px 0;
    margin: 0;
    background: #fff;
}

.chat-toolbar,
.chat-actions,
.chat-compose-tools {
    display: flex;
    gap: 7px;
    align-items: center;
    flex-wrap: wrap;
    min-width: 0
}

.chat-toolbar {
    padding: 8px 16px;
    background: #fff;
    margin: 0
}

.chat-toolbar .btn[aria-pressed=true] {
    background: #e6efe7;
    border-color: #27634b
}

.chat-select {
    flex: none;
    width: 15px;
    height: 15px;
    accent-color: #27634b;
    margin: 3px 0
}

.chat-list-meta {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 7px
}

.chat-list-meta span {
    background: #edf3ed;
    border-radius: 4px;
    padding: 2px 4px;
    font-size: 10px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis
}

.chat-actions {
    padding: 8px 12px;
    border-bottom: 1px solid var(--line);
    background: #fff;
    flex-shrink: 0
}

.chat-actions details {
    width: 100%
}

.chat-actions summary {
    font-size: 12px;
    cursor: pointer;
    padding: 5px 0
}

.chat-actions details>div {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0
}

.chat-actions .btn {
    font-size: 11px;
    padding: 6px 9px;
    background: #f0f2f5;
    border: none;
    border-radius: 20px;
    font-weight: 600
}

.chat-message-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 11px
}

.chat-message-search .input {
    flex: 1;
    min-width: 0;
    padding: 7px 10px;
    font-size: 12px;
    border-radius: 20px;
    background: #f0f2f5;
    border: none
}

.chat-assigned {
    width: 100%;
    font-size: 10px;
    color: #61715f
}

.chat-day {
    align-self: center;
    font-size: 11px;
    background: #eef2eb;
    padding: 4px 10px;
    border-radius: 20px;
    margin: 10px 0
}

.chat-messages .bubble-wrap[hidden] {
    display: none !important
}

.chat-messages .bubble {
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

.message-sender {
    font-size: 11px;
    color: #4c6557;
    margin: 0 0 5px
}

.message-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    margin-top: 4px;
    opacity: .6
}

.bubble-wrap:hover .message-tools,
.bubble-wrap:focus-within .message-tools {
    opacity: 1
}

.message-tools .btn {
    font-size: 10px;
    border: 0;
    padding: 3px 5px;
    background: transparent;
    color: #52705b
}

.bubble-wrap {
    max-width: 90%
}

.chat-highlight {
    outline: 2px solid #72a582;
    border-radius: 8px
}

.chat-attachment {
    display: block;
    margin: 8px 0;
    max-width: 100%;
    color: #27634b
}

.chat-attachment img {
    max-width: 100%;
    max-height: 260px;
    border-radius: 10px;
    object-fit: contain
}

.quote-block {
    display: block;
    white-space: pre-wrap;
    border: 0;
    border-left: 3px solid #62987a;
    padding: 8px;
    background: #eaf1e7;
    color: #425c4b;
    text-align: left;
    font: inherit;
    font-size: 12px;
    max-width: 100%;
    overflow-wrap: anywhere
}

.chat-draft-context:empty {
    display: none
}

.chat-pins {
    padding: 10px;
    background: #fffbe7;
    border: 1px solid #e8ddb1;
    border-radius: 8px;
    align-self: stretch
}

.chat-pins summary {
    cursor: pointer;
    font-size: 12px
}

.chat-pins button {
    display: block;
    margin-top: 5px;
    white-space: normal;
    text-align: left
}

.chat-compose-tools {
    margin-top: 9px
}

.chat-compose-tools .btn {
    font-size: 11px;
    padding: 5px 8px
}

.chat-compose-tools label {
    font-size: 10px;
    margin-left: auto;
    display: flex;
    gap: 4px;
    align-items: center
}

.chat-compose textarea {
    min-height: 64px;
    max-height: 160px
}

.chat-compose .quick-tag-bar {
    margin-top: 8px;
    padding-top: 8px
}

.chat-filter-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 15px 0
}

.chat-filter-grid label,
.chat-filter-grid select {
    min-width: 0
}

.chat-filter-grid .input {
    width: 100%;
    margin-top: 6px
}

#chat-filter-form fieldset {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 14px;
    margin: 15px 0
}

#chat-filter-form legend {
    font-size: 13px;
    font-weight: 600
}

.chat-check-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 10px
}

.chat-check-grid label {
    display: flex;
    gap: 8px;
    font-size: 12px;
    align-items: center
}

.chat-reminder,
.chat-template {
    padding: 15px 0;
    border-bottom: 1px solid var(--line)
}

.chat-reminder.due {
    border-left: 3px solid #c66a45;
    padding-left: 12px
}

.chat-reminder p,
.chat-template p {
    font-size: 12px;
    white-space: pre-wrap
}

.chat-media-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 16px 0
}

.chat-media-grid article {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px;
    overflow-wrap: anywhere;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.chat-media-grid img {
    width: 100%;
    height: 140px;
    object-fit: contain
}

.chat-media-grid small {
    color: #788377
}

.chat-members article {
    padding: 14px;
    border-bottom: 1px solid var(--line)
}

.chat-members small {
    display: block;
    margin-top: 5px;
    color: #75816f
}

.chat-emoji {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px
}

.chat-emoji .btn {
    font-size: 24px
}

.chat-compose textarea:focus {
    outline: 1px solid #aac9b4;
    border-radius: 6px
}

@media(max-width:760px) {

    .chat-filter-grid,
    .chat-check-grid {
        grid-template-columns: 1fr
    }

    .chat-media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .chat-toolbar {
        gap: 5px
    }

    .chat-toolbar .btn {
        font-size: 11px;
        padding: 7px
    }

    .inbox-layout.has-selection {
        height: auto;
        min-height: calc(100dvh - 180px)
    }

    .inbox-layout.has-selection .chat {
        min-height: 780px
    }

    .inbox-layout.has-selection .chat-messages {
        min-height: 250px;
        max-height: 50dvh
    }

    .chat-actions {
        padding: 6px 10px
    }

    .chat-compose-tools {
        gap: 4px
    }

    .chat-compose-tools label {
        margin: 4px 0
    }

    .chat-messages {
        padding: 12px
    }

    .message-tools {
        opacity: 1
    }

    .chat-side.care-side-open {
        bottom: 0 !important
    }

    .chat-emoji {
        grid-template-columns: repeat(4, 1fr)
    }
}

@media(max-width:760px) {
    .content.inbox-page {
        height: auto;
        min-height: calc(100dvh - 82px);
        padding-bottom: 100px
    }

    .content.inbox-page .inbox-layout.has-selection {
        height: auto;
        overflow: visible;
        min-height: 0
    }

    .content.inbox-page .inbox-layout.has-selection .chat {
        height: auto;
        min-height: 0;
        overflow: visible
    }

    .content.inbox-page .inbox-layout.has-selection .chat-messages {
        min-height: 220px;
        max-height: 40dvh;
        overflow: auto
    }

    .content.inbox-page .chat-compose {
        flex-shrink: 0
    }
}

/* Compact conversation workspace */
.content.inbox-page {
    height: calc(100dvh - 82px);
    min-height: 0;
    padding: 0;
    overflow: hidden
}

.content.inbox-page .inbox-layout {
    flex: 1;
    min-height: 0;
    height: 100%;
    grid-template-columns: 280px minmax(0, 1fr);
    position: relative
}

.content.inbox-page .chat-side {
    display: none
}

.content.inbox-page .chat-side.care-side-open {
    display: block;
    top: 0;
    bottom: 0;
    width: min(360px, 100%);
    z-index: 25
}

.content.inbox-page .chat {
    min-height: 0;
    min-width: 0;
    height: 100%;
    display: flex;
    flex-direction: column
}

.content.inbox-page .conversation-list>.toolbar {
    padding: 8px 10px 0
}

.content.inbox-page .conversation-list .tabs {
    gap: 2px;
    overflow: auto;
    flex-wrap: nowrap
}

.content.inbox-page .conversation-list .tab {
    padding: 6px 8px;
    font-size: 11px;
    white-space: nowrap
}

.content.inbox-page .conversation-search {
    padding: 10px
}

.chat-toolbar {
    padding: 0 10px 10px;
    gap: 6px;
    flex-wrap: nowrap
}

.chat-count {
    margin-left: auto;
    font-size: 10px;
    color: var(--muted);
    white-space: nowrap
}

.chat-bulk {
    padding: 5px 10px;
    background: var(--pale);
    display: flex;
    align-items: center;
    justify-content: space-between
}

.chat-menu {
    position: relative;
    flex-shrink: 0
}

.chat-menu>summary {
    list-style: none;
    cursor: pointer;
    white-space: nowrap;
    padding: 6px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 12px;
    background: white;
    min-height: 32px;
    display: flex;
    align-items: center
}

.chat-menu>summary::-webkit-details-marker {
    display: none
}

.chat-menu[open]>summary {
    background: var(--pale);
    border-color: #aac9b4
}

.chat-menu-panel {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    width: 240px;
    max-width: calc(100vw - 24px);
    max-height: 60dvh;
    overflow: auto;
    padding: 10px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 8px 28px #16352626;
    z-index: 30;
    display: grid;
    gap: 4px
}

.chat-menu-panel>.btn {
    text-align: left;
    justify-content: flex-start;
    white-space: normal;
    border: 0;
    background: transparent;
    min-height: 34px;
    border-radius: 6px
}

.chat-menu-panel>.btn:hover {
    background: var(--pale)
}

.chat-menu-panel h4 {
    font-size: 10px;
    color: var(--muted);
    padding: 6px 8px 0;
    text-transform: uppercase
}

.chat-menu-panel label {
    font-size: 12px;
    padding: 8px
}

.chat-toolbar .chat-menu-panel {
    right: auto;
    left: -65px;
    width: 220px
}

.content.inbox-page .chat-head-compact {
    padding: 10px 14px;
    flex-wrap: nowrap;
    gap: 8px;
    min-height: 64px;
    flex-shrink: 0
}

.chat-head-compact>.row:first-child {
    flex: 1;
    min-width: 0;
    max-width: none
}

.chat-head-compact>.row:first-child>div:last-child {
    min-width: 0
}

.chat-head-compact h3,
.chat-head-compact .muted {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chat-head-compact .avatar {
    flex-shrink: 0
}

.chat-head-compact .chat-assigned {
    font-size: 10px;
    display: block;
    max-width: 240px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chat-head-compact .chat-actions {
    padding: 0;
    border: 0;
    width: auto;
    background: none;
    display: block
}

.chat-actions .chat-menu {
    width: auto
}

.chat-actions .chat-menu>summary {
    font-size: 12px;
    padding: 6px 9px
}

.chat-actions .chat-menu-panel {
    width: 260px
}

.chat-message-search {
    display: block;
    font-size: 11px
}

.chat-message-search .input {
    width: 100%;
    margin-top: 5px
}

.content.inbox-page .chat-messages {
    flex: 1;
    min-height: 0;
    max-height: none;
    padding: 16px 20px;
    overflow: auto
}

.message-tools {
    opacity: .45;
    height: 20px;
    margin-top: 2px
}

.bubble-wrap:hover .message-tools,
.bubble-wrap:focus-within .message-tools {
    opacity: 1
}

.content.inbox-page .chat-compose {
    padding: 10px 14px;
    flex-shrink: 0
}

.chat-compose>.row:first-of-type {
    margin-bottom: 5px
}

.chat-compose textarea {
    min-height: 72px;
    max-height: 160px;
    resize: vertical;
    border-radius: 12px
}

.chat-compose-row {
    margin-top: 7px;
    gap: 8px
}

.chat-compose-row>.row {
    gap: 6px;
    min-width: 0;
    flex-wrap: wrap
}

.chat-compose-tools {
    margin: 0;
    flex-wrap: nowrap;
    gap: 4px
}

.chat-compose-tools .btn {
    min-height: 32px;
    padding: 5px 8px
}

.chat-compose-tools .chat-menu-panel,
.chat-tag-menu .chat-menu-panel {
    top: auto;
    bottom: calc(100% + 8px);
    left: 0;
    right: auto
}

.chat-compose-tools label {
    margin: 0;
    display: flex;
    gap: 7px
}

.chat-tag-menu .chat-menu-panel {
    width: 300px
}

.chat-tag-menu .quick-tag-bar {
    margin: 0;
    border: 0;
    padding: 0
}

.chat-tag-menu .quick-tag-bar>div {
    flex-wrap: wrap;
    overflow: visible
}

.chat-compose .chat-draft-context {
    max-height: 110px;
    overflow: auto
}

.chat-compose-row [data-action=ai-reply] {
    font-size: 11px;
    padding: 5px 8px;
    min-height: 32px
}

@media(min-width:1250px) {
    .content.inbox-page .inbox-layout {
        grid-template-columns: 310px minmax(0, 1fr)
    }
}

@media(max-width:760px) {
    .content.inbox-page {
        height: calc(100dvh - 130px - env(safe-area-inset-bottom));
        min-height: 0;
        padding: 0
    }

    .content.inbox-page .inbox-layout,
    .content.inbox-page .inbox-layout.has-selection {
        height: 100%;
        min-height: 0;
        overflow: hidden;
        display: block;
        border-radius: 0
    }

    .content.inbox-page .inbox-layout.has-selection .chat {
        height: 100%;
        min-height: 0;
        overflow: visible
    }

    .content.inbox-page .inbox-layout.has-selection .chat-messages {
        min-height: 0;
        max-height: none;
        flex: 1;
        overflow: auto;
        padding: 12px
    }

    .content.inbox-page .chat-head-compact {
        padding: 8px;
        gap: 5px;
        min-height: 60px
    }

    .chat-head-compact .avatar {
        display: none
    }

    .chat-head-compact>.row:first-child {
        gap: 3px
    }

    .chat-head-compact h3 {
        font-size: 13px
    }

    .chat-head-compact small {
        font-size: 10px
    }

    .chat-head-compact .care-panel-toggle {
        font-size: 10px;
        padding: 5px;
        min-height: 32px
    }

    .chat-head-compact>.row:nth-child(2) {
        gap: 0
    }

    .chat-head-compact>.row:nth-child(2)>.mobile-only {
        display: none
    }

    .chat-head-compact>.row:nth-child(2)>.btn {
        font-size: 0;
        padding: 6px;
        min-height: 32px
    }

    .chat-head-compact>.row:nth-child(2)>.btn svg {
        width: 16px;
        height: 16px
    }

    .chat-actions .chat-menu>summary {
        font-size: 10px;
        padding: 5px;
        min-height: 32px
    }

    .content.inbox-page .chat-compose {
        padding: 8px 10px
    }

    .chat-compose textarea {
        min-height: 70px;
        max-height: 120px
    }

    .chat-compose-row>.row {
        gap: 4px
    }

    .chat-compose-row [data-action=ai-reply] {
        font-size: 0;
        padding: 6px
    }

    .chat-compose-row [data-action=ai-reply] svg {
        width: 16px;
        height: 16px
    }

    .chat-compose-row .btn.primary {
        min-height: 34px;
        padding: 6px 12px
    }

    .chat-menu>summary {
        font-size: 11px
    }

    .chat-compose-tools .btn {
        font-size: 11px;
        min-height: 32px
    }

    .message-tools {
        visibility: visible
    }

    .chat-head-compact .chat-assigned {
        max-width: 115px
    }

    .chat-tag-menu .chat-menu-panel {
        left: auto;
        right: 0
    }

    .chat-menu-panel {
        max-height: 45dvh
    }
}

.chat-menu {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    border-radius: 0 !important
}

.chat-menu>summary {
    margin: 0 !important
}

.chat-head-compact>.care-panel-toggle {
    display: inline-flex !important;
    flex-shrink: 0
}

.chat-menu-panel .input {
    font-size: 13px
}

.chat-compose-row>.row {
    flex-wrap: nowrap
}

.chat-compose-row .chat-tag-menu>summary {
    padding: 6px
}

.chat-head-compact .chat-actions {
    flex-shrink: 0
}

@media(max-width:760px) {
    .chat-compose-row>.row {
        gap: 3px
    }

    .chat-compose-row .chat-menu>summary {
        padding: 5px 6px
    }

    .chat-compose-tools {
        gap: 3px
    }

    .chat-compose-row .chat-tag-menu>summary {
        font-size: 10px
    }

    .chat-compose-row .btn.primary {
        padding: 6px 10px
    }

    .content.inbox-page .chat-head-compact {
        min-height: 60px
    }

    .chat-head-compact .chat-actions .chat-menu>summary {
        padding: 5px 6px
    }
}

@media(max-width:760px) {
    .chat-tag-menu .chat-menu-panel {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 190px;
        top: auto;
        width: auto;
        max-width: none
    }
}

@media(max-width:760px) {
    .content.inbox-page {
        height: calc(100dvh - 145px - env(safe-area-inset-bottom))
    }
}

/* Customer identity and quick actions */
.chat-name-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-wrap: wrap
}

.chat-name-line h3 {
    position: relative;
    min-width: 0;
    max-width: 100%;
    overflow: visible !important
}

.chat-name-copy {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    text-align: left;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    cursor: pointer
}

.chat-name-icons {
    display: flex;
    gap: 3px;
    flex-shrink: 0
}

.chat-name-icon {
    width: 28px;
    height: 28px;
    min-height: 28px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 7px;
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--green)
}

.chat-name-icon:hover {
    background: var(--pale)
}

.chat-name-icon:disabled {
    opacity: .35;
    cursor: not-allowed
}

.chat-copy-feedback {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 35;
    background: #24372f;
    color: #fff;
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 10px;
    font-weight: 400;
    white-space: nowrap;
    box-shadow: 0 3px 10px #0002
}

.chat-copy-feedback[hidden] {
    display: none
}

.chat-name-rule {
    display: grid;
    grid-template-columns: 20px 20px minmax(150px, 1fr) 40px minmax(190px, 1fr) minmax(150px, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--line)
}

.chat-name-rule .input {
    width: 100%;
    min-width: 0
}

.chat-name-rule input[type=color] {
    width: 36px;
    height: 36px;
    padding: 2px;
    border: 1px solid var(--line);
    border-radius: 6px;
    background: white
}

.name-rule-number {
    font-size: 11px;
    color: var(--muted)
}

#chat-name-settings-form {
    margin-top: 16px
}

#chat-name-settings-form>[type=submit] {
    margin-top: 18px
}

#chat-name-settings-form>label {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px
}

#chat-name-settings-form>label input {
    width: 75px
}

.chat-name-line+h3 {
    display: none
}

@media(max-width:1100px) {
    .chat-name-rule {
        grid-template-columns: 20px 20px minmax(100px, 1fr) 40px
    }

    .chat-name-rule select {
        grid-column: 3 / span 2
    }

    .chat-name-rule input[name=value] {
        grid-column: 3 / span 2
    }

    .chat-name-rule>.row {
        grid-column: 3 / span 2
    }
}

@media(max-width:760px) {
    .chat-name-line {
        gap: 3px;
        align-items: flex-start;
        flex-direction: column
    }

    .chat-name-line h3 {
        max-width: 145px
    }

    .chat-name-icon {
        width: 26px;
        height: 26px;
        min-height: 26px
    }

    .chat-name-icons {
        gap: 3px
    }

    .content.inbox-page .chat-head-compact {
        min-height: 82px
    }

    .chat-head-compact .chat-name-line+small {
        max-width: 145px
    }

    .chat-name-rule .icon-btn {
        min-height: 32px
    }

    .chat-name-copy {
        font-size: 13px
    }
}

/* Pending updates stay above messages instead of covering the reply controls. */
body:has(.inbox-page #reply-form) .care-update-pill {
    top: 164px;
    bottom: auto;
    left: auto;
    right: 24px;
    max-width: calc(100vw - 32px);
    font-size: 11px;
    min-height: 30px;
    padding: 5px 10px
}

@media(max-width:760px) {
    body:has(.inbox-page #reply-form) .care-update-pill {
        top: 156px;
        right: 12px;
        left: auto;
        max-width: calc(100vw - 24px)
    }
}

.learner-progress-text {
    display: block;
    max-width: 100%;
    text-align: left;
    padding: 2px 0;
    border: 0;
    background: transparent;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap
}

.learner-progress-text:hover {
    text-decoration: underline
}

.learner-progress-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin: 16px 0
}

.learner-progress-steps button {
    border: 1px solid var(--progress-color);
    color: var(--progress-color);
    background: white;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 11px
}

.learner-progress-steps button[aria-pressed=true] {
    background: var(--progress-color);
    color: white
}

#learner-progress-form label {
    display: block;
    margin: 12px 0;
    font-size: 13px
}

#learner-progress-form .input {
    display: block;
    width: 100%;
    margin-top: 5px
}

#learner-progress-form .check-label {
    display: flex;
    gap: 8px;
    align-items: center
}

@media(max-width:760px) {
    .learner-progress-text {
        font-size: 11px
    }

    .content.inbox-page .chat-head-compact:has(.learner-progress-text) {
        min-height: 100px
    }
}

.media-library-tools {
    margin: 20px 0;
    display: grid;
    gap: 14px
}

.media-filter-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.3fr 1fr 1fr;
    gap: 10px
}

.media-filter-grid input,
.media-filter-grid select,
#media-edit input:not([type=checkbox]),
#media-edit textarea,
#media-category-form input:not([type=checkbox]),
#media-category-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white
}

.media-drop {
    border: 2px dashed #b8c9aa;
    border-radius: 14px;
    padding: 24px;
    text-align: center;
    margin: 18px 0;
    background: #f7faf4
}

.media-drop small {
    display: block;
    margin-top: 10px;
    color: #667085
}

.media-upload-row {
    padding: 9px;
    border-bottom: 1px solid var(--line)
}

.media-upload-row.error {
    color: #b42318
}

.media-card video,
.media-card img {
    object-fit: contain;
    background: #f1f3f5
}

#media-edit fieldset {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px
}

#media-edit fieldset label {
    display: inline-block;
    margin: 6px 12px 6px 0
}

@media(max-width:700px) {
    .media-filter-grid {
        grid-template-columns: 1fr 1fr
    }

    .media-filter-grid>input {
        grid-column: 1/-1
    }

    .media-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr))
    }

    .media-card>div {
        padding: 10px
    }

    .media-drop {
        padding: 14px
    }

    .media-card strong {
        overflow-wrap: anywhere
    }
}

@media(max-width:480px) {
    .media-grid {
        grid-template-columns: 1fr
    }

    .media-card>img,
    .media-card>video {
        max-height: 240px;
        width: 100%
    }
}

.bot-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 20px 0
}

.bot-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--line)
}

.bot-item p {
    margin: 7px 0
}

.bot-form input:not([type=checkbox]),
.bot-form textarea,
.bot-form select,
.bot-staff-row select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white
}

.bot-form fieldset {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px
}

.bot-form fieldset label {
    display: block;
    margin: 8px 0
}

.bot-media-list {
    max-height: 250px;
    overflow: auto
}

.bot-staff-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    align-items: center;
    margin: 10px 0
}

.bot-toggle {
    color: #88918a
}

.bot-toggle.on {
    color: #178345;
    background: #e5f8eb
}

.bot-form label {
    display: block
}

.bot-item p {
    white-space: pre-wrap;
    overflow-wrap: anywhere
}

@media(max-width:700px) {
    .bot-layout {
        grid-template-columns: 1fr
    }

    .bot-staff-row {
        grid-template-columns: 1fr
    }

    .bot-form {
        min-width: 0
    }
}

/* Compact multichannel conversation list */
.content.inbox-page .conversation-search {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 10px
}

.conversation-search .search-field {
    flex: 1;
    min-width: 0;
    width: auto
}

.conversation-search .search-field input {
    min-width: 0;
    width: 100%;
    font-size: 12px
}

.conversation-search>[data-chat] {
    flex: none;
    padding: 7px 9px;
    min-width: 32px
}

.content.inbox-page .chat-toolbar {
    padding-bottom: 5px
}

.content.inbox-page .conversation-item.chat-list-compact {
    min-height: 74px;
    padding: 9px 10px;
    gap: 8px;
    position: relative;
    align-items: center;
    overflow: hidden
}

.chat-list-compact .grow {
    min-width: 0;
    flex: 1
}

.chat-list-title {
    display: flex;
    gap: 7px;
    align-items: center
}

.chat-list-compact .chat-list-title h3 {
    font-size: 13px;
    line-height: 19px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    flex: 1;
    min-width: 0
}

.chat-list-title time {
    font-size: 10px;
    color: var(--muted);
    flex: none
}

.chat-list-compact .grow>p {
    font-size: 12px;
    line-height: 18px;
    margin: 2px 0 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block
}

.chat-list-avatar {
    position: relative;
    flex: none;
    width: 40px;
    height: 40px
}

.chat-list-avatar .avatar {
    width: 40px;
    height: 40px;
    font-size: 12px;
    overflow: hidden
}

.chat-list-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%
}

.chat-list-avatar .social {
    position: absolute;
    right: -3px;
    bottom: -3px;
    width: 18px;
    height: 18px;
    font-size: 10px;
    border: 2px solid #fff;
    border-radius: 50%
}

.chat-list-compact .chat-select {
    width: 13px;
    height: 13px;
    margin: 0
}

.chat-list-compact .chat-list-meta {
    flex-wrap: nowrap;
    gap: 4px;
    margin-top: 3px;
    overflow: hidden
}

.chat-list-compact .chat-list-meta:empty {
    display: none
}

.chat-list-compact .chat-list-meta span {
    font-size: 9px;
    line-height: 13px;
    padding: 0 4px;
    white-space: nowrap;
    max-width: 110px
}

.chat-list-compact .unread-dot {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 6px;
    height: 6px
}

.chat-new-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px
}

.chat-phone-row {
    display: flex;
    gap: 6px
}

.chat-phone-row select {
    width: 70px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #f4f6f4
}

.chat-phone-row input {
    min-width: 0;
    flex: 1
}

.chat-contact-list {
    max-height: 45vh;
    overflow: auto;
    margin-top: 10px
}

.chat-contact-row {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    border: 0;
    background: transparent;
    text-align: left;
    padding: 9px;
    border-radius: 8px
}

.chat-contact-row:hover {
    background: var(--pale)
}

.chat-contact-row[hidden] {
    display: none
}

.chat-contact-row img,
.chat-contact-avatar {
    width: 40px;
    height: 40px;
    flex: none;
    border-radius: 50%;
    object-fit: cover
}

.chat-contact-avatar {
    display: grid;
    place-items: center;
    background: var(--pale);
    font-size: 12px
}

.chat-contact-row>span:last-child {
    min-width: 0
}

.chat-contact-row strong,
.chat-contact-row small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chat-contact-row small {
    font-size: 11px;
    color: var(--muted)
}

/* Delivery errors and AI activity */
.message-failed .bubble {
    background: #ffe0df !important;
    border: 1px solid #d64545;
    color: #801f1f
}

.message-failed>small {
    color: #a32929
}

.message-failed [data-chat="retry-message"] {
    color: #a32929;
    border-color: #d64545;
    font-weight: 700
}

.conversation-item.bot-handoff,
.conversation-item.bot-handoff.active {
    background: #fff1ba !important;
    border-left: 3px solid #d69a00
}

.chat-name-icon.bot-toggle.on {
    background: #087f52 !important;
    color: #fff !important;
    border: 2px solid #22c785;
    box-shadow: 0 0 0 3px #b7f3d5;
    font-size: 22px
}

.chat-name-icon.bot-toggle.attention {
    background: #ffd65b !important;
    color: #704b00 !important;
    border: 2px solid #d99b00;
    box-shadow: 0 0 0 3px #fff1ba;
    font-size: 22px
}

.bot-clock {
    font-variant-numeric: tabular-nums;
    background: #dcfce7;
    color: #166534;
    border-radius: 7px;
    padding: 8px;
    white-space: nowrap;
    font-size: 12px
}

.bot-clock.error {
    background: #fff1ba;
    color: #925d00;
    font-weight: 800;
    font-size: 20px
}

.bot-clock[hidden] {
    display: none
}

.bot-excel-table {
    max-height: 40vh;
    overflow: auto
}

.bot-excel-table table {
    width: 100%;
    font-size: 12px
}

.bot-excel-table td {
    overflow-wrap: anywhere;
    padding: 8px;
    border-bottom: 1px solid var(--line)
}

/* Compact reply template management */
.bot-template-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
    font-size: 12px
}

.bot-template-toolbar label {
    display: flex;
    align-items: center;
    gap: 7px
}

.bot-template-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 0;
    border-bottom: 1px solid var(--line);
    min-width: 0
}

.bot-template-row>input {
    flex: none;
    margin: 0
}

.bot-template-summary {
    flex: 1;
    min-width: 0
}

.bot-template-summary strong {
    display: block;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.bot-template-summary p {
    font-size: 12px;
    line-height: 18px;
    margin: 2px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--muted)
}

.bot-template-summary small {
    font-size: 10px;
    color: var(--muted)
}

.bot-template-row>.btn {
    flex: none
}

.bot-template-delete-list {
    max-height: 30vh;
    overflow: auto;
    overflow-wrap: anywhere
}

.message-task-pending .bubble>span {
    color: #ad6500;
    font-weight: 600
}

#chat-mention-choices {
    max-height: 180px;
    overflow: auto;
    padding: 9px;
    border: 1px solid #cddbd2;
    border-radius: 9px;
    background: #fff;
    margin: 8px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px
}

#chat-mention-choices[hidden] {
    display: none
}

#chat-mention-choices>small {
    width: 100%;
    color: var(--muted);
    font-size: 11px
}

/* Staff requests and chats awaiting mention work */
.conversation-item.chat-mention-pending,
.conversation-item.chat-mention-pending.active {
    background: #fce7f0 !important;
    border-left: 3px solid #d77aa6
}

.handoff-list {
    display: grid;
    gap: 10px;
    margin-top: 12px
}

.handoff-card {
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    min-width: 0
}

.handoff-card:hover {
    background: #f7faf6;
    border-color: #97b6a2
}

.handoff-card:focus-visible {
    outline: 3px solid #8dbba4;
    outline-offset: 2px
}

.handoff-card-head {
    display: flex;
    align-items: center;
    gap: 8px
}

.handoff-card-head>strong {
    min-width: 0;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.handoff-status {
    font-size: 11px;
    padding: 3px 7px;
    border-radius: 6px;
    background: #fff1ba;
    color: #805a00;
    white-space: nowrap
}

.handoff-complete {
    width: 30px;
    height: 30px;
    border: 1px solid #dec8d0;
    background: white;
    color: #a23c65;
    border-radius: 7px;
    font-size: 22px;
    line-height: 1;
    flex: none
}

.handoff-complete:hover {
    background: #fce7f0
}

.handoff-card>small,
.handoff-card>time {
    display: block;
    color: var(--muted);
    font-size: 11px;
    margin-top: 5px
}

.handoff-card>p,
.handoff-card>blockquote {
    margin: 7px 0 0;
    font-size: 13px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden
}

.handoff-card>blockquote {
    border-left: 3px solid #c7d9cd;
    padding-left: 9px;
    color: var(--muted)
}

.learner-profile-grid {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(330px, 1.6fr);
    gap: 28px
}

.learner-profile-grid section {
    min-width: 0
}

.learner-profile-grid h3 {
    margin: 16px 0 12px
}

.learner-profile-grid h4 {
    margin: 10px 0
}

.learner-profile-grid label:not(.check-label) {
    display: grid;
    gap: 6px;
    margin: 12px 0
}

.learner-dates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 10px
}

.learner-dates dd {
    margin: 0
}

.learner-plan-empty {
    opacity: .45
}

.learner-cart input {
    min-width: 65px;
    padding: 6px;
    width: 100%
}

.learner-cart td:nth-child(3) {
    min-width: 105px
}

#learner-product-choices {
    max-height: 220px;
    overflow: auto;
    display: grid;
    gap: 3px
}

#learner-product-choices[hidden] {
    display: none
}

#learner-product-choices button {
    text-align: left;
    justify-content: space-between
}

.learner-profile-grid p {
    overflow-wrap: anywhere
}

@media(max-width:760px) {
    .learner-profile-grid {
        grid-template-columns: 1fr;
        gap: 12px
    }
}

.content.inbox-page .chat-head.chat-head-compact,
.content.inbox-page .chat-head-compact:has(.learner-progress-text) {
    min-height: 58px;
    padding: 6px 10px;
    gap: 6px;
    flex-wrap: nowrap
}

.chat-head-compact>.row:first-child {
    gap: 7px
}

.chat-head-compact>.row:first-child>div:last-child {
    flex: 1
}

.chat-head-compact .avatar {
    width: 30px;
    height: 30px;
    min-width: 30px;
    font-size: 11px
}

.chat-head-compact .chat-name-line {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 5px;
    flex-wrap: nowrap
}

.chat-head-compact .chat-name-line h3 {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
    font-size: 14px
}

.chat-head-compact .chat-name-copy {
    font-size: 14px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.chat-head-compact .chat-name-icons {
    flex-shrink: 0
}

.chat-head-compact .chat-name-icon {
    width: 28px;
    height: 28px;
    min-height: 28px
}

.chat-head-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    white-space: nowrap;
    font-size: 10px;
    line-height: 16px
}

.chat-head-meta .learner-progress-text {
    font-size: 10px;
    padding: 0;
    flex-shrink: 0;
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis
}

.chat-head-meta small.muted {
    font-size: 10px;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis
}

.chat-head-meta .chat-assigned {
    font-size: 10px;
    max-width: 90px;
    flex-shrink: 0
}

.chat-head-compact [data-action=resolve-chat],
.chat-head-compact .chat-actions summary {
    width: 30px;
    height: 30px;
    min-height: 30px;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center
}

.chat-head-compact>.row:nth-child(2) {
    gap: 3px
}

.chat-head-compact .chat-menu-panel .care-panel-toggle {
    display: flex;
    width: 100%
}

.conversation-item.chat-row-selected {
    box-shadow: inset 3px 0 #276650, inset 0 0 0 1px #276650
}

.chat-list-compact {
    touch-action: pan-y
}

.chat-bulk {
    gap: 5px
}

.chat-bulk>.btn {
    color: #a52828
}

.chat-head-compact .bot-clock {
    flex-shrink: 0
}

@media(max-width:760px) {

    .content.inbox-page .chat-head.chat-head-compact,
    .content.inbox-page .chat-head-compact:has(.learner-progress-text) {
        min-height: 58px;
        padding: 5px 7px;
        gap: 4px
    }

    .chat-head-compact .chat-name-copy {
        font-size: 13px
    }

    .chat-head-meta .chat-assigned {
        display: none
    }

    .chat-head-meta .learner-progress-text {
        max-width: 100px
    }

    .chat-head-compact .chat-name-icons {
        gap: 2px
    }

    .chat-head-compact .chat-name-icon {
        width: 25px;
        height: 25px;
        min-height: 25px
    }

    .chat-head-compact>.row:first-child {
        gap: 3px
    }
}

.chat-head-compact>.care-profile-open {
    flex-shrink: 0;
    min-height: 30px;
    padding: 4px 8px;
    font-size: 11px
}

.chat-head-compact .chat-head-meta {
    overflow: hidden
}

@media(max-width:760px) {
    .chat-head-compact>.care-profile-open {
        font-size: 10px;
        padding: 4px
    }

    .chat-head-compact .chat-name-icons [data-care=profile] {
        display: none
    }
}

.conversation-item {
    user-select: none;
    -webkit-user-select: none;
    -webkit-touch-callout: none;
}

.chat-head-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0
}

.chat-head-compact .chat-head-tools button,
.chat-head-compact .chat-actions summary,
.chat-head-compact [data-action=resolve-chat] {
    border: 0;
    box-shadow: none;
    background: transparent;
    width: 32px;
    height: 32px;
    min-height: 32px;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px
}

.chat-head-tools button:hover,
.chat-head-compact [data-action=resolve-chat]:hover,
.chat-head-compact .chat-actions summary:hover {
    background: #edf3ef
}

.chat-head-compact .chat-name-line .chat-name-icons {
    display: none
}

.chat-head-compact .chat-head-tools [data-care=profile] {
    display: inline-flex
}

.chat-head-compact>.row:nth-child(2) {
    align-items: center;
    flex-shrink: 0
}

.chat-head-compact .chat-actions {
    display: flex;
    align-items: center
}

.chat-head-compact .chat-actions details {
    margin: 0;
    border: 0;
    padding: 0
}

.chat-head-compact .bot-toggle {
    color: #12774b
}

.chat-head-compact .bot-toggle.active {
    background: #ddf7e5;
    color: #047c3e
}

.chat-compose-row {
    justify-content: flex-end !important;
    gap: 8px
}

.chat-compose-row>.row {
    margin-left: auto;
    gap: 3px !important
}

.chat-compose-tools {
    display: flex;
    align-items: center;
    gap: 3px
}

.chat-tool {
    width: 32px;
    height: 32px;
    min-height: 32px;
    border: 0;
    background: transparent;
    color: #607a70;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 6px;
    cursor: pointer
}

.chat-tool:hover {
    background: #e7f0e8;
    color: #24634b
}

.chat-tool:disabled {
    opacity: .4;
    cursor: not-allowed
}

.chat-tag-menu {
    border: 0 !important;
    padding: 0 !important;
    margin: 0 !important
}

.chat-tag-menu>summary {
    display: flex;
    padding: 5px !important;
    background: none !important;
    border: 0 !important;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center
}

.compose-note textarea {
    background: #fff4d8 !important
}

.compose-note [type=submit] {
    background: #926f27
}

.chat-compose [type=submit] {
    touch-action: manipulation;
    user-select: none
}

.reminder-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px
}

.reminder-grid>section {
    max-height: 65vh;
    overflow: auto
}

.reminder-grid label:not(.check-label) {
    display: grid;
    gap: 6px;
    margin: 14px 0
}

.reminder-grid h4 {
    margin: 18px 0 10px
}

.reminder-card {
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
    margin: 10px 0;
    background: white
}

.reminder-card p {
    margin: 6px 0;
    overflow-wrap: anywhere
}

.chat-card-list {
    max-height: 45vh;
    overflow: auto;
    margin: 12px 0
}

.quick-message-list {
    max-height: 55vh;
    overflow: auto
}

.quick-message-preview {
    border: 0;
    background: none;
    text-align: left;
    max-width: 360px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    cursor: pointer;
    padding: 9px 4px;
    color: inherit
}

.quick-message-list tr:hover {
    background: #f1f5ef
}

.chat-media-grid video {
    width: 100%;
    height: 160px;
    object-fit: cover
}

.chat-media-grid img {
    object-fit: cover
}

.chat-head-compact .chat-head-tools button[disabled] {
    opacity: .35
}

@media(max-width:760px) {
    .reminder-grid {
        grid-template-columns: 1fr
    }

    .reminder-grid>section {
        max-height: 30vh
    }

    .chat-head-tools {
        gap: 0
    }

    .chat-head-compact .chat-head-tools button {
        width: 26px;
        height: 28px;
        min-height: 28px;
        padding: 4px
    }

    .chat-compose-tools {
        gap: 0
    }

    .chat-tool {
        width: 29px
    }

    .chat-compose-row>.row {
        flex-wrap: wrap !important;
        justify-content: flex-end
    }

    .chat-head-tools [data-plan=customer],
    .chat-head-tools [data-bot=info] {
        display: none !important
    }
}

.chat-head-compact .chat-head-tools .bot-toggle.on {
    background: #ddf7e5;
    color: #047c3e
}

.chat-head-compact .chat-head-tools .bot-toggle.attention {
    background: #fff1b8;
    color: #946500
}

.chat-head-compact>.row .icon-btn {
    border: 0;
    box-shadow: none;
    background: transparent
}

.chat-card-list .check-label {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer
}

.chat-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e4eee3;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
    overflow: hidden
}

.chat-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.chat-card-list .check-label:hover {
    background: #eaf1e8
}

.emoji-scroll {
    max-height: 48vh;
    overflow: auto;
    scroll-behavior: smooth
}

.emoji-categories {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    overflow: auto
}

.chat-emoji {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
    gap: 4px
}

.chat-emoji-button {
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 25px;
    padding: 5px;
    border-radius: 6px
}

.chat-emoji-button:hover {
    background: #e9eee7
}

.emoji-scroll section[hidden] {
    display: none
}

.quick-product-choices {
    max-height: 220px;
    overflow: auto;
    border: 1px solid #dce5da;
    border-radius: 8px
}

.quick-product-choice {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    width: 100%;
    border: 0;
    background: transparent;
    padding: 10px;
    text-align: left;
    cursor: pointer
}

.quick-product-choice:hover {
    background: #eaf1e8
}

#quick-chat-order .learner-cart input {
    min-width: 65px
}

#quick-chat-order label {
    display: block;
    margin: 8px 0
}

#quick-chat-order .check-label {
    display: flex;
    gap: 8px;
    align-items: center
}

#quick-chat-order h3 {
    margin-top: 16px
}

.chat-card-list [hidden],
#chat-quick-choices[hidden],
.chat-library-preview[hidden] {
    display: none !important
}

#chat-quick-choices {
    max-height: 260px;
    overflow: auto;
    border: 1px solid #dae4d8;
    border-radius: 10px;
    background: white;
    margin-bottom: 8px
}

.chat-quick-head,
.chat-quick-choice {
    display: grid;
    grid-template-columns: 55px minmax(80px, 1fr) minmax(120px, 2fr);
    gap: 10px;
    align-items: center;
    padding: 9px 12px
}

.chat-quick-head {
    position: sticky;
    top: 0;
    background: #f0f4ee;
    font-size: 12px;
    z-index: 1
}

.chat-quick-choice {
    width: 100%;
    border: 0;
    border-bottom: 1px solid #edf1ec;
    background: white;
    text-align: left;
    cursor: pointer;
    color: inherit
}

.chat-quick-choice[aria-selected=true],
.chat-quick-choice:hover {
    background: #e8f3e7
}

.chat-quick-choice small {
    display: block;
    color: #70806e
}

.chat-quick-choice strong,
.chat-quick-choice>span:last-child {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis
}

.chat-library-tile {
    position: relative;
    border: 2px solid transparent;
    border-radius: 10px;
    background: #eef2ed;
    padding: 0;
    overflow: hidden;
    cursor: pointer;
    touch-action: pan-y;
    user-select: none
}

.chat-library-tile img,
.chat-library-tile video {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    pointer-events: none
}

.chat-library-tile[aria-pressed=true] {
    border-color: #2c7558
}

.chat-library-check {
    position: absolute;
    right: 7px;
    top: 7px;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    background: #2c7558;
    color: white;
    display: none;
    align-items: center;
    justify-content: center
}

.chat-library-tile[aria-pressed=true] .chat-library-check {
    display: flex
}

.chat-library-video {
    position: absolute;
    inset: 40%;
    color: white;
    text-shadow: 0 1px 5px black
}

.chat-library-footer {
    position: sticky;
    bottom: 0;
    padding: 12px 0 0;
    background: white;
    display: flex;
    justify-content: flex-end
}

.chat-library-preview {
    position: absolute;
    inset: 65px 15px 15px;
    background: #fffffffa;
    border-radius: 10px;
    z-index: 3;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center
}

.chat-library-preview img,
.chat-library-preview video {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain
}

.chat-library-preview .btn {
    align-self: flex-end
}

.chat-card-search-sticky {
    position: sticky;
    top: 0;
    z-index: 2;
    background: white
}

.chat-group-member {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px
}

.chat-group-member[hidden] {
    display: none !important
}

.chat-group-member small {
    margin-left: auto;
    color: #a17330
}

.chat-contact-card {
    display: flex;
    gap: 12px;
    align-items: center;
    min-width: 200px;
    padding: 6px
}

.chat-contact-card>div {
    display: grid;
    gap: 6px
}

.chat-contact-card a {
    color: inherit
}

.chat-card-qr {
    width: 68px !important;
    height: 68px !important;
    object-fit: contain !important
}

.chat-sticker {
    width: 150px !important;
    height: 150px !important;
    object-fit: contain !important;
    background: none
}

.chat-sticker-loading {
    color: #73806e
}

.chat-head .chat-plan-ready {
    color: #1d8253 !important
}

.chat-plan-preview {
    width: 100%;
    height: 65vh;
    border: 0;
    border-radius: 10px
}

.chat-plan-tasks {
    max-height: 60vh;
    overflow: auto
}

.chat-compose .quick-tag-bar {
    border: 0;
    margin: 0 0 6px;
    padding: 0;
    gap: 3px
}

.chat-compose .quick-tag-bar>div {
    gap: 3px;
    min-height: 24px;
    scrollbar-width: thin
}

.chat-compose .quick-tag {
    flex: 1;
    padding: 5px 8px;
    border-radius: 3px;
    opacity: .9
}

.chat-compose .quick-tag.selected {
    opacity: 1
}

.chat-compose .quick-tag:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 1px
}

.modal.chat-plan-modal {
    width: 96vw;
    max-width: 1400px;
    height: 94dvh;
    max-height: 94dvh;
    border-radius: 12px;
    overflow: hidden
}

.chat-plan-modal .modal-body {
    padding: 0;
    height: 100%;
    overflow: hidden
}

.chat-plan-modal .chat-plan-preview {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 0
}

.chat-compose .quick-tag-bar>div:empty,
.chat-compose .chat-draft-context:empty {
    display: none
}

.content.inbox-page .chat-compose {
    padding-top: 6px
}

.chat-compose .quick-tag-bar {
    margin-bottom: 4px
}

.conversation-item[data-progress] {
    position: relative
}

.conversation-item[data-progress]::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--progress-color);
    pointer-events: none
}

.content.inbox-page .conversation-list .tab.chat-filter-populated {
    color: #c45b12;
    font-weight: 700
}

.content.inbox-page .conversation-list .tab.chat-filter-populated.active {
    color: #a3440c;
    background: #fff1dc
}

.chat-compose .quick-tag-bar>div {
    display: flex;
    flex-wrap: wrap;
    overflow: visible;
    gap: 2px
}

.chat-compose .quick-tag {
    flex: 1 1 70px;
    min-width: 0;
    max-width: 100%;
    font-size: 10px;
    white-space: normal;
    overflow-wrap: anywhere;
    padding: 4px 6px;
    line-height: 1.3
}

.tag-settings-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 18px 0
}

.tag-settings-toolbar .input {
    max-width: 280px
}

.tag-color-sample {
    display: block;
    width: 70px;
    height: 15px;
    border-radius: 12px
}

.tag-color-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0
}

.tag-color-palette button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    cursor: pointer
}

#tag-color-preview {
    display: inline-block;
    padding: 5px 20px;
    border-radius: 15px;
    color: white
}

.conversation-tag-settings td small {
    display: block
}

.conversation-tag-settings tbody tr:has(input:checked) {
    background: #e4f3ff
}

#chat-group-mentions {
    max-height: 190px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 9px;
    margin-bottom: 6px
}

#chat-group-mentions[hidden] {
    display: none
}

#chat-group-mentions button {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    background: white;
    text-align: left;
    cursor: pointer
}

#chat-group-mentions button[aria-selected=true] {
    background: #e7f0df
}

#chat-group-mentions .chat-card-avatar {
    height: 30px;
    width: 30px
}

.chat-compose .quick-tag-bar {
    max-height: 90px;
    overflow: auto;
    scrollbar-width: thin
}

.chat-compose .quick-tag {
    background: color-mix(in srgb, var(--tag-color) 45%, white);
    color: #fff;
    border: 0;
    box-shadow: none;
    opacity: 1
}

.chat-compose .quick-tag.selected {
    background: var(--tag-color);
    color: #fff;
    border: 0;
    box-shadow: none
}

.conversation-item[data-progress]::after {
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    width: 3px;
    height: auto
}

.conversation-item[data-progress="NEW"]::after {
    display: none
}

.content.inbox-page .conversation-item.active {
    border-left: 0
}

.chat-messages .chat-day {
    display: none
}

.bubble-wrap {
    position: relative;
    margin: 3px 0
}

.bubble-wrap .message-info,
.bubble-wrap .message-tools {
    display: none
}

.bubble-wrap:hover .message-info,
.bubble-wrap:focus-within .message-info,
.bubble-wrap.message-revealed .message-info,
.bubble-wrap.message-failed .message-info {
    display: block
}

.bubble-wrap:hover .message-tools,
.bubble-wrap:focus-within .message-tools,
.bubble-wrap.message-revealed .message-tools,
.bubble-wrap.message-failed .message-tools {
    display: flex;
    align-items: center;
    gap: 4px;
    opacity: 1
}

.message-info {
    font-size: 10px;
    color: #7b867e;
    line-height: 1.3
}

.message-tools .btn,
.message-tools>details>summary,
.message-reaction-selector>button {
    padding: 2px 6px;
    font-size: 13px;
    border: 0;
    border-radius: 5px;
    background: #ffffffb3;
    cursor: pointer;
    color: #627768
}

.message-more {
    position: relative
}

.message-more summary {
    list-style: none
}

.message-more>div {
    position: absolute;
    bottom: 100%;
    right: 0;
    z-index: 30;
    min-width: 150px;
    padding: 5px;
    background: white;
    box-shadow: 0 3px 15px #0003;
    border-radius: 8px;
    display: grid;
    gap: 3px
}

.message-more>div button {
    font-size: 12px !important;
    text-align: left;
    padding: 7px !important;
    white-space: nowrap
}

.message-reaction-selector {
    position: relative
}

.message-reaction-palette {
    display: none;
    position: absolute;
    bottom: 100%;
    right: 0;
    padding: 5px;
    background: white;
    box-shadow: 0 3px 12px #0002;
    border-radius: 20px;
    z-index: 35;
    white-space: nowrap
}

.incoming .message-reaction-palette {
    left: 0;
    right: auto
}

.message-reaction-selector:hover .message-reaction-palette,
.message-reaction-selector:focus-within .message-reaction-palette {
    display: flex
}

.message-reaction-palette button {
    border: 0;
    background: transparent;
    font-size: 22px;
    padding: 4px;
    cursor: pointer
}

.message-reaction-palette button:hover {
    transform: scale(1.15)
}

.message-reactions {
    display: flex;
    gap: 3px;
    font-size: 12px;
    margin-top: 2px
}

.message-reactions span {
    background: white;
    border-radius: 12px;
    padding: 2px 5px
}

.message-select-box {
    display: none
}

.message-selecting .message-select-box {
    display: block;
    position: absolute;
    left: -24px;
    top: 8px
}

.message-selected {
    outline: 2px solid #98bbd6;
    border-radius: 10px
}

.message-selection-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 6px;
    background: #edf5fb;
    border-radius: 6px;
    margin-bottom: 5px;
    font-size: 11px
}

.message-selection-bar button {
    border: 0;
    background: white;
    padding: 5px;
    border-radius: 5px;
    cursor: pointer;
    font: inherit
}

.chat-typing-status {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 11px;
    color: #627768;
    margin-top: 4px;
    align-self: flex-start
}

.chat-typing-status[hidden] {
    display: none
}

.chat-typing-status span {
    display: flex;
    gap: 5px;
    align-items: center
}

.chat-typing-status i {
    font-style: normal;
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    background: #e4eee5;
    border-radius: 50%;
    font-size: 9px
}

.chat-messages .bubble-wrap {
    margin: 10px 0
}

.bubble-wrap .message-info {
    position: absolute;
    top: 100%;
    right: 0;
    white-space: nowrap;
    z-index: 2
}

.bubble-wrap.incoming .message-info {
    left: 0;
    right: auto
}

.bubble-wrap .message-tools {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin: 0;
    height: 24px;
    z-index: 20;
    flex-wrap: nowrap
}

.bubble-wrap.incoming .message-tools {
    left: 0;
    right: auto
}

/* Inline actions follow the message bubble, with room for keyboard/touch access. */
.chat-messages .bubble-wrap {
    max-width: calc(100% - 112px)
}

.bubble-wrap .message-tools {
    top: 50%;
    bottom: auto;
    right: calc(100% + 6px);
    left: auto;
    transform: translateY(-50%);
    height: auto;
    width: max-content;
    gap: 2px;
    align-items: center
}

.bubble-wrap.incoming .message-tools {
    left: calc(100% + 6px);
    right: auto
}

.message-tools>button,
.message-tools>details>summary,
.message-reaction-selector>button {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 3px 5px;
    color: #68776f;
    font-size: 16px;
    line-height: 22px
}

.message-tools>button:hover,
.message-tools>details>summary:hover,
.message-reaction-selector>button:hover {
    background: transparent !important;
    color: #265e4b
}

.chat-list-compact.chat-unread .chat-list-title time {
    color: #ff0000;
    font-weight: 700
}

.chat-typing-status {
    width: 100%;
    justify-content: flex-start;
    min-height: 24px
}

.forward-targets {
    max-height: 45vh;
    overflow: auto;
    margin-top: 12px;
    display: grid;
    gap: 3px
}

.forward-target {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 7px;
    cursor: pointer
}

.forward-target:hover {
    background: #eef3ec
}

.forward-target[hidden] {
    display: none
}

.forward-target .avatar {
    width: 36px;
    height: 36px;
    flex: none;
    overflow: hidden
}

.forward-target img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.forward-target small {
    display: block;
    color: var(--muted);
    font-size: 11px
}

.forward-count {
    font-size: 12px;
    margin: 12px 0
}

.forward-result {
    font-size: 12px;
    max-height: 160px;
    overflow: auto
}

.message-tools>.message-more {
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    margin: 0
}

.bubble-wrap>.message-reaction-selector {
    position: absolute;
    top: calc(100% - 5px);
    right: 0;
    left: auto;
    z-index: 21;
    display: none
}

.bubble-wrap.outgoing>.message-reaction-selector {
    left: 0;
    right: auto
}

.bubble-wrap:hover>.message-reaction-selector,
.bubble-wrap:focus-within>.message-reaction-selector,
.bubble-wrap.message-revealed>.message-reaction-selector,
.bubble-wrap>.message-reaction-selector.has-reactions {
    display: block
}

.bubble-wrap>.message-reaction-selector>button {
    padding: 1px 6px;
    background: white !important;
    border-radius: 14px;
    line-height: 20px;
    font-size: 14px;
    color: #5b7a69;
    cursor: pointer
}

.bubble-wrap>.message-reaction-selector .message-reaction-palette {
    top: auto;
    bottom: 100%;
    right: 0;
    left: auto
}

.bubble-wrap .message-info {
    padding-right: 32px
}

.learner-relations {
    display: grid;
    gap: 5px;
    max-height: 360px;
    overflow: auto
}

.learner-common-groups { margin: 18px 0 }
.learner-common-groups summary { cursor: pointer; font-weight: 700; padding: 8px 0 }
.learner-common-groups[open] summary { margin-bottom: 8px }
.learner-pending-orders { margin: 12px 0 20px; display: grid; gap: 12px }
.learner-pending-orders h4 { margin: 0 }
.learner-pending-orders h4 small { font-weight: 400 }
.learner-order-card { border: 1px solid var(--border, #dce4df); border-radius: 12px; background: var(--surface, #fff); overflow: hidden; font-size: 13px; overflow-wrap: anywhere }
.learner-order-card header { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 6px; padding: 10px 14px; background: #edf4ef; color: #245b48 }
.learner-order-status { padding: 7px 14px; color: #a85a06; background: #fff8e9; font-weight: 600 }
.learner-order-contact { display: grid; gap: 6px; padding: 12px 14px 6px }
.learner-order-card ul { margin: 4px 14px 10px; padding-left: 16px }
.learner-order-amount { display: flex; justify-content: space-between; gap: 8px; padding: 0 14px 10px }
.learner-order-card dl { margin: 0 14px; padding: 8px 0; border-top: 1px dashed #dce4df }
.learner-order-card dl > div { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(0, 1.2fr); gap: 8px; padding: 4px 0 }
.learner-order-card dt { color: #718079 }
.learner-order-card dd { margin: 0; text-align: right; white-space: pre-line }
.learner-order-tracking { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 14px }
.learner-order-tracking .btn { color: #fff; background: #087f84; border: 0; max-width: 100%; overflow-wrap: anywhere; white-space: normal }

.learner-relation {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 7px;
    cursor: pointer;
    border-radius: 7px;
    font: inherit
}

.learner-relation:hover {
    background: #eef4eb
}

.learner-relation .avatar {
    width: 34px;
    height: 34px;
    flex: none;
    overflow: hidden
}

.learner-relation img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.learner-relation small {
    display: block;
    color: #7b867e;
    font-size: 11px;
    margin-top: 3px
}

/* Keep incoming reaction choices inside the conversation viewport. */
.bubble-wrap.incoming>.message-reaction-selector .message-reaction-palette {
    left: 0;
    right: auto;
    max-width: calc(100vw - 40px);
    flex-wrap: wrap;
    white-space: normal
}

.bubble-wrap.outgoing>.message-reaction-selector .message-reaction-palette {
    right: 0;
    left: auto;
    max-width: calc(100vw - 40px);
    flex-wrap: wrap;
    white-space: normal
}

.learner-registration {
    color: #233f99
}

.learner-registration .learner-profile-grid {
    gap: 40px
}

.learner-registration .form-grid {
    align-items: start
}

.learner-registration label {
    color: #2161ef
}

.learner-registration .deposit-box {
    margin-top: 24px;
    padding: 24px;
    background: #fff8fc;
    border: 1px solid #f5dcea;
    border-radius: 24px
}

.learner-registration .deposit-box label {
    color: #a41569
}

.learner-registration .registration-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px
}

.learner-registration h3 {
    margin-bottom: 22px
}

.learner-registration input,
.learner-registration textarea {
    color: #233f99
}

.bubble-wrap>.message-reaction-selector .message-reaction-palette {
    width: max-content
}

.learner-registration .learner-profile-grid {
    grid-template-columns: 1fr 1fr
}

.learner-registration .registration-footer .primary {
    background: #2463ed;
    border-radius: 24px;
    padding: 12px 28px
}

@media(max-width:700px) {
    .learner-registration .learner-profile-grid {
        grid-template-columns: 1fr;
        gap: 24px
    }
}

.bubble-media {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 12px;
    margin-bottom: 6px;
    object-fit: cover
}

.icon-btn.small {
    width: 28px;
    height: 28px
}

.icon-btn.small.active {
    color: var(--red);
    background: var(--pale)
}
/* Student workflow and staff-only follow-up */
.learner-name-edit{border:0;background:none;padding:0;color:inherit;font:inherit;cursor:pointer}.consultation-review{position:sticky;top:0;z-index:9;flex:0 0 auto;padding:10px 12px;margin:0 0 14px;border:1px solid #d7c695;border-left:3px solid #a47c30;border-radius:10px;background:#fffaf0;box-shadow:0 2px 8px #142a1810}.consultation-review small{display:block;color:#7d704d;font-size:11px;margin:3px 0 7px}.consultation-answers{display:flex;flex-wrap:wrap;gap:5px}.consultation-answers button{border:1px solid #ded8c7;background:#fff;border-radius:6px;padding:5px 8px;color:#435545;font-size:12px;cursor:pointer}.consultation-answers button:hover{background:#eaf2e7}.message-contact-order{position:absolute;top:calc(100% - 2px);right:30px;border:0;background:none;color:#527c66;padding:2px;cursor:pointer;z-index:3;display:flex;align-items:center}.bubble-wrap.has-contact-order{margin-bottom:23px}.has-contact-order .message-reaction-selector{right:0}.learner-registration input:disabled{background:#f0f2f3;color:#596674}.learner-progress-steps button{border-color:var(--progress-color);color:var(--progress-color)}

.chat-group-list [data-member][hidden]{display:none!important}

.chat-list-tag{font-weight:600}
.chat-list-avatar .chat-group-avatar{position:relative;background:transparent}
.chat-group-face{position:absolute;width:29px;height:29px;border:2px solid white;border-radius:50%;background:#dde8db;display:flex;align-items:center;justify-content:center;font-size:9px;color:#486756;overflow:hidden;box-sizing:border-box}
.chat-group-face.face-0{left:0;top:0}.chat-group-face.face-1{right:0;bottom:0}
.chat-list-avatar .chat-group-face img{width:100%;height:100%;object-fit:cover}
.chat-group-count{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;background:#0007;color:white;font-size:10px;font-weight:700}

/* Place long-message actions inside their bubble so menus stay in the chat. */
.bubble-wrap.outgoing .message-tools{right:0;left:auto;top:100%;transform:none}.bubble-wrap.incoming .message-tools{left:0;right:auto;top:100%;transform:none}.incoming .message-more>div{left:0;right:auto}.bubble-wrap:has(.message-more[open]){z-index:40}

.chat-list-compact .chat-list-meta .chat-list-tag{font-size:10px;font-weight:400;line-height:1.25;padding:2px 5px;letter-spacing:0;text-shadow:none}
@media(min-width:761px){
 .topbar.inbox-topbar{height:52px;padding:0 12px;overflow:visible;background:#fff;opacity:1;border-bottom:1px solid var(--line)}
 .topbar.inbox-topbar>:not(.inbox-topbar-tools){display:none!important}
 .inbox-topbar-tools{display:flex;align-items:center;gap:8px;width:100%;min-width:0;flex-wrap:nowrap}
 .inbox-topbar-tools>.toolbar{flex:1;min-width:0;padding:0;margin:0;background:none}
 .inbox-topbar-tools .tabs{display:flex;gap:2px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0;border:0}
 .inbox-topbar-tools .tabs::-webkit-scrollbar{display:none}
 .inbox-topbar-tools .tab{flex:none;font-size:11px;white-space:nowrap;padding:6px 8px}
 .inbox-topbar-tools .tab.chat-filter-populated{color:#c45b12;font-weight:700}
 .inbox-topbar-tools>.conversation-search{display:flex;align-items:center;gap:6px;flex:0 1 260px;min-width:160px;padding:0;border:0}
 .inbox-topbar-tools .conversation-search input{width:100%;min-width:0;font-size:12px;padding:7px 10px}
 .inbox-topbar-tools .conversation-search .btn{flex:none;min-height:32px;padding:4px 8px}
 .inbox-topbar-tools>.chat-toolbar{flex:none;padding:0;margin:0;gap:8px;flex-wrap:nowrap}
 .inbox-topbar-tools .chat-toolbar .chat-menu-panel{left:auto;right:0}
 .main:has(>.inbox-topbar)>.content.inbox-page{height:calc(100dvh - 52px)}
}

.chat>.chat-pins{flex-shrink:0;background:#fff;border-bottom:1px solid var(--line);padding:8px 16px;max-height:140px;overflow:auto}.chat-pins summary{cursor:pointer;font-size:12px;font-weight:600}.chat-pins .btn{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.chat-media-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;max-width:500px}.chat-media-group .chat-attachment{margin:0;min-width:0}.chat-media-group .chat-attachment img{display:block;width:100%;height:180px;object-fit:cover;border-radius:6px}.chat-media-group .chat-attachment:has(video),.chat-media-group .chat-attachment:not(:has(img)){grid-column:1/-1}
.care-stage-policy{border:1px solid var(--line);border-radius:10px;margin:12px 0;background:var(--paper,#fff)}.care-stage-policy summary{cursor:pointer;display:flex;align-items:center;gap:10px;padding:14px;font-weight:600}.care-color-dot{width:14px;height:14px;border-radius:50%;display:inline-block}.care-stage-body{padding:0 16px 16px}.care-color-label{display:flex;align-items:center;gap:12px;margin-bottom:16px}.care-color-label input{width:48px;height:36px}.care-staff-heading,.care-staff-row{display:grid;grid-template-columns:minmax(120px,1fr) 130px 130px;gap:8px;align-items:center;padding:10px 8px;border-bottom:1px solid var(--line)}.care-staff-heading{font-size:12px;background:var(--pale)}.care-staff-row label{display:flex;justify-content:center}.care-staff-heading span{text-align:center}.care-staff-table{overflow:auto}.chat-name-rule>.care-staff-config{grid-column:1/-1;margin:6px 0 12px}.care-staff-config>.help-text{margin:10px 0}.care-staff-config .check-label{display:flex;gap:8px}#student-care-settings-form>[type=submit]{margin-top:16px}@media(max-width:760px){.care-staff-heading,.care-staff-row{grid-template-columns:minmax(90px,1fr) 95px 95px;font-size:12px}.care-stage-body{padding:0 10px 12px}}
/* Selection actions must stay outside the scrolling desktop conversation list. */
.chat-bulk{position:sticky;top:0;z-index:20;flex-shrink:0;background:var(--pale);border-bottom:1px solid var(--line)}
@media(min-width:761px){.inbox-topbar-tools:has(>.chat-bulk){flex-wrap:wrap;gap:4px 8px}.inbox-topbar-tools>.chat-bulk{position:relative;flex:0 0 100%;justify-content:flex-start;padding:4px 10px;min-height:42px}.inbox-topbar-tools>.chat-bulk .chat-menu{margin-left:auto}.topbar.inbox-topbar:has(.chat-bulk){height:100px}.main:has(>.inbox-topbar .chat-bulk)>.content.inbox-page{height:calc(100dvh - 100px)}}
.chat-bulk .chat-menu{position:static;margin-left:0!important}.chat-bulk .chat-menu-panel{left:10px;right:auto;top:calc(100% + 4px);width:240px;max-width:calc(100% - 20px)}.chat-bulk{justify-content:flex-start;gap:6px}.chat-bulk>small{white-space:nowrap}.chat-bulk>[data-chat=clear-selection]{color:var(--text)}
.chat-pins{background:#fff;border-bottom:1px solid var(--line);padding:5px 12px;flex:none;max-height:180px;overflow:auto;font-size:12px}
.chat-pins summary{display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:600;min-height:28px}
.chat-pins summary span{font-weight:400;color:#718178;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex:1;min-width:0}
.chat-pin-row{display:flex;gap:8px;align-items:center;padding:4px 0;border-top:1px solid var(--line)}
.chat-pin-content{flex:1;min-width:0;display:grid;gap:2px}.chat-pin-content button,.chat-pin-content>span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:left;max-width:100%;border:0;background:transparent;padding:2px;font-size:12px}.chat-pin-content small{font-size:10px;color:#718178}
.chat-messages .bubble-wrap{margin-bottom:42px!important}
.bubble-wrap .message-info{top:100%;line-height:14px}
.bubble-wrap .message-tools,.bubble-wrap.outgoing .message-tools,.bubble-wrap.incoming .message-tools{top:calc(100% + 15px);bottom:auto;left:0;right:auto;transform:none;gap:7px;height:24px;max-width:100%;flex-wrap:nowrap}
.bubble-wrap.outgoing .message-tools{left:auto;right:0}
.bubble-wrap>.message-reaction-selector{top:calc(100% + 15px);right:0}.bubble-wrap.outgoing>.message-reaction-selector{left:0;right:auto}
.bubble-wrap .message-tools>button,.bubble-wrap .message-more summary{min-width:28px;padding:3px 5px!important;font-size:14px}
.bubble-wrap .message-tools{max-width:none;width:max-content}
.message-tools .message-reaction-selector{position:relative;top:auto;left:auto;right:auto;display:block;flex:none}
.message-tools .message-reaction-selector>button{min-width:28px;min-height:28px}
/* Side actions leave the message/time line compact. Reactions and order stay below content. */
.chat-messages .bubble-wrap{margin-top:4px!important;margin-bottom:20px!important}
.chat-messages .bubble-wrap.has-contact-order{margin-bottom:26px!important}
.bubble-wrap .message-tools,.bubble-wrap.incoming .message-tools,.bubble-wrap.outgoing .message-tools{top:50%;bottom:auto;transform:translateY(-50%);left:calc(100% + 6px);right:auto;height:30px;gap:3px;background:#fff;border:1px solid #e2e7ed;border-radius:8px;padding:1px 4px;box-shadow:0 2px 8px #172a3b0d}
.bubble-wrap.outgoing .message-tools{left:auto;right:calc(100% + 6px)}
.bubble-wrap>.message-reaction-selector,.bubble-wrap.outgoing>.message-reaction-selector{top:calc(100% - 3px);right:0;left:auto}
.message-contact-order{top:calc(100% - 3px);right:30px}
.message-more>div{width:260px;min-width:220px;padding:7px;border:1px solid #dde3ea;border-radius:12px;box-shadow:0 6px 22px #172a3b26;gap:2px;bottom:calc(100% + 6px)}
.message-more>div button{display:flex;align-items:center;gap:13px;width:100%;min-height:42px;border:0;background:#fff;border-radius:7px;color:#253c58;padding:10px 12px!important;font-size:14px!important}
.message-more>div button:hover,.message-more>div button:focus-visible{background:#f0f2f5;outline:none}
.message-more>div button svg{flex:none;color:#3b516e}.message-more>div button span{white-space:normal;text-align:left}
@media(max-width:760px){.bubble-wrap .message-tools,.bubble-wrap.incoming .message-tools,.bubble-wrap.outgoing .message-tools{top:0;transform:translateY(-100%);left:0;right:auto}.bubble-wrap.outgoing .message-tools{left:auto;right:0}.message-more>div{width:230px;max-width:calc(100vw - 32px)}}
.message-tools button:focus-visible,.message-more summary:focus-visible,.chat-tool:focus-visible{outline:2px solid var(--primary);outline-offset:2px}.chat-compose textarea{min-height:64px;max-height:180px}.chat-menu-panel{max-height:min(520px,70dvh);overflow-y:auto}.message-more>div{max-height:calc(100dvh - 16px);overflow-y:auto}.chat-head-meta{min-width:0}.chat-head-meta>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.chat-message-menu-popup{position:fixed;z-index:1000;display:flex;flex-direction:column;gap:2px;padding:7px;background:white;border:1px solid #dde3ea;border-radius:12px;box-shadow:0 6px 22px #172a3b26;overflow-y:auto}.chat-message-menu-popup button{display:flex;align-items:center;gap:13px;width:100%;min-height:42px;border:0;background:#fff;border-radius:7px;color:#253c58;padding:10px 12px;font-size:14px;text-align:left}.chat-message-menu-popup button:hover,.chat-message-menu-popup button:focus-visible{background:#f0f2f5;outline:none}.chat-message-menu-popup svg{flex:none}
.chat-messages{overflow-x:hidden}
.chat-messages{gap:6px}.chat-messages .bubble-wrap{margin-top:2px!important;margin-bottom:18px!important}.chat-messages .bubble-wrap.has-contact-order{margin-bottom:24px!important}.chat-tool[aria-pressed=true]{background:#fff0c9;color:#8a5b04;border-radius:6px}
/* Keep the action rail beside the bubble, and secondary actions inside its width. */
.message-main{position:relative;max-width:100%}
.message-under-actions{display:flex;align-items:center;gap:4px;min-height:24px;padding-top:2px}
.outgoing .message-under-actions{justify-content:flex-end}
.message-under-actions>.message-reaction-selector,.message-under-actions>.message-contact-order{position:relative;top:auto;left:auto;right:auto;z-index:3;margin:0}
.message-under-actions>.message-reaction-selector{visibility:hidden;display:block}
.bubble-wrap:hover .message-under-actions>.message-reaction-selector,.bubble-wrap:focus-within .message-under-actions>.message-reaction-selector,.message-under-actions>.message-reaction-selector.has-reactions{visibility:visible}
.message-under-actions>.message-reaction-selector>button{background:#fff;border-radius:14px;min-width:26px;height:24px;padding:1px 5px}
.message-under-actions .message-reaction-palette{bottom:100%;top:auto}
.bubble-wrap .message-main>.message-tools{top:50%;transform:translateY(-50%);left:calc(100% + 8px);right:auto;bottom:auto;height:32px;align-items:center}
.bubble-wrap.outgoing .message-main>.message-tools{left:auto;right:calc(100% + 8px)}
.message-tools>.message-more>summary{display:flex;align-items:center;justify-content:center;height:28px;min-width:28px;line-height:1}
.chat-messages .bubble-wrap{max-width:calc(100% - 140px);margin-bottom:16px!important}
.chat-messages .bubble-wrap.has-contact-order{margin-bottom:16px!important}
.message-selecting .message-main>.message-tools,.message-selecting .message-under-actions{display:none!important}
.message-selecting .message-select-box{z-index:50;width:20px;height:20px;left:-28px;top:8px;margin:0;cursor:pointer;accent-color:var(--primary)}
.chat-messages .bubble-wrap.message-selecting{max-width:calc(100% - 36px);margin-left:28px!important}
@media(max-width:760px){.chat-messages .bubble-wrap{max-width:calc(100% - 120px)}.message-under-actions>.message-reaction-selector{visibility:visible}}
/* Restored shared chat rules lost during merge resolution. */
.content.inbox-page .chat-compose{padding:10px 14px;flex-shrink:0}.chat-compose> .row:first-of-type{margin-bottom:5px}.chat-compose textarea{min-height:72px;max-height:160px;resize:vertical;border-radius:12px}.chat-compose-row{margin-top:7px;gap:8px}.chat-compose-row>.row{gap:6px;min-width:0;flex-wrap:wrap}.chat-compose-tools{margin:0;flex-wrap:nowrap;gap:4px}.chat-compose-tools .btn{min-height:32px;padding:5px 8px}.chat-compose-tools .chat-menu-panel,.chat-tag-menu .chat-menu-panel{top:auto;bottom:calc(100% + 8px);left:0;right:auto}.chat-compose-tools label{margin:0;display:flex;gap:7px}.chat-tag-menu .chat-menu-panel{width:300px}.chat-tag-menu .quick-tag-bar{margin:0;border:0;padding:0}.chat-tag-menu .quick-tag-bar>div{flex-wrap:wrap;overflow:visible}.chat-compose .chat-draft-context{max-height:110px;overflow:auto}.chat-compose-row [data-action=ai-reply]{font-size:11px;padding:5px 8px;min-height:32px}
.chat-name-line{display:flex;align-items:center;gap:8px;min-width:0;flex-wrap:wrap}.chat-name-line h3{position:relative;min-width:0;max-width:100%;overflow:visible!important}.chat-name-copy{padding:0;border:0;background:none;font:inherit;text-align:left;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;touch-action:pan-y;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;cursor:pointer}.chat-name-icons{display:flex;gap:3px;flex-shrink:0}.chat-name-icon{width:28px;height:28px;min-height:28px;border:1px solid var(--line);background:#fff;border-radius:7px;display:grid;place-items:center;padding:0;color:var(--green)}.chat-name-icon:hover{background:var(--pale)}.chat-name-icon:disabled{opacity:.35;cursor:not-allowed}.chat-copy-feedback{position:absolute;top:100%;left:0;z-index:35;background:#24372f;color:#fff;border-radius:5px;padding:3px 7px;font-size:10px;font-weight:400;white-space:nowrap;box-shadow:0 3px 10px #0002}.chat-copy-feedback[hidden]{display:none}.chat-name-rule{display:grid;grid-template-columns:20px 20px minmax(150px,1fr) 40px minmax(190px,1fr) minmax(150px,1fr) auto;gap:8px;align-items:center;padding:12px 0;border-bottom:1px solid var(--line)}.chat-name-rule .input{width:100%;min-width:0}.chat-name-rule input[type=color]{width:36px;height:36px;padding:2px;border:1px solid var(--line);border-radius:6px;background:white}.name-rule-number{font-size:11px;color:var(--muted)}#chat-name-settings-form{margin-top:16px}#chat-name-settings-form>[type=submit]{margin-top:18px}#chat-name-settings-form>label{display:flex;align-items:center;gap:8px;flex-wrap:wrap;font-size:13px}#chat-name-settings-form>label input{width:75px}.chat-name-line+h3{display:none}
@media(max-width:760px){.chat-name-line{gap:3px;align-items:flex-start;flex-direction:column}.chat-name-line h3{max-width:145px}.chat-name-icon{width:26px;height:26px;min-height:26px}.chat-name-icons{gap:3px}.content.inbox-page .chat-head-compact{min-height:82px}.chat-head-compact .chat-name-line+small{max-width:145px}.chat-name-rule .icon-btn{min-height:32px}.chat-name-copy{font-size:13px}}
body:has(.inbox-page #reply-form) .care-update-pill{top:164px;bottom:auto;left:auto;right:24px;max-width:calc(100vw - 32px);font-size:11px;min-height:30px;padding:5px 10px}
@media(max-width:760px){body:has(.inbox-page #reply-form) .care-update-pill{top:156px;right:12px;left:auto;max-width:calc(100vw - 24px)}}
.learner-progress-text{display:block;max-width:100%;text-align:left;padding:2px 0;border:0;background:transparent;font-size:12px;font-weight:600;cursor:pointer;white-space:nowrap}.learner-progress-text:hover{text-decoration:underline}.learner-progress-steps{display:flex;flex-wrap:wrap;gap:5px;margin:16px 0}.learner-progress-steps button{border:1px solid var(--progress-color);color:var(--progress-color);background:white;border-radius:6px;padding:6px 8px;font-size:11px}.learner-progress-steps button[aria-pressed=true]{background:var(--progress-color);color:white}#learner-progress-form label{display:block;margin:12px 0;font-size:13px}#learner-progress-form .input{display:block;width:100%;margin-top:5px}#learner-progress-form .check-label{display:flex;gap:8px;align-items:center}@media(max-width:760px){.learner-progress-text{font-size:11px}.content.inbox-page .chat-head-compact:has(.learner-progress-text){min-height:100px}}
.media-library-tools{margin:20px 0;display:grid;gap:14px}.media-filter-grid{display:grid;grid-template-columns:2fr 1fr 1.3fr 1fr 1fr;gap:10px}.media-filter-grid input,.media-filter-grid select,#media-edit input:not([type=checkbox]),#media-edit textarea,#media-category-form input:not([type=checkbox]),#media-category-form textarea{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:white}.media-drop{border:2px dashed #b8c9aa;border-radius:14px;padding:24px;text-align:center;margin:18px 0;background:#f7faf4}.media-drop small{display:block;margin-top:10px;color:#667085}.media-upload-row{padding:9px;border-bottom:1px solid var(--line)}.media-upload-row.error{color:#b42318}.media-card video,.media-card img{object-fit:contain;background:#f1f3f5}#media-edit fieldset{padding:12px;border:1px solid var(--line);border-radius:8px}#media-edit fieldset label{display:inline-block;margin:6px 12px 6px 0}@media(max-width:700px){.media-filter-grid{grid-template-columns:1fr 1fr}.media-filter-grid>input{grid-column:1/-1}.media-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.media-card>div{padding:10px}.media-drop{padding:14px}.media-card strong{overflow-wrap:anywhere}}
.bot-layout{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin:20px 0}.bot-item{padding:14px 0;border-bottom:1px solid var(--line)}.bot-item p{margin:7px 0}.bot-form input:not([type=checkbox]),.bot-form textarea,.bot-form select,.bot-staff-row select{width:100%;padding:10px;border:1px solid var(--line);border-radius:8px;background:white}.bot-form fieldset{padding:12px;border:1px solid var(--line);border-radius:8px}.bot-form fieldset label{display:block;margin:8px 0}.bot-media-list{max-height:250px;overflow:auto}.bot-staff-row{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:center;margin:10px 0}.bot-toggle{color:#88918a}.bot-toggle.on{color:#178345;background:#e5f8eb}.bot-form label{display:block}.bot-item p{white-space:pre-wrap;overflow-wrap:anywhere}@media(max-width:700px){.bot-layout{grid-template-columns:1fr}.bot-staff-row{grid-template-columns:1fr}.bot-form{min-width:0}}
.content.inbox-page .chat-head.chat-head-compact,.content.inbox-page .chat-head-compact:has(.learner-progress-text){min-height:58px;padding:6px 10px;gap:6px;flex-wrap:nowrap}.chat-head-compact>.row:first-child{gap:7px}.chat-head-compact>.row:first-child>div:last-child{flex:1}.chat-head-compact .avatar{width:30px;height:30px;min-width:30px;font-size:11px}.chat-head-compact .chat-name-line{display:flex;flex-direction:row;align-items:center;gap:5px;flex-wrap:nowrap}.chat-head-compact .chat-name-line h3{flex:1;min-width:0;max-width:none;margin:0;font-size:14px}.chat-head-compact .chat-name-copy{font-size:14px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-head-compact .chat-name-icons{flex-shrink:0}.chat-head-compact .chat-name-icon{width:28px;height:28px;min-height:28px}.chat-head-meta{display:flex;align-items:center;gap:6px;min-width:0;white-space:nowrap;font-size:10px;line-height:16px}.chat-head-meta .learner-progress-text{font-size:10px;padding:0;flex-shrink:0;max-width:130px;overflow:hidden;text-overflow:ellipsis}.chat-head-meta small.muted{font-size:10px;min-width:0;overflow:hidden;text-overflow:ellipsis}.chat-head-meta .chat-assigned{font-size:10px;max-width:90px;flex-shrink:0}.chat-head-compact [data-action=resolve-chat],.chat-head-compact .chat-actions summary{width:30px;height:30px;min-height:30px;padding:5px;display:flex;align-items:center;justify-content:center}.chat-head-compact>.row:nth-child(2){gap:3px}.chat-head-compact .chat-menu-panel .care-panel-toggle{display:flex;width:100%}.conversation-item.chat-row-selected{box-shadow:inset 3px 0 #276650,inset 0 0 0 1px #276650}.chat-list-compact{touch-action:pan-y}.chat-bulk{gap:5px}.chat-bulk>.btn{color:#a52828}.chat-head-compact .bot-clock{flex-shrink:0}
@media(max-width:760px){.content.inbox-page .chat-head.chat-head-compact,.content.inbox-page .chat-head-compact:has(.learner-progress-text){min-height:58px;padding:5px 7px;gap:4px}.chat-head-compact .chat-name-copy{font-size:13px}.chat-head-meta .chat-assigned{display:none}.chat-head-meta .learner-progress-text{max-width:100px}.chat-head-compact .chat-name-icons{gap:2px}.chat-head-compact .chat-name-icon{width:25px;height:25px;min-height:25px}.chat-head-compact>.row:first-child{gap:3px}}
.chat-head-compact>.care-profile-open{flex-shrink:0;min-height:30px;padding:4px 8px;font-size:11px}.chat-head-compact .chat-head-meta{overflow:hidden}
@media(max-width:760px){.chat-head-compact>.care-profile-open{font-size:10px;padding:4px}.chat-head-compact .chat-name-icons [data-care=profile]{display:none}}
.conversation-item{user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;}
.chat-head-tools{display:flex;align-items:center;gap:4px;flex-shrink:0}.chat-head-compact .chat-head-tools button,.chat-head-compact .chat-actions summary,.chat-head-compact [data-action=resolve-chat]{border:0;box-shadow:none;background:transparent;width:32px;height:32px;min-height:32px;padding:6px;display:inline-flex;align-items:center;justify-content:center;border-radius:6px}.chat-head-tools button:hover,.chat-head-compact [data-action=resolve-chat]:hover,.chat-head-compact .chat-actions summary:hover{background:#edf3ef}.chat-head-compact .chat-name-line .chat-name-icons{display:none}.chat-head-compact .chat-head-tools [data-care=profile]{display:inline-flex}.chat-head-compact>.row:nth-child(2){align-items:center;flex-shrink:0}.chat-head-compact .chat-actions{display:flex;align-items:center}.chat-head-compact .chat-actions details{margin:0;border:0;padding:0}.chat-head-compact .bot-toggle{color:#12774b}.chat-head-compact .bot-toggle.active{background:#ddf7e5;color:#047c3e}
.chat-head-compact .chat-head-tools .bot-toggle.on{background:#ddf7e5;color:#047c3e}.chat-head-compact .chat-head-tools .bot-toggle.attention{background:#fff1b8;color:#946500}
/* Message footer: one action row below the bubble, separate from its timestamp. */
.chat-messages .bubble-wrap{max-width:calc(100% - 40px);margin-bottom:30px!important}
.chat-messages .bubble-wrap.has-contact-order{margin-bottom:30px!important}
.bubble-wrap .message-under-actions{position:absolute;top:calc(100% + 2px);bottom:auto;left:0;right:auto;width:max-content;display:flex;align-items:center;justify-content:flex-start;gap:4px;min-height:28px;padding:0;z-index:4}
.bubble-wrap.outgoing .message-under-actions{left:auto;right:0;justify-content:flex-end}
.bubble-wrap .message-under-actions>.message-tools,.bubble-wrap.outgoing .message-under-actions>.message-tools,.bubble-wrap.incoming .message-under-actions>.message-tools{position:static;transform:none;display:flex!important;visibility:hidden;opacity:0;align-items:center;flex-wrap:nowrap;gap:2px;width:max-content;height:28px;margin:0;padding:1px 3px;border:1px solid #e2e7ed;border-radius:8px;background:white;box-shadow:0 2px 7px #172a3b0d;transition:opacity .12s ease}
.bubble-wrap .message-under-actions>.message-reaction-selector,.bubble-wrap .message-under-actions>.message-contact-order{position:relative;top:auto;bottom:auto;left:auto;right:auto;flex:none;margin:0;visibility:hidden}
.bubble-wrap .message-under-actions>.message-reaction-selector{order:0}
.bubble-wrap.outgoing .message-under-actions>.message-reaction-selector{order:3}
.bubble-wrap .message-under-actions>.message-contact-order{order:1}
.bubble-wrap .message-under-actions>.message-tools{order:2}
.bubble-wrap .message-under-actions>.message-reaction-selector.has-reactions{visibility:visible}
.bubble-wrap:hover .message-under-actions>*,.bubble-wrap.message-hover-active .message-under-actions>*,.bubble-wrap.message-revealed .message-under-actions>*,.bubble-wrap:has(:focus-visible) .message-under-actions>*,.bubble-wrap:has(.message-more[open]) .message-under-actions>*{visibility:visible;opacity:1}
.bubble-wrap .message-under-actions>.message-reaction-selector>button{width:auto;min-width:28px;height:28px;display:flex;align-items:center;justify-content:center;padding:1px 5px!important;background:white!important;border:1px solid #e2e7ed!important;border-radius:14px}
.bubble-wrap .message-under-actions>.message-contact-order{display:flex;align-items:center;justify-content:center;width:28px;height:28px;padding:3px;border-radius:8px;border:1px solid #e2e7ed;background:white}
.bubble-wrap .message-under-actions .message-more>summary{height:24px;min-width:26px;padding:2px 4px!important}
.bubble-wrap .bubble>.message-info{position:static;top:auto;bottom:auto;left:auto;right:auto;display:block!important;min-height:14px;margin:4px 0 0;padding:0;line-height:14px;font-size:10px;white-space:normal;text-align:left;visibility:hidden;opacity:0}
.bubble-wrap.message-first-minute .bubble>.message-info,.bubble-wrap.message-failed .bubble>.message-info,.bubble-wrap:hover .bubble>.message-info,.bubble-wrap.message-hover-active .bubble>.message-info,.bubble-wrap.message-revealed .bubble>.message-info,.bubble-wrap:has(:focus-visible) .bubble>.message-info{visibility:visible;opacity:1}
.message-info .message-attribution{display:none}.bubble-wrap:hover .message-attribution,.bubble-wrap.message-hover-active .message-attribution,.bubble-wrap:has(:focus-visible) .message-attribution{display:inline}
.chat-messages>.chat-day{display:block;align-self:center;max-width:100%;margin:12px 0 8px;background:#adb2b8;color:white;border-radius:12px;font-size:11px;padding:4px 15px;line-height:18px;text-align:center}
.message-more>div button,.chat-message-menu-popup button{display:grid!important;grid-template-columns:20px minmax(0,1fr);align-items:center;justify-content:start!important;gap:12px!important;text-align:left!important;min-height:40px;padding:9px 12px!important;text-indent:0;margin:0}
.message-more>div button svg,.chat-message-menu-popup button svg{width:18px;height:18px;justify-self:center;flex:none;margin:0}
.message-more>div button span,.chat-message-menu-popup button span{justify-self:start;min-width:0;white-space:normal;text-align:left}
.chat-messages .bubble-wrap.message-selecting{margin-bottom:8px!important}.bubble-wrap.message-selecting .message-under-actions{display:none!important}
@media(pointer:coarse){.bubble-wrap .message-under-actions>.message-reaction-selector{visibility:visible}}
@media(max-width:760px){.chat-messages .bubble-wrap{max-width:calc(100% - 24px)}.chat-messages{padding-left:12px;padding-right:12px}.bubble-wrap .message-under-actions{gap:3px}}
.bubble-wrap:is(:hover,.message-hover-active,.message-revealed,:has(:focus-visible),:has(.message-more[open])) .message-under-actions>:is(.message-tools,.message-contact-order,.message-reaction-selector){visibility:visible;opacity:1}
.bubble-wrap.has-contact-order .message-under-actions>.message-contact-order{visibility:visible;opacity:1}.chat-calendar-reminder{width:100%;text-align:left;border:1px solid #d8c688;background:#fff8df;color:#705c24;cursor:pointer}
.reminder-minute-control{display:flex;gap:6px;align-items:center}.reminder-minute-control input{margin:0;appearance:textfield;-moz-appearance:textfield}.reminder-minute-control input::-webkit-inner-spin-button{appearance:none}.reminder-minute-control button{min-width:36px;height:38px;border:1px solid var(--line);border-radius:8px;background:white;cursor:pointer}.bubble-wrap .bubble{position:relative}.bubble-wrap .message-info .message-attribution{position:absolute;right:0;bottom:calc(100% + 5px);z-index:20;background:#fff;color:#536557;border:1px solid #dde4dd;border-radius:5px;padding:3px 6px;white-space:nowrap;pointer-events:none;box-shadow:0 2px 6px #0001}.bubble-wrap.message-selecting .message-attribution{display:none!important}.bubble-wrap.message-selecting .message-info{visibility:visible!important;opacity:1!important}.chat-appointment-icon{display:inline-flex;color:var(--primary)}

.bubble-wrap .message-info .message-attribution{bottom:auto;top:calc(100% + 2px);right:0;background:transparent;border:0;box-shadow:none;padding:0 2px;font-size:10px;color:#748277;z-index:4}.bubble-wrap.message-selecting .message-info .message-attribution{display:none!important}

/* Keep attribution beside the action row, below the bubble. */
.bubble-wrap.outgoing .message-info .message-attribution{right:140px;top:calc(100% + 8px)}.bubble-wrap.outgoing.has-contact-order .message-info .message-attribution{right:174px}

.chat-list-meta .chat-appointment-icon{display:inline-flex;align-items:center;gap:4px;color:#d5293c;min-width:0;max-width:100%}.chat-appointment-icon>svg{flex:none;stroke-width:2.3}.chat-appointment-summary{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.message-reaction-selector>button{font-family:"Segoe UI Emoji","Apple Color Emoji","Noto Color Emoji",sans-serif}
.handoff-card-head>.handoff-customer{display:flex;align-items:center;gap:8px}.handoff-customer>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.handoff-card .handoff-platform{position:static!important;display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;min-width:20px;flex:none;font-size:12px;border-radius:50%;vertical-align:middle}.handoff-assigner{display:flex;align-items:center;gap:6px;margin-top:9px;font-size:12px;color:var(--muted);min-width:0}.handoff-assigner>span:first-child{white-space:nowrap}.handoff-assigner-names{min-width:0;overflow-wrap:anywhere;color:#425a4d}.handoff-creator{color:var(--muted)}.handoff-creator small{font-size:11px}.handoff-card .handoff-assigner .handoff-platform{width:17px;height:17px;min-width:17px;font-size:10px}@media(max-width:600px){.handoff-assigner{align-items:flex-start;line-height:1.6}.handoff-assigner .handoff-platform{margin-top:2px}.handoff-card-head{gap:6px}.handoff-customer{font-size:14px}}
.handoff-card-head>.handoff-customer>span:not(.handoff-platform){min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.handoff-card-head>.handoff-customer>.handoff-creator{flex:none;font-size:11px;font-weight:400;color:var(--muted);white-space:nowrap}.message-task-assignees{display:inline;font-size:11px;font-weight:400;color:#7a857d;background:none!important;padding:0;margin-left:7px;white-space:normal;overflow-wrap:anywhere}
.bubble>small.message-task-assignees{display:inline;margin-top:0;margin-bottom:0;background:transparent!important;font-size:11px;font-weight:400;color:#7a857d}
.reminder-staff-picker{position:relative;margin-top:6px}.reminder-staff-picker summary{cursor:pointer;list-style:none}.reminder-staff-picker summary::after{content:'⌄';float:right}.reminder-staff-options{position:absolute;z-index:15;left:0;right:0;max-height:240px;overflow:auto;background:#fff;border:1px solid #dce4dc;border-radius:10px;padding:10px;box-shadow:0 8px 24px #163c2520}.reminder-staff-options .check-label{padding:8px;margin:0}.handoff-reason{display:flex;align-items:center;gap:8px}.handoff-customer>svg,.handoff-reason>svg{flex-shrink:0;color:#c34b41}

.handoff-card .handoff-reason>svg{vertical-align:middle;margin-right:7px}
.message-zalo-phone-slot{order:1;display:inline-flex;gap:5px;align-items:center}.message-zalo-phone{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:transparent;color:#0878ef;cursor:pointer}.message-zalo-phone>span{display:grid;place-items:center;width:21px;height:19px;border:1.5px solid currentColor;border-radius:8px 8px 8px 2px;font-size:12px;font-weight:800;line-height:1}.message-zalo-phone:hover,.message-zalo-phone:focus-visible{background:#e9f2ff;outline:2px solid #b4d7ff}.message-zalo-phone:disabled{opacity:.5;cursor:wait}
