/* ── Board Stickies ─────────────────────────────────────────────────────── */

.board-stickies-page {
    background: #f5efe6;
    overflow: hidden;
    height: 100vh;
}

/* Toolbar */
.bs-toolbar {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: #fffdf9;
    border-bottom: 1px solid #e8ddd0;
}
.bs-toolbar.hidden { display: none; }

.bs-add-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #BB5D4C;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.bs-add-btn:hover { background: #a04f3f; }

.bs-zoom-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.bs-zoom-btn {
    background: #f0e8df;
    border: 1px solid #d4c4b5;
    border-radius: 6px;
    width: 30px;
    height: 30px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    color: #4a3728;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}
.bs-zoom-btn:hover { background: #e0d3c5; }
.bs-zoom-reset { font-size: 13px; }
.bs-zoom-label {
    font-size: 12px;
    color: #7a6855;
    min-width: 38px;
    text-align: center;
    font-family: 'DM Mono', monospace, inherit;
}

/* Viewport + Canvas */
.bs-viewport {
    position: fixed;
    top: 106px;
    left: 0;
    right: 0;
    bottom: 64px;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}
.bs-viewport.is-panning { cursor: grabbing; }

.bs-canvas {
    position: absolute;
    width: 4000px;
    height: 4000px;
    transform-origin: 0 0;
    /* stickies absolutely positioned inside */
}

/* Sticky card */
.bs-sticky {
    position: absolute;
    width: 280px;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(74, 55, 40, 0.18), 0 1px 4px rgba(74, 55, 40, 0.10);
    background: #fffdf9;
    display: flex;
    flex-direction: column;
    user-select: none;
    -webkit-user-select: none;
    transition: box-shadow 0.15s;
}
.bs-sticky.is-dragging {
    box-shadow: 0 10px 32px rgba(74, 55, 40, 0.28), 0 2px 8px rgba(74, 55, 40, 0.14);
    z-index: 9999 !important;
}

/* Color bar */
.bs-sticky-color-bar {
    height: 8px;
    border-radius: 10px 10px 0 0;
    flex-shrink: 0;
}
.bs-sticky[data-color="orange"] .bs-sticky-color-bar { background: #FF8C42; }
.bs-sticky[data-color="purple"] .bs-sticky-color-bar { background: #8B5CF6; }
.bs-sticky[data-color="pink"]   .bs-sticky-color-bar { background: #EC4899; }
.bs-sticky[data-color="blue"]   .bs-sticky-color-bar { background: #3B82F6; }

.bs-sticky[data-color="orange"] { background: #FFF8F3; }
.bs-sticky[data-color="purple"] { background: #F8F5FF; }
.bs-sticky[data-color="pink"]   { background: #FFF0F7; }
.bs-sticky[data-color="blue"]   { background: #F0F7FF; }

/* Sticky header (drag handle) */
.bs-sticky { cursor: grab; }
.bs-sticky.is-dragging { cursor: grabbing; }

.bs-sticky-header {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 8px 10px 4px;
}

.bs-sticky-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #2c1a10;
    line-height: 1.3;
    outline: none;
    word-break: break-word;
    min-height: 20px;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}
.bs-sticky-title:focus {
    background: rgba(255,255,255,0.7);
    border-radius: 4px;
    padding: 1px 3px;
    margin: -1px -3px;
}

.bs-sticky-delete-btn {
    background: none;
    border: none;
    color: #c0a898;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 0 2px;
    flex-shrink: 0;
    transition: color 0.15s;
}
.bs-sticky-delete-btn:hover { color: #c0392b; }

/* Date */
.bs-sticky-date {
    padding: 0 10px 4px;
    font-size: 10px;
    color: #a08060;
    letter-spacing: 0.03em;
}

/* Notes */
.bs-sticky-notes {
    margin: 0 10px 8px;
    padding: 6px 8px;
    border: 1px solid #e0d3c5;
    border-radius: 6px;
    background: rgba(255,255,255,0.65);
    font-size: 12px;
    font-family: inherit;
    color: #4a3728;
    resize: none;
    min-height: 60px;
    line-height: 1.5;
    outline: none;
    transition: border-color 0.15s;
    user-select: text;
    -webkit-user-select: text;
}
.bs-sticky-title {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #2c1a10;
    line-height: 1.3;
    outline: none;
    word-break: break-word;
    min-height: 20px;
    cursor: text;
    user-select: text;
    -webkit-user-select: text;
}
.bs-sticky-notes:focus { border-color: #BB5D4C; }

/* Photos strip */
.bs-photos-strip {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    padding: 0 10px 6px;
    scrollbar-width: none;
    position: relative;
    min-height: 0;
}
.bs-photos-strip::-webkit-scrollbar { display: none; }
.bs-photos-strip.has-photos { min-height: 64px; }

.bs-photo-thumb {
    flex-shrink: 0;
    width: 58px;
    height: 58px;
    border-radius: 6px;
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.15s, opacity 0.15s;
    position: relative;
    -webkit-touch-callout: none;
    user-select: none;
}
.bs-photo-thumb:hover { border-color: #BB5D4C; }
.bs-photo-thumb.is-dragging { opacity: 0.45; }

.bs-photo-wrap {
    position: relative;
    flex-shrink: 0;
    width: 58px;
    touch-action: none;
    -webkit-touch-callout: none;
    user-select: none;
}
.bs-photo-wrap.overlay-visible .bs-photo-del { opacity: 1; pointer-events: auto; }

.bs-photo-del {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    font-size: 10px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 2;
}

/* Actions row */
.bs-sticky-actions {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 10px 10px;
    border-top: 1px solid #ede5d8;
    flex-wrap: wrap;
}

.bs-action-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid #d4c4b5;
    background: rgba(255,255,255,0.7);
    color: #4a3728;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.bs-action-btn:hover { background: #e8ddd0; border-color: #b5a498; }
.bs-action-btn.bs-deploy-btn {
    background: #2c6e49;
    color: #fff;
    border-color: #2c6e49;
}
.bs-action-btn.bs-deploy-btn:hover { background: #1e4d33; border-color: #1e4d33; }
.bs-action-btn.bs-dl-btn {
    background: #2c3e50;
    color: #fff;
    border-color: #2c3e50;
}
.bs-action-btn.bs-dl-btn:hover { background: #1a252f; }
.bs-action-btn.bs-dl-btn.is-loading {
    opacity: 0.6;
    cursor: wait;
}

.bs-upload-label {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 5px 9px;
    border-radius: 6px;
    border: 1px solid #d4c4b5;
    background: rgba(255,255,255,0.7);
    color: #4a3728;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s;
}
.bs-upload-label:hover { background: #e8ddd0; }
.bs-upload-label input[type="file"] { display: none; }

/* Color picker */
.bs-color-picker {
    display: flex;
    gap: 5px;
    align-items: center;
    margin-left: auto;
}
.bs-color-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: transform 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.bs-color-dot:hover { transform: scale(1.2); }
.bs-color-dot.active { border-color: #4a3728; }
.bs-color-dot[data-color="orange"] { background: #FF8C42; }
.bs-color-dot[data-color="purple"] { background: #8B5CF6; }
.bs-color-dot[data-color="pink"]   { background: #EC4899; }
.bs-color-dot[data-color="blue"]   { background: #3B82F6; }

/* Deploy modal */
.bs-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 55, 40, 0.45);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.bs-modal-overlay.hidden { display: none; }

.bs-modal {
    background: #fffdf9;
    border-radius: 14px;
    padding: 24px 22px 20px;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 12px 40px rgba(74, 55, 40, 0.25);
}
.bs-modal-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c1a10;
    margin-bottom: 8px;
}
.bs-modal-desc {
    font-size: 13px;
    color: #7a6855;
    margin-bottom: 14px;
}
.bs-date-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d4c4b5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: #2c1a10;
    background: #fff;
    box-sizing: border-box;
    margin-bottom: 16px;
    outline: none;
}
.bs-date-input:focus { border-color: #BB5D4C; }

.bs-modal-actions {
    display: flex;
    gap: 10px;
}
.bs-modal-confirm {
    flex: 1;
    padding: 10px;
    background: #2c6e49;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}
.bs-modal-confirm:hover { background: #1e4d33; }
.bs-modal-cancel {
    flex: 1;
    padding: 10px;
    background: #f0e8df;
    color: #4a3728;
    border: 1px solid #d4c4b5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.bs-modal-cancel:hover { background: #e0d3c5; }

/* Empty state -- lives in viewport, not canvas, so pan/zoom don't move it */
.bs-empty-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #c4b5a0;
    pointer-events: none;
    z-index: 5;
}
.bs-empty-hint-icon { font-size: 40px; margin-bottom: 10px; }
.bs-empty-hint-text { font-size: 14px; }

/* Mobile: slightly narrower stickies */
@media (max-width: 400px) {
    .bs-sticky { width: 250px; }
}

/* Photo strip - needs position:relative for absolute reorder child */
.bs-photos-strip { position: relative; }

/* Reorder mode */
.bs-photo-wrap.reorder-dragging {
    box-shadow: 0 4px 18px rgba(0,0,0,0.28);
    transform: scale(1.08);
    transform-origin: center center;
    z-index: 10;
}
.bs-photos-strip.reorder-mode .bs-photo-wrap:not(.reorder-dragging) {
    transition: transform 0.15s ease;
}

/* Lightbox */
.bs-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    touch-action: none;
}
.bs-lightbox.bs-lightbox--visible { opacity: 1; }
.bs-lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    pointer-events: none;
}

/* Archive open button */
.bs-archive-open-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f0e8df;
    color: #4a3728;
    border: 1px solid #d4c4b5;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.bs-archive-open-btn:hover { background: #e0d3c5; }

/* Set view button */
.bs-set-view-btn {
    background: #f0e8df;
    border: 1px solid #d4c4b5;
    border-radius: 6px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    color: #4a3728;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s;
}
.bs-set-view-btn:hover { background: #e0d3c5; }

/* Archive overlay + panel */
.bs-archive-overlay {
    position: fixed;
    inset: 0;
    background: rgba(74, 55, 40, 0.5);
    z-index: 5000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 64px;
}
.bs-archive-overlay.hidden { display: none; }

.bs-archive-panel {
    background: #fffdf9;
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 75vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 24px rgba(74, 55, 40, 0.2);
}

.bs-archive-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1px solid #ede5d8;
    flex-shrink: 0;
}
.bs-archive-title {
    font-size: 15px;
    font-weight: 700;
    color: #2c1a10;
}
.bs-archive-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    color: #a08060;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}
.bs-archive-close-btn:hover { color: #4a3728; }

.bs-archive-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.bs-archive-empty {
    padding: 40px 20px;
    text-align: center;
    color: #b0a090;
    font-size: 13px;
}
.bs-archive-empty.hidden { display: none; }

.bs-archive-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    border-bottom: 1px solid #f0e8df;
}
.bs-archive-row:last-child { border-bottom: none; }

.bs-archive-color {
    width: 10px;
    height: 44px;
    border-radius: 4px;
    flex-shrink: 0;
}
.bs-archive-color[data-color="orange"] { background: #FF8C42; }
.bs-archive-color[data-color="purple"] { background: #8B5CF6; }
.bs-archive-color[data-color="pink"]   { background: #EC4899; }
.bs-archive-color[data-color="blue"]   { background: #3B82F6; }

.bs-archive-info {
    flex: 1;
    min-width: 0;
}
.bs-archive-row-title {
    font-size: 14px;
    font-weight: 600;
    color: #2c1a10;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.bs-archive-row-meta {
    font-size: 11px;
    color: #a08060;
    margin-top: 2px;
}

.bs-archive-row-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}
.bs-archive-restore-btn {
    padding: 5px 10px;
    background: #2c6e49;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.bs-archive-restore-btn:hover { background: #1e4d33; }
.bs-archive-del-btn {
    padding: 5px 10px;
    background: none;
    color: #c0392b;
    border: 1px solid #e0b0a8;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.bs-archive-del-btn:hover { background: #fdf0ee; }
