/* Chat page — override MainLayout MudContainer padding for full-bleed chat */
.chat-page .mud-container {
    padding: 0 !important;
    max-width: 100% !important;
}

/* Chat header bar — fixed at top, over the MudAppBar */
.chat-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1100; /* Above MudAppBar z-index */
    display: flex;
    flex-direction: column;
    background: var(--mud-palette-appbar-background);
    color: var(--mud-palette-appbar-text);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    max-width: 600px;
    margin: 0 auto;
}

/* Toolbar row inside chat header */
.chat-header-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 4px 8px;
    min-height: 56px;
}

.chat-header-thumbnail {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    cursor: pointer;
    flex-shrink: 0;
}

.chat-header-title {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
    font-size: 1rem;
}

/* Chat message container — scrollable area between header and compose bar */
.chat-container {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 8px 12px;
    padding-top: 100px;  /* ~56px toolbar + 36px task strip + 8px buffer */
    padding-bottom: 120px; /* default; dynamically updated by scrollToBottom JS */
    height: calc(100vh - 56px); /* full viewport minus bottom nav */
}

/* Date separator */
.date-separator {
    text-align: center;
    margin: 16px 0 8px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.date-separator span {
    background: var(--mud-palette-background);
    padding: 4px 12px;
    border-radius: 8px;
    font-weight: 500;
}

/* Message row — flex container for alignment */
.message-row {
    display: flex;
    margin-bottom: 2px;
}

.message-row.own {
    justify-content: flex-end;
}

.message-row.other {
    justify-content: flex-start;
}

/* Extra bottom margin when next message is from a different user or group break */
.message-row.group-end {
    margin-bottom: 12px;
}

/* Avatar column for other users' messages */
.message-avatar {
    width: 32px;
    margin-right: 6px;
    flex-shrink: 0;
    align-self: flex-end;
}

/* Placeholder when avatar is hidden (grouped messages) */
.message-avatar-spacer {
    width: 32px;
    margin-right: 6px;
    flex-shrink: 0;
}

/* Chat bubble */
.chat-bubble {
    max-width: 80%;
    padding: 6px 8px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.chat-bubble.own {
    background: #DCF8C6;
    border-top-right-radius: 0;
    color: #111;
}

.chat-bubble.other {
    background: var(--mud-palette-surface);
    border-top-left-radius: 0;
}

/* Dark mode own bubble */
.mud-theme-dark .chat-bubble.own {
    background: #005C4B;
    color: #E9EDEF;
}

/* Sender name in bubble */
.bubble-sender {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--mud-palette-primary);
    margin-bottom: 2px;
}

/* Bubble image */
.bubble-image {
    width: 100%;
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 4px;
    max-height: 300px;
    object-fit: cover;
}

/* Multi-image grid within a bubble */
.bubble-image-grid {
    display: grid;
    gap: 2px;
    margin-bottom: 4px;
}

.bubble-image-grid.count-2 {
    grid-template-columns: 1fr 1fr;
}

.bubble-image-grid.count-3 {
    grid-template-columns: 1fr 1fr;
}

.bubble-image-grid.count-4 {
    grid-template-columns: 1fr 1fr;
}

.bubble-image-grid img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
}

/* Bubble text content */
.bubble-text {
    font-size: 0.9375rem;
    line-height: 1.4;
    white-space: pre-wrap;
}

/* Bubble timestamp */
.bubble-time {
    font-size: 0.6875rem;
    color: var(--mud-palette-text-secondary);
    text-align: right;
    margin-top: 2px;
}

.chat-bubble.own .bubble-time {
    color: rgba(0, 0, 0, 0.45);
}

.mud-theme-dark .chat-bubble.own .bubble-time {
    color: rgba(255, 255, 255, 0.6);
}

/* Reaction pills row inside chat bubble */
.reaction-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    padding-top: 2px;
    position: relative;
}

.reaction-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8125rem;
    background: rgba(0, 0, 0, 0.06);
    cursor: pointer;
    user-select: none;
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
}

.reaction-pill:active {
    background: rgba(0, 0, 0, 0.12);
}

.mud-theme-dark .reaction-pill {
    background: rgba(255, 255, 255, 0.1);
}

.mud-theme-dark .reaction-pill:active {
    background: rgba(255, 255, 255, 0.18);
}

.reaction-pill.own {
    background: rgba(var(--mud-palette-primary-rgb), 0.15);
    font-weight: 500;
}

.mud-theme-dark .reaction-pill.own {
    background: rgba(var(--mud-palette-primary-rgb), 0.25);
}

.reaction-divider {
    width: 1px;
    height: 16px;
    background: rgba(0, 0, 0, 0.15);
    margin: 0 2px;
    flex-shrink: 0;
}

.mud-theme-dark .reaction-divider {
    background: rgba(255, 255, 255, 0.2);
}

.reaction-add-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.04);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.reaction-add-btn:active {
    background: rgba(0, 0, 0, 0.1);
}

.mud-theme-dark .reaction-add-btn {
    background: rgba(255, 255, 255, 0.06);
}

.mud-theme-dark .reaction-add-btn:active {
    background: rgba(255, 255, 255, 0.14);
}

/* Compose bar — fixed at bottom, above navigation bar */
.compose-bar {
    position: fixed;
    bottom: 56px; /* above bottom nav */
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--mud-palette-surface);
    border-top: 1px solid var(--mud-palette-lines-default);
    max-width: 600px;
    margin: 0 auto;
}

/* Image preview strip above compose input */
.compose-previews {
    display: flex;
    gap: 8px;
    padding: 8px 12px 0;
    overflow-x: auto;
    overflow-y: hidden;  /* suppress vertical scrollbar from remove button bleed */
}

.compose-preview-thumb {
    position: relative;
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.compose-preview-thumb img {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 8px;
}

.compose-preview-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--mud-palette-error) !important;
    color: white !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    min-height: 20px !important;
}

.compose-preview-remove .mud-icon-root {
    font-size: 14px;
}

/* Compose input row */
.compose-row {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    padding: 8px 8px;
}

.compose-row .mud-input-control {
    flex: 1;
}

/* Constrain MudFileUpload as fixed-size flex item */
.compose-row .mud-file-upload {
    flex-shrink: 0;
    flex-grow: 0;
}

/* Hide MudBlazor internal file list container in compose row */
.compose-row .mud-file-upload .mud-file-upload-files {
    display: none;
}

/* Empty state */
.chat-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    color: var(--mud-palette-text-secondary);
    text-align: center;
    padding: 24px;
}

/* Read receipt avatar dots */
.read-receipts {
    display: flex;
    gap: 2px;
    margin-top: 2px;
}

.read-receipts.own-receipts {
    justify-content: flex-end;
}

.read-receipts.other-receipts {
    justify-content: flex-start;
    padding-left: 38px; /* align with bubble (avatar 32px + gap 6px) */
}

.read-receipt-avatar {
    transition: all 0.3s ease;
}

/* Unread divider */
.unread-divider {
    text-align: center;
    margin: 12px 0;
    position: relative;
}

.unread-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--mud-palette-primary);
    opacity: 0.4;
}

.unread-divider span {
    position: relative;
    z-index: 1;
    background: var(--mud-palette-primary);
    color: white;
    padding: 2px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* New message pill */
.new-message-pill {
    position: fixed;
    bottom: 140px; /* above compose bar */
    left: 50%;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--mud-palette-primary);
    color: white;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    max-width: 90%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Optimistic send states */
.message-sending {
    opacity: 0.6;
}

.message-status {
    font-size: 0.6875rem;
    margin-top: 2px;
    text-align: right;
}

.message-status.sending {
    color: var(--mud-palette-text-secondary);
}

.message-status.failed {
    color: var(--mud-palette-error);
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.message-retry-btn {
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}

/* Loading skeleton bubbles */
.chat-skeleton {
    padding: 16px;
}

.skeleton-bubble {
    margin-bottom: 12px;
    border-radius: 8px;
}

.skeleton-bubble.left {
    margin-right: 20%;
}

.skeleton-bubble.right {
    margin-left: 20%;
}

/* === Presence: Stacked viewer avatars === */
.viewer-avatars {
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    cursor: pointer;
    padding: 0 4px;
}

.viewer-avatars .viewer-avatar {
    margin-left: -8px;
    border: 2px solid var(--mud-palette-appbar-background);
    border-radius: 50%;
    transition: margin-left 0.2s ease;
}

.viewer-avatars .viewer-avatar:last-child {
    margin-left: 0;
}

/* Tighter stacking as count grows */
.viewer-avatars.count-4 .viewer-avatar { margin-left: -10px; }
.viewer-avatars.count-5 .viewer-avatar { margin-left: -12px; }
.viewer-avatars.count-6 .viewer-avatar { margin-left: -14px; }

.viewer-overflow {
    margin-left: -8px;
    background: var(--mud-palette-primary);
    color: white;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    border: 2px solid var(--mud-palette-appbar-background);
}

/* === Presence: Status rings (box-shadow, not border, to avoid layout shift) === */
.presence-ring-active {
    box-shadow: 0 0 0 2px #4CAF50;
}

.presence-ring-idle {
    box-shadow: 0 0 0 2px #FFC107;
}

.presence-ring-offline {
    box-shadow: 0 0 0 2px #9E9E9E;
}

/* === Presence: Viewer dropdown === */
.viewer-dropdown-popover {
    z-index: 1300 !important;
}

.viewer-dropdown {
    min-width: 200px;
    max-width: 280px;
    max-height: 300px;
    overflow-y: auto;
    padding: 8px 0;
    background: var(--mud-palette-surface);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.viewer-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
}

.viewer-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.viewer-status-dot.active { background: #4CAF50; }
.viewer-status-dot.idle { background: #FFC107; }
.viewer-status-dot.offline { background: #9E9E9E; }

.viewer-name {
    font-weight: 500;
    font-size: 0.875rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.viewer-time {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    white-space: nowrap;
}

.viewer-dropdown-empty {
    padding: 12px 16px;
    text-align: center;
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

.viewer-dropdown-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1299;
}

/* === Presence: Read receipt status rings === */
.read-receipt-avatar.presence-ring-active {
    box-shadow: 0 0 0 2.5px #4CAF50;
}

.read-receipt-avatar.presence-ring-idle {
    box-shadow: 0 0 0 2.5px #FFC107;
}

.read-receipt-avatar.presence-ring-offline {
    box-shadow: 0 0 0 2.5px #9E9E9E;
    opacity: 0.5;
}

/* === Presence: Read receipt tooltip === */
.read-receipt-tooltip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
}

.read-receipt-tooltip .viewer-status-dot {
    width: 6px;
    height: 6px;
}

/* === Bot message styling === */
.bot-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    padding: 1px 6px;
    border-radius: 4px;
    background-color: rgba(16, 185, 129, 0.15);
    color: #10B981;
    margin-left: 6px;
    vertical-align: middle;
}

.chat-bubble.bot-message {
    background-color: rgba(16, 185, 129, 0.08);
    border-left: 2px solid rgba(16, 185, 129, 0.4);
}

.mud-theme-dark .chat-bubble.bot-message {
    background-color: rgba(16, 185, 129, 0.12);
    border-left: 2px solid rgba(16, 185, 129, 0.5);
}

/* === System messages — centered label with separator lines (WhatsApp style) === */
.system-message {
    display: flex;
    align-items: center;
    margin: 12px 0;
    padding: 0 16px;
}

.system-message::before,
.system-message::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(0, 0, 0, 0.12);
}

.mud-theme-dark .system-message::before,
.mud-theme-dark .system-message::after {
    background: rgba(255, 255, 255, 0.12);
}

.system-message-inner {
    text-align: center;
    padding: 4px 16px;
    line-height: 1.4;
}

.system-message-action {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.system-message-detail {
    display: block;
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
}

.mud-theme-dark .system-message-detail {
    color: rgba(255, 255, 255, 0.6);
}

/* === Offline subscriber list backdrop === */
.offline-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1299;
}

.viewer-dropdown-header {
    padding: 8px 16px 4px;
}

.viewer-dropdown-name {
    font-weight: 500;
    font-size: 0.875rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* === Drop overlay for drag-and-drop === */
.drop-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(var(--mud-palette-primary-rgb), 0.15);
    border: 3px dashed var(--mud-palette-primary);
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.drop-overlay-content {
    text-align: center;
    color: var(--mud-palette-primary);
}

/* === Compose bar PDF preview === */
.compose-pdf-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    background: var(--mud-palette-surface);
    border-radius: 8px;
    min-width: 150px;
}
.compose-pdf-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.compose-pdf-name {
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.compose-pdf-size {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
}

/* === Chat bubble PDF rendering === */
.bubble-pdf {
    cursor: pointer;
    padding: 4px;
}
.bubble-pdf-thumbnail {
    position: relative;
    max-width: 200px;
    border-radius: 8px;
    overflow: hidden;
}
.bubble-pdf-thumbnail img {
    width: 100%;
    border-radius: 8px;
}
.bubble-pdf-badge {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: var(--mud-palette-error);
    color: white;
    border-radius: 4px;
    padding: 2px 6px;
    display: flex;
    align-items: center;
}
.bubble-pdf-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 160px;
    height: 120px;
    background: var(--mud-palette-surface);
    border-radius: 8px;
}
.bubble-pdf-filename {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* File processing indicator in compose bar */
.compose-processing {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    color: var(--mud-palette-text-secondary);
}

/* PDF compose preview thumb needs auto height to fit content */
.compose-preview-thumb:has(.compose-pdf-preview) {
    width: auto;
    height: auto;
}

/* === Reaction popover backdrop === */
.reaction-popover-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    -webkit-tap-highlight-color: transparent;
}

/* === Reaction detail popover === */
.reaction-detail-popover {
    position: absolute;
    bottom: calc(100% + 4px);
    left: 0;
    z-index: 1201;
    background: var(--mud-palette-surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 8px;
    min-width: 200px;
    max-width: 280px;
    max-height: 240px;
    overflow-y: auto;
}

.reaction-detail-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    margin-bottom: 6px;
}

.reaction-detail-emoji {
    font-size: 1.25rem;
}

.reaction-detail-count {
    font-size: 0.8125rem;
    color: var(--mud-palette-text-secondary);
}

.reaction-detail-entry {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 4px;
}

.reaction-detail-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.reaction-detail-name {
    font-size: 0.8125rem;
    font-weight: 500;
}

.reaction-detail-comment {
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
    word-break: break-word;
}

.reaction-detail-more {
    color: var(--mud-palette-primary);
    cursor: pointer;
    font-weight: 500;
}

/* === Reaction picker popover === */
.reaction-picker-popover {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0;
    z-index: 1201;
    background: var(--mud-palette-surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    padding: 12px;
    min-width: 240px;
    max-width: 300px;
}

.reaction-picker-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
}

.reaction-picker-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.reaction-picker-emoji:active {
    background: rgba(0, 0, 0, 0.08);
}

.reaction-picker-emoji.selected {
    background: rgba(var(--mud-palette-primary-rgb), 0.15);
    outline: 2px solid var(--mud-palette-primary);
}

.reaction-picker-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    gap: 8px;
}

/* Bot FAB positioning — sits just above compose bar */
.bot-fab-container {
    position: fixed;
    bottom: 124px; /* 56px bottom-nav + ~60px compose bar + 8px gap */
    right: 16px;
    z-index: 101;
}

.bot-fab {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border-radius: 50% !important;
    width: 48px;
    height: 48px;
}

@media (min-width: 960px) {
    .bot-fab-container {
        bottom: 72px; /* no bottom nav on desktop, just above compose bar */
        right: 24px;
    }
}

/* Bot status pulse animation */
@keyframes bot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.bot-status-pulse {
    animation: bot-pulse 1.5s ease-in-out infinite;
}

/* === Bot Panel === */
.bot-panel-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 1200;
}

.bot-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 380px;
    max-width: 100vw;
    background: var(--mud-palette-surface);
    z-index: 1201;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.2);
}

@media (max-width: 959px) {
    .bot-panel {
        inset: 0;
        width: 100%;
        box-shadow: none;
    }
}

.bot-panel-header {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 8px;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    min-height: 56px;
    flex-shrink: 0;
}

.bot-panel-search {
    padding: 12px 16px 8px;
    flex-shrink: 0;
}

.bot-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
    min-height: 0;
}

.bot-panel-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 48px 16px;
}

/* Bot task card — rich card layout */
.bot-task-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--mud-palette-lines-default);
    margin-bottom: 8px;
    transition: background 0.15s;
}

.bot-task-card:hover {
    background: rgba(var(--mud-palette-primary-rgb), 0.04);
}

.bot-task-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.bot-task-card-content {
    flex: 1;
    min-width: 0;
}

.bot-task-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.3;
}

.bot-task-card-desc {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 2px;
    line-height: 1.4;
}

.bot-task-card-shortcut {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    font-size: 0.75rem;
    color: var(--mud-palette-text-secondary);
}

.bot-task-card-shortcut code {
    background: rgba(var(--mud-palette-primary-rgb), 0.1);
    color: var(--mud-palette-primary);
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-family: monospace;
}

.bot-task-card-bot-name {
    font-size: 0.7rem;
    color: var(--mud-palette-text-secondary);
    margin-top: 4px;
    opacity: 0.7;
}

.bot-task-card-action {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    padding-top: 4px;
}

/* === Modal Bottom Sheet (portaled to body) === */
.modal-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1300;
}

.modal-sheet {
    position: fixed;
    top: 0;
    left: 50%;
    height: 100vh;
    transform: translateX(-50%) translateY(100%);
    width: 100%;
    max-width: 600px;
    z-index: 1301;
    background: var(--mud-palette-surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.modal-sheet-handle {
    display: flex;
    justify-content: center;
    padding: 12px 16px 8px;
    cursor: grab;
    touch-action: none;
}

.modal-sheet-drag-indicator {
    width: 32px;
    height: 4px;
    border-radius: 2px;
    background: var(--mud-palette-lines-default);
}

.modal-sheet-content {
    overflow-y: auto;
    max-height: calc(90vh - 40px);
    padding: 0 16px 16px;
}

