/*
 | BMS work screens: lists, boards, the task page, My Work, the spaces tree.
 |
 | Plain CSS for the same reason as pms.css: Filament's stylesheet is
 | precompiled, so Tailwind classes in our own Blade render as nothing.
 | Colours come from Filament's variables (--gray-*, --primary-*) so light and
 | dark mode follow the panel. Run `php artisan filament:assets` after editing.
 */

.bms-page {
    --bms-line: rgba(0, 0, 0, 0.08);
    --bms-hover: rgba(0, 0, 0, 0.03);
    --bms-muted: var(--gray-500);
    --bms-surface: #fff;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    min-width: 0;
}

.dark .bms-page {
    --bms-line: rgba(255, 255, 255, 0.1);
    --bms-hover: rgba(255, 255, 255, 0.04);
    --bms-muted: var(--gray-400);
    --bms-surface: var(--gray-900);
}

/* ---- toolbar ------------------------------------------------------- */

.bms-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    border-bottom: 1px solid var(--bms-line);
    padding-bottom: 0.5rem;
}

.bms-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.bms-search {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.5rem;
    padding: 0 0.5rem;
    background: var(--bms-surface);
}

.bms-search input {
    border: 0;
    background: transparent;
    padding: 0.4rem 0;
    font-size: 0.875rem;
    width: 12rem;
    max-width: 50vw;
    outline: none;
    box-shadow: none;
}

.bms-select,
.bms-input {
    border: 1px solid var(--bms-line);
    border-radius: 0.5rem;
    padding: 0.4rem 2rem 0.4rem 0.6rem;
    font-size: 0.875rem;
    background-color: var(--bms-surface);
    color: inherit;
}

.bms-input {
    padding-right: 0.6rem;
}

.bms-check {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.875rem;
    color: var(--bms-muted);
    white-space: nowrap;
}

.bms-list-description {
    color: var(--bms-muted);
    font-size: 0.875rem;
    white-space: pre-line;
}

/* ---- shared bits ---------------------------------------------------- */

.bms-meta-icon {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.bms-rotate {
    transform: rotate(-90deg);
}

.bms-status-pill {
    display: inline-block;
    padding: 0.15rem 0.55rem;
    border-radius: 0.375rem;
    background: var(--status);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bms-count {
    color: var(--bms-muted);
    font-size: 0.8125rem;
}

.bms-meta {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    color: var(--bms-muted);
    font-size: 0.75rem;
    white-space: nowrap;
}

.bms-tag {
    display: inline-block;
    padding: 0 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    line-height: 1.25rem;
    color: var(--tag);
    background: color-mix(in srgb, var(--tag) 14%, transparent);
    white-space: nowrap;
}

.bms-avatars {
    display: inline-flex;
    align-items: center;
}

.bms-avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    border-radius: 999px;
    border: 2px solid var(--bms-surface, #fff);
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    object-fit: cover;
    flex-shrink: 0;
}

.bms-avatar + .bms-avatar {
    margin-left: -0.45rem;
}

.bms-avatar-c0 { background: #7c3aed; }
.bms-avatar-c1 { background: #2563eb; }
.bms-avatar-c2 { background: #db2777; }
.bms-avatar-c3 { background: #0d9488; }
.bms-avatar-c4 { background: #ea580c; }
.bms-avatar-c5 { background: #4f46e5; }
.bms-avatar-c6 { background: #65a30d; }
.bms-avatar-c7 { background: #0891b2; }
.bms-avatar-more { background: var(--gray-400); }

.bms-due {
    font-size: 0.8125rem;
    white-space: nowrap;
    color: var(--bms-muted);
}

.bms-due-overdue { color: var(--danger-600); font-weight: 600; }
.bms-due-soon { color: var(--warning-600); font-weight: 600; }
.bms-due-done { text-decoration: line-through; }

.bms-flag {
    display: inline-flex;
    color: var(--flag);
}

.bms-empty {
    padding: 2rem;
    text-align: center;
    color: var(--bms-muted);
    border: 1px dashed var(--bms-line);
    border-radius: 0.75rem;
}

.bms-ghost {
    opacity: 0.4;
}

/* ---- list view ------------------------------------------------------ */

.bms-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.bms-group-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

.bms-twisty {
    display: inline-flex;
    color: var(--bms-muted);
}

.bms-row {
    display: grid;
    grid-template-columns: 3.25rem minmax(0, 1fr) 7rem 6.5rem 4rem;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.5rem;
    padding: 0.25rem 0.5rem;
    border-bottom: 1px solid var(--bms-line);
    background: var(--bms-surface);
}

.bms-row:hover {
    background: var(--bms-hover);
}

.bms-row-head {
    min-height: 1.75rem;
    background: transparent;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bms-muted);
}

.bms-row-head:hover {
    background: transparent;
}

.bms-row-handle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.bms-drag {
    cursor: grab;
    color: var(--gray-300);
    font-size: 0.75rem;
    letter-spacing: -0.15em;
    user-select: none;
    visibility: hidden;
}

.bms-row:hover .bms-drag {
    visibility: visible;
}

.bms-dot,
.bms-dot-select {
    display: inline-block;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 0.25rem;
    border: 2px solid var(--status);
    background: color-mix(in srgb, var(--status) 25%, transparent);
    flex-shrink: 0;
}


.bms-row-name {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
    min-width: 0;
}

.bms-row-name a {
    font-size: 0.875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.bms-row-name a:hover {
    color: var(--primary-600);
}

.bms-done {
    color: var(--bms-muted);
    text-decoration: line-through;
}

.bms-group-body {
    min-height: 0.5rem;
}

.bms-quick-add input {
    width: 100%;
    border: 0;
    background: transparent;
    padding: 0.45rem 0.5rem;
    font-size: 0.875rem;
    color: inherit;
    box-shadow: none;
}

.bms-quick-add input:focus {
    outline: 1px solid var(--primary-400);
    border-radius: 0.375rem;
    background: var(--bms-surface);
}

.bms-quick-add-row {
    padding-left: 3.25rem;
}

@media (max-width: 767px) {
    .bms-row {
        grid-template-columns: 2.25rem minmax(0, 1fr) auto;
        grid-template-areas: 'h n n' 'h a d';
    }

    .bms-row > :nth-child(1) { grid-area: h; }
    .bms-row > :nth-child(2) { grid-area: n; }
    .bms-row > :nth-child(3) { grid-area: a; }
    .bms-row > :nth-child(4) { grid-area: d; justify-self: end; }
    .bms-row > :nth-child(5) { display: none; }
    .bms-row-head { display: none; }
    .bms-drag { display: none; }
    .bms-quick-add-row { padding-left: 0; }
    .bms-search input { width: 8rem; }
}

/* ---- board view ----------------------------------------------------- */

.bms-board {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    padding-bottom: 0.75rem;
    align-items: flex-start;
}

.bms-column {
    flex: 0 0 17rem;
    max-width: 85vw;
    border-radius: 0.75rem;
    background: var(--bms-hover);
    border: 1px solid var(--bms-line);
}

.bms-column-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.6rem 0.4rem;
}

.bms-column-body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem 0.5rem;
    min-height: 3rem;
}

.bms-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.6rem 0.7rem;
    border-radius: 0.5rem;
    background: var(--bms-surface);
    border: 1px solid var(--bms-line);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    cursor: grab;
}

.bms-card:hover {
    border-color: var(--primary-400);
}

.bms-card-name {
    font-size: 0.875rem;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.bms-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

.bms-card-meta:empty {
    display: none;
}

.bms-card-foot,
.bms-card-right {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

/* ---- task page ------------------------------------------------------ */

.bms-task {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 1023px) {
    .bms-task {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bms-task-main,
.bms-task-side {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    min-width: 0;
}

.bms-task-side {
    position: sticky;
    top: 5rem;
}

@media (max-width: 1023px) {
    .bms-task-side {
        position: static;
        order: -1;
    }
}

.bms-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bms-muted);
    margin-bottom: 0.5rem;
}

.bms-task-title {
    width: 100%;
    min-height: 2.8rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: transparent;
    padding: 0.25rem 0.4rem;
    margin-left: -0.4rem;
    color: inherit;
    resize: none;
    box-shadow: none;
}

.bms-task-title:hover {
    border-color: var(--bms-line);
}

.bms-task-title:focus {
    outline: none;
    border-color: var(--primary-400);
    background: var(--bms-surface);
}

.bms-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.8125rem;
    color: var(--bms-muted);
}

.bms-crumbs a:hover {
    color: var(--primary-600);
}

.bms-prose {
    font-size: 0.9375rem;
    line-height: 1.6;
    overflow-wrap: anywhere;
}

.bms-prose p { margin: 0 0 0.6rem; }
.bms-prose p:last-child { margin-bottom: 0; }
.bms-prose ul { list-style: disc; padding-left: 1.25rem; margin: 0 0 0.6rem; }
.bms-prose ol { list-style: decimal; padding-left: 1.25rem; margin: 0 0 0.6rem; }
.bms-prose a { color: var(--primary-600); text-decoration: underline; }
.bms-prose img { max-width: 100%; height: auto; border-radius: 0.5rem; }
.bms-prose blockquote { border-left: 3px solid var(--bms-line); padding-left: 0.75rem; color: var(--bms-muted); }
.bms-prose code { font-size: 0.85em; background: var(--bms-hover); padding: 0.1rem 0.3rem; border-radius: 0.25rem; }
.bms-prose [data-type='mention'] { color: var(--primary-600); font-weight: 600; }

.bms-subtasks {
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
    overflow: hidden;
}

.bms-subtask {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-subtask:last-child {
    border-bottom: 0;
}

.bms-subtask a {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.bms-files {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
    gap: 0.5rem;
}

.bms-file {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.5rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    min-width: 0;
}

.bms-file img {
    width: 100%;
    height: 6rem;
    object-fit: cover;
    border-radius: 0.375rem;
}

.bms-file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 6rem;
    border-radius: 0.375rem;
    background: var(--bms-hover);
    color: var(--bms-muted);
}

.bms-file-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.bms-file-remove {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 0.15rem;
}

.bms-file:hover .bms-file-remove {
    display: inline-flex;
}

.bms-feed {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bms-comment {
    display: flex;
    gap: 0.6rem;
}

.bms-comment-body {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
    padding: 0.6rem 0.8rem;
    background: var(--bms-surface);
}

.bms-comment-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.8125rem;
}

.bms-comment-head strong {
    font-weight: 600;
}

.bms-comment-actions {
    margin-left: auto;
    display: inline-flex;
    gap: 0.5rem;
}

.bms-link {
    color: var(--bms-muted);
    font-size: 0.75rem;
}

.bms-link:hover {
    color: var(--primary-600);
}

.bms-link-danger:hover {
    color: var(--danger-600);
}

.bms-replies {
    margin-top: 0.6rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--bms-line);
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bms-activity {
    display: flex;
    gap: 0.5rem;
    align-items: baseline;
    padding-left: 0.5rem;
    font-size: 0.8125rem;
    color: var(--bms-muted);
}

.bms-activity strong {
    color: inherit;
    font-weight: 600;
}

.bms-time {
    font-size: 0.75rem;
    color: var(--bms-muted);
    white-space: nowrap;
}

.bms-timer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
}

.bms-timer-running {
    border-color: var(--success-500);
    background: color-mix(in srgb, var(--success-500) 8%, transparent);
}

.bms-secret {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* ---- my work -------------------------------------------------------- */

.bms-mywork-group + .bms-mywork-group {
    margin-top: 1.25rem;
}

.bms-mywork-row {
    display: grid;
    grid-template-columns: 1.75rem minmax(0, 1fr) minmax(0, 14rem) 6.5rem 5.5rem;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-mywork-row:hover {
    background: var(--bms-hover);
}

.bms-mywork-where {
    color: var(--bms-muted);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 767px) {
    .bms-mywork-row {
        grid-template-columns: 1.75rem minmax(0, 1fr) auto;
    }

    .bms-mywork-row > :nth-child(3),
    .bms-mywork-row > :nth-child(5) {
        display: none;
    }
}

/* ---- sidebar spaces tree -------------------------------------------- */

.bms-tree {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-inline: -0.5rem;
    font-size: 0.875rem;
}

/* The same as Filament's group headings (Reports, Administration) */
.bms-tree-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5rem;
    font-weight: 500;
    color: var(--gray-500);
    cursor: pointer;
}

.bms-tree-title > span {
    flex: 1;
}

.bms-tree-title .fi-icon {
    width: 1.25rem;
    height: 1.25rem;
    color: var(--gray-400);
}

.dark .bms-tree-title {
    color: var(--gray-400);
}

/* The same as Filament's menu items (Team workload, Spaces...) */
.bms-tree-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
    text-align: left;
    min-width: 0;
}

.bms-tree-item > .fi-icon {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    color: var(--gray-400);
}

.dark .bms-tree-item {
    color: var(--gray-200);
}

.bms-tree-item:hover {
    background: var(--gray-100);
}

.dark .bms-tree-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bms-tree-item span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-tree-on {
    color: var(--primary-700) !important;
    background: var(--gray-100);
}

.bms-tree-on > .fi-icon {
    color: var(--primary-600);
}

.dark .bms-tree-on {
    color: var(--primary-400) !important;
    background: rgba(255, 255, 255, 0.05);
}

.bms-tree-space {
    font-weight: 500;
}

.bms-tree-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 0.35rem;
    background: var(--space, var(--gray-400));
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    flex-shrink: 0;
}

.bms-tree-children {
    padding-left: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bms-tree-filter {
    margin: 0 0.25rem 0.25rem;
    width: calc(100% - 0.5rem);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 0.5rem;
    padding: 0.3rem 0.5rem;
    font-size: 0.8125rem;
    background: transparent;
    color: inherit;
}

.dark .bms-tree-filter {
    border-color: rgba(255, 255, 255, 0.12);
}

/* ---- calendar ------------------------------------------------------- */

.bms-cal-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.bms-cal-head strong {
    min-width: 9rem;
    text-align: center;
}

.bms-cal {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    border-top: 1px solid var(--bms-line);
    border-left: 1px solid var(--bms-line);
}

.bms-cal-dow {
    padding: 0.35rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--bms-muted);
    border-right: 1px solid var(--bms-line);
    border-bottom: 1px solid var(--bms-line);
}

.bms-cal-day {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 6.5rem;
    min-width: 0;
    padding: 0.3rem;
    border-right: 1px solid var(--bms-line);
    border-bottom: 1px solid var(--bms-line);
    background: var(--bms-surface);
}

.bms-cal-out {
    background: var(--bms-hover);
}

.bms-cal-out .bms-cal-num {
    opacity: 0.5;
}

.bms-cal-num {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bms-muted);
}

.bms-cal-today .bms-cal-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.4rem;
    height: 1.4rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
}

.bms-cal-task {
    display: block;
    padding: 0.1rem 0.35rem;
    border-left: 3px solid var(--status);
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--status) 12%, transparent);
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-cal-task:hover {
    background: color-mix(in srgb, var(--status) 24%, transparent);
}

@media (max-width: 767px) {
    .bms-cal-day {
        min-height: 4rem;
    }

    .bms-cal-task {
        font-size: 0.625rem;
        padding: 0 0.2rem;
    }
}

/* ---- task view (TaskPanel): ClickUp's layout -------------------------- */

.bms-no-scroll {
    overflow: hidden;
}

.bms-overlay {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.bms-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
}

.bms-overlay-box {
    position: relative;
    width: min(1440px, 100%);
    height: min(92vh, 100%);
    border-radius: 0.875rem;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

@media (max-width: 767px) {
    .bms-overlay {
        padding: 0;
    }

    .bms-overlay-box {
        height: 100%;
        border-radius: 0;
    }
}

.bms-tp {
    --bms-line: rgba(0, 0, 0, 0.08);
    --bms-hover: rgba(0, 0, 0, 0.03);
    --bms-muted: var(--gray-500);
    --bms-surface: #fff;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 26rem;
    background: var(--bms-surface);
    height: calc(100vh - 9rem);
    min-height: 32rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.875rem;
    overflow: hidden;
}

.bms-tp-overlay {
    height: 100%;
    border: 0;
    border-radius: 0;
}

.dark .bms-tp {
    --bms-line: rgba(255, 255, 255, 0.1);
    --bms-hover: rgba(255, 255, 255, 0.04);
    --bms-muted: var(--gray-400);
    --bms-surface: var(--gray-900);
}

@media (max-width: 1023px) {
    .bms-tp {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        height: auto;
        overflow: visible;
    }

    .bms-tp-overlay {
        height: 100%;
        overflow-y: auto;
    }
}

.bms-tp-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.bms-tp-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-tp-bar-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}

.bms-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.5rem;
    color: var(--bms-muted);
}

.bms-icon-btn:hover {
    background: var(--bms-hover);
    color: inherit;
}

.bms-tp-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

@media (max-width: 767px) {
    .bms-tp-scroll {
        padding: 1rem;
    }
}

.bms-tp-kind {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1rem;
}

.bms-tp-props {
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--bms-line);
}

/* The property grid's labels: grey, one line, like ClickUp's */
.bms-tp-props .fi-fo-field-label-content,
.bms-tp-fields .fi-fo-field-label-content {
    color: var(--bms-muted);
    font-weight: 400;
    white-space: nowrap;
}

.bms-tp-props .fi-sc,
.bms-tp-props .fi-fo-field {
    row-gap: 0.4rem;
}

/* Inputs look flat until hovered, like ClickUp's cells */
.bms-tp-props .fi-input-wrp,
.bms-tp-fields .fi-input-wrp {
    border-color: transparent;
    box-shadow: none;
    background: transparent;
}

.bms-tp-props .fi-input-wrp:hover,
.bms-tp-fields .fi-input-wrp:hover,
.bms-tp-props .fi-input-wrp:focus-within,
.bms-tp-fields .fi-input-wrp:focus-within {
    border-color: var(--bms-line);
    background: var(--bms-surface);
}

.bms-tp-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bms-muted);
    font-size: 0.875rem;
    white-space: nowrap;
}

.bms-tp-section {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bms-tp-heading,
.bms-tp-heading-static {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 600;
    font-size: 0.9375rem;
}

.bms-tp-description {
    cursor: text;
    border-radius: 0.5rem;
    padding: 0.25rem;
    margin: -0.25rem;
}

.bms-tp-description:hover {
    background: var(--bms-hover);
}

.bms-tp-add {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--bms-muted);
    font-size: 0.875rem;
    align-self: flex-start;
}

.bms-tp-add:hover {
    color: var(--primary-600);
}

/* Fields: a table of name | value with a line between rows */
.bms-tp-fields {
    border-top: 1px solid var(--bms-line);
}

.bms-tp-fields > .fi-sc > *,
.bms-tp-secret {
    border-bottom: 1px solid var(--bms-line);
    padding: 0.15rem 0;
}

.bms-tp-fields .fi-sc {
    gap: 0;
}

.bms-tp-secret {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
    align-items: center;
    gap: 1rem;
    min-height: 2.5rem;
}

.bms-tp-secret-value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.75rem;
    padding-left: 0.75rem;
}

.bms-tp-secret-actions {
    display: inline-flex;
    gap: 0.75rem;
}

.bms-subtask-name {
    flex: 1;
    min-width: 0;
    text-align: left;
    font-size: 0.875rem;
    overflow-wrap: anywhere;
}

.bms-subtask-name:hover {
    color: var(--primary-600);
}

.bms-drop {
    display: block;
    padding: 0.9rem;
    border: 1px dashed var(--bms-line);
    border-radius: 0.6rem;
    text-align: center;
    font-size: 0.875rem;
    color: var(--bms-muted);
    cursor: pointer;
}

.bms-drop:hover,
.bms-drop-over {
    border-color: var(--primary-400);
    color: var(--primary-600);
    background: color-mix(in srgb, var(--primary-500) 6%, transparent);
}

/* Activity: its own column, the comment box pinned at the bottom */
.bms-tp-activity {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid var(--bms-line);
    background: var(--bms-hover);
}

@media (max-width: 1023px) {
    .bms-tp-activity {
        border-left: 0;
        border-top: 1px solid var(--bms-line);
        max-height: none;
    }
}

.bms-tp-activity-head {
    padding: 0.9rem 1rem;
    font-weight: 600;
    border-bottom: 1px solid var(--bms-line);
}

.bms-tp-feed {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.bms-tp-composer {
    padding: 0.75rem 1rem 1rem;
    border-top: 1px solid var(--bms-line);
    background: var(--bms-surface);
}

.bms-tp-composer-foot {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

/* The header bar spans both columns (task and activity), as in ClickUp:
   .bms-tp-main dissolves so its bar and its scroll area sit on the grid. */
.bms-tp {
    grid-template-rows: auto minmax(0, 1fr);
}

.bms-tp-main {
    display: contents;
}

.bms-tp-bar {
    grid-column: 1 / -1;
}

.bms-tp-scroll {
    grid-column: 1;
    min-height: 0;
}

.bms-tp-activity {
    grid-column: 2;
    grid-row: 2;
}

@media (max-width: 1023px) {
    .bms-tp {
        grid-template-rows: auto auto auto;
    }

    .bms-tp-activity {
        grid-column: 1;
        grid-row: 3;
    }
}

/* ---- property grid --------------------------------------------------- */

.bms-props {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.35rem 2.5rem;
}

@media (max-width: 767px) {
    .bms-props {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bms-prop {
    display: grid;
    grid-template-columns: 8.5rem minmax(0, 1fr);
    align-items: center;
    min-height: 2.25rem;
}

.bms-prop-value {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem;
    min-width: 0;
}

.bms-prop-btn {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    min-height: 2rem;
    padding: 0.15rem 0.45rem;
    margin-left: -0.45rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    text-align: left;
}

.bms-prop-btn:not(:disabled):hover,
.bms-date:hover {
    background: var(--bms-hover);
}

.bms-empty-value {
    color: var(--bms-muted);
}

.bms-person {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

/* Status: a coloured badge with a "next" arrow segment, then the ✓ */
.bms-status-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0.3rem 0.2rem 0.6rem;
    border-radius: 0.35rem;
    background: var(--status);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
}

.bms-status-btn-next {
    width: 0.9rem;
    height: 0.9rem;
    padding-left: 0.3rem;
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    box-sizing: content-box;
}

.bms-check-btn {
    border: 1px solid var(--bms-line);
    border-radius: 0.35rem;
}

/* Dates: Start → Due, each opening the browser's own picker */
.bms-date {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.bms-date-input {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

/* Priority badge (cards, rows, the task view) */
.bms-priority {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0 0.4rem;
    border-radius: 0.3rem;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.25rem;
    color: var(--flag);
    background: color-mix(in srgb, var(--flag) 12%, transparent);
    white-space: nowrap;
}

.bms-priority .bms-meta-icon {
    width: 0.8rem;
    height: 0.8rem;
}

/* Small menus (status, assignees, priority) */
.bms-menu-wrap {
    position: relative;
}

.bms-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    left: 0;
    z-index: 30;
    min-width: 13rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.3rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.6rem;
    background: var(--bms-surface);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.bms-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.8125rem;
    text-align: left;
}

.bms-menu-item:hover {
    background: var(--bms-hover);
}

.bms-menu-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-menu-search {
    width: 100%;
    margin-bottom: 0.25rem;
    padding: 0.35rem 0.5rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.4rem;
    font-size: 0.8125rem;
    background: transparent;
    color: inherit;
}

/* The comment box: smaller toolbar icons, attach and send in its foot */
.bms-tp-composer .fi-fo-rich-editor-tool {
    padding: 0.2rem;
    min-width: 0;
    height: auto;
}

.bms-tp-composer .fi-fo-rich-editor-tool svg {
    width: 0.95rem;
    height: 0.95rem;
}

.bms-tp-composer .fi-fo-rich-editor-toolbar {
    gap: 0.1rem;
    padding: 0.3rem 0.4rem;
}

.bms-tp-composer-foot {
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bms-comment-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.bms-file-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    max-width: 16rem;
    padding: 0.2rem 0.5rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    background: var(--bms-surface);
}

.bms-file-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-file-chip img {
    width: 1.5rem;
    height: 1.5rem;
    object-fit: cover;
    border-radius: 0.25rem;
}

a.bms-file-chip:hover {
    border-color: var(--primary-400);
}

/* Which list a card belongs to, on a space board */
.bms-card-list {
    font-size: 0.6875rem;
    color: var(--bms-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-tree-row {
    display: flex;
    align-items: center;
    border-radius: 0.5rem;
}

.bms-tree-row .bms-tree-item {
    flex: 1;
}

.bms-tree-twisty {
    display: inline-flex;
    padding: 0.5rem;
    border-radius: 0.5rem;
    color: var(--gray-400);
}

.bms-tree-twisty:hover {
    background: var(--gray-100);
}

.dark .bms-tree-twisty:hover {
    background: rgba(255, 255, 255, 0.05);
}

.bms-tree-twisty .fi-icon {
    width: 1rem;
    height: 1rem;
    transition: transform 0.1s;
}

/* ---- property row polish -------------------------------------------- */

.bms-prop {
    min-height: 2.5rem;
}

.bms-prop-value {
    min-height: 2rem;
}

.bms-status-btn {
    height: 1.625rem;
}

/* The tick: same height as the badge, a quiet grey square until hovered */
.bms-check-btn.fi-icon-btn {
    width: 1.625rem;
    height: 1.625rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.35rem;
    background: var(--bms-surface);
}

.bms-check-btn.fi-icon-btn svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* Things that only matter while pointing at the row (clear the dates) */
.bms-prop .bms-hover-only {
    visibility: hidden;
}

.bms-prop:hover .bms-hover-only {
    visibility: visible;
}

.bms-date .bms-meta-icon {
    color: var(--bms-muted);
}

.bms-date.bms-due-overdue .bms-meta-icon {
    color: inherit;
}

/* ---- comment box: send icon inside the editor, bottom right ---------- */

.bms-tp-composer form {
    position: relative;
}

.bms-tp-composer .fi-fo-rich-editor-content,
.bms-tp-composer .tiptap {
    padding-right: 2.75rem;
    min-height: 3.5rem;
}

.bms-send {
    position: absolute;
    right: 0.5rem;
    bottom: 0.5rem;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.45rem;
    background: var(--gray-900);
    color: #fff;
}

.dark .bms-send {
    background: #fff;
    color: var(--gray-900);
}

.bms-send:hover {
    background: var(--primary-600);
    color: #fff;
}

.bms-send:disabled {
    opacity: 0.5;
}

.bms-send .bms-meta-icon {
    width: 1rem;
    height: 1rem;
}

/* A field shown on cards (Project Name) */
.bms-card-field {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--bms-line);
    font-size: 0.8125rem;
    min-width: 0;
}

.bms-card-field span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-field-glyph {
    width: 1rem;
    text-align: center;
    font-family: Georgia, serif;
    font-weight: 600;
    color: var(--bms-muted);
}

/* ---- status badge, ClickUp-style: [ NAME | ▶ ] [ ✓ ] -------------------- */

.bms-status-group {
    display: inline-flex;
    align-items: stretch;
    height: 1.625rem;
    border-radius: 0.35rem;
    overflow: hidden;
    background: var(--status);
}

.bms-status-group .bms-status-btn {
    height: 100%;
    padding: 0 0.6rem;
    border-radius: 0;
    background: transparent;
}

.bms-status-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    background: color-mix(in srgb, var(--status) 78%, #000);
    color: #fff;
}

.bms-status-next:hover {
    background: color-mix(in srgb, var(--status) 60%, #000);
}

.bms-status-next-icon {
    width: 0.6rem;
    height: 0.6rem;
}

/* The tick: a soft grey square, the badge's height, green when done */
.bms-check-btn.fi-icon-btn {
    width: 1.625rem;
    height: 1.625rem;
    margin-left: 0.25rem;
    border: 0;
    border-radius: 0.35rem;
    background: var(--gray-100);
    color: var(--gray-500);
}

.dark .bms-check-btn.fi-icon-btn {
    background: var(--gray-800);
}

.bms-check-btn.fi-icon-btn:hover {
    background: var(--gray-200);
}

.bms-check-btn.fi-color-success {
    background: color-mix(in srgb, var(--success-500) 18%, transparent);
    color: var(--success-600);
}

/* Badge text and arrow centred on the same line (the button's line-height
   was pushing the capitals off centre). */
.bms-status-group .bms-status-btn,
.bms-status-next {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.bms-status-group .bms-status-btn {
    padding-top: 0.05rem;
}

/* Centre the CAPITALS, not the line box: trimmed to cap height and baseline,
   the letters sit in the middle like the arrow does. */
.bms-status-group .bms-status-btn {
    padding-top: 0;
    text-box: trim-both cap alphabetic;
}

.bms-status-pill {
    padding: 0.32rem 0.55rem;
    text-box: trim-both cap alphabetic;
}

/* A wider Activity column (owner, 2026-10-09): about a third of the view. */
.bms-tp {
    grid-template-columns: minmax(0, 1fr) clamp(26rem, 36%, 36rem);
}

@media (max-width: 1023px) {
    .bms-tp {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* ---- card chips (ClickUp): dates, priority, status, editable in place --- */

.bms-card-foot {
    flex-wrap: wrap;
    justify-content: flex-start;
}

.bms-chips {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.bms-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.5rem;
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.35rem;
    font-size: 0.75rem;
    color: var(--bms-muted);
    background: var(--bms-surface);
    cursor: pointer;
}

.bms-chip:not(:disabled):hover {
    border-color: var(--gray-300);
    background: var(--bms-hover);
}

.bms-chip:disabled {
    cursor: default;
}

/* A chip holding a priority badge needs no border of its own */
.bms-chip:has(.bms-priority) {
    padding: 0;
    border: 0;
}

.bms-chip-status {
    text-transform: uppercase;
    font-weight: 600;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    color: inherit;
}

.bms-chip-status .bms-dot {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
}

.bms-chip .bms-due {
    font-size: 0.75rem;
}

/* Popups: fixed to the window so the board's scroll box cannot clip them */
.bms-pop {
    position: fixed;
    z-index: 50;
    border: 1px solid var(--bms-line);
    border-radius: 0.7rem;
    background: var(--bms-surface, #fff);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.16);
    cursor: default;
    color: var(--gray-950);
}

.dark .bms-pop {
    background: var(--gray-900);
    color: var(--gray-100);
}

.bms-menu-pop {
    min-width: 13rem;
    max-height: 18rem;
    overflow-y: auto;
    padding: 0.3rem;
}

.bms-datepop {
    width: min(470px, calc(100vw - 16px));
}

.bms-datepop-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    padding: 0.6rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-datepop-tab {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem;
    border: 1px solid transparent;
    border-radius: 0.5rem;
    background: var(--bms-hover);
    font-size: 0.8125rem;
    color: var(--bms-muted);
}

.bms-datepop-tab.bms-on {
    border-color: var(--gray-900);
    background: var(--bms-surface);
    color: inherit;
}

.dark .bms-datepop-tab.bms-on {
    border-color: var(--gray-200);
}

.bms-datepop-x {
    margin-left: auto;
    padding: 0 0.25rem;
    color: var(--bms-muted);
}

.bms-datepop-body {
    display: grid;
    grid-template-columns: 11rem minmax(0, 1fr);
}

.bms-datepop-presets {
    padding: 0.4rem;
    border-right: 1px solid var(--bms-line);
}

.bms-datepop-cal {
    padding: 0.6rem;
}

.bms-datepop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
}

.bms-datepop-head span {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

.bms-datepop-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.1rem;
    text-align: center;
}

.bms-datepop-dow {
    font-size: 0.6875rem;
    color: var(--bms-muted);
    padding: 0.2rem 0;
}

.bms-datepop-day {
    aspect-ratio: 1;
    border-radius: 999px;
    font-size: 0.8125rem;
}

.bms-datepop-day:hover {
    background: var(--bms-hover);
}

.bms-datepop-day.bms-out {
    color: var(--gray-400);
}

.bms-datepop-day.bms-span {
    background: color-mix(in srgb, var(--primary-500) 10%, transparent);
    border-radius: 0;
}

.bms-datepop-day.bms-today {
    color: var(--primary-600);
    font-weight: 700;
}

.bms-datepop-day.bms-picked {
    background: var(--primary-600);
    color: #fff;
}

@media (max-width: 520px) {
    .bms-datepop-body {
        grid-template-columns: minmax(0, 1fr);
    }

    .bms-datepop-presets {
        display: none;
    }
}

/* ---- board cards: hover tools, subtasks dropdown, inline subtask form ---- */

.bms-card-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bms-card {
    position: relative;
}

.bms-card-done .bms-card-name {
    color: var(--bms-muted);
}

/* ✓ ⊕ ✎ ⋯ in the top-right corner, on hover (ClickUp) */
.bms-card-tools {
    position: absolute;
    top: 0.35rem;
    right: 0.35rem;
    display: none;
    align-items: center;
    gap: 0.1rem;
    padding: 0.1rem 0.2rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.45rem;
    background: var(--bms-surface);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    cursor: default;
}

.bms-card:hover > .bms-card-tools,
.bms-card-tools:has(.bms-pop-open) {
    display: inline-flex;
}

@media (hover: none) {
    .bms-card-tools {
        display: inline-flex;
        position: static;
        align-self: flex-end;
    }
}

.bms-card-rename {
    width: 100%;
    padding: 0.2rem 0.35rem;
    border: 1px solid var(--primary-400);
    border-radius: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
    background: var(--bms-surface);
    color: inherit;
}

.bms-menu-danger {
    color: var(--danger-600);
}

/* "▾ 7 subtasks": a grey bar along the card's foot */
.bms-subs-toggle {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: calc(100% + 1.4rem);
    margin: 0.1rem -0.7rem -0.6rem;
    padding: 0.35rem 0.7rem;
    border-top: 1px solid var(--bms-line);
    border-radius: 0 0 0.5rem 0.5rem;
    background: var(--bms-hover);
    font-size: 0.75rem;
    color: var(--bms-muted);
    text-align: left;
}

.bms-subs-toggle:hover {
    color: inherit;
}

.bms-subs-toggle .bms-count {
    margin-left: auto;
}

/* The subtasks hang under their parent, indented */
.bms-card-subs {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-left: 0.9rem;
}

.bms-card-sub {
    cursor: pointer;
}

/* "Subtask name... [Save ↵]" then assignee / dates / priority rows */
.bms-sub-form {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    margin-left: 0.9rem;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--gray-900);
    border-radius: 0.6rem;
    background: var(--bms-surface);
}

.dark .bms-sub-form {
    border-color: var(--gray-300);
}

.bms-sub-form-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
}

.bms-sub-form-head input {
    flex: 1;
    min-width: 0;
    border: 0;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    background: transparent;
    color: inherit;
    box-shadow: none;
    outline: none;
}

.bms-sub-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
    color: var(--bms-muted);
}


.bms-save {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
    background: var(--gray-900);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.bms-save:disabled {
    background: var(--gray-300);
}

.dark .bms-save {
    background: #fff;
    color: var(--gray-900);
}

.bms-btn-ghost {
    padding: 0.25rem 0.6rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    background: var(--bms-surface);
}

/* ---- the task view's "Add subtask" row --------------------------------- */

.bms-subadd {
    border-top: 1px solid var(--bms-line);
}

.bms-subadd-start {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    font-size: 0.875rem;
    color: var(--bms-muted);
    text-align: left;
}

.bms-subadd-start:hover {
    color: inherit;
    background: var(--bms-hover);
}

.bms-subadd-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.75rem;
}

.bms-subadd-circle {
    width: 0.95rem;
    height: 0.95rem;
    flex-shrink: 0;
    border: 1.5px dashed var(--gray-400);
    border-radius: 999px;
}

.bms-subadd-row > input[type='text'] {
    flex: 1;
    min-width: 6rem;
    border: 0;
    padding: 0.2rem 0;
    font-size: 0.875rem;
    background: transparent;
    color: inherit;
    box-shadow: none;
    outline: none;
}

.bms-subadd-tools {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
}

.bms-subadd-tool {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.35rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.4rem;
    font-size: 0.75rem;
    color: var(--bms-muted);
    cursor: pointer;
}

.bms-subadd-tool:hover,
.bms-subadd-tool.bms-on {
    color: var(--primary-600);
    border-color: var(--primary-300);
}

@media (max-width: 767px) {
    .bms-subadd-row {
        flex-wrap: wrap;
    }
}

.bms-sub-row {
    position: relative;
    cursor: pointer;
}

.bms-sub-row select {
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

/* ---- ClickUp toolbar: Sort, Filter, Closed, Assignee, me, search, Add Task ---- */

.bms-tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
}

.bms-pill,
.bms-icon-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 2rem;
    padding: 0 0.65rem;
    border: 1px solid var(--bms-line);
    border-radius: 999px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-700);
    white-space: nowrap;
}

.bms-icon-pill {
    padding: 0;
    width: 2rem;
    justify-content: center;
}

.dark .bms-pill,
.dark .bms-icon-pill {
    color: var(--gray-200);
}

.bms-pill:hover,
.bms-icon-pill:hover {
    background: var(--bms-hover);
}

.bms-pill-on {
    border-color: color-mix(in srgb, var(--primary-500) 45%, transparent);
    background: color-mix(in srgb, var(--primary-500) 10%, transparent);
    color: var(--primary-700);
}

.dark .bms-pill-on {
    color: var(--primary-300);
}

.bms-pill-count {
    min-width: 1.1rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.6875rem;
    line-height: 1.1rem;
    text-align: center;
}

.bms-me {
    display: inline-flex;
    border-radius: 999px;
    padding: 2px;
    border: 2px solid transparent;
}

.bms-me-on {
    border-color: var(--primary-500);
}

.bms-search-wrap .bms-search {
    height: 2rem;
    border-radius: 999px;
}

.bms-add-task {
    display: inline-flex;
    align-items: center;
    height: 2rem;
    padding: 0 0.9rem;
    border-radius: 0.5rem;
    background: var(--gray-900);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
}

.bms-add-task:hover {
    background: var(--gray-700);
}

.bms-add-task:disabled {
    background: var(--gray-300);
    cursor: not-allowed;
}

.dark .bms-add-task {
    background: #fff;
    color: var(--gray-900);
}

.bms-pop-title {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--gray-500);
    padding: 0.3rem 0.5rem;
}

.bms-pop-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bms-filter-pop {
    width: min(24rem, calc(100vw - 16px));
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.bms-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0 0.5rem;
}

.bms-filter-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.bms-filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.55rem;
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: nowrap;
}

.bms-filter-chip:hover {
    background: rgba(127, 127, 127, 0.08);
}

.bms-filter-chip.bms-on {
    border-color: var(--primary-500);
    background: color-mix(in srgb, var(--primary-500) 12%, transparent);
    color: var(--primary-700);
}

.dark .bms-filter-chip.bms-on {
    color: var(--primary-300);
}

/* Teleported to <body>, outside .bms-page: no --bms-* variables there */
.bms-drawer-wrap {
    position: fixed;
    inset: 0;
    z-index: 45;
}

.bms-drawer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.2);
}

.bms-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 100vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: var(--gray-950);
    box-shadow: -12px 0 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s ease;
}

.bms-drawer-in {
    transform: translateX(100%);
}

.dark .bms-drawer {
    background: var(--gray-900);
    color: var(--gray-100);
}

.bms-drawer-head,
.bms-drawer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-drawer-foot {
    border-bottom: 0;
    border-top: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-drawer-search {
    margin: 0.75rem 1rem 0.25rem;
    border: 1px solid rgba(127, 127, 127, 0.25);
    background: transparent;
}

.bms-drawer-search input {
    width: 100%;
    max-width: none;
}

.bms-drawer-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.25rem 0.5rem;
}

.bms-drawer-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.45rem 0.5rem;
    border-radius: 0.4rem;
    font-size: 0.875rem;
    cursor: pointer;
}

.bms-drawer-row:hover {
    background: rgba(127, 127, 127, 0.08);
}

.bms-drawer-row .bms-count {
    margin-left: 0.3rem;
}

/* The Add Task popup */
.bms-create {
    align-items: flex-start;
    padding-top: 12vh;
}

.bms-create-box {
    position: relative;
    width: min(40rem, 100%);
    display: flex;
    flex-direction: column;
    border-radius: 0.875rem;
    background: #fff;
    color: var(--gray-950);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
}

.dark .bms-create-box {
    background: var(--gray-900);
    color: var(--gray-100);
}

.bms-create-head,
.bms-create-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
}

.bms-create-head {
    border-bottom: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-create-foot {
    border-top: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-create-body {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 1rem;
}

.bms-create-where,
.bms-create-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.bms-create-chip {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 1.9rem;
    padding: 0 0.6rem;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 0.45rem;
    font-size: 0.8125rem;
    white-space: nowrap;
    cursor: pointer;
}

.bms-create-name {
    border: 0;
    background: transparent;
    padding: 0.25rem 0;
    font-size: 1.35rem;
    font-weight: 600;
    outline: none;
    box-shadow: none;
    color: inherit;
}

.bms-create-desc {
    border: 0;
    background: transparent;
    padding: 0;
    font-size: 0.875rem;
    resize: vertical;
    outline: none;
    box-shadow: none;
    color: inherit;
}

@media (max-width: 767px) {
    .bms-create {
        padding: 0.5rem;
    }
}

/* Dragging the board's empty space scrolls it sideways */
.bms-board {
    cursor: default;
}

.bms-panning,
.bms-panning * {
    cursor: grabbing !important;
    user-select: none;
}

/* x-bms.pick / x-bms.date-pick: styled dropdowns in place of <select> */
.bms-pick-caret {
    width: 0.9rem;
    height: 0.9rem;
    opacity: 0.6;
}

.bms-pick-label {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 14rem;
}

button.bms-sub-row {
    width: 100%;
    text-align: left;
}

button.bms-sub-row:hover {
    color: var(--gray-900);
}

.dark button.bms-sub-row:hover {
    color: #fff;
}

button.bms-sub-row .bms-pick-caret {
    display: none;
}

.bms-dot-btn {
    display: inline-flex;
    padding: 0.15rem;
    border-radius: 0.3rem;
    cursor: pointer;
}

.bms-dot-btn:hover {
    background: var(--bms-hover);
}

.bms-subadd-tools .bms-chip-wrap {
    display: inline-flex;
}

.bms-subadd-tools .bms-on > .bms-subadd-tool {
    border-color: var(--primary-300);
    color: var(--primary-600);
}

button.bms-date:disabled {
    cursor: default;
}

/* Filament centres its tab bars; ours (and the Spaces screen's) sit on the left */
.fi-tabs:not(.fi-contained):not(.fi-vertical) {
    margin-inline: 0;
}

/* Sidebar: My work / Dashboard / Inbox, then the Spaces tree, then Reports and
   Administration. The tree is a render hook after the menu, so the menu's
   groups are lifted into the nav's own column and ordered around it. */
.fi-sidebar-nav > .fi-sidebar-nav-groups {
    display: contents;
}

.fi-sidebar-nav > .fi-sidebar-nav-groups > .fi-sidebar-group {
    margin-inline: -0.5rem;
    order: 2;
}

.fi-sidebar-nav > .fi-sidebar-nav-groups > .fi-sidebar-group:first-child {
    order: 0;
}

.fi-sidebar-nav > .bms-tree {
    order: 1;
}

/* ---- Dashboard and Inbox ------------------------------------------- */

.bms-dash {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 1023px) {
    .bms-dash {
        grid-template-columns: minmax(0, 1fr);
    }
}

.bms-dash-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0.5rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
    background: var(--bms-surface);
}

.bms-dash-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem 0.6rem;
    font-size: 0.875rem;
}

.bms-dash-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.45rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
}

.bms-dash-row:hover {
    background: var(--bms-hover);
}

.bms-dash-row .bms-menu-text a:hover {
    text-decoration: underline;
}

.bms-dash-row .bms-menu-text .bms-count {
    margin-left: 0.4rem;
}

.bms-dash-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    white-space: nowrap;
}

.bms-dash-bar {
    flex: 1;
    height: 0.4rem;
    border-radius: 999px;
    background: var(--bms-hover);
    overflow: hidden;
}

.bms-dash-bar > span {
    display: block;
    height: 100%;
    border-radius: 999px;
}


.bms-tree-top {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.bms-tree-title a {
    display: inline-flex;
}

/* The "+" on a sidebar space or folder: shown on hover, as in ClickUp */
.bms-tree-add {
    display: inline-flex;
}

.bms-tree-row:hover .bms-tree-add,
.bms-tree-add:has(.bms-pop-open) {
    visibility: visible;
}

@media (hover: none) {
    .bms-tree-add {
        visibility: visible;
    }
}

.bms-create-menu {
    min-width: 16rem;
}

.bms-create-menu .bms-menu-item {
    align-items: flex-start;
    padding: 0.5rem;
}

.bms-create-menu .bms-menu-text {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    font-size: 0.875rem;
}

.bms-create-menu .bms-menu-text small {
    font-weight: 400;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bms-create-head > span {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.bms-create-head strong {
    font-size: 1.05rem;
}

.bms-create-note {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.bms-create-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.bms-required {
    color: var(--danger-600);
}

.bms-create-input {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 400;
    color: inherit;
}

.bms-create-input:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary-500) 20%, transparent);
}

.bms-create-field .bms-chip-wrap {
    display: block;
}

.bms-create-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-align: left;
}

.bms-create-select .bms-pick-label {
    flex: 1;
    max-width: none;
}

.bms-create-error {
    font-size: 0.8125rem;
    font-weight: 400;
    color: var(--danger-600);
}

/* The styled pickers' search box: no browser focus ring */
.bms-menu-search:focus {
    outline: none;
    border-color: var(--primary-500);
}

/* An open sidebar on a wide screen does not move, but Filament's
   translate-x-0 still makes it the frame for fixed popups (they landed 4rem
   low). No translate, so the sidebar's popups place like everyone else's. */
@media (min-width: 1024px) {
    .fi-sidebar.fi-sidebar-open {
        translate: none;
    }
}

/* ---- Inbox: ClickUp's tabs, day groups and rows -------------------- */

.bms-inbox-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-bottom: 1px solid var(--bms-line);
}

.bms-inbox-tab {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-500);
    text-align: left;
    min-width: 0;
}

.bms-inbox-tab + .bms-inbox-tab {
    border-left: 1px solid var(--bms-line);
}

.bms-inbox-tab > span {
    display: flex;
    flex-direction: column;
    min-width: 0;
    white-space: nowrap;
}

.bms-inbox-tab small {
    font-size: 0.75rem;
    font-weight: 400;
    color: var(--gray-500);
}

.bms-inbox-tab:hover {
    background: var(--bms-hover);
}

.bms-inbox-tab.bms-on {
    color: var(--gray-950);
    border-bottom-color: var(--gray-950);
}

.dark .bms-inbox-tab.bms-on {
    color: #fff;
    border-bottom-color: #fff;
}

.bms-inbox-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bms-inbox-bar-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.bms-inbox-day {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bms-inbox-day-label {
    padding: 0 0.6rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.bms-inbox {
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
    background: var(--bms-surface);
    overflow: hidden;
}

.bms-inbox-row {
    display: grid;
    grid-template-columns: minmax(8rem, 16rem) 2rem minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.35rem 0.75rem;
    cursor: pointer;
}

.bms-inbox-row + .bms-inbox-row {
    border-top: 1px solid var(--bms-line);
}

.bms-inbox-row:hover {
    background: var(--bms-hover);
}

.bms-inbox-task {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--bms-muted);
}

.bms-inbox-unread .bms-inbox-task {
    color: inherit;
    font-weight: 600;
}

.bms-inbox-who {
    display: inline-flex;
    justify-content: center;
    color: var(--gray-400);
}

.bms-inbox-main {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    font-size: 0.875rem;
}

.bms-inbox-title {
    flex: none;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bms-muted);
}

.bms-inbox-unread .bms-inbox-title {
    color: inherit;
    font-weight: 500;
}

.bms-inbox-body {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--bms-muted);
}

.bms-inbox-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 5rem;
}

.bms-inbox-time {
    font-size: 0.8125rem;
    color: var(--bms-muted);
    white-space: nowrap;
}

.bms-inbox-tools {
    display: none;
    align-items: center;
    gap: 0.25rem;
}

.bms-inbox-row:hover .bms-inbox-time,
.bms-inbox-row:has(.bms-pop-open) .bms-inbox-time {
    display: none;
}

.bms-inbox-row:hover .bms-inbox-tools,
.bms-inbox-row:has(.bms-pop-open) .bms-inbox-tools {
    display: flex;
}

.bms-inbox-clear {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    height: 1.9rem;
    padding: 0 0.7rem;
    border-radius: 0.45rem;
    background: var(--gray-900);
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 600;
}

.dark .bms-inbox-clear {
    background: #fff;
    color: var(--gray-900);
}

@media (max-width: 767px) {
    .bms-inbox-tabs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .bms-inbox-row {
        grid-template-columns: 2rem minmax(0, 1fr) auto;
    }

    .bms-inbox-task {
        grid-column: 1 / -1;
    }

    .bms-inbox-tools {
        display: flex;
    }

    .bms-inbox-time {
        display: none;
    }
}

/* A small on/off switch for menu settings */
.bms-switch {
    position: relative;
    flex: none;
    width: 2rem;
    height: 1.1rem;
    border-radius: 999px;
    background: var(--gray-300);
    transition: background 0.15s;
}

.bms-switch::after {
    content: '';
    position: absolute;
    top: 0.15rem;
    left: 0.15rem;
    width: 0.8rem;
    height: 0.8rem;
    border-radius: 999px;
    background: #fff;
    transition: transform 0.15s;
}

.bms-switch.bms-on {
    background: var(--primary-600);
}

.bms-switch.bms-on::after {
    transform: translateX(0.9rem);
}

/* My tasks inside the Dashboard card: group headings the card's size, the
   tick a fixed square, the priority badge at the row's end */
.bms-dash-card .bms-mywork-group {
    margin-top: 0.5rem;
}

.bms-dash-card .bms-group-head strong {
    font-size: 0.875rem;
}

.bms-mywork-row > :first-child {
    justify-self: center;
}

.bms-mywork-row > :last-child {
    justify-self: end;
}

/* ---- Chat ------------------------------------------------------------ */

.bms-chat {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    height: calc(100dvh - 12rem);
    min-height: 28rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.75rem;
    background: var(--bms-surface);
    overflow: hidden;
}

.bms-chat-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-right: 1px solid var(--bms-line);
}

.bms-chat-side-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-chat-side-head .bms-search {
    flex: 1;
    min-width: 0;
}

.bms-chat-side-head .bms-search input {
    width: 100%;
}

.bms-chat-side-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.4rem;
}

.bms-chat-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.6rem 0.5rem 0.3rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-500);
}

.bms-chat-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-700);
    text-align: left;
}

.dark .bms-chat-item {
    color: var(--gray-200);
}

.bms-chat-item > .fi-icon {
    color: var(--gray-400);
}

.bms-chat-item:hover {
    background: var(--bms-hover);
}

.bms-chat-item.bms-on {
    background: var(--gray-100);
    color: var(--primary-700);
}

.dark .bms-chat-item.bms-on {
    background: rgba(255, 255, 255, 0.06);
    color: var(--primary-400);
}

.bms-chat-unread {
    font-weight: 600;
    color: var(--gray-950);
}

.bms-chat-add {
    color: var(--gray-500);
}

.bms-chat-badge {
    min-width: 1.2rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.2rem;
    text-align: center;
}

.bms-chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.bms-chat-head {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-chat-head .bms-count {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-chat-open {
    margin-left: auto;
}

.bms-chat-feed {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 1rem 1rem;
}

.bms-chat-day {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-500);
}

.bms-chat-day::before,
.bms-chat-day::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bms-line);
}

.bms-chat-msg {
    position: relative;
    display: grid;
    grid-template-columns: 2rem minmax(0, 1fr) auto;
    gap: 0.6rem;
    padding: 0.35rem 0.5rem;
    border-radius: 0.5rem;
}

.bms-chat-joined {
    padding-top: 0.05rem;
}

.bms-chat-msg:hover {
    background: var(--bms-hover);
}

.bms-chat-msg-head {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.875rem;
}

.bms-chat-text {
    font-size: 0.875rem;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.bms-chat-text a {
    color: var(--primary-600);
    text-decoration: underline;
}

.bms-chat-del {
    visibility: hidden;
}

.bms-chat-msg:hover .bms-chat-del {
    visibility: visible;
}

.bms-chat-start,
.bms-chat-empty {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 2rem 0.5rem 0.5rem;
}

.bms-chat-empty {
    flex: 1;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bms-chat-empty-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--gray-400);
}

.bms-chat-composer {
    position: relative;
    margin: 0 1rem 1rem;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 0.75rem;
}

.bms-chat-composer:focus-within {
    border-color: var(--primary-500);
}

.bms-chat-composer textarea {
    display: block;
    width: 100%;
    min-height: 2.75rem;
    max-height: 200px;
    padding: 0.7rem 3rem 0.7rem 0.9rem;
    border: 0;
    background: transparent;
    font-size: 0.875rem;
    resize: none;
    outline: none;
    box-shadow: none;
    color: inherit;
}

.bms-chat-composer .bms-send {
    bottom: 0.45rem;
    right: 0.5rem;
}

.bms-chat-readonly {
    margin: 0 1rem 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    background: var(--bms-hover);
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.bms-create-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    text-align: left;
    font-size: 0.875rem;
}

.bms-create-toggle > span:first-child {
    display: flex;
    flex-direction: column;
}

.bms-chat-people-pick {
    max-height: 14rem;
    overflow-y: auto;
}

@media (max-width: 767px) {
    .bms-chat {
        grid-template-columns: minmax(0, 1fr);
        height: auto;
    }

    .bms-chat-side {
        max-height: 16rem;
        border-right: 0;
        border-bottom: 1px solid var(--bms-line);
    }

    .bms-chat-main {
        min-height: 60dvh;
    }
}

/* ---- To-do -------------------------------------------------------- */

.bms-todos {
    padding: 0.25rem 0.5rem 0.5rem;
}

.bms-todo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--bms-line);
}

.bms-todo:hover {
    background: var(--bms-hover);
}

.bms-todo-check {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--gray-300);
    border-radius: 999px;
    color: #fff;
}

.bms-todo-check:hover {
    border-color: var(--success-500);
}

.bms-todo-check.bms-on {
    border-color: var(--success-500);
    background: var(--success-500);
}

.bms-todo-check .fi-icon {
    width: 0.8rem;
    height: 0.8rem;
}

.bms-todo-title {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    cursor: text;
    overflow-wrap: anywhere;
}

.bms-todo-is-done .bms-todo-title {
    color: var(--bms-muted);
    text-decoration: line-through;
}

.bms-todo .bms-card-rename {
    flex: 1;
}

.bms-todo-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex: none;
}

.bms-todo .bms-hover-only {
    visibility: hidden;
}

.bms-todo:hover .bms-hover-only {
    visibility: visible;
}

.bms-remind-chip.bms-on {
    color: var(--warning-600);
    border-color: color-mix(in srgb, var(--warning-500) 45%, transparent);
    background: color-mix(in srgb, var(--warning-500) 10%, transparent);
}

.bms-remind-pop {
    width: 18rem;
    padding: 0.3rem;
}

.bms-remind-custom {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem;
    border-top: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-remind-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 0.25rem 0.5rem 0.4rem;
}

.bms-todo-done {
    margin-top: 0.75rem;
}

.bms-remind-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    font-weight: 400;
}

.bms-remind-chips .bms-filter-chip {
    padding: 0.35rem 0.7rem;
    font-size: 0.8125rem;
}

.bms-remind-custom.bms-remind-inline {
    align-items: center;
    padding: 0.25rem 0 0;
    border-top: 0;
    font-weight: 400;
}

/* ---- Chat: files, voice notes, reactions, tools, composer ------------ */

.bms-chat-files {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.35rem;
}

.bms-chat-image img {
    display: block;
    max-width: 18rem;
    max-height: 14rem;
    border-radius: 0.5rem;
    border: 1px solid var(--bms-line);
    object-fit: cover;
}

.bms-chat-voice,
.bms-voice {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0.5rem 0.25rem 0.6rem;
    border: 1px solid var(--bms-line, rgba(127, 127, 127, 0.25));
    border-radius: 999px;
    color: var(--primary-600);
}

.bms-chat-voice audio,
.bms-voice audio {
    height: 2rem;
    max-width: 16rem;
}

.bms-chat-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.bms-chat-reaction {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.05rem 0.45rem;
    border: 1px solid var(--bms-line);
    border-radius: 999px;
    font-size: 0.8125rem;
}

.bms-chat-reaction span {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bms-chat-reaction.bms-on {
    border-color: var(--primary-400);
    background: color-mix(in srgb, var(--primary-500) 10%, transparent);
}

.bms-chat-mention {
    padding: 0 0.15rem;
    border-radius: 0.25rem;
    background: color-mix(in srgb, var(--primary-500) 12%, transparent);
    color: var(--primary-700);
    font-weight: 500;
}

.dark .bms-chat-mention {
    color: var(--primary-300);
}

.bms-chat-tools {
    display: flex;
    align-items: flex-start;
    gap: 0.1rem;
    visibility: hidden;
}

.bms-chat-msg:hover .bms-chat-tools,
.bms-chat-tools:has(.bms-pop-open) {
    visibility: visible;
}

.bms-chat-emoji-pop {
    display: flex;
    gap: 0.15rem;
    width: max-content;
    max-width: calc(100vw - 16px);
    flex-wrap: wrap;
    padding: 0.3rem;
}

.bms-chat-emoji-pop button {
    width: 2rem;
    height: 2rem;
    border-radius: 0.4rem;
    font-size: 1.1rem;
}

.bms-chat-emoji-pop button:hover {
    background: rgba(127, 127, 127, 0.12);
}

.bms-chat-edit textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--primary-500);
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.875rem;
    resize: vertical;
    color: inherit;
    outline: none;
    box-shadow: none;
}

.bms-chat-edit-foot {
    display: flex;
    justify-content: flex-end;
    gap: 0.4rem;
    margin-top: 0.3rem;
}

.bms-chat-pending {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 1rem 0.4rem;
}

.bms-chat-error {
    margin: 0 1rem 0.4rem;
    font-size: 0.8125rem;
    color: var(--danger-600);
}

.bms-chat-composer-left .bms-chat-error {
    margin: 0;
}

.bms-chat-composer textarea {
    padding-bottom: 0.25rem;
}

.bms-chat-composer-tools {
    display: flex;
    align-items: center;
    min-height: 2.25rem;
    padding: 0 3rem 0.3rem 0.4rem;
}

.bms-chat-composer-left,
.bms-chat-recording {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.bms-chat-recording {
    gap: 0.6rem;
    font-size: 0.8125rem;
    color: var(--danger-600);
}

.bms-rec-dot {
    width: 0.6rem;
    height: 0.6rem;
    border-radius: 999px;
    background: var(--danger-600);
    animation: bms-blink 1s infinite;
}

@keyframes bms-blink {
    50% {
        opacity: 0.25;
    }
}

.bms-mention-pop {
    bottom: calc(100% + 0.4rem);
    left: 0.5rem;
    position: absolute;
    min-width: 14rem;
}

.bms-mention-pop .bms-menu-item.bms-on {
    background: rgba(127, 127, 127, 0.12);
}

.bms-chat-main.bms-drop-over {
    outline: 2px dashed var(--primary-500);
    outline-offset: -6px;
}

/* The comment box's mic, beside Send in the editor's bottom-right corner */
.bms-comment-voice {
    position: absolute;
    right: 2.85rem;
    bottom: 0.5rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0 0.25rem;
    border-radius: 0.45rem;
    background: var(--bms-surface, #fff);
}

.dark .bms-comment-voice {
    background: var(--gray-900);
}

.bms-comment-voice .bms-chat-error {
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.3rem);
    margin: 0;
    white-space: nowrap;
}

/* The task's properties go to one column when the task view itself is
   narrow (the standalone task page beside the sidebar), not only on phones. */
.bms-tp-scroll {
    container-type: inline-size;
}

@container (max-width: 700px) {
    .bms-props {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Task view: Tags across the full row, chips with a remove cross */
.bms-prop-wide {
    grid-column: 1 / -1;
}

.bms-tags-value {
    flex-wrap: wrap;
    gap: 0.3rem;
}

.bms-tags-value > .bms-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5rem;
    padding: 0 0.5rem;
    border-radius: 999px;
}

.bms-tags-value > .bms-tag button {
    font-size: 0.875rem;
    line-height: 1;
    opacity: 0.6;
}

.bms-tags-value > .bms-tag button:hover {
    opacity: 1;
}

.bms-tags-menu {
    min-width: 15rem;
}

.bms-tags-menu .bms-tag {
    font-size: 0.75rem;
    line-height: 1.4rem;
    border-radius: 999px;
    padding: 0 0.5rem;
}

/* ---- Voice note player (Slack-like) ------------------------------- */

.bms-vp {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.75rem 0.4rem 0.45rem;
    border: 1px solid rgba(127, 127, 127, 0.28);
    border-radius: 0.85rem;
    background: var(--bms-surface, #fff);
    max-width: 100%;
}

.dark .bms-vp {
    background: var(--gray-900);
}

.bms-vp-play {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
}

.bms-vp-play:hover {
    background: var(--primary-700);
}

.bms-vp-icon {
    width: 1.1rem;
    height: 1.1rem;
}

.bms-vp-icon:first-child {
    margin-left: 2px;
}

.bms-vp-wave {
    display: flex;
    align-items: center;
    gap: 2px;
    width: 9.5rem;
    height: 1.9rem;
    cursor: pointer;
}

.bms-vp-wave > span {
    flex: 1;
    min-height: 3px;
    border-radius: 2px;
    background: var(--gray-300);
    transition: background 0.1s;
}

.dark .bms-vp-wave > span {
    background: var(--gray-600);
}

.bms-vp-wave > span.bms-on {
    background: var(--primary-600);
}

.bms-vp-time {
    min-width: 2.2rem;
    font-size: 0.8125rem;
    font-variant-numeric: tabular-nums;
    color: var(--gray-600);
}

.bms-vp-speed {
    padding: 0.1rem 0.4rem;
    border-radius: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
}

.bms-vp-speed:hover {
    background: rgba(127, 127, 127, 0.12);
}

.bms-vp-remove {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    background: var(--gray-700);
    color: #fff;
}

.bms-vp-remove .fi-icon {
    width: 0.85rem;
    height: 0.85rem;
}

.bms-chat-pending {
    padding-top: 0.5rem;
}

/* Chat replies: the quote on a reply, and the bar above the box */
.bms-chat-quote {
    display: flex;
    flex-direction: column;
    max-width: 32rem;
    margin: 0.15rem 0 0.3rem;
    padding: 0.25rem 0.6rem;
    border-left: 3px solid var(--primary-500);
    border-radius: 0.3rem;
    background: rgba(127, 127, 127, 0.08);
    font-size: 0.8125rem;
    text-align: left;
    color: var(--gray-600);
}

.dark .bms-chat-quote {
    color: var(--gray-300);
}

.bms-chat-quote strong {
    color: var(--gray-900);
    font-size: 0.75rem;
}

.dark .bms-chat-quote strong {
    color: #fff;
}

.bms-chat-quote span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

button.bms-chat-quote:hover {
    background: rgba(127, 127, 127, 0.14);
}

.bms-chat-quote-gone {
    font-style: italic;
}

.bms-chat-flash {
    animation: bms-flash 1.5s ease-out;
}

@keyframes bms-flash {
    0%, 30% {
        background: color-mix(in srgb, var(--primary-500) 18%, transparent);
    }
}

.bms-chat-replybar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0 1rem 0.4rem;
    padding: 0.35rem 0.4rem 0.35rem 0.7rem;
    border-left: 3px solid var(--primary-500);
    border-radius: 0.4rem;
    background: rgba(127, 127, 127, 0.08);
    font-size: 0.8125rem;
    color: var(--gray-600);
}

/* Chat: select, forward, search */
.bms-chat-head-tools {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
}

.bms-chat-insearch input {
    width: 14rem;
}

.bms-chat-check {
    position: absolute;
    left: -0.15rem;
    top: 0.55rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.2rem;
    height: 1.2rem;
    border: 2px solid var(--gray-300);
    border-radius: 999px;
    color: transparent;
    background: var(--bms-surface);
}

.bms-chat-check.bms-on {
    border-color: var(--primary-600);
    background: var(--primary-600);
    color: #fff;
}

.bms-chat-check .fi-icon {
    width: 0.8rem;
    height: 0.8rem;
}

.bms-selecting .bms-chat-msg {
    padding-left: 1.6rem;
    cursor: pointer;
}

.bms-chat-selected {
    background: color-mix(in srgb, var(--primary-500) 8%, transparent) !important;
}

.bms-chat-selbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0 1rem 0.5rem;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--bms-line);
    border-radius: 0.6rem;
    font-size: 0.875rem;
}

.bms-chat-selbar-tools {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin-left: auto;
}

.bms-chat-selbar .bms-pill:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.bms-chat-forwarded {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    font-style: italic;
    color: var(--gray-500);
}

.bms-forward-list {
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid rgba(127, 127, 127, 0.2);
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.bms-forward-list .bms-menu-item.bms-on {
    background: color-mix(in srgb, var(--primary-500) 10%, transparent);
}

.bms-chat-found {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    width: 100%;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--bms-line);
    text-align: left;
}

.bms-chat-found:hover {
    background: var(--bms-hover);
}

.bms-chat-found-where {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bms-chat-found-text {
    font-size: 0.875rem;
}

.bms-chat-found mark {
    padding: 0 0.1rem;
    border-radius: 0.2rem;
    background: color-mix(in srgb, var(--warning-400) 45%, transparent);
    color: inherit;
}

/* ---- File viewer -------------------------------------------------- */

.bms-fv {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 22rem;
    background: rgba(17, 17, 20, 0.94);
    color: #f4f4f5;
}

.bms-fv-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.bms-fv-head {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.bms-fv-title {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
}

.bms-fv-title strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bms-fv-title span {
    font-size: 0.75rem;
    color: #a1a1aa;
}

.bms-fv-tools {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.bms-fv-btn,
.bms-fv-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    height: 2.1rem;
    padding: 0 0.6rem;
    border-radius: 0.5rem;
    color: #e4e4e7;
    font-size: 0.8125rem;
}

.bms-fv-icon {
    width: 2.1rem;
    justify-content: center;
    padding: 0;
}

.bms-fv-btn:hover,
.bms-fv-icon:hover {
    background: rgba(255, 255, 255, 0.1);
}

.bms-fv-btn.bms-on {
    background: var(--primary-600);
    color: #fff;
}

.bms-fv-stage {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.bms-fv-page {
    position: relative;
    width: min(100%, 60rem);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.bms-fv-image {
    width: auto;
    max-width: 100%;
    background: transparent;
}

.bms-fv-image img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
}

.bms-fv-pdf canvas {
    display: block;
    width: 100%;
}

.bms-fv-pageno {
    position: absolute;
    left: -2rem;
    top: 0.25rem;
    font-size: 0.75rem;
    color: #a1a1aa;
}

.bms-fv-pinning .bms-fv-page {
    cursor: crosshair;
    outline: 2px dashed var(--primary-400);
}

.bms-fv-pin {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    margin: -0.8rem 0 0 -0.8rem;
    border: 2px solid #fff;
    border-radius: 999px 999px 999px 0;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.bms-fv-pin.bms-on {
    transform: scale(1.25);
    background: var(--warning-500);
}

.bms-fv-pin-done {
    background: var(--gray-500);
}

.bms-fv-pin-draft {
    background: var(--warning-500);
}

.bms-fv-video {
    max-width: 100%;
    max-height: calc(100vh - 8rem);
}

.bms-fv-text {
    width: min(100%, 60rem);
    padding: 1rem;
    border-radius: 0.5rem;
    background: #1f1f23;
    color: #e4e4e7;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bms-fv-center {
    margin: auto;
}

.bms-fv-none {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
}

.bms-fv-none-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: #71717a;
}

.bms-fv-note {
    font-size: 0.8125rem;
    color: #a1a1aa;
    padding: 0.5rem;
}

.bms-fv-side {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    color: var(--gray-950);
}

.dark .bms-fv-side {
    background: var(--gray-900);
    color: var(--gray-100);
}

.bms-fv-side-head {
    padding: 1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-fv-comments {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
}

.bms-fv-comment {
    padding: 0.6rem;
    border-radius: 0.5rem;
    cursor: pointer;
}

.bms-fv-comment:hover,
.bms-fv-comment.bms-on {
    background: rgba(127, 127, 127, 0.1);
}

.bms-fv-resolved {
    opacity: 0.55;
}

.bms-fv-comment-head {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
}

.bms-fv-comment-tools {
    display: flex;
    margin-left: auto;
}

.bms-fv-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.3rem;
    height: 1.3rem;
    border-radius: 999px;
    background: var(--primary-600);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
}

.bms-fv-comment-body {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.bms-fv-composer {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border-top: 1px solid rgba(127, 127, 127, 0.18);
}

.bms-fv-composer textarea {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid rgba(127, 127, 127, 0.3);
    border-radius: 0.5rem;
    background: transparent;
    font-size: 0.875rem;
    color: inherit;
    resize: vertical;
    outline: none;
    box-shadow: none;
}

.bms-fv-composer textarea:focus {
    border-color: var(--primary-500);
}

.bms-fv-composer .bms-add-task {
    align-self: flex-end;
}

.bms-fv-draft {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: var(--warning-600);
}

@media (max-width: 900px) {
    .bms-fv {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) 40vh;
    }
}

/* ---- File cards (chat and comments), as Slack's ------------------- */

.bms-fcard {
    display: flex;
    flex-direction: column;
    width: min(100%, 22rem);
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 0.75rem;
    background: var(--bms-surface, #fff);
    overflow: hidden;
    text-align: left;
    color: inherit;
}

.dark .bms-fcard {
    background: var(--gray-900);
}

.bms-fcard:hover {
    border-color: rgba(127, 127, 127, 0.45);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.bms-fcard-head {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.6rem 0.75rem;
    min-width: 0;
}

.bms-fcard-icon {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.5rem;
    background: var(--c);
    color: #fff;
}

.bms-fcard-icon .fi-icon {
    width: 1.3rem;
    height: 1.3rem;
}

.bms-fcard-name {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.bms-fcard-name strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.bms-fcard-name small {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.bms-fcard-body {
    display: block;
    max-height: 13rem;
    overflow: hidden;
    border-top: 1px solid rgba(127, 127, 127, 0.18);
    background: #f4f4f5;
}

.dark .bms-fcard-body {
    background: #18181b;
}

.bms-fcard-body img,
.bms-fcard-body video {
    display: block;
    width: 100%;
    max-height: 13rem;
    object-fit: cover;
}

.bms-fcard-pdf {
    min-height: 8rem;
    background: #fff;
}

.bms-fcard-pdf canvas {
    display: block;
    width: 100%;
    opacity: 0;
    transition: opacity 0.2s;
}

.bms-fcard-pdf.bms-fcard-ready canvas {
    opacity: 1;
}

.bms-comment-files .bms-fcard {
    width: min(100%, 18rem);
}

.bms-fcard {
    position: relative;
    cursor: pointer;
}

.bms-fcard-head {
    padding-right: 2.75rem;
}

/* Download, top right of the card */
.bms-fcard-dl {
    position: absolute;
    top: 0.55rem;
    right: 0.55rem;
    z-index: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: 1px solid rgba(127, 127, 127, 0.25);
    border-radius: 0.5rem;
    background: var(--bms-surface, #fff);
    color: var(--gray-600);
}

.dark .bms-fcard-dl {
    background: var(--gray-800);
    color: var(--gray-300);
}

.bms-fcard-dl:hover {
    color: var(--primary-600);
    border-color: var(--primary-400);
}

/* File viewer composer: @ picker over the box, mic and Comment below */
.bms-fv-box {
    position: relative;
}

.bms-fv-composer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.bms-fv-voice {
    margin-top: 0.4rem;
}

.bms-fv-voice .bms-vp-wave {
    width: 7rem;
}
