/* ── Reset & Base ──────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-primary: #0f0f1a;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-modal: #1a1a2e;
    --accent: #4f8ef7;
    --accent-hover: #3a7be0;
    --danger: #e05555;
    --success: #4caf7d;
    --text-primary: #e8eaf0;
    --text-secondary: #8892a4;
    --border: #2a2d3e;
    --radius: 8px;
    --radius-lg: 12px;
}

/* RESPONSIVE: prevent horizontal overflow globally */
html, body {
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
}

/* ── Buttons ─────────────────────────────────────── */
.btn-primary {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
    /* RESPONSIVE: minimum tap target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-primary:hover:not(:disabled) {
        background: var(--accent-hover);
    }

    .btn-primary:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: border-color 0.2s;
    /* RESPONSIVE: minimum tap target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-secondary:hover {
        border-color: var(--accent);
        color: var(--accent);
    }

.btn-danger {
    background: var(--danger);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
    /* RESPONSIVE: minimum tap target */
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-danger:hover:not(:disabled) {
        opacity: 0.85;
    }

.btn-icon {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    color: var(--text-secondary);
    font-size: 16px;
    transition: color 0.2s;
    /* RESPONSIVE: minimum tap target */
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-icon:hover {
        color: var(--text-primary);
    }

    .btn-icon.btn-danger:hover {
        color: var(--danger);
    }

.btn-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    /* RESPONSIVE: minimum tap target */
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

    .btn-close:hover {
        color: var(--text-primary);
    }

/* ── Page Layout ─────────────────────────────────── */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px 16px;
    /* RESPONSIVE: allow wrapping on small screens */
    flex-wrap: wrap;
    gap: 12px;
}

    .page-header h1 {
        font-size: 24px;
        font-weight: 600;
    }

.subtitle {
    color: var(--text-secondary);
    margin-top: 4px;
    font-size: 14px;
}

/* ── Breadcrumb ──────────────────────────────────── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 14px;
    color: var(--text-secondary);
    /* RESPONSIVE: allow wrapping */
    flex-wrap: wrap;
}

    .breadcrumb a {
        color: var(--accent);
        text-decoration: none;
    }

        .breadcrumb a:hover {
            text-decoration: underline;
        }

/* ── Projects Search Bar ─────────────────────────── */
.search-bar {
    padding: 0 32px 20px;
    max-width: 1080px;
    min-width: 720px;
}

    .search-bar input {
        width: 100%;
        box-sizing: border-box;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: 8px;
        color: var(--text-primary);
        font-size: 14px;
        padding: 9px 14px 9px 36px;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 12px center;
    }

        .search-bar input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
        }

        .search-bar input::placeholder {
            color: var(--text-secondary);
        }

/* ── Sort Controls ────────────────────────────────── */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 20px;
}

.sort-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.sort-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 13px;
    padding: 7px 28px 7px 10px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%238892a4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    font-family: inherit;
}

    .sort-select:hover {
        border-color: var(--accent);
    }

    .sort-select:focus {
        border-color: var(--accent);
        box-shadow: 0 0 0 3px rgba(79, 142, 247, 0.15);
    }

    .sort-select option {
        background: var(--bg-card);
        color: var(--text-primary);
    }

/* ── Projects Grid ───────────────────────────────── */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding: 0 32px 32px;
}

.project-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    transition: border-color 0.2s, transform 0.2s;
    /* RESPONSIVE: prevent overflow */
    min-width: 0;
    word-break: break-word;
}

    .project-card:hover {
        border-color: var(--accent);
        transform: translateY(-2px);
    }

.project-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
    gap: 8px;
}

    .project-card-header h3 {
        font-size: 16px;
        font-weight: 600;
        /* RESPONSIVE: prevent long titles breaking layout */
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        min-width: 0;
    }

.project-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.project-description {
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 16px;
    min-height: 36px;
    overflow-wrap: break-word;
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 4px;
}

/* ── Models Grid ─────────────────────────────────── */
.models-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    padding: 0 32px 32px;
}

.model-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: border-color 0.2s;
    min-width: 0;
}

    .model-card:hover {
        border-color: var(--accent);
    }

.model-thumbnail {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.model-icon {
    font-size: 48px;
}

.model-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

    .model-info h4 {
        font-size: 14px;
        font-weight: 600;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .model-info small {
        color: var(--text-secondary);
        font-size: 12px;
    }

.model-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* ── Viewer Layout ───────────────────────────────── */
.viewer-layout {
    display: flex;
    height: calc(100vh - 100px);
    overflow: hidden;
}

.viewer-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    min-width: 0;
}

.viewer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
    gap: 8px;
}

    .viewer-toolbar h2 {
        font-size: 16px;
        font-weight: 600;
    }

.viewer-toolbar-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ── Layer Colour Picker ──────────────────────────── */
.layer-color-picker {
    display: flex;
    align-items: center;
    gap: 6px;
}

.layer-color-label {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    user-select: none;
}

.layer-color-input {
    width: 32px;
    height: 28px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-card);
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

    .layer-color-input:hover,
    .layer-color-input:focus {
        border-color: var(--accent);
    }

.three-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.viewer-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15,15,26,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ── Fly Controls D-Pad ──────────────────────────── */
.fly-controls {
    position: absolute;
    bottom: 16px;
    right: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    z-index: 10;
    user-select: none;
}

.fly-btn-row {
    display: flex;
    gap: 4px;
}

.fly-btn {
    width: 40px;
    height: 40px;
    background: rgba(20, 20, 40, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 7px;
    color: #e0e0f0;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background 0.1s, transform 0.08s;
    -webkit-tap-highlight-color: transparent;
}

.fly-btn:hover {
    background: rgba(60, 60, 110, 0.85);
}

.fly-btn:active {
    background: rgba(80, 80, 160, 0.95);
    transform: scale(0.93);
}

/* ── Comments Pane ───────────────────────────────── */
.comments-pane {
    width: 360px;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    border-left: 1px solid var(--border);
    position: relative;
    transition: width 0.3s ease;
    flex-shrink: 0;
}

    .comments-pane:not(.open) {
        width: 48px;
    }

        .comments-pane:not(.open) .comments-header,
        .comments-pane:not(.open) .comments-list,
        .comments-pane:not(.open) .comment-composer,
        .comments-pane:not(.open) .comment-filters {
            display: none;
        }

.comments-toggle {
    position: absolute;
    top: 12px;
    left: -40px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius) 0 0 var(--radius);
    padding: 8px 10px;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 13px;
    z-index: 10;
    /* RESPONSIVE: better tap target */
    min-height: 44px;
    display: flex;
    align-items: center;
}

    .comments-toggle:hover {
        background: var(--accent);
        border-color: var(--accent);
    }

.comments-header {
    padding: 16px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

    .comments-header h3 {
        font-size: 16px;
        font-weight: 600;
        margin-bottom: 10px;
    }

/* ── Comment Search ───────────────────────────────── */
.comment-search {
    margin-bottom: 10px;
}

    .comment-search input {
        width: 100%;
        box-sizing: border-box;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: 6px;
        color: var(--text-primary);
        font-size: 12px;
        padding: 6px 10px 6px 30px;
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238892a4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 10px center;
    }

        .comment-search input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px rgba(79, 142, 247, 0.12);
        }

        .comment-search input::placeholder {
            color: var(--text-secondary);
        }

.comment-filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
    /* RESPONSIVE: tap target */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

    .filter-btn.active,
    .filter-btn:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

.comments-list {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

    .comments-list::-webkit-scrollbar {
        width: 4px;
    }

    .comments-list::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }

/* ── Comment Item ────────────────────────────────── */
.comment-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    transition: border-color 0.2s;
    /* RESPONSIVE: prevent overflow */
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
    overflow: hidden;
}

    .comment-item.resolved {
        opacity: 0.6;
        border-color: var(--success);
    }

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    min-width: 0;
}

.comment-avatar {
    width: 28px;
    height: 28px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.comment-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

    .comment-meta strong {
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .comment-meta small {
        color: var(--text-secondary);
        font-size: 11px;
    }

.comment-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

.btn-resolve {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

    .btn-resolve:hover {
        border-color: var(--success);
        color: var(--success);
    }

    .btn-resolve.resolved {
        border-color: var(--success);
        background: var(--success);
        color: white;
    }

.comment-body p {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary);
    word-break: break-word;
    overflow-wrap: break-word;
}

.resolved-badge {
    margin-top: 8px;
    font-size: 11px;
    color: var(--success);
    padding: 2px 8px;
    background: rgba(76, 175, 125, 0.1);
    border-radius: 20px;
    display: inline-block;
}

/* ── Comment Composer ────────────────────────────── */
.comment-composer {
    padding: 12px;
    border-top: 1px solid var(--border);
    background: var(--bg-card);
    flex-shrink: 0;
}

    .comment-composer textarea {
        width: 100%;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text-primary);
        padding: 10px;
        /* RESPONSIVE: prevent iOS zoom — must be >= 16px */
        font-size: max(13px, 16px);
        resize: none;
        outline: none;
        transition: border-color 0.2s;
        font-family: inherit;
    }

        .comment-composer textarea:focus {
            border-color: var(--accent);
        }

.composer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.hint {
    font-size: 11px;
    color: var(--text-secondary);
}

/* ── Members ─────────────────────────────────────── */
.members-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: var(--bg-card);
    border-radius: var(--radius);
    min-width: 0;
}

.member-avatar {
    width: 36px;
    height: 36px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.member-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

    .member-info strong {
        font-size: 14px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .member-info small {
        color: var(--text-secondary);
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.badge-owner {
    font-size: 11px;
    background: rgba(79,142,247,0.15);
    color: var(--accent);
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.badge-role {
    font-size: 11px;
    background: rgba(255,255,255,0.08);
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.role-select {
    font-size: 12px;
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 3px 8px;
    cursor: pointer;
    outline: none;
    flex-shrink: 0;
}

    .role-select:focus {
        border-color: var(--accent);
    }

.add-member-form {
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

    .add-member-form h4 {
        font-size: 14px;
        margin-bottom: 10px;
    }

.input-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

    .input-row input {
        flex: 1;
        min-width: 0;
        background: var(--bg-primary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 8px 12px;
        color: var(--text-primary);
        font-size: 14px;
        outline: none;
    }

        .input-row input:focus {
            border-color: var(--accent);
        }

/* ── Modal ───────────────────────────────────────── */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(2px);
    /* RESPONSIVE: allow bottom-anchoring on mobile */
    padding: 16px;
}

.modal {
    background: var(--bg-modal);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    width: 480px;
    max-width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
    position: relative;
}

.modal-sm {
    width: 380px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
}

    .modal-header h2 {
        font-size: 18px;
        font-weight: 600;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.modal-body {
    padding: 20px 24px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    flex-wrap: wrap;
}

/* ── Forms ───────────────────────────────────────── */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

    .form-group label {
        font-size: 13px;
        font-weight: 500;
        color: var(--text-secondary);
    }

    .form-group input,
    .form-group textarea {
        background: var(--bg-primary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 10px 12px;
        color: var(--text-primary);
        /* RESPONSIVE: prevent iOS zoom */
        font-size: max(14px, 16px);
        outline: none;
        transition: border-color 0.2s;
        font-family: inherit;
        width: 100%;
    }

        .form-group input:focus,
        .form-group textarea:focus {
            border-color: var(--accent);
        }

/* ── Toast ───────────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    z-index: 9999;
    animation: slideIn 0.3s ease;
    /* RESPONSIVE: don't overflow on mobile */
    max-width: calc(100vw - 32px);
}

.toast-success {
    background: var(--success);
    color: white;
}

.toast-error {
    background: var(--danger);
    color: white;
}

/* ── Progress Bar ────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ── Empty / Loading States ──────────────────────── */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

    .empty-state h3 {
        font-size: 18px;
        margin-bottom: 8px;
        color: var(--text-primary);
    }

.empty-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

/* ── Misc ────────────────────────────────────────── */
.text-danger {
    color: var(--danger);
    font-size: 13px;
}

.text-success {
    color: var(--success);
}

@keyframes slideIn {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}


/* ════════════════════════════════════════════════════
   AUTH PAGES
   ════════════════════════════════════════════════════ */

.auth-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-primary);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(79,142,247,0.08) 0%, transparent 60%), radial-gradient(ellipse at 80% 20%, rgba(79,142,247,0.05) 0%, transparent 50%);
    padding: 20px;
}

.auth-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 24px 64px rgba(0,0,0,0.4);
    animation: fadeUp 0.3s ease;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo {
    width: 56px;
    height: 56px;
    object-fit: contain;
    margin-bottom: 12px;
    display: block;
}

.auth-header h1 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 6px;
}

.auth-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

    .input-wrapper .input-icon {
        position: absolute;
        left: 12px;
        font-size: 14px;
        pointer-events: none;
        z-index: 1;
    }

    .input-wrapper input {
        width: 100%;
        padding: 11px 40px 11px 36px;
        background: var(--bg-secondary);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        color: var(--text-primary);
        /* RESPONSIVE: prevent iOS zoom */
        font-size: max(14px, 16px);
        outline: none;
        transition: border-color 0.2s, box-shadow 0.2s;
        font-family: inherit;
    }

        .input-wrapper input:focus {
            border-color: var(--accent);
            box-shadow: 0 0 0 3px rgba(79,142,247,0.15);
        }

.input-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px;
    line-height: 1;
    /* RESPONSIVE: tap target */
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .input-toggle:hover {
        color: var(--text-primary);
    }

.btn-auth {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
    margin-top: 8px;
    /* RESPONSIVE: tap target */
    min-height: 44px;
}

    .btn-auth:hover:not(:disabled) {
        background: var(--accent-hover);
        transform: translateY(-1px);
    }

    .btn-auth:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

.btn-auth-outline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-top: 0;
    /* RESPONSIVE: tap target */
    min-height: 44px;
}

    .btn-auth-outline:hover {
        background: rgba(79,142,247,0.1);
    }

.auth-error {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(224,85,85,0.12);
    border: 1px solid rgba(224,85,85,0.3);
    color: #ff7070;
    padding: 10px 14px;
    border-radius: var(--radius);
    font-size: 13px;
    margin-bottom: 12px;
}

.auth-success {
    text-align: center;
    padding: 20px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.success-icon {
    width: 56px;
    height: 56px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 700;
}

.auth-success h3 {
    font-size: 18px;
    font-weight: 600;
}

.auth-success p {
    color: var(--text-secondary);
    font-size: 14px;
}

.auth-success .btn-auth {
    max-width: 200px;
    margin-top: 8px;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 12px;
    color: var(--text-secondary);
    font-size: 13px;
    text-align: center;
    justify-content: center;
}

.strength-bar-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}

.strength-bar {
    flex: 1;
    display: flex;
    gap: 4px;
}

.strength-segment {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    transition: background 0.3s;
}

.strength-label {
    font-size: 12px;
    font-weight: 500;
    width: 48px;
}

.strength-weak {
    background: #e05555;
    color: #e05555;
}

.strength-fair {
    background: #e09c55;
    color: #e09c55;
}

.strength-good {
    background: #55b4e0;
    color: #55b4e0;
}

.strength-strong {
    background: var(--success);
    color: var(--success);
}

.spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    flex-shrink: 0;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ════════════════════════════════════════════════════
   SIDEBAR & APP SHELL
   ════════════════════════════════════════════════════ */

.app-shell {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.sidebar {
    width: 240px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.25s ease, transform 0.25s ease;
    position: relative;
    flex-shrink: 0;
    z-index: 100;
}

    .sidebar.collapsed {
        width: 60px;
    }

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
    overflow: hidden;
    white-space: nowrap;
}

.logo-icon {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex-shrink: 0;
}

.logo-text {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.3px;
}

.sidebar-nav {
    flex: 0 0 auto;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
    overflow: hidden;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    /* RESPONSIVE: tap target */
    min-height: 44px;
}

    .nav-item:hover {
        background: rgba(255,255,255,0.05);
        color: var(--text-primary);
    }

    .nav-item.active {
        background: rgba(79,142,247,0.15);
        color: var(--accent);
    }

.nav-item-danger:hover {
    background: rgba(224,85,85,0.1);
    color: var(--danger);
}

.nav-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.nav-label {
    opacity: 1;
    transition: opacity 0.2s;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
}

.sidebar-toggle {
    position: absolute;
    bottom: 20px;
    right: -14px;
    width: 28px;
    height: 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background 0.2s, color 0.2s;
}

    .sidebar-toggle:hover {
        background: var(--accent);
        border-color: var(--accent);
        color: white;
    }

.sidebar-announcements {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: 8px;
    border-top: 1px solid var(--border);
    min-height: 0;
    overflow: hidden;
    position: relative;
}

    /* fade gradient indicating more content below */
    .sidebar-announcements.expanded::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 32px;
        background: linear-gradient(to bottom, transparent, var(--bg-secondary));
        pointer-events: none;
    }

.sidebar-announcements.collapsed {
    overflow: hidden;
}

.announcement-pinned-stack {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 6px;
    margin-bottom: 6px;
}

.announcement-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
    padding-right: 2px;
}

    .announcement-scroll::-webkit-scrollbar {
        width: 4px;
    }

    .announcement-scroll::-webkit-scrollbar-track {
        background: transparent;
    }

    .announcement-scroll::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 2px;
    }

        .announcement-scroll::-webkit-scrollbar-thumb:hover {
            background: var(--accent);
        }

.announcement-section-header {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-secondary);
    padding: 6px 4px 8px;
}

.announcement-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.announcement-empty {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 8px 4px;
    font-style: italic;
}

.announcement-item {
    padding: 10px 10px;
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.04);
    border-left: 2px solid transparent;
    transition: background 0.15s, border-left-color 0.15s;
    cursor: default;
}

    .announcement-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

.announcement-item.pinned {
    border-left-color: var(--accent);
    background: rgba(79, 142, 247, 0.08);
}

    .announcement-item.pinned:hover {
        background: rgba(79, 142, 247, 0.14);
    }

.announcement-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 4px;
    line-height: 1.3;
}

.announcement-body {
    font-size: 11px;
    color: var(--text-secondary);
    line-height: 1.5;
    white-space: pre-line;
}

.announcement-meta {
    font-size: 10px;
    color: var(--text-secondary);
    opacity: 0.6;
    margin-top: 5px;
}

.pin-badge {
    font-size: 10px;
    flex-shrink: 0;
}

/* ── Announcements Page ─────────────────────────────── */
.announcement-form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 0 32px 24px;
}

.announcement-page-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 32px 32px;
}

.announcement-page-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: border-color 0.2s;
}

.announcement-page-card.pinned {
    border-left-color: var(--accent);
    background: rgba(79, 142, 247, 0.04);
}

.announcement-page-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}

.announcement-page-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.4;
}

.announcement-page-body {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-line;
    margin-bottom: 10px;
}

.announcement-page-meta {
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.sidebar-footer {
    padding: 12px 8px;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.03);
    overflow: hidden;
    white-space: nowrap;
    margin-bottom: 4px;
}

.user-avatar-sm {
    width: 30px;
    height: 30px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: white;
    flex-shrink: 0;
}

.user-chip-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.user-chip-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-chip-email {
    font-size: 11px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 24px;
    height: 56px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 12px;
    min-width: 0;
}

.topbar-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    min-width: 0;
    overflow: hidden;
}

    .topbar-breadcrumb a {
        color: var(--accent);
        text-decoration: none;
        white-space: nowrap;
    }

        .topbar-breadcrumb a:hover {
            text-decoration: underline;
        }

.crumb-sep {
    color: var(--border);
    flex-shrink: 0;
}

.crumb-current {
    color: var(--text-primary);
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.topbar-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.clock-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 10px;
    min-width: 80px;
}

.clock-box--project {
    border-color: var(--accent);
}

.clock-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.clock-time {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.05em;
}

.clock-box--project .clock-time {
    color: var(--accent);
}

.clock-divider {
    color: var(--border);
    font-size: 16px;
    flex-shrink: 0;
}

/* ── GMT select in create form ───────────────────── */
.gmt-select {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 13px;
    padding: 8px 10px;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

    .gmt-select:focus {
        border-color: var(--accent);
    }

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.page-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

    .page-body::-webkit-scrollbar {
        width: 6px;
    }

    .page-body::-webkit-scrollbar-thumb {
        background: var(--border);
        border-radius: 3px;
    }

.full-screen-loader {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--bg-primary);
}

.not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 60vh;
    gap: 12px;
    color: var(--text-secondary);
}

    .not-found h1 {
        font-size: 72px;
        font-weight: 800;
        color: var(--border);
        line-height: 1;
    }

    .not-found a {
        color: var(--accent);
        text-decoration: none;
        font-size: 14px;
    }

.validation-message {
    color: #ff7070;
    font-size: 12px;
    margin-top: 4px;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}


/* ════════════════════════════════════════════════════
   MODEL VIEWER ROOT
   ════════════════════════════════════════════════════ */

.model-viewer-root {
    display: grid;
    grid-template-columns: 240px 1fr 300px;
    height: 100%;
    gap: 0;
    background: #0f0f1a;
    color: #e0e0e0;
    font-family: sans-serif;
    overflow: hidden;
}

/* ── Layer Panel ── */
.layer-panel {
    background: #161625;
    border-right: 1px solid #2a2a3d;
    padding: 12px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

    .layer-panel h4 {
        color: #aaa;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin-bottom: 8px;
    }

.layer-tree {
    list-style: none;
    margin: 0;
    padding: 0;
}

.layer-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    user-select: none;
    /* RESPONSIVE: tap target */
    min-height: 36px;
}

    .layer-item:hover {
        background: #1e1e35;
    }

    .layer-item.selected {
        background: #1a3a5c;
        color: #00aaff;
    }

.layer-icon {
    font-size: 11px;
    opacity: 0.6;
}

.layer-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.comment-badge {
    background: #e74c3c;
    color: white;
    border-radius: 10px;
    padding: 1px 6px;
    font-size: 10px;
    flex-shrink: 0;
}

/* ── Canvas ── */
.canvas-wrapper {
    position: relative;
    overflow: hidden;
    min-width: 0;
    min-height: 0;
}

/* ── Comment Panel ── */
.comment-panel {
    background: #161625;
    border-left: 1px solid #2a2a3d;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    min-width: 0;
}

    .comment-panel h4 {
        color: #aaa;
        font-size: 11px;
        text-transform: uppercase;
        letter-spacing: 1px;
    }

        .comment-panel h4 small {
            color: #00aaff;
            font-size: 11px;
            text-transform: none;
        }

.muted {
    color: #555;
    font-size: 13px;
}

.comment-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.comment-card {
    background: #1e1e35;
    border-radius: 6px;
    padding: 10px;
    font-size: 13px;
    word-break: break-word;
    overflow-wrap: break-word;
}

.comment-author {
    font-weight: bold;
    color: #00aaff;
    font-size: 12px;
}

.comment-date {
    color: #555;
    font-size: 11px;
    margin-bottom: 6px;
}

.comment-body {
    color: #ccc;
    line-height: 1.4;
    white-space: pre-wrap;
}

.comment-add {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

    .comment-add textarea {
        background: #1e1e35;
        border: 1px solid #2a2a3d;
        color: #e0e0e0;
        border-radius: 6px;
        padding: 8px;
        /* RESPONSIVE: prevent iOS zoom */
        font-size: max(13px, 16px);
        resize: vertical;
        width: 100%;
        font-family: inherit;
    }

    .comment-add button {
        background: #0066cc;
        color: white;
        border: none;
        border-radius: 6px;
        padding: 8px;
        cursor: pointer;
        font-size: 13px;
        /* RESPONSIVE: tap target */
        min-height: 44px;
    }

        .comment-add button:hover {
            background: #0077ee;
        }

        .comment-add button:disabled {
            background: #333;
            color: #666;
            cursor: not-allowed;
        }

/* ── Replies Section ─────────────────────────────── */
.replies-section {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #1e1e35;
}

.replies-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 6px;
}

.reply-item {
    background: #12121f;
    border-left: 2px solid #2a2a4a;
    border-radius: 0 6px 6px 0;
    padding: 8px 10px;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}

.reply-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    min-width: 0;
}

.reply-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #1a3a5c;
    color: #00aaff;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.reply-meta {
    flex: 1;
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 12px;
    min-width: 0;
    flex-wrap: wrap;
}

    .reply-meta strong {
        color: #ccc;
        font-size: 12px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        max-width: 100px;
    }

    .reply-meta small {
        color: #555;
        font-size: 11px;
    }

.reply-body p {
    margin: 0;
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.btn-reply-trigger {
    background: none;
    border: none;
    color: #555;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 0;
    transition: color 0.15s;
    /* RESPONSIVE: tap target */
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

    .btn-reply-trigger:hover {
        color: #00aaff;
    }

.reply-count {
    color: #444;
    margin-left: 4px;
}

.replies-toggle {
    background: none;
    border: none;
    color: #445;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 0;
    margin-bottom: 4px;
    transition: color 0.15s;
    /* RESPONSIVE: tap target */
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

    .replies-toggle:hover {
        color: #00aaff;
    }

.reply-composer {
    margin-top: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

    .reply-composer textarea {
        background: #12121f;
        border: 1px solid #2a2a4a;
        color: #e0e0e0;
        border-radius: 6px;
        padding: 6px 8px;
        /* RESPONSIVE: prevent iOS zoom */
        font-size: max(12px, 16px);
        resize: vertical;
        width: 100%;
        box-sizing: border-box;
        font-family: inherit;
    }

.reply-composer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.btn-ghost {
    background: none;
    border: 1px solid #2a2a4a;
    color: #888;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    min-height: 36px;
}

    .btn-ghost:hover {
        border-color: #555;
        color: #ccc;
    }

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

/* ── Deleted comment/reply ── */
.comment-item.deleted {
    border-color: #f1aeb5;
    background: rgba(248, 215, 218, 0.08);
    opacity: 0.9;
}

.reply-item.deleted {
    border-left: 2px solid #dc3545;
    background: rgba(248, 215, 218, 0.06);
    border-radius: 6px;
    margin-bottom: 6px;
}

.deleted-banner {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(248, 215, 218, 0.15);
    color: #f1aeb5;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(241, 174, 181, 0.3);
    flex-wrap: wrap;
}

.deleted-banner-sm {
    padding: 3px 10px;
    font-size: 0.72rem;
    border-radius: 6px 6px 0 0;
}

.deleted-banner-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #dc3545;
    flex-shrink: 0;
}

.deleted-avatar {
    background: #adb5bd !important;
    opacity: 0.6;
}

.deleted-body p {
    text-decoration: line-through;
    color: #666;
    font-style: italic;
}

.btn-restore {
    margin-left: auto;
    background: transparent;
    border: 1px solid #f1aeb5;
    color: #f1aeb5;
    border-radius: 4px;
    padding: 1px 8px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    /* RESPONSIVE: tap target */
    min-height: 32px;
    display: inline-flex;
    align-items: center;
}

    .btn-restore:hover {
        background: #842029;
        color: #fff;
        border-color: #842029;
    }

.btn-restore-sm {
    padding: 1px 6px;
    font-size: 0.68rem;
}

.icon-trash {
    display: inline-block;
    width: 11px;
    height: 13px;
    position: relative;
}

    .icon-trash::before {
        content: '';
        position: absolute;
        top: 3px;
        left: 1px;
        width: 9px;
        height: 9px;
        border: 1.5px solid currentColor;
        border-top: none;
        border-radius: 0 0 2px 2px;
    }

    .icon-trash::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 11px;
        height: 2px;
        background: currentColor;
        border-radius: 1px;
    }

/* ── Blazor internals ── */
#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0,0,0,0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 0.75rem;
        top: 0.5rem;
    }

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

    .blazor-error-boundary::after {
        content: "An error has occurred."
    }

.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto;
}

    .loading-progress circle {
        fill: none;
        stroke: #e0e0e0;
        stroke-width: 0.6rem;
        transform-origin: 50% 50%;
        transform: rotate(-90deg);
    }

        .loading-progress circle:last-child {
            stroke: #1b6ec2;
            stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
            transition: stroke-dasharray 0.05s ease-in-out;
        }

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

    .loading-progress-text:after {
        content: var(--blazor-load-percentage-text, "Loading");
    }


/* ════════════════════════════════════════════════════
   RESPONSIVE — MOBILE OVERLAY SIDEBAR
   Used on all breakpoints <= 768px
   ════════════════════════════════════════════════════ */

/* RESPONSIVE: overlay backdrop for mobile sidebar */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 99;
    backdrop-filter: blur(1px);
}

    .sidebar-overlay.visible {
        display: block;
    }

/* RESPONSIVE: hamburger toggle shown only on mobile */
.topbar-menu-btn {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px 8px;
    border-radius: var(--radius);
    flex-direction: column;
    gap: 4px;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    transition: color 0.2s;
}

    .topbar-menu-btn:hover {
        color: var(--text-primary);
    }

    .topbar-menu-btn span {
        display: block;
        width: 18px;
        height: 2px;
        background: currentColor;
        border-radius: 1px;
        transition: transform 0.2s, opacity 0.2s;
    }


/* ════════════════════════════════════════════════════
   RESPONSIVE — TABLET  (max-width: 1024px)
   ════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

    /* Shrink the 3-col viewer grid — hide layer panel */
    .model-viewer-root {
        grid-template-columns: 1fr 280px;
    }

    .layer-panel {
        display: none;
    }

    /* Narrower grids */
    .projects-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        padding: 0 20px 24px;
    }

    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        padding: 0 20px 24px;
    }

    .page-header {
        padding: 20px 20px 12px;
    }

    .breadcrumb {
        padding: 12px 20px;
    }

    .topbar {
        padding: 0 16px;
    }

    /* Slightly smaller sidebar */
    .sidebar {
        width: 200px;
    }

        .sidebar.collapsed {
            width: 56px;
        }

    /* Comments pane — narrower */
    .comments-pane {
        width: 300px;
    }

        .comments-pane:not(.open) {
            width: 44px;
        }
}


/* ════════════════════════════════════════════════════
   RESPONSIVE — MOBILE  (max-width: 768px)
   ════════════════════════════════════════════════════ */
@media (max-width: 768px) {

    /* ── App shell: sidebar becomes slide-in overlay ── */
    .app-shell {
        position: relative;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px !important; /* always full-width when open */
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: 4px 0 24px rgba(0,0,0,0.4);
    }

        .sidebar.open {
            transform: translateX(0);
        }

        /* Always show labels when sidebar is an overlay */
        .sidebar .nav-label {
            opacity: 1;
        }

    /* Show hamburger */
    .topbar-menu-btn {
        display: flex;
    }

    /* Hide desktop sidebar toggle button */
    .sidebar-toggle {
        display: none;
    }

    /* Topbar gets tighter padding */
    .topbar {
        padding: 0 12px;
        height: 52px;
    }

    /* Shrink breadcrumb — hide intermediate crumbs on very small screens */
    .topbar-breadcrumb {
        font-size: 12px;
        gap: 4px;
    }

    /* Hide right-side user label in topbar — icon only */
    .topbar-user span:not(.user-avatar-sm) {
        display: none;
    }

    /* ── Page layout ── */
    .page-header {
        padding: 16px 16px 12px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

        .page-header h1 {
            font-size: 20px;
        }

    .breadcrumb {
        padding: 10px 16px;
    }

    /* ── Grids: single column on mobile ── */
    .projects-grid {
        grid-template-columns: 1fr;
        padding: 0 16px 24px;
    }

    .models-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        padding: 0 16px 24px;
    }

    /* ── Model viewer: stack vertically ── */
    .model-viewer-root {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr auto;
        height: 100%;
    }

    .layer-panel {
        display: none;
    }
    /* hidden on mobile — use filter pills instead */
    .comment-panel {
        border-left: none;
        border-top: 1px solid #2a2a3d;
        max-height: 40vh;
        min-height: 200px;
    }

    /* ── Viewer layout: stack canvas + comments vertically ── */
    .viewer-layout {
        flex-direction: column;
        height: calc(100vh - 52px);
    }

    .viewer-pane {
        flex: 1 1 55%;
        min-height: 0;
    }

    /* Comments pane becomes full-width bottom panel */
    .comments-pane {
        position: relative !important;
        width: 100% !important;
        height: 45vh;
        border-left: none;
        border-top: 1px solid var(--border);
        flex-shrink: 0;
        /* Smooth slide-up feel */
        transition: height 0.3s ease;
    }

        /* Collapsed state on mobile: shrink to a tab strip */
        .comments-pane:not(.open) {
            width: 100% !important;
            height: 44px;
        }

            .comments-pane:not(.open) .comments-header {
                display: none;
            }

            .comments-pane:not(.open) .comments-list {
                display: none;
            }

            .comments-pane:not(.open) .comment-composer {
                display: none;
            }

            .comments-pane:not(.open) .comment-filters {
                display: none;
            }

    /* Toggle floats at top edge of panel */
    .comments-toggle {
        left: auto;
        right: 12px;
        top: 8px;
        border-radius: var(--radius);
        padding: 6px 10px;
    }

    .viewer-toolbar {
        padding: 8px 12px;
    }

        .viewer-toolbar h2 {
            font-size: 14px;
        }

    /* ── Modal: full-screen bottom sheet on mobile ── */
    .modal-backdrop {
        align-items: flex-end;
        padding: 0;
    }

    .modal {
        width: 100%;
        max-width: 100%;
        max-height: 92vh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        /* drag handle */
        padding-top: 8px;
    }

        /* Drag handle indicator */
        .modal::before {
            content: '';
            display: block;
            width: 36px;
            height: 4px;
            background: var(--border);
            border-radius: 2px;
            margin: 0 auto 8px;
            flex-shrink: 0;
        }

    .modal-header {
        padding: 12px 16px;
    }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        padding: 12px 16px;
    }

        /* Modal footer buttons fill width */
        .modal-footer .btn-primary,
        .modal-footer .btn-secondary,
        .modal-footer .btn-danger {
            flex: 1 1 auto;
        }

    /* ── Toast: full width at bottom ── */
    .toast {
        bottom: 16px;
        right: 16px;
        left: 16px;
        max-width: none;
        text-align: center;
    }

    /* ── Auth card: compact padding ── */
    .auth-card {
        padding: 28px 20px;
        border-radius: 12px;
    }

    .auth-header {
        margin-bottom: 24px;
    }

        .auth-header h1 {
            font-size: 20px;
        }

    /* ── Input row: stack on mobile ── */
    .input-row {
        flex-direction: column;
    }

        .input-row input {
            width: 100%;
        }

    /* ── Comment composer: send btn full width ── */
    .composer-footer {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }

        .composer-footer .btn-primary {
            width: 100%;
        }

    .hint {
        text-align: center;
    }

    /* ── Reply composer ── */
    .reply-composer-actions {
        justify-content: stretch;
    }

        .reply-composer-actions .btn-primary,
        .reply-composer-actions .btn-ghost {
            flex: 1 1 auto;
        }

    /* ── Member row: tighter ── */
    .member-row {
        padding: 6px;
        gap: 8px;
    }

    .member-avatar {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    /* ── Not-found page ── */
    .not-found h1 {
        font-size: 48px;
    }
}


/* ════════════════════════════════════════════════════
   RESPONSIVE — SMALL MOBILE  (max-width: 400px)
   ════════════════════════════════════════════════════ */
@media (max-width: 400px) {

    .page-header h1 {
        font-size: 18px;
    }

    .auth-card {
        padding: 24px 16px;
    }

    .auth-logo {
        font-size: 32px;
    }

    .models-grid {
        grid-template-columns: 1fr 1fr;
        padding: 0 12px 20px;
    }

    /* Viewer: give more room to canvas on small phones */
    .comments-pane {
        height: 38vh;
    }

    .viewer-pane {
        flex: 1 1 62%;
    }

    /* Modal: full-screen */
    .modal {
        max-height: 96vh;
    }

    /* Filter pills: wrap tightly */
    .comment-filters {
        gap: 4px;
    }

    .filter-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
}


/* ════════════════════════════════════════════════════
   RESPONSIVE — iPhone safe-area (notch / home bar)
   ════════════════════════════════════════════════════ */
@supports (padding-bottom: env(safe-area-inset-bottom)) {

    .comment-composer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .comments-pane {
        padding-bottom: env(safe-area-inset-bottom);
    }

    .modal-footer {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    .toast {
        bottom: calc(16px + env(safe-area-inset-bottom));
    }
    /* Sidebar safe-area on the left */
    .sidebar {
        padding-left: env(safe-area-inset-left);
    }
}

.expiry-warning-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: rgba(224, 156, 85, 0.15);
    border-bottom: 1px solid rgba(224, 156, 85, 0.4);
    color: #e09c55;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
    animation: slideIn 0.3s ease;
}

.workspace {
    position: relative;  /* ← required for absolute children to be contained */
    overflow: hidden;
    height: 100%;
}





/* ── Pane Shell ──────────────────────────────────────────── */
.layers-pane {
    display: flex;
    flex-direction: row;
    position: relative;
    transition: width 0.26s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

/* ── Toggle Tab ──────────────────────────────────────────── */
.layers-toggle-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 20px;
    flex-shrink: 0;
    background: rgba(30, 35, 55, 0.9);
    border: none;
    border-right: 1px solid rgba(99, 130, 255, 0.12);
    color: rgba(140, 160, 210, 0.6);
    cursor: pointer;
    padding: 10px 0;
    transition: background 0.18s, color 0.18s;
}

    .layers-toggle-tab:hover {
        background: rgba(99, 130, 255, 0.1);
        color: rgba(160, 185, 255, 1);
    }

.layers-toggle-icon {
    font-size: 10px;
}

.layers-toggle-label {
    writing-mode: vertical-rl;
    font-size: 9px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    user-select: none;
}

/* ── Pane Body ───────────────────────────────────────────── */
.layers-pane-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: opacity 0.22s ease, width 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

.layers-pane--collapsed .layers-pane-body {
    width: 0;
    opacity: 0;
    pointer-events: none;
}

/* ── Header Actions ──────────────────────────────────────── */
.layers-header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.layers-action-btn {
    background: transparent;
    border: none;
    color: rgba(120, 140, 200, 0.55);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 4px;
    border-radius: 3px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}

    .layers-action-btn:hover {
        color: rgba(160, 185, 255, 1);
        background: rgba(99, 130, 255, 0.1);
    }

/* ── Search ──────────────────────────────────────────────── */
.layers-search {
    padding: 5px 8px;
}

.layers-search-input {
    width: 100%;
    box-sizing: border-box;
    background: rgba(20, 25, 45, 0.6);
    border: 1px solid rgba(99, 130, 255, 0.15);
    border-radius: 4px;
    color: rgba(180, 195, 235, 0.9);
    font-size: 11px;
    padding: 4px 8px;
    outline: none;
    transition: border-color 0.15s;
}

    .layers-search-input:focus {
        border-color: rgba(99, 130, 255, 0.45);
    }

    .layers-search-input::placeholder {
        color: rgba(100, 120, 180, 0.35);
    }

/* ── Collapse Button & Chevron ───────────────────────────── */
.layer-collapse-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0 2px;
    color: rgba(120, 140, 200, 0.5);
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.15s;
}

    .layer-collapse-btn:hover {
        color: rgba(160, 185, 255, 0.9);
    }

.layer-collapse-spacer {
    display: inline-block;
    width: 16px;
    flex-shrink: 0;
}

.layer-chevron {
    display: inline-block;
    font-size: 13px;
    font-style: normal;
    transition: transform 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.chevron-right {
    transform: rotate(0deg);
}

.chevron-down {
    transform: rotate(90deg);
}


/* Panel — fixed height flex column */
.comments-panel,
.comments-pane,
.comment-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

/* List — scrollable region */
.comments-list {
    flex: 1 1 0;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0; /* lets the list shrink so composer stays visible */
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Cards — NEVER let flex squish these */
.comment-item,
.comment-item.resolved,
.comment-item.deleted {
    flex-shrink: 0; /* ← the key line */
}

/* Composer — pinned to bottom */
.comment-composer {
    flex-shrink: 0;
    border-top: 1px solid rgba(255, 71, 87, 0.1);
    padding: 10px;
    background: rgba(11, 15, 30, 0.95);
}

/* Scrollbar styling */
.comments-list::-webkit-scrollbar {
    width: 4px;
}

.comments-list::-webkit-scrollbar-track {
    background: transparent;
}

.comments-list::-webkit-scrollbar-thumb {
    background: rgba(255, 71, 87, 0.25);
    border-radius: 4px;
}

    .comments-list::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 71, 87, 0.5);
    }

.comments-list {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 71, 87, 0.25) transparent;
}


.composer-pin-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.btn-pin {
    display: flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px dashed rgba(255, 71, 87, 0.3);
    border-radius: 5px;
    color: rgba(255, 110, 120, 0.7);
    font-size: 11px;
    padding: 3px 9px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

    .btn-pin:hover {
        background: rgba(255, 71, 87, 0.08);
        border-color: rgba(255, 71, 87, 0.55);
        border-style: solid;
        color: rgba(255, 130, 140, 1);
    }

.pin-waiting-hint {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: rgba(255, 200, 80, 0.85);
}

.pin-pulse-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 200, 80, 0.9);
    animation: pinPulse 1s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pinPulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.75);
    }
}

.pin-placed-hint {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: rgba(46, 213, 115, 0.85);
}
/* ── Goto pin button (in comment-actions) ────────────────── */ .btn-goto-pin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: rgba(255, 100, 115, 0.5);
    cursor: pointer;
    transition: color 0.14s, background 0.14s;
    padding: 0;
    flex-shrink: 0;
}

    .btn-goto-pin:hover {
        color: rgba(255, 100, 115, 1);
        background: rgba(255, 71, 87, 0.1);
    }
/* ── Pin coords strip under comment body ─────────────────── */ .comment-pin-strip {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 4px 0 6px;
    padding: 4px 8px;
    background: rgba(255, 71, 87, 0.05);
    border: 1px solid rgba(255, 71, 87, 0.1);
    border-radius: 4px;
}

.pin-strip-icon {
    color: rgba(255, 80, 95, 0.55);
    flex-shrink: 0;
}

.pin-strip-coords {
    flex: 1;
    font-size: 10px;
    color: rgba(180, 150, 160, 0.55);
    font-family: 'JetBrains Mono', monospace;
}

.btn-goto-pin-inline {
    background: transparent;
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 3px;
    color: rgba(255, 110, 120, 0.7);
    font-size: 10px;
    font-family: inherit;
    padding: 2px 7px;
    cursor: pointer;
    transition: all 0.12s;
    flex-shrink: 0;
}

    .btn-goto-pin-inline:hover {
        background: rgba(255, 71, 87, 0.1);
        border-color: rgba(255, 71, 87, 0.45);
        color: rgba(255, 140, 150, 1);
    }


.btn-clear-layer {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 71, 87, 0.7);
    background: transparent;
    border: 1px solid rgba(255, 71, 87, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    white-space: nowrap;
    user-select: none;
}

    .btn-clear-layer:hover {
        color: #ff4757;
        background: rgba(255, 71, 87, 0.1);
        border-color: rgba(255, 71, 87, 0.5);
    }

    .btn-clear-layer:active {
        background: rgba(255, 71, 87, 0.2);
        border-color: rgba(255, 71, 87, 0.7);
        transform: scale(0.97);
    }

    .btn-clear-layer:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        pointer-events: none;
    }