/* <Kanban /> — default styling, lm-kanban-* convention.
   Each column is its own vertical flex stack: cards flow naturally, so
   uneven card heights never leave gaps. Every color reads a shared
   --lm-* theme token (same contract as charts/gantt) with the standalone
   value as fallback — retheming --lm-main-color / the neutral ramp
   re-tints the board like the rest of the catalog. */
.lm-kanban {
    --lm-kanban-column-width: 280px;
    --lm-kanban-header-height: 44px;
    --lm-kanban-column-bg: var(--lm-background-color-header, #f4f4f5);
    --lm-kanban-column-radius: 12px;
    --lm-kanban-card-bg: var(--lm-background-color, #ffffff);
    --lm-kanban-card-radius: 8px;
    --lm-kanban-card-shadow: var(--lm-shadow, 0 1px 2px rgba(0, 0, 0, 0.08), 0 1px 1px rgba(0, 0, 0, 0.04));
    --lm-kanban-card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.14);
    --lm-kanban-accent: var(--lm-main-color, #2563eb);
    --lm-kanban-tag-radius: 2px;
    --lm-kanban-gap: 12px;

    display: flex;
    align-items: flex-start;
    gap: var(--lm-kanban-gap);
    font: 13.5px/1.45 system-ui, sans-serif;
    color: var(--lm-font-color, #18181b);
    overflow-x: auto;
    padding: 4px;
}

/* ---- column: a vertical stack (header + its own card flow) */
.lm-kanban-column {
    display: flex;
    flex-direction: column;
    flex: 0 0 var(--lm-kanban-column-width);
    width: var(--lm-kanban-column-width);
    background: var(--lm-kanban-column-bg);
    border-radius: var(--lm-kanban-column-radius);
    min-height: 120px;
}

.lm-kanban-column-header {
    height: var(--lm-kanban-header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    box-sizing: border-box;
    user-select: none;
    flex: 0 0 auto;
}

.lm-kanban-column-title {
    font-weight: 650;
    font-size: 13px;
    color: var(--lm-font-color, #3f3f46);
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-kanban-column-count {
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--lm-background-color-highlight, rgba(0, 0, 0, 0.07));
    color: var(--lm-secondary-color, #52525b);
    font-size: 11.5px;
    font-weight: 600;
    box-sizing: border-box;
}

/* ---- the card flow: a flex column, cards ordered by data position */
.lm-kanban-column-cards {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 4px 10px 12px;
    flex: 1 1 auto;
}

.lm-kanban-card {
    position: relative;
    padding: 10px 12px;
    background: var(--lm-kanban-card-bg);
    border-radius: var(--lm-kanban-card-radius);
    box-shadow: var(--lm-kanban-card-shadow);
    border-left: 3px solid var(--lm-kanban-accent);
    box-sizing: border-box;
    cursor: grab;
    user-select: none;
    transition: box-shadow 0.15s ease;
}

.lm-kanban-card:hover {
    box-shadow: var(--lm-kanban-card-shadow-hover);
}

.lm-kanban-card:focus-visible {
    outline: 2px solid var(--lm-kanban-accent);
    outline-offset: 1px;
}

/* keyboard/single-pointer move mode: the picked card stays in the flow,
   highlighted; the shared ghost previews its landing slot */
.lm-kanban-card-picked {
    outline: 2px solid var(--lm-kanban-accent);
    outline-offset: 1px;
    box-shadow: var(--lm-kanban-card-shadow-hover);
}

.lm-kanban-card-dragging {
    opacity: 0.92;
    cursor: grabbing;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
    transition: none;
    z-index: 3;
    pointer-events: none;
}

.lm-kanban-card-title {
    font-weight: 600;
    font-size: 13px;
    color: var(--lm-font-color, #18181b);
}

/* ---- the card ▾ menu button: exists only when oncardmenu is handled,
   fades in on card hover (and stays visible while keyboard-focused) */
.lm-kanban-card-menu {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    color: var(--lm-icon-color, #71717a);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}

.lm-kanban-card:hover .lm-kanban-card-menu,
.lm-kanban-card-menu:focus-visible {
    opacity: 1;
}

.lm-kanban-card-menu:hover {
    background: var(--lm-background-color-highlight, rgba(0, 0, 0, 0.07));
    color: var(--lm-font-color, #18181b);
}

/* ---- the ⠿ grip: the always-present pick-up/drop affordance (keyboard
   Space does the same); aria-pressed mirrors the pick, and keeps the
   button visible while a move is in flight */
.lm-kanban-card-move {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 6px;
    padding: 0;
    background: transparent;
    color: var(--lm-icon-color, #71717a);
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease, background 0.12s ease;
}

.lm-kanban-card:hover .lm-kanban-card-move,
.lm-kanban-card:focus-within .lm-kanban-card-move,
.lm-kanban-card-move[aria-pressed='true'] {
    opacity: 1;
}

.lm-kanban-card-move:hover {
    background: var(--lm-background-color-highlight, rgba(0, 0, 0, 0.07));
    color: var(--lm-font-color, #18181b);
}

/* the ▾ menu keeps the corner; the grip slides left of it */
.lm-kanban-card:has(.lm-kanban-card-menu) .lm-kanban-card-move {
    right: 30px;
}

.lm-kanban-card .lm-kanban-card-title {
    padding-right: 22px;
}

.lm-kanban-card:has(.lm-kanban-card-menu) .lm-kanban-card-title {
    padding-right: 46px;
}

/* ---- the SR-only live region narrating pick/move/drop */
.lm-kanban-live {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

.lm-kanban-card-description {
    margin-top: 4px;
    font-size: 12.5px;
    color: var(--lm-secondary-color, #71717a);
}

.lm-kanban-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
}

.lm-kanban-tag {
    padding: 1px 8px;
    border-radius: var(--lm-kanban-tag-radius);
    background: var(--lm-main-color-tint, rgba(37, 99, 235, 0.09));
    color: var(--lm-main-color-highlight, #3730a3);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ---- the ghost slot: a card-sized drop preview between cards (flex
   order); the dragged card is out of the flow, so this IS its landing
   spot — the other cards shift around it */
.lm-kanban-ghost {
    border: 1.5px dashed var(--lm-kanban-accent);
    border-radius: var(--lm-kanban-card-radius);
    background: color-mix(in srgb, var(--lm-kanban-accent) 5%, transparent);
    box-sizing: border-box;
    flex: 0 0 auto;
    pointer-events: none;
}
