/**
 * assets/css/whiteboards.css
 * Styles for the Whiteboards module and shell.
 */
.whiteboards-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    margin: 0 -5px;
}

.whiteboards-outlet {
    flex: 1;
    height: -webkit-fill-available;
    overflow: hidden;
}

/* Shared Components */
.whiteboards-page-header {
    margin-bottom: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.whiteboards-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.whiteboards-loader {
    display: flex;
    justify-content: center;
    padding: 40px;
    color: var(--danger);
    font-weight: 500;
}

/* Overview Page */
.whiteboards-overview-page {
    padding: 20px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 4pc;
    height: -webkit-fill-available;
    overflow: auto;
}

.whiteboards-hero {
    text-align: center;
}

.whiteboards-hero-title {
    font-size: 2.8rem;
    margin-bottom: 12px;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.whiteboards-hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 36px;
}

.whiteboards-hero-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.whiteboards-hero-btn {
    min-width: 180px;
    height: 48px;
    font-weight: 600;
}

.whiteboards-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 32px;
}

.whiteboards-insight-card, .whiteboards-recommendations-card {
    padding: 32px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 28px;
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

.whiteboards-stats-row {
    display: flex;
    gap: 64px;
    margin-top: 24px;
    margin-bottom: 40px;
}

.whiteboards-card-subtitle {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.whiteboards-activity-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.whiteboards-activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--bg-light);
}

.whiteboards-activity-item:last-child {
    border-bottom: none;
}

.whiteboards-activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    opacity: 0.5;
    margin-top: 6px;
    flex-shrink: 0;
}

.whiteboards-activity-user {
    font-weight: 700;
    color: var(--text);
}

.whiteboards-activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 4px 0 0 0;
}

.whiteboards-stat-label {
    display: block;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
}

.whiteboards-stat-value {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary);
}

.whiteboards-rec-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.whiteboards-rec-item {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
    background: var(--bg-light);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whiteboards-rec-item:hover {
    background: var(--surface-deep);
    border-color: var(--primary-faded);
    transform: translateX(8px);
}

.whiteboards-rec-item i {
    font-size: 1.6rem;
    color: var(--primary);
    width: 52px;
    height: 52px;
    display: flex;
    align-items:center;
    justify-content: center;
    background: var(--primary-faded);
    border-radius: 14px;
}

.whiteboards-rec-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.whiteboards-rec-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Boards Grid */
.whiteboards-boards-page {
    padding: 10px 20px;
    animation: whiteboards-fade-in 0.4s ease-out;
    min-height: 0;
    height: stretch;
    overflow: auto;
}

@keyframes whiteboards-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.whiteboards-boards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 28px;
}

.whiteboards-empty-state {
    grid-column: 1 / -1;
    padding: 80px 20px;
    text-align: center;
    background: var(--surface);
    border: 2px dashed var(--line);
    border-radius: 32px;
}

.whiteboards-empty-icon {
    font-size: 4rem;
    color: var(--primary-faded);
    margin-bottom: 24px;
    display: block;
}

.whiteboards-empty-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.whiteboards-empty-summary {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.whiteboards-empty-actions {
    display: flex;
    justify-content: center;
    gap: 20px;
}

.whiteboards-board-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.whiteboards-board-card:hover {
    transform: translateY(-6px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px -15px rgba(0,0,0,0.15);
}

.whiteboards-template-card:hover .whiteboards-template-preview {
    opacity: 0.4;
}

.whiteboards-board-preview {
    height: 160px;
    background: var(--bg-light);
    border-radius: 16px;
    margin-bottom: 20px;
}

.whiteboards-board-info strong {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.whiteboards-board-info p {
    margin: 0;
}

.whiteboards-search-input {
    width: 320px;
    height: 40px;
    padding: 0 16px;
    border-radius: 20px;
    background: var(--bg-light);
    border: 1px solid var(--line);
    color: var(--text);
}

/* Library Page */
.whiteboards-library-page, 
.whiteboards-settings-page, 
.whiteboards-docs-page {
    display: flex;
    flex-direction: column;
    padding: 12px 18px;
    min-height: 0;
    gap: 12px;
    height: -webkit-fill-available;
    overflow: auto;
}

.whiteboards-library-header {
    display: flex;
    flex-direction: column;
}

.whiteboards-library-subtitle {
    color: var(--text-muted);
}

.whiteboards-library-layout {
    display: flex;
    gap: 20px;
    flex-direction: row-reverse;
    position: relative;
    overflow: auto;
    height: stretch;
    padding-right: 5px;
    margin-right: -10px;
}

.whiteboards-library-sidebar {
    top: 0;
    width: 260px;
    position: sticky;
    flex-shrink: 0;
    min-height: 0;
    height: stretch;
    display: grid;
}

.whiteboards-sidebar-section-title {
    padding: 0 5px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.whiteboards-sidebar-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 12px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 500;
    text-align: left;
    transition: all 0.2s ease;
    cursor: pointer;
}

.whiteboards-sidebar-btn:hover {
    background: var(--bg-light);
    color: var(--text);
    padding-left: 20px;
}

.whiteboards-sidebar-btn.active {
    background: var(--primary-faded);
    color: var(--primary);
}

.whiteboards-sidebar-btn i {
    font-size: 1.1rem;
}

.whiteboards-library-grid {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    grid-auto-rows: max-content;
    gap: 20px;
    padding: 10px 0;
}

.whiteboards-template-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.whiteboards-template-card:hover {
    transform: translateY(-8px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px -15px rgba(0,0,0,0.15);
}

.whiteboards-template-preview {
    height: 180px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    color: var(--primary);
    opacity: 0.2;
}

.whiteboards-template-info {
    padding: 24px;
}

.whiteboards-template-title {
    display: block;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.whiteboards-template-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.5;
}

.whiteboards-template-btn {
    width: 100%;
    height: 40px;
}

/* Editor Shell */
.whiteboard-editor-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.whiteboards-editor-header {
    position: absolute;
    width: 100%;
    padding: 8px 15px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
}

.whiteboards-header-left, .whiteboards-header-right {
    display: flex;
    align-items: center;
}

.whiteboards-title-pill {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 5px;
    padding: 5px 10px;
    background: var(--strans);
    border-radius: 24px;
    border: var(--line);
    transition: all 0.2s ease;
}

.whiteboards-title-pill:hover {
    border-color: var(--primary-faded);
    background: var(--surface);
}

.whiteboards-title-pill h2 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
}

.whiteboards-edit-title-btn {
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 2px;
}

.whiteboards-edit-title-btn:hover {
    color: var(--primary);
}

.whiteboards-template-form, .whiteboards-rename-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 10px;
}

.whiteboards-form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whiteboards-form-label {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.whiteboards-collaborators {
    display: flex;
    align-items: center;
}

.whiteboards-editor-controls-top {
    display: flex;
    align-items: center;
    gap: 5px;
    padding-right: 10px;
    border-left: 1px solid var(--line);
}

.whiteboards-editor-main {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    background: var(--bg);
}

.whiteboards-canvas-container {
    flex: 1;
    position: relative;
    background: var(--strans);
    overflow: hidden;
}

/* Documentation */
.whiteboards-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.whiteboards-doc-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 32px;
    transition: all 0.3s ease;
}

.whiteboards-doc-card:hover {
    border-color: var(--primary);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.1);
}

.whiteboards-doc-card i {
    display: block;
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 20px;
}

.whiteboards-doc-title {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.whiteboards-doc-summary {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    line-height: 1.6;
}

.whiteboards-doc-link {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}

/* Settings */
.whiteboards-settings-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.whiteboards-settings-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 24px;
}

.whiteboards-settings-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--bg-light);
}

.whiteboards-setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
}

.whiteboards-setting-info {
    flex: 1;
}

.whiteboards-setting-label {
    display: block;
    font-size: 1.1rem;
    margin-bottom: 4px;
}

.whiteboards-setting-summary {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
}

.whiteboards-editor-toolbar-right {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    backdrop-filter: blur(2px);
    background: var(--strans);
    border-radius: 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 16px 10px;
    z-index: 10;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.whiteboards-tool-btn {
    width: 32px;
    height: 32px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border: none;
    background: transparent;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-size: 1.01rem;
}

.whiteboards-tool-btn:hover {
    background: var(--dots);
    color: var(--text);
    transform: scale(1.1);
}

.whiteboards-tool-btn:active {
    transform: scale(0.95);
}

.whiteboards-tool-btn.active {
    background: var(--primary-dark);
    border: var(--line);
    color: #fff;
    box-shadow: var(--shadow);
}

.whiteboards-floating-bottom-bar {
    position: absolute;
    display: flex;
    bottom: 24px;
    left: 50%;
    gap: 1rem;
    transform: translateX(-50%);
    background: var(--strans);
    backdrop-filter: blur(3px);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 16px;
    z-index: 10;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    align-items: center;
    justify-content: space-between;
}

.whiteboards-zoom-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.9rem;
}

.whiteboards-zoom-controls button {
    border: none;
    background: var(--dots);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 2px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.whiteboards-zoom-controls button:hover {
    color: var(--primary);
}

.whiteboards-import-picker {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
}

.whiteboards-import-btn {
    text-align: left;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    border-radius: 16px;
}

.whiteboard-layer {
    image-rendering: auto;
}

/* The interaction layer must capture pointer input; it sits above the others. */
.whiteboards-canvas-container .layer-interaction {
    touch-action: none;
}

/* Documentation */
.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Settings */
.settings-content {
    max-width: 700px;
}

.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Utils */
.vinc { position: relative; }
.vinc-ring-active { border-color: var(--primary) !important; }

@media (max-width: 768px) {
    .overview-grid { grid-template-columns: 1fr; }
    .whiteboards-overview-page { padding: 20px; }
}

/* --- Premium Phase 2025 Upgrades --- */

.whiteboards-glass {
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
}

.whiteboards-glass-card {
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--primary, #7c5cff) 10%, transparent), transparent 48%),    linear-gradient(180deg, color-mix(in srgb, var(--bg, rgba(255,255,255,.04)) 95%, transparent), color-mix(in srgb, var(--bg, rgba(255,255,255,.04)) 84%, transparent));
    border: var(--line);
    border-radius: 28px;
    padding: 10px 20px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.whiteboards-glass-card:hover {
    background: color-mix(in srgb, var(--surface) 80%, transparent);
    border-color: var(--primary-faded);
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.15);
}

.whiteboards-gradient-thumb {
    width: 100%;
    height: 100%;
    border-radius: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 800;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.whiteboards-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.whiteboards-stat-card {
    padding: 24px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.whiteboards-stat-card .value {
    font-size: 2.4rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}

.whiteboards-stat-card .label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}

.whiteboards-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.whiteboards-section-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin: 0;
}

/* List Items */
.whiteboards-activity-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    border-radius: 18px;
    transition: background 0.2s ease;
}

.whiteboards-activity-row:hover {
    background: var(--bg-light);
}

.whiteboards-activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-faded);
    color: var(--primary);
    font-size: 1.2rem;
}

.whiteboards-activity-info {
    flex: 1;
}

.whiteboards-activity-info strong {
    display: block;
    font-size: 0.95rem;
}

.whiteboards-activity-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Boards Grid Enhancements */
.whiteboards-board-card .whiteboards-board-preview {
    overflow: hidden;
    position: relative;
}

.whiteboards-board-card .whiteboards-board-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, transparent 60%, rgba(0,0,0,0.05));
}

.whiteboards-badge-live {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    background: var(--danger);
    color: #fff;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.3);
    animation: wb-pulse 2s infinite;
    z-index: 2;
}

@keyframes wb-pulse {
    0% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
    100% { transform: scale(1); opacity: 1; }
}


/* Glassy Animation & Performance */
.whiteboards-glass-card {
    will-change: transform, box-shadow;
}

.whiteboards-loader {
    animation: wb-pulse 1.5s infinite ease-in-out;
}

/* Scrollbar refinement for glassy areas */
.whiteboards-outlet::-webkit-scrollbar {
    width: 6px;
}
.whiteboards-outlet::-webkit-scrollbar-thumb {
    background: var(--primary-faded);
    border-radius: 10px;
}
.whiteboards-outlet::-webkit-scrollbar-track {
    background: transparent;
}

/* Smooth module transitions */
#whiteboards-outlet {
    animation: whiteboards-fade-in 0.3s ease-out;
}

/* Empty State Polish */
.whiteboards-empty-state {
    background: color-mix(in srgb, var(--surface) 40%, transparent);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px dashed var(--line);
}


/* Editor Specific Polish */
.whiteboards-tool-btn.active {
    background: var(--primary);
    color: #fff;
    transform: scale(1.1);
    box-shadow: 0 8px 20px var(--primary-faded);
}

/* Skeleton Loaders */
@keyframes wb-shimmer {
    0% { background-position: -468px 0; }
    100% { background-position: 468px 0; }
}

.whiteboards-skeleton {
    background: #f6f7f8;
    background-image: linear-gradient(to right, #f6f7f8 0%, #edeef1 20%, #f6f7f8 40%, #f6f7f8 100%);
    background-repeat: no-repeat;
    background-size: 800px 104px;
    display: inline-block;
    position: relative;
    animation: wb-shimmer 1.2s infinite linear;
}


/* Floating Toolbars */
.whiteboards-context-toolbar {
    position: absolute;
    display: flex;
    gap: 8px;
    padding: 8px;
    background: color-mix(in srgb, var(--surface) 90%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    z-index: 1000;
    pointer-events: auto;
}

.whiteboards-context-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text);
    transition: background 0.2s ease;
}

.whiteboards-context-btn:hover {
    background: var(--primary-faded);
    color: var(--primary);
}


/* Toolbar Option Blocks */
.whiteboards-tool-btn {
    position: relative;
}

.whiteboards-option-block {
    position: absolute;
    right: 48px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    padding: 10px;
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0,0,0,0.22);
    z-index: 120;
    animation: wb-flyout-in 0.14s ease-out;
}

@keyframes wb-flyout-in {
    from { opacity: 0; transform: translateY(-50%) translateX(6px); }
    to { opacity: 1; transform: translateY(-50%) translateX(0); }
}

.whiteboards-option-block button {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.whiteboards-option-block button:hover {
    background: var(--primary-faded);
    color: var(--primary);
}

.whiteboards-option-block button.active {
    background: var(--primary);
    color: #fff;
}


/* Additional Polish */
.whiteboards-sync-status {
    font-size: 0.85rem;
    color: var(--success);
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 16px;
    padding-right: 16px;
    border-right: 1px solid var(--line);
}

.whiteboards-perf-pill {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    background: var(--bg-light);
    padding: 4px 12px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.whiteboards-perf-pill .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success);
}

.whiteboards-card-menu-trigger {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    opacity: 0.6;
}

.whiteboards-card-menu-trigger:hover {
    background: var(--bg-light);
    opacity: 1;
}

.whiteboards-board-actions-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
}

.whiteboards-action-item {
    text-align: left;
    justify-content: flex-start;
    padding: 12px 16px;
    border-radius: 12px;
}

/* ---------------------------------------------------------------- Floating selection context bar */
.whiteboards-context-bar {
    position: absolute;
    top: 64px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 10px;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0,0,0,0.22);
    z-index: 60;
    max-width: calc(100% - 120px);
    flex-wrap: wrap;
    justify-content: center;
    animation: wb-flyout-in 0.16s ease-out;
}
.whiteboards-context-bar[hidden] { display: none; }

.wb-ctx-group { display: flex; align-items: center; gap: 4px; }
.wb-ctx-label {
    font-size: 0.68rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.04em; color: var(--text-muted); margin-right: 2px;
}
.wb-ctx-divider { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }

.wb-swatch {
    width: 22px; height: 22px; border-radius: 50%;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    cursor: pointer; padding: 0; position: relative;
    transition: transform 0.12s ease;
}
.wb-swatch:hover { transform: scale(1.18); }
.wb-swatch.is-active { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.12); }
.wb-swatch-custom {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-light); color: var(--text-muted); font-size: 0.8rem;
}

.wb-wbtn, .wb-ctx-btn {
    min-width: 30px; height: 30px; padding: 0 6px;
    border-radius: 9px; border: none; cursor: pointer;
    background: transparent; color: var(--text); font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.95rem; transition: background 0.15s ease, color 0.15s ease;
}
.wb-wbtn:hover, .wb-ctx-btn:hover { background: var(--primary-faded); color: var(--primary); }
.wb-wbtn.is-active { background: var(--primary); color: #fff; }
.wb-ctx-btn.wb-ctx-danger:hover { background: color-mix(in srgb, var(--danger, #ef4444) 18%, transparent); color: var(--danger, #ef4444); }

/* Inline editors created over the canvas */
.whiteboard-text-editor, .whiteboard-table-editor {
    box-sizing: border-box;
    font-family: Inter, system-ui, sans-serif;
}

/* Tool cursor affordance handled in JS; ensure the canvas never shows a text caret by default */
.whiteboards-canvas-container { cursor: default; user-select: none; }

/* ---------------------------------------------------------------------------
   Live / Private segmented toggle (header)
   --------------------------------------------------------------------------- */
.whiteboards-live-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 3px;
    border-radius: 999px;
    background: var(--bg-light, #f1f5f9);
    box-shadow: inset 0 0 0 1px var(--line);
    user-select: none;
}
.whiteboards-live-toggle .wb-live-thumb {
    position: absolute;
    top: 3px; left: 3px;
    width: calc(50% - 3px); height: calc(100% - 6px);
    border-radius: 999px;
    background: var(--primary);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--primary) 45%, transparent);
    transition: transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1), background 0.2s ease;
    z-index: 0;
}
.whiteboards-live-toggle.is-private .wb-live-thumb {
    transform: translateX(100%);
    background: var(--text-muted, #64748b);
    box-shadow: none;
}
.whiteboards-live-toggle .wb-live-seg {
    position: relative;
    z-index: 1;
    display: inline-flex; align-items: center; gap: 6px;
    border: none; background: transparent; cursor: pointer;
    padding: 5px 12px; border-radius: 999px;
    font-size: 0.8rem; font-weight: 700;
    color: var(--text-muted);
    transition: color 0.18s ease;
    white-space: nowrap;
}
.whiteboards-live-toggle .wb-live-seg.is-active { color: #fff; }
.whiteboards-live-toggle .wb-live-seg i { font-size: 0.9rem; }
@media (max-width: 720px) {
    .whiteboards-live-toggle .wb-live-seg span { display: none; }
}

/* ---------------------------------------------------------------------------
   Compact colour picker control (replaces long swatch rows in context + tool bars)
   --------------------------------------------------------------------------- */
.wb-color-ctl {
    position: relative;
    width: 26px; height: 26px;
    border-radius: 50%;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 1px var(--line);
    overflow: hidden;
}
.wb-color-ctl:hover { transform: scale(1.08); }
.wb-color-dot {
    width: 100%; height: 100%; border-radius: 50%;
    border: 2px solid var(--surface);
}
.wb-color-ctl input[type="color"] {
    position: absolute; inset: 0;
    opacity: 0; cursor: pointer; border: none; padding: 0;
    width: 100%; height: 100%;
}

/* ---------------------------------------------------------------------------
   Floating per-tool options bar (slides up above the bottom bar, like the minimap)
   --------------------------------------------------------------------------- */
.whiteboards-tool-options {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(18px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    background: color-mix(in srgb, var(--surface) 95%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 9;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.22s cubic-bezier(0.22, 0.61, 0.36, 1);
    max-width: calc(100% - 40px);
    flex-wrap: nowrap;
}
.whiteboards-tool-options.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.whiteboards-tool-options[hidden] { display: none; }
.wb-to-title {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.78rem; font-weight: 700; color: var(--text);
    padding-right: 4px; white-space: nowrap;
}
.wb-to-title i { font-size: 0.95rem; color: var(--primary); }
.wb-to-range {
    -webkit-appearance: none; appearance: none;
    width: 96px; height: 4px; border-radius: 999px;
    background: var(--line); outline: none; cursor: pointer;
}
.wb-to-range::-webkit-slider-thumb {
    -webkit-appearance: none; appearance: none;
    width: 14px; height: 14px; border-radius: 50%;
    background: var(--primary); cursor: pointer;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}
.wb-to-range::-moz-range-thumb {
    width: 14px; height: 14px; border-radius: 50%; border: none;
    background: var(--primary); cursor: pointer;
}
.wb-to-sizeval, .wb-to-opval {
    font-size: 0.72rem; font-weight: 700; color: var(--text-muted);
    min-width: 26px; text-align: center;
}
@media (max-width: 720px) {
    .whiteboards-tool-options { bottom: 92px; gap: 4px; padding: 6px 8px; }
    .wb-to-title span { display: none; }
    .wb-to-range { width: 70px; }
}
