﻿/* Fonts are loaded dynamically via wp_enqueue_style based on the Typography settings. */

:root {
    --bn-primary: #27cfc3;
    --bn-shadow: rgba(0, 0, 0, 0.08);
    --bn-shadow-hover: rgba(0, 0, 0, 0.15);
    --bn-radius: 16px;
    /* Overridden by inline CSS when custom colors/fonts are saved in settings */
    --bn-button-bg: #111;
    --bn-button-hover: #27cfc3;
    --bn-icon-color: #ffffff;
    --bn-icon-hover-color: #ffffff;
    --bn-badge-bg: #ef4444;
    --bn-ui-font: 'Inter', sans-serif;
    --bn-note-font: 'Gochi Hand', cursive;
}

/* Floating Toggle Button */
.boat-notes-widget-wrap {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 999999;
    font-family: var(--bn-ui-font);
}

.boat-notes-toggle-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bn-button-bg);
    color: var(--bn-icon-color) !important;
    border: none !important;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    padding: 0 !important;
}

.boat-notes-toggle-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--bn-button-hover);
    color: var(--bn-icon-hover-color) !important;
}

.boat-notes-toggle-btn .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
}

.bn-svg-icon {
    display: inline-block;
    width: 28px;
    height: 28px;
    background-color: currentColor;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    vertical-align: middle;
    flex-shrink: 0;
}

.bn-svg-icon--sm {
    width: 20px;
    height: 20px;
}

.custom-note-icon-small img {
    width: 24px;
    height: 24px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 10px;
    object-fit: contain;
}

.notes-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--bn-badge-bg);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
}

/* Left-side position variant */
.bn-position-left.boat-notes-widget-wrap {
    right: auto;
    left: 30px;
}

.bn-position-left .boat-notes-panel {
    right: auto;
    left: -420px;
    box-shadow: 10px 0 50px rgba(0, 0, 0, 0.1);
}

.bn-position-left .boat-notes-panel.open {
    right: auto;
    left: 20px;
}

/* Side Panel */
.boat-notes-panel {
    position: fixed;
    top: 20px;
    bottom: 20px;
    right: -420px;
    width: 380px;
    background: #fff;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.1);
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #f0f0f0;
    overflow: hidden;
}

.boat-notes-panel.open {
    right: 20px;
}

.notes-panel-header {
    padding: 25px 30px;
    border-bottom: 1px solid #f5f5f5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fcfcfc;
}

.notes-panel-header h3 {
    margin: 0 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111 !important;
    display: flex;
    align-items: center;
    gap: 10px;
}

.notes-panel-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bn-view-all-link {
    margin-left: auto;
    align-self: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--bn-button-bg);
    text-decoration: none;
    white-space: nowrap;
    opacity: 0.7;
    padding: 4px 6px;
    transition: opacity 0.2s;
}

.bn-view-all-link:hover {
    opacity: 1;
    text-decoration: underline;
}

.panel-close-btn {
    background: none !important;
    border: none !important;
    font-size: 24px;
    color: #bbb;
    cursor: pointer;
    transition: color 0.2s;
}

.panel-close-btn:hover {
    color: #333;
}

/* Notes List (The Stickies) */
.notes-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px;
    background: #f9f9f9;
}

.boat-notes-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sticky-note {
    background: #fff9c4;
    padding: 20px;
    border-radius: 2px;
    box-shadow: 2px 2px 10px var(--bn-shadow);
    position: relative;
    transition: all 0.3s ease;
    transform: rotate(-1deg);
    cursor: default;
}

.sticky-note::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    border-width: 0 16px 16px 0;
    border-style: solid;
    border-color: rgba(0,0,0,0.05) #f9f9f9;
}

.sticky-note:nth-child(even) {
    transform: rotate(1deg);
}

.sticky-note:hover {
    transform: scale(1.02) rotate(0deg);
    box-shadow: 5px 5px 20px var(--bn-shadow-hover);
    z-index: 10;
}

.note-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.note-date {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0,0,0,0.4);
    text-transform: uppercase;
}

.note-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

.note-edit,
.note-delete,
.welcome-note-delete {
    background: none !important;
    border: none !important;
    padding: 2px !important;
    color: rgba(0,0,0,0.3) !important;
    cursor: pointer;
    font-size: 15px !important;
    line-height: 1 !important;
    transition: color 0.2s;
}

.note-edit:hover {
    color: var(--bn-button-bg) !important;
}

.note-delete:hover,
.welcome-note-delete:hover {
    color: #ef4444 !important;
}

/* Delete confirmation overlay */
.bn-delete-confirm {
    position: absolute;
    inset: 0;
    border-radius: 2px;
    background: rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    z-index: 20;
    animation: bnFadeIn 0.15s ease;
}

@keyframes bnFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.bn-delete-confirm p {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    text-align: center;
    padding: 0 16px;
}

.bn-delete-confirm-actions {
    display: flex;
    gap: 8px;
}

.bn-delete-confirm-yes {
    background: #ef4444 !important;
    color: #fff !important;
    border: none !important;
    padding: 7px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.bn-delete-confirm-yes:hover {
    background: #dc2626 !important;
}

.bn-delete-confirm-cancel {
    background: rgba(255,255,255,0.15) !important;
    color: #fff !important;
    border: 1px solid rgba(255,255,255,0.4) !important;
    padding: 7px 16px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: background 0.2s !important;
}

.bn-delete-confirm-cancel:hover {
    background: rgba(255,255,255,0.25) !important;
}

/* Highlight the note currently being edited */
.sticky-note.bn-note-editing {
    outline: 2px solid var(--bn-button-bg);
    outline-offset: 3px;
    transform: scale(1.01) rotate(0deg) !important;
    z-index: 10;
}

.cancel-edit-btn {
    background: none !important;
    border: 1px solid #ddd !important;
    padding: 8px 14px !important;
    border-radius: 8px !important;
    font-size: 13px !important;
    color: #888 !important;
    cursor: pointer !important;
    margin-left: 8px !important;
    transition: all 0.2s;
}

.cancel-edit-btn:hover {
    border-color: #bbb !important;
    color: #444 !important;
}

.note-content-text {
    font-family: var(--bn-note-font);
    font-size: 18px;
    line-height: 1.4;
    color: #333;
}

.note-meta {
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed rgba(0,0,0,0.1);
    font-size: 12px;
    color: rgba(0,0,0,0.5);
    font-weight: 600;
}

/* Form Footer */
.notes-panel-footer {
    padding: 25px 30px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.note-form-wrap textarea {
    box-sizing: border-box !important;
    width: 100% !important;
    height: 100px !important;
    padding: 15px !important;
    border-radius: 12px !important;
    border: 2px solid #f0f0f0 !important;
    resize: none !important;
    font-size: 14px !important;
    font-family: var(--bn-note-font) !important;
    background-color: #fff9c4;
    margin-bottom: 15px !important;
    transition: border-color 0.3s, background-color 0.2s;
}

.note-form-wrap textarea:focus {
    border-color: var(--bn-button-bg) !important;
    outline: none !important;
}

.note-form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.color-picker-wrap {
    display: flex;
    gap: 8px;
}

.color-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0 !important;
    transition: all 0.2s;
}

.color-dot.active {
    border-color: #333;
    transform: scale(1.2);
}

.save-note-btn {
    background: var(--bn-button-bg) !important;
    color: var(--bn-icon-color) !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 10px !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    transition: background 0.2s, color 0.2s !important;
}

.save-note-btn:hover {
    background: var(--bn-button-hover) !important;
    color: var(--bn-icon-hover-color) !important;
}

/* Sticky Board (All Notes) */
.boat-notes-board-container {
    padding: 40px 0;
    font-family: var(--bn-ui-font);
}

.board-header {
    margin-bottom: 40px;
    text-align: center;
}

.board-header h2 {
    font-size: 36px !important;
    font-weight: 800 !important;
    letter-spacing: -1.5px !important;
    margin-bottom: 10px !important;
}

.boat-notes-board-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
}


.parent-link {
    display: inline-block;
    margin-top: 10px;
    font-size: 11px;
    color: var(--bn-primary);
    text-decoration: none;
    font-weight: 700;
}

.parent-link:hover {
    text-decoration: underline;
}

.notes-loading {
    text-align: center;
    padding: 60px 40px;
    color: #bbb;
    font-style: italic;
    font-size: 14px;
}

.notes-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
    color: #888;
}

.boat-notes-board-grid .notes-empty-state {
    grid-column: 1 / -1;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    background: #fbfbfb;
    border: 1px solid #f0f0f0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 25px;
    color: #ddd;
    box-shadow: 0 10px 20px rgba(0,0,0,0.02);
}

.empty-state-icon .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.notes-empty-state h4 {
    font-size: 16px;
    font-weight: 800;
    color: #111;
    margin: 0 0 10px 0 !important;
    letter-spacing: -0.5px;
}

.notes-empty-state p {
    font-size: 14px;
    line-height: 1.6;
    color: #888;
    max-width: 260px;
    margin: 0 !important;
}

.notes-empty-state strong {
    color: #444;
    word-break: break-word;
}

/* ==========================================================================
   Themes
   ========================================================================== */

/* ── Notebook ── */
.bn-theme-notebook .bn-panel-tabs,
.bn-theme-notebook .notes-panel-body {
    background: #eef2ff;
}

.bn-theme-notebook .sticky-note {
    background: #fff !important;
    transform: none !important;
    border-radius: 2px;
    box-shadow: 1px 2px 6px rgba(0, 0, 0, 0.08);
    padding: 16px 16px 16px 48px;
}

.bn-theme-notebook .sticky-note::before {
    content: '';
    position: absolute;
    left: 36px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: #f87171;
    border: none;
}

.bn-theme-notebook .sticky-note:hover {
    transform: scale(1.01) !important;
}

.bn-theme-notebook .note-content-text {
    color: #1e3a8a;
    line-height: 28px;
    /* Gradient applied here so rule period = line-height, baseline always on the line.
       Line position within each 28px period: half-leading(5) + font-size(18) × 0.8 ≈ 19px. */
    background-image: repeating-linear-gradient(
        transparent 0, transparent 19px,
        #c5d3f5 19px, #c5d3f5 20px
    );
    background-size: 100% 28px;
    padding-bottom: 28px;
}

.bn-theme-notebook .note-date {
    color: rgba(30, 58, 138, 0.5);
}

.bn-theme-notebook .note-form-wrap textarea {
    background-color: #fff !important;
    /* font-size: 14px, line-height: 28px → baseline at 18px into line box.
       background-position-y = textarea padding-top (15px) shifts pattern down
       so the rule lands at 15 + 18 = 33px = first baseline from textarea top. */
    background-image: repeating-linear-gradient(
        transparent 0, transparent 18px,
        #c5d3f5 18px, #c5d3f5 19px
    ) !important;
    background-size: 100% 28px !important;
    background-position-y: 15px !important;
    line-height: 28px !important;
    color: #1e3a8a !important;
}

/* ── Torn Paper ── */
.bn-theme-torn .bn-panel-tabs,
.bn-theme-torn .notes-panel-body {
    background: #fdf8f0;
}

.bn-theme-torn .sticky-note {
    background: #f4e4c8 !important;
    border-radius: 1px;
    box-shadow: 2px 3px 10px rgba(0, 0, 0, 0.14);
    clip-path: polygon(
        0% 3%, 2% 0%, 5% 3%, 8% 1%, 11% 3%, 14% 0%, 18% 3%, 21% 1%,
        25% 3%, 28% 0%, 32% 3%, 35% 1%, 39% 3%, 42% 0%, 46% 3%, 49% 1%,
        53% 3%, 56% 0%, 60% 3%, 63% 1%, 67% 3%, 70% 0%, 74% 3%, 77% 1%,
        81% 3%, 84% 0%, 88% 3%, 91% 1%, 95% 3%, 98% 0%, 100% 3%,
        100% 97%, 98% 100%, 95% 97%, 91% 100%, 88% 97%, 84% 100%,
        81% 97%, 77% 100%, 74% 97%, 70% 100%, 67% 97%, 63% 100%,
        60% 97%, 56% 100%, 53% 97%, 49% 100%, 46% 97%, 42% 100%,
        39% 97%, 35% 100%, 32% 97%, 28% 100%, 25% 97%, 21% 100%,
        18% 97%, 14% 100%, 11% 97%, 8% 100%, 5% 97%, 2% 100%, 0% 97%
    );
    padding: 22px 18px;
}

.bn-theme-torn .sticky-note::before {
    display: none;
}

.bn-theme-torn .sticky-note:nth-child(even) {
    background: #ecddc0 !important;
}

.bn-theme-torn .note-content-text {
    color: #4a3728;
}

.bn-theme-torn .note-date {
    color: rgba(74, 55, 40, 0.5);
}

.bn-theme-torn .note-form-wrap textarea {
    background-color: #f4e4c8 !important;
    color: #4a3728 !important;
    border-color: #d9c4a0 !important;
}

.bn-theme-torn .note-form-wrap textarea:focus {
    border-color: var(--bn-button-bg) !important;
}

/* ── Minimal ── */
.bn-theme-minimal .bn-panel-tabs,
.bn-theme-minimal .notes-panel-body {
    background: #f5f5f5;
}

.bn-theme-minimal .sticky-note {
    background: #fff !important;
    border-radius: 10px;
    transform: none !important;
    box-shadow: none;
    border: 1.5px solid #e8e8e8;
}

.bn-theme-minimal .sticky-note::before {
    display: none;
}

.bn-theme-minimal .sticky-note:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.07);
    border-color: #d0d0d0;
}

.bn-theme-minimal .sticky-note.bn-note-editing {
    transform: translateY(-2px) !important;
}

.bn-theme-minimal .note-content-text {
    color: #1a1a1a;
}

.bn-theme-minimal .note-form-wrap textarea {
    background-color: #fff !important;
    border-radius: 10px !important;
}

/* Hide color picker for themes that ignore note colors */
.bn-theme-notebook .color-picker-wrap,
.bn-theme-torn .color-picker-wrap,
.bn-theme-minimal .color-picker-wrap {
    display: none;
}

/* ==========================================================================
   Background Patterns
   ========================================================================== */

/* Base styling for board container when any pattern is active */
.boat-notes-board-container.bn-pattern-dots,
.boat-notes-board-container.bn-pattern-grid,
.boat-notes-board-container.bn-pattern-lines,
.boat-notes-board-container.bn-pattern-diagonal,
.boat-notes-board-container.bn-pattern-crosshatch {
    background-color: #fafafa;
    border-radius: 12px;
    padding: 40px;
}

/* ── Dots ── */
.bn-pattern-dots .notes-panel-body,
.boat-notes-board-container.bn-pattern-dots {
    background-image: radial-gradient(circle, rgba(0,0,0,0.08) 1.5px, transparent 1.5px);
    background-size: 20px 20px;
}

/* ── Grid ── */
.bn-pattern-grid .notes-panel-body,
.boat-notes-board-container.bn-pattern-grid {
    background-image:
        linear-gradient(rgba(0,0,0,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0,0,0,0.05) 1px, transparent 1px);
    background-size: 24px 24px;
}

/* ── Lines ── */
.bn-pattern-lines .notes-panel-body,
.boat-notes-board-container.bn-pattern-lines {
    background-image: linear-gradient(rgba(0,0,0,0.06) 1px, transparent 1px);
    background-size: 100% 24px;
}

/* ── Diagonal ── */
.bn-pattern-diagonal .notes-panel-body,
.boat-notes-board-container.bn-pattern-diagonal {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(0,0,0,0.04) 10px,
        rgba(0,0,0,0.04) 11px
    );
}

/* ── Crosshatch ── */
.bn-pattern-crosshatch .notes-panel-body,
.boat-notes-board-container.bn-pattern-crosshatch {
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(0,0,0,0.04) 8px, rgba(0,0,0,0.04) 9px),
        repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(0,0,0,0.04) 8px, rgba(0,0,0,0.04) 9px);
}

/* Board — theme overrides */
.bn-theme-notebook .boat-notes-board-grid .sticky-note {
    padding-left: 48px;
}

.bn-theme-minimal .boat-notes-board-grid .sticky-note {
    transform: none !important;
}

/* ==========================================================================
   Trash / Recycle Bin
   ========================================================================== */

/* Tab pills (Notes / Trash) */
.bn-panel-tabs {
    display: flex;
    gap: 4px;
    padding: 0 20px 0;
    border-bottom: 1px solid #f0f0f0;
    background: #fcfcfc;
}

.bn-panel-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px !important;
    background: none !important;
    border: none !important;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 13px;
    font-weight: 500;
    color: #888;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.bn-panel-tab:hover {
    color: #333;
}

.bn-panel-tab--active {
    color: #111 !important;
    border-bottom-color: var(--bn-primary) !important;
}

.bn-panel-tab .dashicons {
    font-size: 15px;
    width: 15px;
    height: 15px;
    opacity: 0.7;
}

/* Count badge on tabs */
.bn-tab-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    background: var(--bn-primary);
    color: #fff;
}

.bn-tab-badge--muted {
    background: #e8e8e8;
    color: #666;
}

/* Trash view container */
.bn-trash-view {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.bn-trash-actions-bar {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 12px;
}

.bn-empty-trash-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: none !important;
    border: none !important;
    color: #ef4444;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 8px !important;
    border-radius: 4px;
    transition: background 0.2s;
}

.bn-empty-trash-btn:hover {
    background: #fff0f0 !important;
}

/* Trash list scroll area */
.bn-trash-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.bn-trash-empty-msg {
    text-align: center;
    color: #aaa;
    font-size: 13px;
    padding: 20px 0;
}

/* Individual trashed note card */
.bn-trash-note {
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0.88;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.bn-trash-note-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.bn-trash-note-origin {
    font-size: 11px;
    font-weight: 600;
    color: rgba(0,0,0,0.45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bn-trash-note-date {
    font-size: 11px;
    color: rgba(0,0,0,0.35);
    white-space: nowrap;
    flex-shrink: 0;
}

.bn-trash-note-content {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(0,0,0,0.7);
    white-space: pre-wrap;
    word-break: break-word;
}

.bn-trash-note-actions {
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.bn-trash-restore,
.bn-trash-delete-forever {
    background: none !important;
    border: none !important;
    cursor: pointer;
    font-size: 12px;
    padding: 3px 8px !important;
    border-radius: 4px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
}

.bn-trash-restore {
    color: var(--bn-primary);
    background: rgba(39,207,195,0.08) !important;
}

.bn-trash-restore:hover {
    background: rgba(39,207,195,0.2) !important;
}

.bn-trash-delete-forever {
    color: #ef4444;
    background: rgba(239,68,68,0.06) !important;
}

.bn-trash-delete-forever:hover {
    background: rgba(239,68,68,0.15) !important;
}

/* Note fade-out animation when being trashed */
.bn-note-trashing {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.2s;
}

/* ==========================================================================
   Board Filters
   ========================================================================== */

.bn-board-filters {
    margin-bottom: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bn-filter-search {
    position: relative;
}

.bn-filter-search .dashicons {
    position: absolute;
    left: 13px;
    top: 50%;
    transform: translateY(-50%);
    color: #bbb;
    font-size: 18px;
    width: 18px;
    height: 18px;
    pointer-events: none;
}

.bn-filter-search input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 14px 11px 40px;
    border: 1.5px solid #e8e8e8;
    border-radius: 10px;
    font-size: 14px;
    font-family: var(--bn-ui-font);
    background: #fff;
    color: #111;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.bn-filter-search input[type="text"]:focus {
    border-color: var(--bn-primary);
    box-shadow: 0 0 0 3px rgba(39, 207, 195, 0.12);
}

.bn-filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.bn-filter-row select {
    padding: 8px 30px 8px 11px;
    border: 1.5px solid #e8e8e8;
    border-radius: 8px;
    font-size: 13px;
    font-family: var(--bn-ui-font);
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23aaa' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: calc(100% - 10px) center;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
    outline: none;
}

.bn-filter-row select:focus {
    border-color: var(--bn-primary);
}

.bn-filter-row select.bn-filter-active {
    border-color: var(--bn-primary);
    background-color: rgba(39, 207, 195, 0.04);
    color: #111;
}

/* Color swatches */
.bn-filter-colors {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.bn-filter-colors-label {
    font-size: 12px;
    color: #aaa;
    font-family: var(--bn-ui-font);
    white-space: nowrap;
}

.bn-filter-color-dot {
    position: relative;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid transparent;
    cursor: pointer;
    transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
    flex-shrink: 0;
    padding: 0 !important;
    outline: none;
}

.bn-filter-color-dot:hover {
    transform: scale(1.18);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.bn-filter-color-dot.active {
    border-color: #333;
    transform: scale(1.18);
}

/* Checkmark overlay on selected swatches */
.bn-filter-color-dot.active::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 11px;
    font-weight: 900;
    line-height: 1;
    pointer-events: none;
    color: #fff;
    text-shadow: 0 0 2px rgba(0, 0, 0, 0.55), 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* "All" swatch — white circle with dashed border */
.bn-filter-color-all {
    background: #fff !important;
    border-style: dashed !important;
    border-color: #ccc !important;
}

.bn-filter-color-all:hover {
    border-color: #888 !important;
}

.bn-filter-color-all.active {
    border-style: solid !important;
    border-color: #333 !important;
}

.bn-filter-color-all.active::after {
    color: #333;
    text-shadow: none;
}

/* Clear filters button */
.bn-filter-clear {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none !important;
    border: 1.5px solid #e8e8e8 !important;
    padding: 7px 12px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #999 !important;
    cursor: pointer !important;
    font-family: var(--bn-ui-font) !important;
    transition: border-color 0.2s, color 0.2s, background 0.2s !important;
    white-space: nowrap;
}

.bn-filter-clear .dashicons {
    font-size: 14px;
    width: 14px;
    height: 14px;
}

.bn-filter-clear:hover {
    border-color: #ef4444 !important;
    color: #ef4444 !important;
    background: rgba(239, 68, 68, 0.04) !important;
}

/* Result count line */
.bn-board-result-count {
    font-size: 12px;
    color: #bbb;
    text-align: right;
    margin: -16px 0 16px;
    font-family: var(--bn-ui-font);
}

/* ==========================================================================
   Mobile — bottom sheet layout (≤ 640px)
   ========================================================================== */

@media (max-width: 640px) {

    /* Slightly smaller toggle button */
    .boat-notes-toggle-btn {
        width: 52px;
        height: 52px;
    }

    /* Reposition widget closer to screen edge */
    .boat-notes-widget-wrap {
        bottom: 20px;
        right: 16px;
    }

    .bn-position-left.boat-notes-widget-wrap {
        left: 16px;
    }

    /* Bottom sheet: slide up from below instead of sliding in from side */
    .boat-notes-panel,
    .bn-position-left .boat-notes-panel {
        top: auto !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        max-height: 88vh;
        border-radius: 20px 20px 0 0 !important;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15) !important;
        transform: translateY(calc(100% + 4px));
        /* Keep right-based transition from desktop but override with transform */
        transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1) !important;
    }

    .boat-notes-panel.open,
    .bn-position-left .boat-notes-panel.open {
        right: 0 !important;
        left: 0 !important;
        transform: translateY(0) !important;
    }

    /* Drag handle pill at top of sheet */
    .boat-notes-panel::before {
        content: '';
        display: block;
        flex-shrink: 0;
        width: 36px;
        height: 4px;
        background: #e0e0e0;
        border-radius: 2px;
        margin: 10px auto 0;
    }

    /* Tighter inner padding */
    .notes-panel-header {
        padding: 16px 20px;
    }

    .notes-panel-body {
        padding: 20px;
    }

    .bn-panel-tabs {
        padding: 0 16px;
    }

    .notes-panel-footer {
        padding: 16px 20px;
        /* Respect iPhone home indicator safe area */
        padding-bottom: max(16px, env(safe-area-inset-bottom));
    }

    /* Trash view padding matches body */
    #bn-trash-view {
        padding: 0;
    }

    /* Board filters collapse on mobile */
    .bn-filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .bn-filter-row select {
        width: 100%;
    }

    .bn-filter-clear {
        margin-left: 0 !important;
        justify-content: center;
    }

    .bn-filter-colors {
        justify-content: flex-start;
    }
}

/* ==========================================================================
   Dark Mode
   #boat-notes-widget.bn-dark → widget panel (ID + class = high specificity)
   .boat-notes-board-container.bn-dark → board page
   ========================================================================== */

/* ── Scheme toggle button (always rendered, styled here) ── */
.bn-scheme-toggle-btn {
    background: none !important;
    border: none !important;
    padding: 4px !important;
    cursor: pointer;
    color: #bbb;
    display: flex;
    align-items: center;
    line-height: 1;
    transition: color 0.2s;
}

.bn-scheme-toggle-btn:hover { color: #555; }

#boat-notes-widget.bn-dark .bn-scheme-toggle-btn       { color: #666; }
#boat-notes-widget.bn-dark .bn-scheme-toggle-btn:hover { color: #ccc !important; }

.bn-scheme-toggle-btn .bn-icon-moon,
.bn-scheme-toggle-btn .bn-icon-sun {
    display: flex;
    align-items: center;
    line-height: 1;
}

/* Sun hidden by default; shown when button has .is-dark */
.bn-scheme-toggle-btn .bn-icon-sun  { display: none; }
.bn-scheme-toggle-btn.is-dark .bn-icon-moon { display: none; }
.bn-scheme-toggle-btn.is-dark .bn-icon-sun  { display: flex; }

/* ── Panel shell ── */
#boat-notes-widget.bn-dark .boat-notes-panel {
    background: #1c1c1e !important;
    border-color: #2c2c2e !important;
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5) !important;
}

/* ── Panel header ── */
#boat-notes-widget.bn-dark .notes-panel-header {
    background: #141416 !important;
    border-bottom-color: #2c2c2e !important;
}

#boat-notes-widget.bn-dark .notes-panel-header h3 {
    color: #f0f0f0 !important;
}

#boat-notes-widget.bn-dark .notes-panel-header .dashicons {
    color: #666 !important;
}

#boat-notes-widget.bn-dark .bn-view-all-link {
    color: var(--bn-primary) !important;
}

#boat-notes-widget.bn-dark .panel-close-btn {
    color: #555 !important;
}

#boat-notes-widget.bn-dark .panel-close-btn:hover {
    color: #ccc !important;
}

/* ── Panel tabs ── */
#boat-notes-widget.bn-dark .bn-panel-tabs {
    background: #111113 !important;
    border-bottom-color: #2c2c2e !important;
}

#boat-notes-widget.bn-dark .bn-panel-tab {
    color: #555 !important;
    background: transparent !important;
    border-bottom-color: transparent !important;
}

#boat-notes-widget.bn-dark .bn-panel-tab--active {
    color: #f0f0f0 !important;
    background: #1c1c1e !important;
    border-bottom-color: #1c1c1e !important;
}

#boat-notes-widget.bn-dark .bn-tab-badge {
    background: #2a2a2c !important;
    color: #777 !important;
}

/* ── Panel body ── */
#boat-notes-widget.bn-dark .notes-panel-body {
    background: #111113 !important;
}

/* ── Loading / empty states ── */
#boat-notes-widget.bn-dark .notes-loading {
    color: #555 !important;
}

#boat-notes-widget.bn-dark .notes-empty-state h4 {
    color: #d0d0d0 !important;
}

#boat-notes-widget.bn-dark .notes-empty-state p {
    color: #555 !important;
}

#boat-notes-widget.bn-dark .notes-empty-state strong {
    color: #999 !important;
}

#boat-notes-widget.bn-dark .empty-state-icon {
    background: #1c1c1e !important;
    border-color: #2c2c2e !important;
    color: #444 !important;
}

/* ── Note cards — keep their own colors; only fix the fold corner ── */
#boat-notes-widget.bn-dark .sticky-note::before {
    border-color: rgba(255, 255, 255, 0.05) #111113 !important;
}

#boat-notes-widget.bn-dark .note-edit,
#boat-notes-widget.bn-dark .note-delete,
#boat-notes-widget.bn-dark .welcome-note-delete {
    color: rgba(255, 255, 255, 0.2) !important;
}

#boat-notes-widget.bn-dark .note-edit:hover      { color: var(--bn-button-bg) !important; }
#boat-notes-widget.bn-dark .note-delete:hover,
#boat-notes-widget.bn-dark .welcome-note-delete:hover { color: #ef4444 !important; }

#boat-notes-widget.bn-dark .cancel-edit-btn {
    border-color: #2c2c2e !important;
    color: #666 !important;
}

#boat-notes-widget.bn-dark .cancel-edit-btn:hover {
    border-color: #444 !important;
    color: #aaa !important;
}

#boat-notes-widget.bn-dark .color-dot.active { border-color: #fff !important; }

/* ── Panel footer + write form ── */
#boat-notes-widget.bn-dark .notes-panel-footer {
    background: #1c1c1e !important;
    border-top-color: #2c2c2e !important;
}

#boat-notes-widget.bn-dark .note-form-wrap textarea {
    background-color: #111113 !important;
    border-color: #2c2c2e !important;
    color: #e0e0e0 !important;
}

#boat-notes-widget.bn-dark .note-form-wrap textarea:focus {
    border-color: var(--bn-button-bg) !important;
}

/* ── Trash view ── */
#boat-notes-widget.bn-dark .bn-trash-actions-bar {
    background: #111113 !important;
    border-bottom-color: #2c2c2e !important;
}

#boat-notes-widget.bn-dark .bn-empty-trash-btn       { color: #555 !important; }
#boat-notes-widget.bn-dark .bn-empty-trash-btn:hover  { color: #ef4444 !important; }

#boat-notes-widget.bn-dark .bn-trash-note {
    border-color: rgba(255, 255, 255, 0.06) !important;
    background: #2a2a2c !important;
}

#boat-notes-widget.bn-dark .bn-trash-note-meta {
    color: rgba(255, 255, 255, 0.35) !important;
    border-bottom-color: rgba(255, 255, 255, 0.06) !important;
}

/* ── Board dark mode ── */
.boat-notes-board-container.bn-dark .board-header h2 { color: #f0f0f0 !important; }
.boat-notes-board-container.bn-dark .board-header p  { color: #888 !important; }

.boat-notes-board-container.bn-dark .bn-board-filters {
    background: #1c1c1e !important;
    border-color: #2c2c2e !important;
}

.boat-notes-board-container.bn-dark #bn-filter-search {
    background: #111113 !important;
    border-color: #2c2c2e !important;
    color: #e0e0e0 !important;
}

.boat-notes-board-container.bn-dark #bn-filter-search::placeholder { color: #444 !important; }

.boat-notes-board-container.bn-dark .bn-filter-row select {
    background: #111113 !important;
    border-color: #2c2c2e !important;
    color: #e0e0e0 !important;
}

.boat-notes-board-container.bn-dark .bn-filter-colors-label { color: #666 !important; }

.boat-notes-board-container.bn-dark .bn-filter-color-all {
    background: #2c2c2e !important;
    border-color: #444 !important;
}

.boat-notes-board-container.bn-dark .bn-filter-clear {
    color: #666 !important;
    border-color: #2c2c2e !important;
    background: transparent !important;
}

.boat-notes-board-container.bn-dark .bn-filter-clear:hover {
    background: #2c2c2e !important;
    color: #aaa !important;
    border-color: #444 !important;
}

.boat-notes-board-container.bn-dark .bn-board-result-count { color: #666 !important; }

.boat-notes-board-container.bn-dark .notes-empty-state h4 { color: #d0d0d0 !important; }
.boat-notes-board-container.bn-dark .notes-empty-state p  { color: #555 !important; }
.boat-notes-board-container.bn-dark .empty-state-icon {
    background: #1c1c1e !important;
    border-color: #2c2c2e !important;
}

/* ── Background patterns in dark mode — invert dot/line opacity ── */
#boat-notes-widget.bn-dark .bn-pattern-dots .notes-panel-body,
.boat-notes-board-container.bn-dark.bn-pattern-dots {
    background-image: radial-gradient(circle, rgba(255,255,255,0.07) 1.5px, transparent 1.5px) !important;
}

#boat-notes-widget.bn-dark .bn-pattern-grid .notes-panel-body,
.boat-notes-board-container.bn-dark.bn-pattern-grid {
    background-image:
        linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px) !important;
}

#boat-notes-widget.bn-dark .bn-pattern-lines .notes-panel-body,
.boat-notes-board-container.bn-dark.bn-pattern-lines {
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px) !important;
}

#boat-notes-widget.bn-dark .bn-pattern-diagonal .notes-panel-body,
.boat-notes-board-container.bn-dark.bn-pattern-diagonal {
    background-image: repeating-linear-gradient(
        45deg, transparent, transparent 10px,
        rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px
    ) !important;
}

#boat-notes-widget.bn-dark .bn-pattern-crosshatch .notes-panel-body,
.boat-notes-board-container.bn-dark.bn-pattern-crosshatch {
    background-image:
        repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px),
        repeating-linear-gradient(-45deg, transparent, transparent 10px, rgba(255,255,255,0.03) 10px, rgba(255,255,255,0.03) 11px) !important;
}