/* ===== Course Whiteboard Dashboard (self-contained) ===== */

/* ── Inline SVG icon base (replaces Font Awesome) ───────────────────────── */
.icon {
    display: inline-block;
    width: 1em;
    height: 1em;
    fill: currentColor;
    vertical-align: -0.125em; /* optical alignment matching FA behaviour */
    flex-shrink: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: auto;
    background: var(--background-secondary, #fafafa);
    color: var(--text-secondary, #525252);
    min-height: 100vh;
    line-height: 1.6;
}

.dashboard-app {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.btn {
    padding: 6px 12px;
    border: none;
    border-radius: var(--radius-md, 6px);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.15s ease;
    text-decoration: none;
}

.btn-primary {
    background: #BAA377;
    color: #fff;
}

.btn-primary:hover {
    background: #A68F5F;
}

.btn-secondary {
    background: var(--background-tertiary, #f5f5f5);
    color: var(--text-secondary, #525252);
    border: 1px solid var(--border-primary, #e6e6e6);
}

.btn-secondary:hover {
    background: var(--background-secondary, #fafafa);
}

.btn-danger {
    background: var(--error-color, #ef4444);
    color: #fff;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Header */
.dashboard-header {
    background: var(--background-primary, #fff);
    border-bottom: 1px solid var(--border-primary, #e6e6e6);
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dashboard-header .header-left .app-icon {
    width: auto;
    height: 50px;
    object-fit: contain;
}

.dashboard-header .header-left h1 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #0f0f0f);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dashboard-header .subtitle {
    font-size: 13px;
    color: var(--text-tertiary, #878787);
    font-weight: 400;
    margin-left: 4px;
    white-space: nowrap;
}

/* Main */
.dashboard-main {
    flex: 1;
    width: 100%;
}

/* Empty State */
.empty-state {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-tertiary, #878787);
    text-align: center;
}

.empty-state svg.icon-folder-open {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    opacity: 0.35;
}

.empty-state h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-secondary, #525252);
    margin: 0 0 8px;
}

.empty-state p {
    font-size: 14px;
    margin: 0 0 24px;
    color: var(--text-tertiary, #878787);
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
}

/* Project Grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.project-card {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-primary, #e6e6e6);
    border-radius: var(--radius-lg, 8px);
    cursor: pointer;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.project-card:hover {
    border-color: #BAA377;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}

.project-card-body {
    padding: 20px 20px 12px;
    flex: 1;
}

.project-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #0f0f0f);
    margin: 0 0 8px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-desc {
    font-size: 13px;
    color: var(--text-tertiary, #878787);
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.project-card-footer {
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-secondary, #f0f0f0);
}

.project-time {
    font-size: 12px;
    color: var(--text-tertiary, #878787);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.project-card:hover .project-actions {
    opacity: 1;
}

.action-btn {
    background: none;
    border: none;
    padding: 6px 8px;
    border-radius: var(--radius-sm, 4px);
    color: var(--text-tertiary, #878787);
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s ease, color 0.15s ease;
}

.action-btn:hover {
    background: var(--background-tertiary, #f5f5f5);
    color: var(--text-primary, #0f0f0f);
}

.action-btn.delete-btn:hover {
    color: var(--error-color, #ef4444);
}

/* Modal */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--background-primary, #fff);
    border-radius: var(--radius-lg, 8px);
    width: 480px;
    max-width: 100%;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.modal-create {
    width: min(92vw, 1300px);
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

/* 2-column form row at the top of create modal */
.modal-create-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 20px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ede3d0;
}

.modal-small {
    width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #0f0f0f);
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--text-tertiary, #878787);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm, 4px);
    line-height: 1;
}

.modal-close:hover {
    background: var(--background-tertiary, #f5f5f5);
    color: var(--text-primary, #0f0f0f);
}

.modal-body {
    padding: 20px 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group:last-child {
    margin-bottom: 0;
}

.modal-body label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #525252);
    margin-bottom: 6px;
}

.modal-body .label-hint {
    font-weight: 400;
    color: var(--text-tertiary, #878787);
    font-size: 12px;
}

.modal-body input[type="text"],
.modal-body textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-primary, #e6e6e6);
    border-radius: var(--radius-md, 6px);
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary, #0f0f0f);
    background: var(--background-primary, #fff);
    transition: border-color 0.15s ease;
    box-sizing: border-box;
}

.modal-body input[type="text"]:focus,
.modal-body textarea:focus {
    outline: none;
    border-color: #BAA377;
}

.modal-body textarea {
    resize: vertical;
    min-height: 60px;
}

.modal-footer {
    padding: 0 24px 20px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Template picker ──────────────────────────────────────── */
.tpl-section {
    margin-bottom: 20px;
}

.tpl-section-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary, #525252);
    margin-bottom: 10px;
}

.tpl-label-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--text-tertiary, #878787);
}

.tpl-list {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
    scrollbar-color: #d4c4a0 transparent;
}

.tpl-list::-webkit-scrollbar {
    height: 4px;
}
.tpl-list::-webkit-scrollbar-thumb {
    background: #d4c4a0;
    border-radius: 2px;
}

/* 5-column template grid used in create modal */
.tpl-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
}

.tpl-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    background: #fdf8f2;
    border: 1.5px solid #e8dcc8;
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
    text-align: left;
    overflow: hidden;
    min-width: 0;
}

.tpl-card:hover {
    border-color: #BAA377;
    box-shadow: 0 3px 10px rgba(186, 163, 119, 0.2);
    transform: translateY(-2px);
}

.tpl-card.selected {
    border-color: #BAA377;
    box-shadow: 0 0 0 2.5px #BAA377, 0 3px 10px rgba(186, 163, 119, 0.25);
    background: #fff8ee;
}

.tpl-thumb {
    width: 100%;
    aspect-ratio: 3 / 2;
    background: #f5f0e6;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #ede3d0;
}

.tpl-thumb img,
.tpl-thumb svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.tpl-thumb--blank svg {
    opacity: 0.7;
}

.tpl-info {
    padding: 6px 8px 8px;
}

.tpl-name {
    font-size: 12px;
    font-weight: 600;
    color: #2a1f0e;
    line-height: 1.3;
    margin-bottom: 2px;
}

.tpl-desc {
    font-size: 11px;
    color: #8a7a60;
    line-height: 1.4;
}

/* ===== Language Toggle Button ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-lang {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    white-space: nowrap;
}

.btn-lang:hover {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #1e293b);
    border-color: var(--border-secondary, #cbd5e1);
}

.btn-lang i {
    font-size: 12px;
    opacity: 0.75;
}

@media (max-width: 1000px) {
    .tpl-grid { grid-template-columns: repeat(5, 1fr); }
    .modal-create-form { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .tpl-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
    .dashboard-header {
        padding: 0 16px;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .project-actions {
        opacity: 1;
    }

    .btn-lang span {
        display: none;
    }

    .btn-lang i {
        font-size: 14px;
        opacity: 1;
    }

    .tpl-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== Product Showcase Section ===== */
.product-showcase {
    background: linear-gradient(160deg, #fdf8f2 0%, #f5efe4 100%);
    border-top: 1px solid #ecdfc8;
    padding: 48px 0 56px;
}

.showcase-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header block */
.showcase-header {
    position: relative;
    text-align: center;
    margin-bottom: 32px;
}

/* Close button inside showcase header */
.showcase-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 28px;
    height: 28px;
    border: 1px solid #d6c5a4;
    border-radius: 50%;
    background: #fff;
    color: #8a7050;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.showcase-close-btn:hover {
    background: #f5ede0;
    border-color: #BAA377;
    color: #3d2e18;
}

/* Floating help button */
.showcase-help-btn {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px 8px 12px;
    background: #BAA377;
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(186, 163, 119, 0.45);
    transition: background 0.15s, transform 0.15s;
}

.showcase-help-btn:hover {
    background: #A68F5F;
    transform: translateY(-2px);
}

.help-btn-icon {
    width: 20px;
    height: 20px;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.showcase-title {
    font-size: 20px;
    font-weight: 700;
    color: #3d2e18;
    margin: 0 0 10px;
    letter-spacing: 0.01em;
}

.showcase-intro {
    font-size: 14px;
    color: #6b5535;
    line-height: 1.8;
    margin: 0;
}

.showcase-intro-em {
    font-weight: 600;
    color: #BAA377;
}

/* Scroll wrapper: holds arrows + scrollable track */
.showcase-scroll-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Arrow buttons */
.showcase-arrow {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border: 1px solid #d6c5a4;
    border-radius: 50%;
    background: #fff;
    color: #7a6240;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    padding: 0;
    z-index: 2;
}

.showcase-arrow:hover {
    background: #BAA377;
    border-color: #BAA377;
    color: #fff;
}

/* Scrollable track – scroll-snap shows 2 cards at a time */
.showcase-track {
    flex: 1;
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 4px;
}

.showcase-track::-webkit-scrollbar {
    display: none;
}

/* Each card occupies exactly 50% of the track minus half the gap */
.showcase-card {
    flex: 0 0 calc(50% - 10px);
    min-width: 0;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #e8dac2;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(186, 163, 119, 0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
}

.showcase-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(186, 163, 119, 0.18);
    border-color: #BAA377;
}

/* Illustration area */
.showcase-card-illo {
    width: 100%;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    max-height: 180px;
}

.showcase-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

/* Emoji illustration variant */
.showcase-card-illo--emoji {
    height: 140px;
    max-height: 140px;
    background: linear-gradient(135deg, #fdf6ec 0%, #f5f0e8 100%);
}

.showcase-emoji {
    font-size: 4rem;
    line-height: 1;
    display: block;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.08));
}

.showcase-intro-hint {
    font-weight: 600;
    color: #BAA377 !important;
    margin-top: 4px;
}

/* Body */
.showcase-card-body {
    padding: 16px 24px 12px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.showcase-card-num {
    font-size: 15px;
    font-weight: 700;
    color: #2a1f0e;
}

.showcase-pain,
.showcase-solution {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 13px;
    line-height: 1.65;
    color: #4a3520;
}

.showcase-pain p,
.showcase-solution p {
    margin: 0;
}

.pain-label,
.solution-label {
    flex-shrink: 0;
    display: inline-block;
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-top: 2px;
    white-space: nowrap;
}

.pain-label {
    background: #fdecea;
    color: #c62828;
}

.solution-label {
    background: #e8f5e9;
    color: #2e7d32;
}

.showcase-card-footer {
    padding: 0 24px 20px;
}

.btn-showcase {
    display: inline-block;
    padding: 9px 20px;
    background: #BAA377;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    letter-spacing: 0.02em;
}

.btn-showcase:hover {
    background: #A68F5F;
}

/* Dot indicators */
.showcase-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #d6c5a4;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.dot.active {
    background: #BAA377;
    transform: scale(1.25);
}

/* Responsive: on narrow screens show 1 card */
@media (max-width: 640px) {
    .product-showcase {
        padding: 36px 0 44px;
    }

    .showcase-inner {
        padding: 0 16px;
    }

    .showcase-card {
        flex: 0 0 calc(100% - 0px);
    }

    .showcase-arrow {
        width: 30px;
        height: 30px;
        font-size: 18px;
    }
}

/* ===== Guide Button (header) ===== */
.btn-guide {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary, #64748b);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    line-height: 1;
    white-space: nowrap;
}
.btn-guide:hover {
    background: var(--bg-secondary, #f1f5f9);
    color: var(--text-primary, #1e293b);
    border-color: var(--border-secondary, #cbd5e1);
}

/* ===== Guide Overlay (fixed below header, covers viewport minus header) ===== */
.guide-modal-overlay {
    position: fixed;
    top: 56px;   /* exactly below the sticky header */
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(0, 0, 0, 0.22);
    z-index: 500;
}

.guide-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 960px;
    max-height: calc(100vh - 56px - 40px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22), 0 0 0 1px rgba(0,0,0,0.08);
}

.guide-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
    flex-shrink: 0;
    background: var(--bg-primary, #fff);
}

.guide-modal-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
    margin: 0;
}

/* ── Two-column layout ── */
.guide-modal-layout {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* Left: sidebar TOC */
.guide-sidebar {
    width: 200px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 16px 0;
    border-right: 1px solid var(--border-primary, #e2e8f0);
    background: var(--bg-secondary, #f8fafc);
}

.guide-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-secondary, #94a3b8);
    padding: 0 16px 8px;
}

.guide-sidebar-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.guide-sidebar-list li {
    margin: 0;
}

.guide-sidebar-list a.guide-toc-link {
    display: block;
    padding: 5px 16px;
    font-size: 12.5px;
    color: var(--text-secondary, #64748b);
    text-decoration: none;
    border-left: 2px solid transparent;
    line-height: 1.4;
    transition: color 0.12s, background 0.12s, border-color 0.12s;
}

.guide-sidebar-list a.guide-toc-link:hover {
    color: var(--text-primary, #1e293b);
    background: var(--bg-primary, #fff);
}

.guide-sidebar-list a.guide-toc-link.active {
    color: #2563eb;
    border-left-color: #2563eb;
    background: #eff6ff;
    font-weight: 500;
}

.guide-sidebar-list .guide-toc-sub a.guide-toc-link {
    padding-left: 28px;
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
}

.guide-sidebar-list .guide-toc-sub a.guide-toc-link.active {
    color: #2563eb;
}

.guide-sidebar-loading {
    font-size: 12px;
    color: var(--text-secondary, #94a3b8);
    padding: 16px;
}

/* Right: main content */
.guide-modal-body {
    overflow-y: auto;
    padding: 24px 28px;
    flex: 1;
    background: var(--bg-primary, #fff);
    color: var(--text-primary, #1e293b);
    font-size: 14px;
    line-height: 1.7;
    min-width: 0;
}

.guide-loading {
    color: var(--text-secondary, #64748b);
    padding: 40px 0;
    text-align: center;
}

/* ── Guide content typography ── */
.guide-modal-body h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: var(--text-primary, #1e293b);
}
.guide-modal-body h2 {
    font-size: 15px;
    font-weight: 700;
    margin: 28px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border-primary, #e2e8f0);
    color: var(--text-primary, #1e293b);
}
.guide-modal-body h2:first-child { margin-top: 0; }
.guide-modal-body h3 {
    font-size: 13.5px;
    font-weight: 600;
    margin: 18px 0 8px;
    color: var(--text-primary, #1e293b);
}
.guide-modal-body p {
    margin: 6px 0;
}
.guide-modal-body strong {
    font-weight: 600;
}
.guide-modal-body code {
    font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
    font-size: 12px;
    background: var(--bg-secondary, #f1f5f9);
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 4px;
    padding: 1px 5px;
}
.guide-modal-body pre {
    background: var(--bg-secondary, #f8fafc);
    border: 1px solid var(--border-primary, #e2e8f0);
    border-radius: 8px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 10px 0;
}
.guide-modal-body pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 12.5px;
}
.guide-modal-body hr {
    border: none;
    border-top: 1px solid var(--border-primary, #e2e8f0);
    margin: 20px 0;
}
.guide-modal-body blockquote {
    border-left: 3px solid #BAA377;
    margin: 10px 0;
    padding: 8px 14px;
    background: #fdf8f0;
    border-radius: 0 6px 6px 0;
    color: #6b5a3e;
    font-size: 13px;
}
.guide-modal-body blockquote p { margin: 0; }
.guide-modal-body ul {
    margin: 8px 0;
    padding-left: 20px;
}
.guide-modal-body li { margin: 3px 0; }

/* ── Guide table ── */
.guide-modal-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin: 10px 0 16px;
}
.guide-modal-body th {
    background: var(--bg-secondary, #f8fafc);
    font-weight: 600;
    text-align: left;
    padding: 8px 12px;
    border: 1px solid var(--border-primary, #e2e8f0);
    color: var(--text-primary, #1e293b);
    white-space: nowrap;
}
.guide-modal-body td {
    padding: 7px 12px;
    border: 1px solid var(--border-primary, #e2e8f0);
    vertical-align: top;
}
.guide-modal-body tr:nth-child(even) td {
    background: var(--bg-secondary, #f8fafc);
}
.guide-modal-body a {
    color: #2563eb;
    text-decoration: none;
}
.guide-modal-body a:hover { text-decoration: underline; }

/* Mobile: collapse sidebar to top strip */
@media (max-width: 640px) {
    .guide-modal-content { max-height: 95vh; border-radius: 8px; }
    .guide-modal-layout { flex-direction: column; }
    .guide-sidebar {
        width: 100%;
        max-height: 120px;
        border-right: none;
        border-bottom: 1px solid var(--border-primary, #e2e8f0);
        padding: 8px 0;
    }
    .guide-sidebar-list { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 8px; }
    .guide-sidebar-list li { flex-shrink: 0; }
    .guide-sidebar-list a.guide-toc-link { padding: 3px 8px; border-left: none; border-radius: 4px; white-space: nowrap; font-size: 12px; }
    .guide-sidebar-list a.guide-toc-link.active { background: #eff6ff; border-radius: 4px; }
    .guide-sidebar-list .guide-toc-sub { display: none; }
    .guide-sidebar-title { display: none; }
    .guide-modal-body { padding: 16px; }
    .btn-guide span { display: none; }
    .btn-guide { padding: 6px 8px; }
}

/* ===== Category Sidebar ===== */

.dashboard-main {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 0;
    gap: 0;
}

.cat-sidebar {
    width: 172px;
    flex-shrink: 0;
    padding: 20px 10px;
    min-height: calc(100vh - 56px);
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: sticky;
    top: 56px;
    box-sizing: border-box;
}

/* Drag handle between sidebar and content */
.cat-resize-handle {
    width: 5px;
    flex-shrink: 0;
    background: transparent;
    border-left: 1px solid var(--border-primary, #e6e6e6);
    cursor: col-resize;
    position: sticky;
    top: 56px;
    min-height: calc(100vh - 56px);
    transition: background 0.15s, border-color 0.15s;
    box-sizing: border-box;
}

.cat-resize-handle:hover,
.dashboard-main.resizing .cat-resize-handle {
    background: #f0e6d6;
    border-color: #BAA377;
}

.cat-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #525252);
    transition: background 0.12s, color 0.12s;
    user-select: none;
    min-width: 0;
    position: relative;
}

.cat-item:hover {
    background: var(--background-tertiary, #f5f5f5);
}

.cat-item.active {
    background: #f5ede0;
    color: #7a5c2e;
    font-weight: 600;
}

.cat-item-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.cat-item-count {
    font-size: 11px;
    color: var(--text-tertiary, #878787);
    flex-shrink: 0;
}

/* Floating context menu — appears on .cat-item hover */
.cat-item-menu {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 7px;
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.10);
    display: flex;
    flex-direction: row;
    padding: 3px;
    gap: 1px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
    z-index: 20;
}

.cat-item:hover .cat-item-menu {
    opacity: 1;
    pointer-events: auto;
}

.cat-item-rename,
.cat-item-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 5px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    color: var(--text-secondary, #525252);
    transition: background 0.1s, color 0.1s;
}

.cat-item-rename:hover {
    background: #f5f5f5;
    color: #BAA377;
}

.cat-item-delete:hover {
    background: #fef2f2;
    color: var(--error-color, #ef4444);
}

.cat-item-input {
    flex: 1;
    border: 1px solid #BAA377;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    min-width: 0;
    color: var(--text-primary, #0f0f0f);
}

.cat-add-btn {
    margin-top: 8px;
    background: none;
    border: 1px dashed var(--border-primary, #e6e6e6);
    border-radius: 6px;
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text-tertiary, #878787);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.12s, color 0.12s;
    width: 100%;
    box-sizing: border-box;
}

.cat-add-btn:hover {
    border-color: #BAA377;
    color: #BAA377;
}

.dashboard-main.resizing {
    user-select: none;
    cursor: col-resize;
}

.dashboard-content {
    flex: 1;
    padding: 28px 24px;
    min-width: 0;
}

/* Section header above project grid */
.project-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.project-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary, #0f0f0f);
}

.project-section-count {
    font-size: 13px;
    color: var(--text-tertiary, #878787);
}

/* Category select in modal — spans full width */
.modal-form-category {
    grid-column: 1 / -1;
}

#project-category {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-primary, #e6e6e6);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background: #fff;
    cursor: pointer;
    color: var(--text-primary, #0f0f0f);
    box-sizing: border-box;
}

#project-category:focus {
    outline: none;
    border-color: #BAA377;
    box-shadow: 0 0 0 3px rgba(186,163,119,0.15);
}

/* Category delete modal footer: cancel left, actions right */
.cat-delete-footer {
    justify-content: space-between;
    align-items: center;
}

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

/* Mobile: collapse sidebar */
@media (max-width: 640px) {
    .dashboard-main {
        flex-direction: column;
    }

    .cat-sidebar {
        width: 100%;
        min-height: unset;
        border-right: none;
        border-bottom: 1px solid var(--border-primary, #e6e6e6);
        position: static;
        padding: 12px 10px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .cat-list {
        flex-direction: row;
        flex-wrap: wrap;
        flex: none;
        gap: 4px;
    }

    .cat-add-btn {
        margin-top: 0;
        width: auto;
    }

    .dashboard-content {
        padding: 16px 12px;
    }
}

/* ===== Language Onboarding Popover ===== */
.lang-onboarding-anchor {
    position: relative;
}

.lang-onboarding-popover {
    position: absolute;
    top: calc(100% + 14px);
    right: 0;
    z-index: 9999;
    width: 230px;
    background: var(--wb-float-dark-surface, #111827);
    color: var(--wb-float-dark-text, #f9fafb);
    border-radius: 16px;
    padding: 18px 18px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.28), 0 2px 8px rgba(0,0,0,0.18);
    animation: lang-pop-in 0.22s cubic-bezier(0.34,1.56,0.64,1) both;
    transform-origin: top right;
}

.lang-onboarding-popover::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 18px;
    width: 16px;
    height: 8px;
    background: var(--wb-float-dark-surface, #111827);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
}

.lang-onboarding-popover.hidden {
    display: none;
}

@keyframes lang-pop-in {
    from { opacity: 0; transform: scale(0.88) translateY(-6px); }
    to   { opacity: 1; transform: scale(1)   translateY(0); }
}

.lang-onboarding-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 7px;
    color: var(--wb-float-dark-text, #f9fafb);
}

.lang-onboarding-desc {
    font-size: 12.5px;
    color: var(--wb-float-dark-text-muted, #cbd5e1);
    line-height: 1.55;
    margin: 0 0 14px;
}

.lang-onboarding-choices {
    display: flex;
    gap: 8px;
}

.lang-onboarding-choice {
    flex: 1;
    padding: 7px 0;
    border-radius: 8px;
    border: 1.5px solid var(--wb-float-dark-border, #374151);
    background: transparent;
    color: var(--wb-float-dark-text, #f9fafb);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}

.lang-onboarding-choice:hover,
.lang-onboarding-choice.active {
    background: var(--wb-float-dark-accent-bg, rgba(99,102,241,0.22));
    border-color: var(--wb-float-dark-accent-text, #a5b4fc);
    color: var(--wb-float-dark-accent-text, #a5b4fc);
}

.lang-onboarding-dismiss {
    display: block;
    width: 100%;
    margin-top: 10px;
    padding: 0;
    background: none;
    border: none;
    color: var(--wb-float-dark-text-muted, #cbd5e1);
    font-size: 11.5px;
    cursor: pointer;
    text-align: center;
    opacity: 0.7;
}
.lang-onboarding-dismiss:hover { opacity: 1; }
