/**
 * 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: 20px;
    top: 50%;
    transform: translateY(-50%);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    background: color-mix(in srgb, var(--surface) 88%, transparent);
    border: 1px solid var(--line);
    border-radius: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    z-index: 10;
    box-shadow: 0 16px 40px -12px rgba(0,0,0,0.28);
}

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

.whiteboards-tool-btn:hover {
    background: var(--bg-light);
    color: var(--text);
    transform: translateY(-1px);
}

.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; }
}

/* Quick-pick colour swatches in the tool-options bar */
.wb-to-swatches { gap: 4px !important; }
.wb-to-swatch {
    width: 18px; height: 18px; border-radius: 50%; padding: 0; cursor: pointer;
    background: var(--sw);
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--line);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.wb-to-swatch:hover { transform: scale(1.2); }
.wb-to-swatch.is-active { box-shadow: 0 0 0 2px var(--primary); transform: scale(1.12); }

/* Version history dialog */
.wb-ver { display: flex; flex-direction: column; gap: 12px; min-width: 380px; max-width: 480px; }
.wb-ver-actions { display: flex; align-items: center; gap: 8px; }
.wb-ver-hint { font-size: 0.8rem; color: var(--text-muted); line-height: 1.5; }
.wb-ver-list { display: flex; flex-direction: column; gap: 6px; max-height: 360px; overflow: auto; }
.wb-ver-loading { padding: 24px; text-align: center; color: var(--text-muted); font-size: 0.9rem; }
.wb-ver-loading i { animation: wb-pulse 1.2s infinite; }
.wb-ver-empty { padding: 30px 16px; text-align: center; color: var(--text-muted); }
.wb-ver-empty i { font-size: 2rem; color: var(--primary-faded); display: block; margin-bottom: 10px; }
.wb-ver-empty p { margin: 0 0 2px; color: var(--text); font-weight: 600; }
.wb-ver-empty span { font-size: 0.82rem; }
.wb-ver-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
    transition: border-color .2s ease, background .2s ease;
}
.wb-ver-item:hover { border-color: var(--primary-faded); background: var(--bg-light); }
.wb-ver-ico {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-faded); color: var(--primary); font-size: 1rem;
}
.wb-ver-ico.wb-ver-auto { background: color-mix(in srgb, #0ea5e9 16%, transparent); color: #0ea5e9; }
.wb-ver-ico.wb-ver-restore-point { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #f59e0b; }
.wb-ver-meta { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wb-ver-meta strong { font-size: 0.9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-ver-meta span { font-size: 0.76rem; color: var(--text-muted); }
.wb-ver-restore { flex-shrink: 0; }

/* ===========================================================================
   Template Library v2
   =========================================================================== */
.wb-lib-search {
    position: relative; margin-top: 12px; max-width: 420px;
}
.wb-lib-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.wb-lib-search input {
    width: 100%; height: 42px; padding: 0 14px 0 40px; border-radius: 12px;
    background: var(--bg-light); border: 1px solid var(--line); color: var(--text); font-size: 0.92rem;
}
.wb-lib-search input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.wb-lib-count { margin-left: auto; font-size: 0.72rem; font-weight: 700; color: var(--text-muted); background: var(--bg-light); border-radius: 20px; padding: 1px 8px; }
.whiteboards-sidebar-btn.active .wb-lib-count { background: color-mix(in srgb, var(--primary) 18%, transparent); color: var(--primary); }
/* Keep the v2 template previews fully visible (override the old hover-dim). */
.whiteboards-template-preview { opacity: 1; position: relative; }
.whiteboards-template-card:hover .whiteboards-template-preview { opacity: 1; }
.whiteboards-template-card:hover .whiteboards-template-preview i { transform: scale(1.08); }
.whiteboards-template-preview i { transition: transform .25s ease; }
.wb-tpl-badge {
    position: absolute; top: 12px; right: 12px; display: inline-flex; align-items: center; gap: 4px;
    background: rgba(255,255,255,0.85); color: #0ea5e9; font-size: 0.68rem; font-weight: 700;
    padding: 3px 9px; border-radius: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.wb-lib-empty { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--text-muted); }
.wb-lib-empty i { font-size: 2.2rem; color: var(--primary-faded); display: block; margin-bottom: 12px; }

/* ===========================================================================
   Help & Documentation
   =========================================================================== */
.wb-docs-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 22px; align-items: start; min-height: 0; flex: 1; overflow: hidden; }
.wb-docs-nav { display: flex; flex-direction: column; gap: 4px; overflow: auto; max-height: 100%; padding-right: 4px; }
.wb-docs-nav-btn {
    display: flex; align-items: flex-start; gap: 12px; text-align: left;
    padding: 12px; border-radius: 14px; border: 1px solid transparent;
    background: transparent; cursor: pointer; color: var(--text); transition: all .2s ease; width: 100%;
}
.wb-docs-nav-btn:hover { background: var(--bg-light); }
.wb-docs-nav-btn.active { background: var(--surface); border-color: var(--primary-faded); box-shadow: 0 8px 22px -14px rgba(0,0,0,.3); }
.wb-docs-nav-ico {
    width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
    background: var(--primary-faded); color: var(--primary);
}
.wb-docs-nav-text { display: flex; flex-direction: column; min-width: 0; }
.wb-docs-nav-text strong { font-size: 0.9rem; font-weight: 600; }
.wb-docs-nav-text span { font-size: 0.76rem; color: var(--text-muted); line-height: 1.4; }

.wb-docs-content { overflow: auto; max-height: 100%; }
.wb-doc-article { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px 30px; }
.wb-doc-article-head { display: flex; align-items: center; gap: 16px; margin-bottom: 22px; padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.wb-doc-article-ico {
    width: 52px; height: 52px; border-radius: 14px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    background: var(--primary-faded); color: var(--primary);
}
.wb-doc-article-head h3 { margin: 0; font-size: 1.3rem; font-weight: 700; }
.wb-doc-article-head p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.wb-doc-body { font-size: 0.95rem; line-height: 1.65; color: var(--text); }
.wb-doc-body p { margin: 0 0 14px; }
.wb-doc-body em { font-style: normal; font-weight: 600; color: var(--text); }
.wb-doc-list, .wb-doc-steps { margin: 0 0 16px; padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.wb-doc-steps { counter-reset: wb-step; }
.wb-doc-list li { display: flex; align-items: flex-start; gap: 10px; }
.wb-doc-list li i { color: var(--primary); margin-top: 3px; flex-shrink: 0; }
.wb-doc-steps li { position: relative; padding-left: 34px; }
.wb-doc-steps li::before {
    counter-increment: wb-step; content: counter(wb-step);
    position: absolute; left: 0; top: -1px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--primary-faded); color: var(--primary); font-size: 0.78rem; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
}
.wb-doc-tip {
    display: flex; align-items: flex-start; gap: 10px;
    background: color-mix(in srgb, var(--primary) 8%, var(--surface));
    border: 1px solid var(--primary-faded); border-radius: 12px; padding: 12px 14px; font-size: 0.88rem;
}
.wb-doc-tip i { color: var(--primary); margin-top: 2px; }
.wb-kbd {
    display: inline-block; padding: 1px 7px; border-radius: 6px; font-size: 0.78rem; font-weight: 600;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    background: var(--bg-light); border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line);
    color: var(--text); white-space: nowrap;
}
.wb-doc-keys { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.wb-doc-keys-group h4 { margin: 0 0 10px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.wb-doc-key-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 0.88rem; }
.wb-doc-key-row:last-child { border-bottom: none; }

@media (max-width: 900px) {
    .wb-docs-layout { grid-template-columns: 1fr; overflow: visible; }
    .wb-docs-nav { flex-direction: row; flex-wrap: wrap; max-height: none; }
    .wb-docs-nav-btn { width: auto; }
}

/* ===========================================================================
   Overview v2 — command-center layout
   =========================================================================== */
.wb-ov {
    padding: 18px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    height: -webkit-fill-available;
    overflow: auto;
}
.wb-ov-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}
.wb-ov-title { font-size: 1.7rem; font-weight: 800; margin: 0; }
.wb-ov-sub { color: var(--text-muted); margin: 4px 0 0; }
.wb-ov-newbtn { height: 42px; border-radius: 12px; padding: 0 18px; font-weight: 600; white-space: nowrap; }

.wb-ov-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.wb-stat-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 18px;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 18px;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.wb-stat-card:hover { border-color: var(--primary-faded); box-shadow: 0 12px 30px -18px rgba(0,0,0,.35); }
.wb-stat-ico {
    width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.25rem; color: var(--tint);
    background: color-mix(in srgb, var(--tint) 14%, transparent);
}
.wb-stat-meta { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.wb-stat-label { font-size: 0.8rem; color: var(--text-muted); font-weight: 600; }
.wb-stat-value { font-size: 1.85rem; font-weight: 800; line-height: 1.05; color: var(--text); }
.wb-stat-sub { font-size: 0.73rem; color: var(--text-muted); }

.wb-ov-body { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.wb-ov-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.wb-ov-split { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.wb-ov-rail {display: flex;flex-direction: column;gap: 22px;height: stretch;}

.wb-panel {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 20px;
}
.wb-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; }
.wb-panel-head h3 { font-size: 1.05rem; font-weight: 700; margin: 0; }
.wb-panel-head-actions { display: flex; align-items: center; gap: 8px; }
.wb-panel-foot-link {
    display: inline-flex; align-items: center; gap: 6px; margin-top: 16px;
    font-weight: 600; color: var(--primary); font-size: 0.9rem; text-decoration: none;
    transition: gap .2s ease;
}
.wb-panel-foot-link:hover { gap: 10px; }

.wb-view-toggle { display: inline-flex; background: var(--bg-light); border-radius: 10px; padding: 3px; gap: 2px; }
.wb-view-toggle button {
    border: none; background: transparent; width: 30px; height: 28px; border-radius: 8px;
    color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.wb-view-toggle button.is-active { background: var(--surface); color: var(--primary); box-shadow: 0 1px 3px rgba(0,0,0,.12); }

.wb-recent-grid[data-view="grid"] { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.wb-recent-grid[data-view="list"] { display: flex; flex-direction: column; gap: 10px; }
.wb-recent-card {
    border: 1px solid var(--line); border-radius: 16px; overflow: hidden; cursor: pointer;
    background: var(--surface); display: flex; flex-direction: column;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.wb-recent-card:hover { transform: translateY(-4px); border-color: var(--primary-faded); box-shadow: 0 14px 30px -16px rgba(0,0,0,.3); }
.wb-recent-thumb { height: 104px; position: relative; display: flex; align-items: center; justify-content: center; }
.wb-recent-initial { font-size: 1.9rem; font-weight: 800; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.25); }
.wb-recent-live {
    position: absolute; top: 8px; left: 8px; background: #ef4444; color: #fff;
    font-size: 0.6rem; font-weight: 800; letter-spacing: .05em; padding: 3px 7px; border-radius: 20px;
}
.wb-recent-info { padding: 12px 14px; display: flex; flex-direction: column; gap: 7px; }
.wb-recent-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.wb-recent-row strong { font-size: 0.92rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-recent-fav { border: none; background: transparent; color: var(--text-muted); cursor: pointer; padding: 2px; font-size: 0.95rem; flex-shrink: 0; }
.wb-recent-fav.is-fav { color: #f59e0b; }
.wb-recent-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 0.76rem; color: var(--text-muted); }
.wb-recent-chip { background: var(--bg-light); padding: 2px 9px; border-radius: 20px; font-weight: 600; text-transform: capitalize; }
.wb-recent-collabs { display: flex; align-items: center; gap: 7px; font-size: 0.74rem; color: var(--text-muted); }
.wb-recent-avatar {
    width: 20px; height: 20px; border-radius: 50%; background: var(--primary-faded); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 0.65rem;
}
.wb-recent-grid[data-view="list"] .wb-recent-card { flex-direction: row; align-items: stretch; }
.wb-recent-grid[data-view="list"] .wb-recent-thumb { width: 96px; height: auto; flex-shrink: 0; }
.wb-recent-grid[data-view="list"] .wb-recent-info { flex: 1; }
.wb-recent-empty { grid-column: 1 / -1; text-align: center; padding: 40px 20px; color: var(--text-muted); }
.wb-recent-empty i { font-size: 2.4rem; color: var(--primary-faded); display: block; margin-bottom: 12px; }
.wb-recent-empty strong { display: block; color: var(--text); margin-bottom: 4px; }
.wb-recent-empty p { margin: 0 0 16px; }

.wb-breakdown { display: flex; flex-direction: column; gap: 4px; }
.wb-bd-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; transition: background .2s; }
.wb-bd-row:hover { background: var(--bg-light); }
.wb-bd-ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--tint); background: color-mix(in srgb, var(--tint) 14%, transparent); font-size: 0.95rem;
}
.wb-bd-label { flex: 1; font-weight: 600; font-size: 0.9rem; }
.wb-bd-count { font-weight: 800; font-size: 1.05rem; min-width: 24px; text-align: right; }
.wb-bd-time { font-size: 0.74rem; color: var(--text-muted); min-width: 64px; text-align: right; }

.wb-activity { display: flex; flex-direction: column; gap: 4px; }
.wb-activity-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.wb-activity-row:hover { background: var(--bg-light); }
.wb-activity-ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-faded); color: var(--primary);
}
.wb-activity-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wb-activity-text strong { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-activity-text span { font-size: 0.76rem; color: var(--text-muted); }
.wb-activity-row > .bi-chevron-right { color: var(--text-muted); font-size: 0.8rem; }
.wb-activity-empty { color: var(--text-muted); padding: 20px 4px; font-size: 0.9rem; }

.wb-tpl-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.wb-tpl-item { display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; cursor: pointer; transition: background .2s; }
.wb-tpl-item:hover { background: var(--bg-light); }
.wb-tpl-ico {
    width: 38px; height: 38px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-faded); color: var(--primary); font-size: 1.05rem;
}
.wb-tpl-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wb-tpl-text strong { font-size: 0.88rem; font-weight: 600; }
.wb-tpl-text span { font-size: 0.74rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wb-tpl-add { color: var(--text-muted); opacity: 0; transition: opacity .2s; flex-shrink: 0; }
.wb-tpl-item:hover .wb-tpl-add { opacity: 1; color: var(--primary); }
.wb-rail-link { font-size: 0.82rem; color: var(--primary); text-decoration: none; font-weight: 600; }

.wb-quick { display: flex; flex-direction: column; gap: 2px; }
.wb-quick-btn {
    display: flex; align-items: center; gap: 12px; padding: 9px 10px;
    border: none; background: transparent; border-radius: 12px; cursor: pointer;
    color: var(--text); font-weight: 600; font-size: 0.88rem; text-align: left; transition: background .2s;
}
.wb-quick-btn:hover { background: var(--bg-light); }
.wb-quick-ico {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--qc); background: color-mix(in srgb, var(--qc) 14%, transparent);
}

.wb-rail-help {text-align: center;background: linear-gradient(160deg, color-mix(in srgb, var(--primary) 10%, var(--bg)), var(--bg));height: stretch;place-items: center;}
.wb-rail-help-ico {
    width: 48px; height: 48px; border-radius: 14px; margin: 0 auto 12px;
    background: var(--primary-faded); color: var(--primary);
    display: flex; align-items: center; justify-content: center; font-size: 1.4rem;
}
.wb-rail-help strong { display: block; margin-bottom: 6px; }
.wb-rail-help p { font-size: 0.82rem; color: var(--text-muted); margin: 0 0 14px; line-height: 1.5; }

.wb-skel {
    display: inline-block; border-radius: 8px; background: var(--bg-light);
    background-image: linear-gradient(90deg, var(--bg-light) 0%, color-mix(in srgb, var(--bg-light) 55%, var(--surface)) 45%, var(--bg-light) 80%);
    background-size: 600px 100%; background-repeat: no-repeat;
    animation: wb-shimmer 1.2s infinite linear;
}

@media (max-width: 1180px) {
    .wb-ov-body { grid-template-columns: 1fr; }
    .wb-ov-rail { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
@media (max-width: 1100px) { .wb-ov-stats { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .wb-ov-split { grid-template-columns: 1fr; } }
