/* ============================================================
   board.css — JCRec Boards corkboard
   Adapted from VerityCom-Relationships/02-pinnable-cards.html.
   Loaded last on the board view, so it can override --pa-* tokens.
   ============================================================ */

.board-page {
    --vc-primary:      var(--pa-primary, #0075b2);
    --vc-primary-dark: var(--pa-primary-dark, #005a8c);
    --vc-ink:          #1a1a2e;
    --vc-text:         var(--pa-text, #2d3748);
    --vc-mute:         var(--pa-muted, #718096);
    --vc-line:         var(--pa-border, #e2e8f0);
    --vc-surface:      #f7fafc;
    --vc-card:         #ffffff;
    --vc-shadow:       0 8px 28px rgba(15, 23, 42, .12);
    --vc-shadow-lg:    0 20px 60px rgba(15, 23, 42, .22);
}

.card-board-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 8px;
    background: #fff;
    border: 1px solid var(--vc-line);
    border-radius: 8px;
}

.card-board-identity {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    min-width: 0;
}

.card-board-title-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding-right: 18px;
}

.card-board-title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.2;
    color: var(--vc-ink);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid transparent;
    cursor: text;
    transition: background-color .15s ease, border-color .15s ease;
}

.card-board-title-wrap:hover .card-board-title,
.card-board-title:focus {
    background: rgba(0, 117, 178, .06);
    border-color: rgba(0, 117, 178, .25);
}

.card-board-title[contenteditable="true"] {
    background: #fff;
    border-color: var(--vc-primary);
    outline: none;
    cursor: text;
}

.card-board-title-pencil {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: .72rem;
    color: var(--vc-mute);
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s ease;
}

.card-board-title-wrap:hover .card-board-title-pencil,
.card-board-title-wrap:focus-within .card-board-title-pencil {
    opacity: 1;
}

.card-board-title-wrap.is-editing .card-board-title-pencil {
    opacity: 0;
}

.card-board-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 5px;
}

.card-board-actions .btn,
.card-board-actions .form-select {
    font-size: .74rem;
    padding: .22rem .42rem;
}

.board-page {
    background: var(--vc-surface);
    min-height: calc(100vh - 4rem);
    padding-bottom: 8rem;
}

.board-brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 10px;
    background: #fff;
    border: 1px solid var(--vc-line);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
}

.board-brand-icon {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    background: var(--vc-primary);
    border-radius: 6px;
    font-size: .75rem;
}

.board-brand-text {
    font-size: .76rem;
    font-weight: 800;
    color: var(--vc-ink);
    letter-spacing: 0;
    text-transform: uppercase;
}

.board-help-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--vc-mute);
    border-radius: 50%;
    line-height: 1;
    cursor: pointer;
    transition: color .15s ease, background-color .15s ease, transform .15s ease;
}

.board-help-btn:hover,
.board-help-btn:focus {
    color: var(--vc-primary);
    background: rgba(0, 117, 178, .08);
    transform: scale(1.05);
    outline: none;
}

.board-terminology-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.board-terminology-list li {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 12px;
    align-items: baseline;
    padding: 8px 10px;
    background: var(--vc-surface);
    border: 1px solid var(--vc-line);
    border-radius: 6px;
}

.board-terminology-term {
    font-weight: 700;
    color: var(--vc-ink);
    white-space: nowrap;
}

.board-terminology-term i {
    color: var(--vc-primary);
    margin-right: 6px;
}

.board-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 5px;
    background: #fff;
    border: 1px solid var(--vc-line);
    border-radius: 8px;
}

.board-filter-group {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: min(100%, 260px);
    padding: 4px 8px;
    background: #f8fafc;
    border: 1px solid var(--vc-line);
    border-radius: 7px;
    color: var(--vc-mute);
}

.board-filter-input {
    border: 0;
    outline: 0;
    min-width: 0;
    width: 100%;
    background: transparent;
    color: var(--vc-text);
    font-size: .78rem;
}

.card-board-actions .is-toolbar-filter {
    min-width: 145px;
    max-width: 190px;
    padding: .22rem .42rem;
}

.card-board-actions .is-toolbar-filter .board-filter-input {
    font-size: .74rem;
}

/* ---- Workspace ---- */

.board-canvas {
    position: relative;
    min-height: calc(100vh - 3rem);
    margin: 0 1rem;
    padding-bottom: 10rem;
    background: var(--vc-surface);
    border: 1px dashed transparent;
    transform: scale(var(--board-zoom, 1));
    transform-origin: top left;
}

.board-canvas.is-grid-view {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 1rem;
    padding-bottom: 8rem;
    transform: none;
}

.board-canvas.is-grid-view .board-box {
    position: static;
    width: 100% !important;
    max-width: none;
    height: auto !important;
    min-height: 0;
}

.board-canvas.is-grid-view .board-box.is-collapsed .box-card-search-row,
.board-canvas.is-grid-view .board-box.is-collapsed .box-cards-list {
    display: none;
}

.board-canvas.is-grid-view .box-resize-handle {
    display: none;
}

.board-canvas.is-grid-view .box-cards-list {
    flex-direction: column;
    flex-wrap: nowrap;
    overflow: visible;
}

.board-canvas.is-grid-view .board-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    border-radius: 6px;
}

.board-canvas.is-grid-view .card-lead {
    border-radius: 5px 0 0 5px;
}

.board-canvas.is-grid-view .card-main {
    min-width: 180px;
    flex: 1.2;
}

.board-canvas.is-grid-view .card-grid-meta {
    display: grid;
    grid-template-columns: max-content minmax(70px, 1fr) max-content minmax(70px, 1fr);
    gap: 3px 7px;
    align-items: center;
    font-size: .76rem;
    color: var(--vc-text);
    padding: 7px 9px;
    flex: 2;
    min-width: 0;
    border-left: 1px solid var(--vc-line);
}

.board-canvas.is-grid-view .card-footer-row {
    flex-direction: column;
    justify-content: center;
    border-left: 1px solid #f0f3f6;
    border-radius: 0 5px 5px 0;
}

.board-canvas.is-empty::before {
    content: 'Empty board. Click Add Day or Add Box above.';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: var(--vc-mute);
    font-style: italic;
}

/* ---- Bucket (Box) ---- */

.board-box {
    position: absolute;
    width: 360px;
    min-width: 300px;
    max-width: min(92vw, 760px);
    min-height: 110px;
    max-height: 80vh;
    background: var(--vc-card);
    border: 1px solid var(--vc-line);
    border-radius: 14px;
    box-shadow: var(--vc-shadow);
    overflow: visible;
    display: flex;
    flex-direction: column;
    animation: board-box-drop .25s cubic-bezier(.2,.9,.3,1.4);
    transition: box-shadow .15s, transform .15s, border-color .12s;
}

.board-box.is-nested-box {
    position: relative;
    width: calc(100% - 24px);
    min-width: 240px;
    box-shadow: none;
}

.board-box.is-nested-box .box-header {
    border-bottom: 1px solid #e4ebf3;
}

.board-box.is-nested-box .box-resize-handle,
.board-box.is-nested-box .box-overflow-indicator {
    display: none;
}

.board-box.is-nested-box .board-cards-list {
    max-height: 220px;
}

.board-box-children {
    margin-top: 8px;
    margin-left: 4px;
    padding-top: 8px;
    padding-left: 12px;
    border-left: 2px solid rgba(0, 117, 178, 0.12);
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.board-box.has-custom-height {
    max-height: none;
}

.board-box.is-dragging {
    box-shadow:
        0 18px 48px rgba(15, 23, 42, .32),
        0 6px 16px rgba(15, 23, 42, .20);
    transform: rotate(1.2deg) scale(1.025);
    z-index: 1000;
}

.board-box.is-collapsed {
    min-height: 0;
    height: auto !important;
}

.board-box.is-collapsed .box-card-search-row,
.board-box.is-collapsed .box-cards-list,
.board-box.is-collapsed .box-overflow-indicator,
.board-box.is-collapsed .box-resize-handle {
    display: none;
}

.board-box.is-droptarget-candidate {
    border-color: rgba(0, 117, 178, .35);
}

.board-canvas.is-card-dragging .box-cards-list:empty {
    min-height: 46px;
    border: 1px dashed rgba(0, 117, 178, .32);
    border-radius: 8px;
    background: rgba(0, 117, 178, .04);
}

.board-canvas.is-card-dragging .box-cards-list:empty::after {
    content: 'Drop card here';
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    color: #64748b;
    font-size: .76rem;
    font-weight: 700;
}

.board-canvas.is-card-dragging .board-box.is-collapsed {
    min-height: 86px;
}

.board-canvas.is-card-dragging .board-box.is-collapsed .box-card-search-row {
    display: none;
}

.board-canvas.is-card-dragging .board-box.is-collapsed .box-cards-list {
    display: flex;
    min-height: 46px;
    margin: 0 12px 12px;
    padding: 8px;
    border: 1px dashed rgba(0, 117, 178, .32);
    border-radius: 8px;
    background: rgba(0, 117, 178, .04);
}

.board-box.is-being-deleted {
    opacity: 0;
    transform: scale(.92);
    transition: opacity .12s ease, transform .12s ease;
}

.board-box.is-dropzone {
    border-color: var(--vc-primary);
    box-shadow:
        0 0 0 6px rgba(0, 117, 178, .35),
        0 0 32px rgba(0, 117, 178, .25),
        var(--vc-shadow-lg);
    transform: scale(1.03);
    animation: board-dropzone-pulse 1.1s ease-in-out infinite;
}

.board-box.is-dropzone .box-cards-list {
    background: rgba(0, 117, 178, .06);
}

.board-box.is-unscheduled {
    background: #fffaf0;
    border-color: #f6d8a3;
}

.board-box.is-unscheduled .box-band {
    background: #f59e0b;
}

.board-box.is-unscheduled .board-card {
    background: #fff;
    flex-direction: column;
    align-items: stretch;
}

.board-box.is-unscheduled .card-lead {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    justify-content: flex-start;
    border-right: none;
    border-bottom: 1px solid var(--vc-line);
    border-radius: 7px 7px 0 0;
    padding: 5px 10px;
    min-height: 0;
}

.card-lead-org {
    font-size: .75rem;
    font-weight: 500;
    color: var(--vc-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.board-box.is-unscheduled .card-main {
    flex: 1;
    padding: 8px 12px 10px;
    justify-content: flex-start;
}

@keyframes board-box-drop {
    from { transform: scale(.85) translateY(-12px); opacity: 0; }
    to   { transform: scale(1) translateY(0);     opacity: 1; }
}

@keyframes board-dropzone-pulse {
    0%, 100% {
        box-shadow:
            0 0 0 6px rgba(0, 117, 178, .35),
            0 0 32px rgba(0, 117, 178, .25),
            var(--vc-shadow-lg);
    }
    50% {
        box-shadow:
            0 0 0 9px rgba(0, 117, 178, .20),
            0 0 40px rgba(0, 117, 178, .35),
            var(--vc-shadow-lg);
    }
}

.box-band {
    height: 5px;
    flex-shrink: 0;
    background: var(--box-color, #94a3b8);
}

.box-header {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    user-select: none;
    cursor: grab;
}

.box-header:active {
    cursor: grabbing;
}

.box-card-search-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 10px 6px;
    padding: 5px 8px;
    background: #f8fafc;
    border: 1px solid var(--vc-line);
    border-radius: 8px;
    color: var(--vc-mute);
    flex-shrink: 0;
}

.box-card-search {
    border: 0;
    outline: 0;
    min-width: 0;
    width: 100%;
    background: transparent;
    color: var(--vc-text);
    font-size: .78rem;
}

.box-card-search::placeholder {
    color: #94a3b8;
}

.box-cards-list.is-search-empty::after {
    content: 'No matching applications';
    color: var(--vc-mute);
    font-size: .8rem;
    width: 100%;
    padding: 14px 6px;
    text-align: center;
    font-style: italic;
    border: 2px dashed var(--vc-line);
    border-radius: 8px;
}

.box-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    background: var(--box-color, #94a3b8);
    border: 1px solid rgba(0, 0, 0, .1);
    flex-shrink: 0;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, .28),
        0 1px 1px rgba(15, 23, 42, .08);
}

.box-header-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.box-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-width: 0;
}

.box-title {
    font-size: .98rem;
    font-weight: 700;
    color: var(--vc-ink);
    line-height: 1.25;
    white-space: normal;
    overflow: hidden;
    text-overflow: ellipsis;
}

.box-subtitle {
    font-size: .74rem;
    color: var(--vc-mute);
    line-height: 1.3;
    margin-top: 1px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
}

.box-count {
    font-size: .72rem;
    color: var(--vc-mute);
    background: #f1f5f9;
    padding: 3px 9px;
    border-radius: 999px;
    font-weight: 700;
}

.box-end-badge {
    font-size: .68rem;
    color: var(--vc-mute);
    background: #eaf4fb;
    padding: 3px 8px;
    border-radius: 999px;
    font-weight: 700;
}

.box-header-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.box-icon-btn {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: var(--vc-mute);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .85rem;
    transition: all .12s;
}

.box-icon-btn:hover {
    background: #f1f5f9;
    color: var(--vc-ink);
}

.box-icon-btn[data-jc-box-action="delete"]:hover {
    background: #fee2e2;
    color: #b91c1c;
}

.board-layout-select {
    width: auto;
    min-width: 160px;
}

.box-cards-list {
    padding: 44px 10px 48px;
    min-height: 56px;
    overflow: auto;          /* always scrollable so SortableJS hit-tests work */
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, .22) transparent;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-content: flex-start;
    flex: 1 1 auto;
}
.box-cards-list::-webkit-scrollbar {
    display: block;
    width: 3px;
}

.box-cards-list::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, .22);
    border-radius: 999px;
}

.box-cards-list::-webkit-scrollbar-track {
    background: transparent;
}

.box-overflow-indicator {
    position: absolute;
    left: 10px;
    right: 10px;
    transform: translateY(4px);
    min-height: 32px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #334155;
    background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(248, 250, 252, .96) 100%);
    border: 1px solid rgba(203, 213, 225, .92);
    box-shadow: 0 10px 18px rgba(15, 23, 42, .10);
    opacity: 0;
    pointer-events: none;
    cursor: pointer;
    transition: opacity .16s ease, transform .16s ease, background-color .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
    z-index: 3;
    padding: 0 12px;
    font-size: .78rem;
    font-weight: 700;
}

.box-overflow-indicator--up {
    top: 82px;
}

.box-overflow-indicator--down {
    bottom: 8px;
}

.box-overflow-indicator i {
    font-size: .85rem;
}

.box-overflow-indicator__icons {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.board-box.has-overflow-above .box-overflow-indicator--up,
.board-box.has-overflow-below .box-overflow-indicator--down {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
    color: #0f172a;
    background: linear-gradient(180deg, rgba(255, 255, 255, .99) 0%, rgba(241, 245, 249, .98) 100%);
    border-color: rgba(148, 163, 184, .95);
    box-shadow:
        0 12px 24px rgba(15, 23, 42, .14),
        0 0 0 1px rgba(255, 255, 255, .55) inset;
}

.board-box:hover .box-overflow-indicator,
.board-box.is-resizing .box-overflow-indicator {
    background: linear-gradient(180deg, rgba(255, 255, 255, .98) 0%, rgba(248, 250, 252, .98) 100%);
}

.board-box.has-overflow-above .box-overflow-indicator--up:hover,
.board-box.has-overflow-above .box-overflow-indicator--up:focus,
.board-box.has-overflow-below .box-overflow-indicator--down:hover,
.board-box.has-overflow-below .box-overflow-indicator--down:focus {
    background: linear-gradient(180deg, rgba(255, 255, 255, 1) 0%, rgba(226, 232, 240, .98) 100%);
    color: #0f172a;
    border-color: rgba(100, 116, 139, .92);
    box-shadow: 0 14px 28px rgba(15, 23, 42, .16);
    outline: none;
}

.board-box.is-at-scroll-top .box-overflow-indicator--up,
.board-box.is-at-scroll-end .box-overflow-indicator--down {
    opacity: 0;
    pointer-events: none;
}

/* Reveal scrollbar on box hover */
.board-box:hover .box-cards-list,
.board-box.is-resizing .box-cards-list {
    scrollbar-color: rgba(71, 85, 105, .82) rgba(226, 232, 240, .72);
}
.board-box:hover .box-cards-list::-webkit-scrollbar,
.board-box.is-resizing .box-cards-list::-webkit-scrollbar {
    width: 8px;
}
.board-box:hover .box-cards-list::-webkit-scrollbar-thumb,
.board-box.is-resizing .box-cards-list::-webkit-scrollbar-thumb {
    background: rgba(71, 85, 105, .82);
    border-radius: 999px;
}

.board-box:hover .box-cards-list::-webkit-scrollbar-track,
.board-box.is-resizing .box-cards-list::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, .72);
    border-radius: 999px;
}

.box-cards-list:empty::before {
    content: 'Drop a card here';
    color: var(--vc-mute);
    font-size: .8rem;
    width: 100%;
    padding: 14px 6px;
    text-align: center;
    font-style: italic;
    border: 2px dashed var(--vc-line);
    border-radius: 8px;
}

/* ---- Board card ---- */

.board-card {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--vc-line);
    border-radius: 10px;
    font-size: .84rem;
    cursor: grab;
    user-select: none;
    box-shadow: 0 2px 6px rgba(0,0,0,.07);
    transition: box-shadow .12s, border-color .12s, transform .12s;
    min-height: 52px;
}

.board-card:hover {
    border-color: var(--vc-primary);
    box-shadow: 0 3px 10px rgba(0,0,0,.09);
    transform: translateY(-1px);
}

.board-card:active {
    cursor: grabbing;
    transform: none;
}

.board-card.is-filtered-out,
.board-card.is-board-filtered-out {
    display: none;
}

.board-card.sortable-ghost {
    opacity: .3;
    border-style: dashed;
    border-color: var(--vc-mute);
    background: #f7fafc;
    box-shadow: none;
}

.board-card.sortable-chosen {
    box-shadow: 0 6px 16px rgba(15, 23, 42, .2);
    transform: rotate(.5deg);
}

.board-card.is-drag-style-locked {
    flex-shrink: 0 !important;
    max-width: none !important;
    opacity: .96;
    pointer-events: none;
    z-index: 1200;
}

.board-card.sortable-drag,
.board-card.sortable-fallback {
    pointer-events: none;
    z-index: 1200;
}

.board-canvas.is-card-dragging .board-card.sortable-fallback {
    opacity: 0 !important;
}

.board-card-drag-mirror {
    opacity: .96;
    pointer-events: none;
    z-index: 3000;
    filter: drop-shadow(0 14px 24px rgba(15, 23, 42, .20));
}

/* ── Left accent stripe (type icon column) ── */
.card-lead {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    padding: 7px 6px;
    background: #f4f6f9;
    border-right: 1px solid var(--vc-line);
    border-radius: 7px 0 0 7px;
    flex-shrink: 0;
}

.card-drag-dots {
    font-size: .75rem;
    color: var(--vc-mute, #718096);
    opacity: .45;
    cursor: grab;
}

/* ── Main content ── */
.card-main {
    flex: 1;
    min-width: 0;
    padding: 13px 12px 18px 13px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-title {
    font-weight: 400;
    color: var(--vc-ink, #1a1a2e);
    font-size: .83rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-subtitle {
    font-size: .76rem;
    font-weight: 400;
    color: #4a5568;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.card-meta-row {
    display: none;
}

.card-grid-meta {
    display: none;
}

.board-box.is-unscheduled .card-grid-meta {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 6px;
    row-gap: 2px;
    font-size: .72rem;
    color: var(--vc-ink);
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f3f6;
}

.card-grid-label {
    color: var(--vc-mute);
    font-weight: 600;
}

/* ── Footer / action strip (right side) ── */
.card-footer-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 5px 5px;
    border-left: 1px solid #f0f3f6;
    border-radius: 0 7px 7px 0;
    background: #fafbfc;
    color: var(--vc-mute);
    font-size: .7rem;
    flex-shrink: 0;
}

.card-footer-row--actions {
    /* already column, no change needed */
}

/* ── Task card ── */
.board-card.is-task {
    border-left: 3px solid #4a90d9;
    cursor: pointer;
}
.board-card.is-task:hover {
    background: #f0f6ff;
    border-left-color: #1a5fa8;
}

/* ── Checklist card ── */
.board-card.is-checklist {
    border-left: 3px solid #5cb85c;
}
.board-card.is-checklist:hover {
    background: #f0fff0;
    border-left-color: #3d8b3d;
}

/* ── Note card ── */
.board-card.is-note {
    background: #fffde7;
    border-color: #e9cf57;
    box-shadow: 0 2px 5px rgba(80, 65, 0, .1);
}

.board-card.is-note .card-lead {
    background: #fff3c4;
    border-right-color: #e9cf57;
    border-radius: 7px 0 0 7px;
}

.board-card.is-note .card-type-icon { color: #b38600; }
.board-card.is-note .card-drag-dots { color: #a07700; }
.board-card.is-note .card-title { color: #3d2f00; }
.board-card.is-note .card-subtitle { color: #6d5b00; }

.board-card.is-note .card-footer-row {
    background: #fff3c4;
    border-left-color: #e9cf57;
    border-radius: 0 7px 7px 0;
}

.board-card.is-note:hover {
    background: #fff9e0;
    border-color: #d6b83f;
}

/* ── Time slot + duration (presentation setup) ── */
.card-time-slot {
    color: var(--vc-primary);
    font-weight: 700;
    white-space: nowrap;
    font-size: .68rem;
}

.card-duration-input {
    width: 2.4rem;
    padding: 1px .15rem;
    font-size: .68rem;
    border: 1px solid var(--vc-line);
    border-radius: 3px;
    background: #fff;
    text-align: center;
}

.card-duration-control {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: .66rem;
    color: var(--vc-mute);
}

.card-remove-btn {
    background: transparent;
    border: none;
    color: var(--vc-mute);
    padding: 0 3px;
    cursor: pointer;
    line-height: 1;
}

.card-remove-btn:hover {
    color: #b91c1c;
}

.card-remove-btn[data-jc-card-action="add-note"]:hover {
    color: var(--vc-primary);
}

/* ── Resize handles — cursor-only, no visual highlight ── */
.box-resize-handle {
    position: absolute;
    padding: 0;
    border: 0;
    background: transparent;
    z-index: 10;
}

/* Corner: centered on the bottom-right corner, half inside / half outside */
.box-resize-handle--corner {
    right: -10px;
    bottom: -10px;
    width: 20px;
    height: 20px;
    cursor: se-resize !important;
}

/* Left / right edges: entirely outside the box so scrollbar never overlaps */
.box-resize-handle--left,
.box-resize-handle--right {
    top: 50px;
    bottom: 20px;
    height: auto;
    width: 12px;
    cursor: col-resize !important;
}
.box-resize-handle--left  { left: -12px; right: auto; }
.box-resize-handle--right { right: -12px; left: auto; }

/* Bottom edge: entirely outside the bottom border */
.box-resize-handle--bottom {
    left: 20px;
    right: 20px;
    bottom: -12px;
    height: 12px;
    width: auto;
    cursor: row-resize !important;
}

.board-canvas.is-grid-view .box-resize-handle {
    display: none;
}

.is-flying-to-unscheduled {
    position: fixed;
    z-index: 2000;
    pointer-events: none;
    transition: transform .22s ease-in, opacity .22s ease-in;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .25);
}

/* ---- Tile drag ghost (the ghost element following the cursor) ---- */

.tile-ghost {
    position: fixed;
    pointer-events: none;
    z-index: 1500;
    background: #fff;
    border: 2px solid var(--vc-primary);
    box-shadow:
        0 16px 36px rgba(0, 117, 178, .35),
        0 4px 14px rgba(0, 117, 178, .25);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 5px 16px 5px 8px;
    font-size: .9rem;
    font-weight: 700;
    color: var(--vc-ink);
    transform: translate(-12px, -18px) scale(1.1) rotate(-3deg);
    transform-origin: top left;
}

/* ---- Toast container created by board.js ---- */
#jcrec-board-toasts .toast {
    min-width: 220px;
}

/* ---- Stat tile (thin info chip) for presentation banner ---- */
.board-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
    margin: 0 1rem 1rem;
    padding: .5rem .75rem;
    background: #fff;
    border: 1px solid var(--vc-line);
    border-radius: 10px;
}

.board-info-bar .info-pill {
    background: #f1f5f9;
    color: var(--vc-text);
    padding: 3px 10px;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
}

/* Larger, easier-to-click checkboxes inside Card Board modals */
#boardSettingsModal .form-check,
#saveBoardLayoutModal .form-check {
    display: flex;
    align-items: flex-start;
    gap: .65rem;
    padding: .55rem .75rem .55rem 2.6rem;
    margin-bottom: .5rem;
    border: 1px solid var(--vc-line, #e2e8f0);
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#boardSettingsModal .form-check:hover,
#saveBoardLayoutModal .form-check:hover {
    background: #f7fafc;
    border-color: var(--vc-primary, #0075b2);
}

#boardSettingsModal .form-check:focus-within,
#saveBoardLayoutModal .form-check:focus-within {
    border-color: var(--vc-primary, #0075b2);
    box-shadow: 0 0 0 3px rgba(0, 117, 178, .18);
}

#boardSettingsModal .form-check:has(.form-check-input:checked),
#saveBoardLayoutModal .form-check:has(.form-check-input:checked) {
    background: rgba(0, 117, 178, .06);
    border-color: var(--vc-primary, #0075b2);
}

#boardSettingsModal .form-check:has(.form-check-input:disabled),
#saveBoardLayoutModal .form-check:has(.form-check-input:disabled) {
    cursor: not-allowed;
    opacity: .6;
    background: #f1f5f9;
}

#boardSettingsModal .form-check .form-check-input,
#saveBoardLayoutModal .form-check .form-check-input {
    width: 1.35rem;
    height: 1.35rem;
    margin-top: .1rem;
    margin-left: -1.95rem;
    border: 2px solid #94a3b8;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

#boardSettingsModal .form-check .form-check-input:hover,
#saveBoardLayoutModal .form-check .form-check-input:hover {
    border-color: var(--vc-primary, #0075b2);
}

#boardSettingsModal .form-check .form-check-input:focus,
#saveBoardLayoutModal .form-check .form-check-input:focus {
    border-color: var(--vc-primary, #0075b2);
    box-shadow: 0 0 0 3px rgba(0, 117, 178, .25);
}

#boardSettingsModal .form-check .form-check-input:checked,
#saveBoardLayoutModal .form-check .form-check-input:checked {
    background-color: var(--vc-primary, #0075b2);
    border-color: var(--vc-primary, #0075b2);
}

#boardSettingsModal .form-check .form-check-label,
#saveBoardLayoutModal .form-check .form-check-label {
    cursor: pointer;
    font-weight: 600;
    color: var(--vc-ink, #1a1a2e);
    line-height: 1.35;
    user-select: none;
}

#boardSettingsModal .form-check .form-text,
#saveBoardLayoutModal .form-check .form-text {
    flex-basis: 100%;
    margin-top: .25rem;
    margin-left: 0;
    color: var(--vc-mute, #718096);
    font-weight: 400;
}

/* ── Full-screen state ─────────────────────────────────────── */
.board-page:fullscreen,
.board-page:-webkit-full-screen {
    background: var(--vc-bg, #f4f6f9);
    overflow: auto;
    padding: 1rem 0.5rem 1.5rem;
}
.board-page:fullscreen .card-board-strip,
.board-page:-webkit-full-screen .card-board-strip {
    margin-top: .25rem;
}

/* ── Boards index — empty landing ──────────────────────────── */
.board-empty-landing {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 4rem 1rem;
    color: var(--vc-mute, #718096);
}
.board-empty-landing__icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #c8d3df;
}
.board-empty-landing__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--vc-ink, #1a2735);
    margin-bottom: .5rem;
}
.board-empty-landing__copy {
    max-width: 360px;
    margin: 0 auto 1.5rem;
    font-size: .9rem;
}

/* ── Boards index — card grid ─────────────────────────────── */
.board-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1rem;
}
.board-card-tile {
    display: flex;
    flex-direction: column;
    border: 1px solid #e7ebf1;
    border-radius: 12px;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.board-card-tile:hover {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

/* type accent bar at the top of every tile */
.board-tile-type-bar {
    display: flex;
    align-items: center;
    gap: .45rem;
    padding: .6rem .9rem;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.board-tile-type--presentation {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e7ebf1;
}
.board-tile-type--general {
    background: #f8fafc;
    color: #475569;
    border-bottom: 1px solid #e7ebf1;
}
.board-tile-fy {
    font-size: .7rem;
    opacity: .75;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
.board-tile-shared { color: #1d6b45; }
.board-tile-private { color: #b0bbc6; }

.board-card-tile__body {
    padding: .9rem;
    flex: 1;
}
.board-card-thumb-wrap {
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    overflow: hidden;
    background: #f8fafc;
    margin-bottom: .7rem;
}
.board-card-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    display: block;
    object-fit: cover;
}
.board-card-tile__head {
    margin-bottom: .4rem;
}
.board-entry-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .35rem;
}
.board-card-tile__title {
    font-size: 1.02rem;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
    display: block;
}
.board-card-tile__title:hover { text-decoration: underline; color: var(--vc-primary, #0075b2); }
.board-entry-value {
    line-height: 1.25;
}
.board-card-tile__meta {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .45rem;
}
.board-card-tile__meta--pills {
    align-items: center;
}
.board-thumb-state {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .73rem;
}
.board-thumb-state--refreshing {
    color: #92400e;
}
.board-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .25rem .55rem;
    font-size: .73rem;
    font-weight: 700;
    border: 1px solid transparent;
    white-space: nowrap;
}
.board-pill--muted {
    background: rgba(100, 116, 139, 0.12);
    color: #334155;
    border-color: rgba(100, 116, 139, 0.24);
}
.board-pill--good {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.26);
}
.board-pill--warn {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.28);
}
.board-card-tile__actions {
    display: flex;
    gap: .35rem;
    padding: .65rem .9rem .8rem;
    border-top: 1px solid #eef2f7;
    background: #fcfdff;
}
.board-card-tile__actions .btn { flex: 1 1 auto; }

/* ── Compact Card Board modal forms ─────────────────────── */
body:has(.board-page) .modal .modal-header {
    padding: .55rem .75rem;
}

body:has(.board-page) .modal .modal-title {
    font-size: .95rem;
    line-height: 1.15;
}

body:has(.board-page) .modal .modal-body {
    padding: .65rem .75rem;
}

body:has(.board-page) .modal .modal-footer {
    padding: .5rem .75rem;
    gap: .35rem;
}

body:has(.board-page) .modal .mb-3 {
    margin-bottom: .48rem !important;
}

body:has(.board-page) .modal .mb-2 {
    margin-bottom: .38rem !important;
}

body:has(.board-page) .modal .form-label {
    margin-bottom: .12rem;
    font-size: .72rem;
    line-height: 1.1;
    font-weight: 700;
    color: #334155;
}

body:has(.board-page) .modal .form-control,
body:has(.board-page) .modal .form-select {
    min-height: 30px;
    padding: .24rem .45rem;
    font-size: .78rem;
    line-height: 1.2;
    border-radius: 5px;
}

body:has(.board-page) .modal textarea.form-control {
    min-height: 64px;
}

body:has(.board-page) .modal .form-text {
    margin-top: .14rem;
    font-size: .67rem;
    line-height: 1.15;
}

body:has(.board-page) .modal hr {
    margin: .48rem 0;
}

body:has(.board-page) .modal .btn-sm {
    padding: .24rem .5rem;
    font-size: .75rem;
    line-height: 1.15;
}

body:has(.board-page) .modal .form-check {
    min-height: 0;
    margin-bottom: .4rem !important;
    padding-top: .28rem !important;
    padding-bottom: .28rem !important;
}

body:has(.board-page) .modal .form-check .form-check-label {
    font-size: .76rem;
    line-height: 1.15;
}

#editBoardBoxModal .modal-dialog,
#addBoardNoteModal .modal-dialog {
    max-width: 360px;
}

/* ── Compact box ─────────────────────────────────────────────
 * A box where cards "go to be hidden". Cards inside render as
 * compact single-line list items rather than full visual cards.
 */
.board-box.is-compact {
    --box-color: #6b7280;
    background: #fafbfc;
    border: 1px dashed #b9c4d3;
}
.board-box.is-compact .box-band {
    background: repeating-linear-gradient(
        45deg,
        #d6dbe2 0,
        #d6dbe2 4px,
        #e8edf3 4px,
        #e8edf3 8px
    );
}

/* ============================================================
   Boards Index v2 (from-scratch redesign)
   ============================================================ */
.cb2-page {
    padding: 0 .75rem 1rem;
}

.cb2-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    padding: 1rem 1.1rem;
    margin-bottom: .9rem;
    border: 1px solid #e7ebf1;
    border-radius: 12px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.cb2-kicker {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .35rem;
}

.cb2-hero h1 {
    margin: 0 0 .2rem 0;
    font-size: 1.7rem;
    line-height: 1.2;
    color: #0f172a;
}

.cb2-hero p {
    margin: 0;
    color: #475569;
    font-size: .92rem;
}

.cb2-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: .75rem;
    margin-bottom: .9rem;
}

.cb2-stat {
    border: 1px solid #e7ebf1;
    background: #fff;
    border-radius: 12px;
    padding: .75rem .85rem;
}

.cb2-stat-label {
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .25rem;
}

.cb2-stat-value {
    font-size: 1.35rem;
    line-height: 1.2;
    color: #0f172a;
    font-weight: 800;
}

.cb2-empty {
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: #fff;
    text-align: center;
    padding: 2rem 1rem;
}

.cb2-empty i {
    font-size: 1.55rem;
    color: #64748b;
    margin-bottom: .5rem;
}

.cb2-empty h2 {
    margin: 0 0 .4rem;
    font-size: 1.2rem;
    color: #0f172a;
}

.cb2-empty p {
    margin: 0 0 .85rem;
    color: #475569;
}

.cb2-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: .9rem;
}

.cb2-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e7ebf1;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.cb2-card:hover {
    box-shadow: 0 12px 28px rgba(15, 23, 42, .08);
    border-color: #cbd5e1;
    transform: translateY(-2px);
}

.cb2-thumb-link {
    display: block;
    position: relative;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

.cb2-thumb {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    background: #f8fafc;
}

.cb2-thumb-badge,
.cb2-thumb-status {
    position: absolute;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    max-width: calc(100% - 1.1rem);
    padding: .34rem .56rem;
    border-radius: 999px;
    font-size: .69rem;
    font-weight: 700;
    line-height: 1;
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .14);
}

.cb2-thumb-badge {
    top: .6rem;
    left: .6rem;
}

.cb2-thumb-status {
    right: .6rem;
    bottom: .6rem;
}

.cb2-thumb-badge-primary {
    background: rgba(0, 117, 178, .92);
    color: #fff;
}

.cb2-thumb-badge-muted {
    background: rgba(15, 23, 42, .72);
    color: #fff;
}

.cb2-thumb-status-muted {
    background: rgba(255, 255, 255, .92);
    color: #334155;
}

.cb2-thumb-status-warn {
    background: rgba(245, 158, 11, .92);
    color: #fff;
}

.cb2-card-body {
    padding: .88rem .95rem .85rem;
    display: flex;
    flex-direction: column;
    gap: .72rem;
}

.cb2-card-head {
    display: flex;
    flex-direction: column;
    gap: .24rem;
}

.cb2-eyebrow {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .09em;
    color: #64748b;
    font-weight: 700;
}

.cb2-title {
    display: block;
    margin: 0;
    font-size: 1.02rem;
    line-height: 1.28;
    font-weight: 700;
    color: #0f172a;
    text-decoration: none;
}

.cb2-title:hover {
    color: #0075b2;
    text-decoration: underline;
}

.cb2-subtitle {
    color: #475569;
    font-size: .84rem;
    line-height: 1.4;
    min-height: 2.35em;
}

.cb2-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
}

.cb2-meta-cell {
    min-width: 0;
    padding: .62rem .68rem;
    border: 1px solid #e7ebf1;
    border-radius: 8px;
    background: #f8fafc;
}

.cb2-meta-label {
    font-size: .65rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #64748b;
    font-weight: 700;
    margin-bottom: .22rem;
}

.cb2-meta-value {
    font-size: .83rem;
    color: #0f172a;
    font-weight: 700;
    line-height: 1.35;
}

.cb2-meta-value-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: .75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cb2-data-actions {
    margin-top: auto;
    padding: .78rem .95rem .9rem;
    border-top: 1px solid #eef2f7;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: .45rem;
    background: #fcfdff;
}

.cb2-btn {
    border-radius: 8px;
    font-size: .78rem;
    font-weight: 700;
    padding: .35rem .62rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .35rem;
    border-width: 1px;
}

.cb2-btn-open {
    background: #0075b2;
    border-color: #0075b2;
    color: #fff;
}

.cb2-btn-open:hover,
.cb2-btn-open:focus {
    background: #006299;
    border-color: #006299;
    color: #fff;
}

.cb2-btn-delete {
    background: #fff;
    border-color: #f1c9ce;
    color: #b42318;
}

.cb2-btn-delete:hover,
.cb2-btn-delete:focus {
    background: #fff5f5;
    border-color: #e9a8b0;
    color: #912018;
}

.cb2-card-subtle-note {
    font-size: .78rem;
    color: #64748b;
    line-height: 1.4;
    padding: 0;
}

.cb2-pills {
    display: flex;
    flex-wrap: wrap;
    gap: .38rem;
}

.cb2-pill {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    padding: .24rem .55rem;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: .73rem;
    font-weight: 700;
    white-space: nowrap;
}

.cb2-pill-muted {
    background: rgba(100, 116, 139, 0.12);
    color: #334155;
    border-color: rgba(100, 116, 139, 0.24);
}

.cb2-pill-good {
    background: rgba(34, 197, 94, 0.12);
    color: #166534;
    border-color: rgba(34, 197, 94, 0.26);
}

.cb2-pill-warn {
    background: rgba(245, 158, 11, 0.14);
    color: #92400e;
    border-color: rgba(245, 158, 11, 0.28);
}

@media (max-width: 768px) {
    .cb2-page {
        padding: 0 .4rem .8rem;
    }
    .cb2-hero {
        padding: .85rem;
        align-items: start;
        flex-direction: column;
    }
    .cb2-grid {
        grid-template-columns: 1fr;
    }
    .cb2-thumb-badge,
    .cb2-thumb-status {
        max-width: calc(100% - .8rem);
        font-size: .64rem;
        padding: .3rem .48rem;
    }
    .cb2-meta-grid {
        grid-template-columns: 1fr;
    }
    .cb2-data-actions {
        grid-template-columns: 1fr;
    }
}
.board-box.is-compact .box-title::before {
    content: "\f187"; /* fa-box-archive */
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-right: .35em;
    color: #6b7280;
    font-size: .85em;
}
.board-box.is-compact .box-cards-list {
    padding: .25rem .35rem;
    gap: .2rem;
    display: flex;
    flex-direction: column;
}
/* Collapse cards inside a compact to compact one-line rows */
.board-box.is-compact .board-card {
    border-radius: 4px !important;
    background: #fff !important;
    border: 1px solid #e1e6ec !important;
    box-shadow: none !important;
    cursor: grab;
}
.board-box.is-compact .board-card.is-note {
    background: #fff7b8 !important;
    border-color: #e9cf57 !important;
}
.board-box.is-compact .board-card:hover {
    background: #f4f6f9 !important;
    border-color: #b9c4d3 !important;
    transform: none !important;
}
/* Hide non-essential chrome — show only card-main */
.board-box.is-compact .board-card .card-lead,
.board-box.is-compact .board-card .card-footer-row,
.board-box.is-compact .board-card .card-subtitle,
.board-box.is-compact .board-card .card-grid-meta {
    display: none !important;
}
.board-box.is-compact .board-card .card-main {
    padding: .28rem .55rem !important;
}
.board-box.is-compact .board-card .card-title {
    font-size: .8rem;
    font-weight: 500;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Trash box ─────────────────────────────────────────────
 * Reuses all .is-compact compact-card rendering; only the
 * visual chrome (color, band, icon) differs.
 */
.board-box.is-trash {
    --box-color: #dc2626;
    background: #fff8f8;
    border: 1px dashed #fca5a5;
}
.board-box.is-trash .box-band {
    background: repeating-linear-gradient(
        45deg,
        #fca5a5 0,
        #fca5a5 4px,
        #fee2e2 4px,
        #fee2e2 8px
    );
}
/* Override the compact archive icon with a trash-can icon */
.board-box.is-trash .box-title::before {
    content: "\f2ed"; /* fa-trash-can */
    color: #dc2626;
}

/* ── Toolbar zone dividers ────────────────────────────────── */
.toolbar-divider {
    display: inline-block;
    width: 1px;
    height: 1.6rem;
    background: #d6dbe2;
    align-self: center;
    margin: 0 .15rem;
    flex-shrink: 0;
}

/* ── Empty state ──────────────────────────────────────────── */
.board-empty-state {
    margin: 1rem auto;
    max-width: 720px;
    background: #fff;
    border: 1px dashed #b9c4d3;
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
}
.board-empty-state__icon {
    font-size: 2.4rem;
    color: #b9c4d3;
    margin-bottom: .65rem;
}
.board-empty-state__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 .35rem;
}
.board-empty-state__copy {
    color: #5b6b7d;
    margin: 0 auto .9rem;
    max-width: 540px;
}
.board-empty-state__actions {
    display: flex;
    justify-content: center;
    gap: .5rem;
    flex-wrap: wrap;
}

/* ── Tutorial modal — self-playing animated demo ─────────── */
.board-tutorial {
    --tut-bg: #f4f6f9;
    --tut-border: #d6dbe2;
    --tut-accent: #0075b2;
    background: var(--tut-bg);
    border-radius: 8px;
    padding: 1rem;
}
.board-tutorial__caption {
    text-align: center;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: .65rem;
    min-height: 1.4em;
    animation: tut-caption 24s infinite linear;
}
.board-tutorial-stage {
    position: relative;
    height: 320px;
    background: #fff;
    border: 1px solid var(--tut-border);
    border-radius: 6px;
    overflow: hidden;
}
.board-tutorial-stage .tut-toolbar {
    background: #fff;
    border-bottom: 1px solid var(--tut-border);
    padding: .35rem .55rem;
    display: flex;
    gap: .35rem;
    align-items: center;
    font-size: .78rem;
}
.board-tutorial-stage .tut-tbtn {
    background: #f4f6f9;
    border: 1px solid var(--tut-border);
    border-radius: 4px;
    padding: .15rem .5rem;
    font-size: .75rem;
    color: #2c3e50;
}
.board-tutorial-stage .tut-tbtn--primary {
    background: var(--tut-accent);
    color: #fff;
    border-color: var(--tut-accent);
}
.board-tutorial-canvas {
    position: relative;
    height: calc(100% - 36px);
    background: linear-gradient(0deg, #fafbfc, #fff);
}

/* Cursor pointer that "drives" the demo */
.tut-cursor {
    position: absolute;
    width: 18px;
    height: 18px;
    background: #1a2735;
    clip-path: polygon(0 0, 0 70%, 25% 50%, 40% 80%, 60% 70%, 35% 40%, 70% 35%);
    pointer-events: none;
    z-index: 10;
    animation: tut-cursor 24s infinite cubic-bezier(.4,.0,.2,1);
}

/* Stage elements — each with staggered fade-in / move animation */
.tut-el {
    position: absolute;
    opacity: 0;
    transition: none;
}

.tut-box {
    background: #fff;
    border: 1px solid var(--tut-border);
    border-top: 4px solid var(--tut-accent);
    border-radius: 4px;
    padding: .35rem .5rem;
    width: 130px;
    font-size: .8rem;
    font-weight: 700;
    color: #2c3e50;
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.tut-box--day1   { left: 16px;  top: 14px; animation: tut-fade-in 24s infinite both; animation-delay: 1.5s; }
.tut-box--compact  { left: 162px; top: 14px; border-top-color: #6b7280; background: #fafbfc; border-style: dashed; animation: tut-fade-in 24s infinite both; animation-delay: 13s; }

.tut-card {
    background: #fff;
    border: 1px solid var(--tut-border);
    border-radius: 4px;
    padding: .25rem .45rem;
    font-size: .72rem;
    color: #2c3e50;
    box-shadow: 0 1px 2px rgba(0,0,0,.06);
    width: 110px;
}
.tut-card--app1 {
    left: 26px; top: 60px;
    animation: tut-fade-in 24s infinite both;
    animation-delay: 4s;
}
.tut-card--app2 {
    left: 26px; top: 92px;
    animation: tut-fade-in 24s infinite both;
    animation-delay: 6.5s;
}
.tut-card--note {
    left: 26px; top: 124px;
    background: #fff7c2;
    border-color: #f1c40f;
    animation: tut-note 24s infinite both;
    animation-delay: 9s;
}

@keyframes tut-fade-in {
    0%, 100% { opacity: 0; transform: translateY(-4px); }
    /* visible from delay onward — keyframes inside the 24s loop */
    8%, 95% { opacity: 1; transform: translateY(0); }
}

/* Note card: appears, then around 14-16s moves into position */
@keyframes tut-note {
    0%, 100% { opacity: 0; transform: translate(0, -4px) scale(1); }
    8%, 55% { opacity: 1; transform: translate(0, 0) scale(1); left: 26px; top: 124px; }
    /* slide to compact position and shrink */
    65%, 95% {
        opacity: 1;
        transform: translate(146px, -64px) scale(.7);
    }
}

/* Cursor path — moves to each "button" then to drag the note */
@keyframes tut-cursor {
    0%   { left: 50%;  top: 50%; }
    /* hover Add Box */
    5%   { left: 240px; top: 12px; }
    /* hover Add Card */
    18%  { left: 290px; top: 12px; }
    /* hover Add Application */
    27%  { left: 340px; top: 12px; }
    /* add another board action */
    50%  { left: 390px; top: 12px; }
    /* go pick up the note */
    58%  { left: 64px;  top: 130px; }
    /* drag note into position */
    72%  { left: 200px; top: 30px; }
    100% { left: 50%;  top: 50%; opacity: 0; }
}

@keyframes tut-caption {
    0%, 6% { content: "Welcome — let's build a card board."; }
    7%, 20% { content: "Step 1: Add a box for a day or a category."; }
    21%, 36% { content: "Step 2: Add cards to the box."; }
    37%, 52% { content: "Step 3: Add applications to the box."; }
    53%, 65% { content: "Step 4: Add a note to capture remarks."; }
    66%, 90% { content: "Step 5: Drag cards between boxes to finalize the order."; }
    91%, 100% { content: "That's it! Click Add Box to start."; }
}
.board-tutorial__caption::before {
    content: "Welcome — let's build a card board.";
    animation: tut-caption-text 24s infinite linear;
}
@keyframes tut-caption-text {
    0%, 6%   { content: "Welcome — let's build a card board."; }
    7%, 20%  { content: "Step 1: Add a box for a day or a category."; }
    21%, 36% { content: "Step 2: Add cards to the box."; }
    37%, 52% { content: "Step 3: Add applications to the box."; }
    53%, 65% { content: "Step 4: Add a note to capture remarks."; }
    66%, 90% { content: "Step 5: Drag cards between boxes to finalize the order."; }
    91%, 100% { content: "That's it! Close this and click Add Box to start."; }
}

/* Highlight ring on each toolbar button as the cursor "hovers" */
.tut-toolbar .tut-tbtn { transition: box-shadow .25s, transform .25s; }
.tut-toolbar .tut-tbtn[data-tut-step="add-box"]    { animation: tut-highlight 24s infinite both; animation-delay: 1s; }
.tut-toolbar .tut-tbtn[data-tut-step="add-card"]   { animation: tut-highlight 24s infinite both; animation-delay: 3.5s; }
.tut-toolbar .tut-tbtn[data-tut-step="add-app"]    { animation: tut-highlight 24s infinite both; animation-delay: 6s; }
.tut-toolbar .tut-tbtn[data-tut-step="add-note"]   { animation: tut-highlight 24s infinite both; animation-delay: 8.5s; }
.tut-toolbar .tut-tbtn[data-tut-step="add-compact"]  { animation: tut-highlight 24s infinite both; animation-delay: 12s; }

@keyframes tut-highlight {
    0%, 100% { box-shadow: none; transform: scale(1); }
    /* a 2-second emphasis pulse */
    1%, 9%   { box-shadow: 0 0 0 3px rgba(0,117,178,.35); transform: scale(1.06); }
}

/* ── Compact / trash drop-target states (box dragged onto them) ── */
.board-box.is-compact.is-box-droptarget-candidate {
    border-color: #94a3b8;
    box-shadow: 0 0 0 2px rgba(100, 116, 139, .22);
    transition: border-color .15s, box-shadow .15s;
}
.board-box.is-compact.is-box-over-compact {
    border-color: var(--vc-primary, #0075b2);
    box-shadow:
        0 0 0 4px rgba(0, 117, 178, .28),
        0 0 24px rgba(0, 117, 178, .18);
    transform: scale(1.015);
}

:root {
    --board-infinite-surface: #f6f9fc;
}

body:has(.board-page),
body:has(.board-page) .body,
body:has(.board-page) .content-body,
body:has(.board-page) .main-content,
body:has(.board-page) .page-content,
body:has(.board-page) .app-content,
.board-page,
.board-canvas {
    background-color: var(--board-infinite-surface);
}

.board-page {
    min-height: 100vh;
}

/* ── Minimap ───────────────────────────────────────────── */
.board-minimap {
    position: fixed;
    bottom: 1.25rem;
    right: 4.75rem;
    width: 160px;
    height: 120px;
    background: rgba(255,255,255,0.92);
    border: 1px solid #d6dbe2;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(15,23,42,.14);
    overflow: hidden;
    z-index: 900;
    cursor: crosshair;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
}
.board-minimap.is-visible { opacity: 1; pointer-events: auto; }

.board-minimap.is-collapsed {
    width: 42px;
    height: 36px;
    cursor: default;
}

.board-minimap.is-collapsed .board-minimap__inner {
    display: none;
}

.board-minimap__toggle {
    position: absolute;
    top: .35rem;
    right: .35rem;
    z-index: 2;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid rgba(148, 163, 184, .7);
    border-radius: 5px;
    background: rgba(255, 255, 255, .9);
    color: #334155;
    font-size: .85rem;
    font-weight: 800;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.board-minimap__toggle:hover {
    background: #f8fafc;
    color: var(--vc-primary, #0075b2);
}

.board-minimap.is-collapsed .board-minimap__toggle {
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
}

@media (max-width: 767.98px) {
    .board-minimap {
        right: 1rem;
        bottom: 4.75rem;
    }
}

.board-minimap__inner { position: relative; width: 100%; height: 100%; }

.board-minimap__box {
    position: absolute;
    border-radius: 2px;
    opacity: 0.85;
}

.board-minimap__viewport {
    position: absolute;
    background: rgba(0,117,178,0.12);
    border: 1.5px solid rgba(0,117,178,0.55);
    border-radius: 2px;
    pointer-events: none;
}

/* Ensure .board-page scrolls in fullscreen (some browsers need this explicit) */
.board-page:fullscreen,
.board-page:-webkit-full-screen {
    overflow: auto;   /* already set; ensure it's present */
}
