/* Reset and base styles */
* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

html {
    font-size: 0.9rem;
    line-height: 1.5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-family: "input-sans", sans-serif;
    color: #333;
    background-color: #fff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.2;
}

h1 { font-size: 1.5rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.125rem; }

p {
    margin: 0 0 1rem 0;
}

/* Layout */
header {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e9ecef;
    border-bottom: 8px solid red;
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0 0 0.1em 1rem;
    font-size: 5rem;
    font-family: "nickel-gothic-variable", sans-serif;
    font-variation-settings: "slnt" 15, "wdth" 150;
    color: #1e446b;
    text-shadow: -.05em .05em 0 lightblue;
}

.content-counter {
    display: flex;
    gap: 1rem;
    font-size: 0.875rem;
    color: #6c757d;
    font-weight: 500;
}

.global-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-left: 1rem;
}

.global-actions button {
    background-color: white;
    border: 1px solid #dee2e6;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
}

.global-actions .load-all-btn:hover {
    background-color: #17a2b8;
    color: white;
}

.global-actions .export-all-btn:hover {
    background-color: #6c757d;
    color: white;
}

.parts-count,
.builds-count {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.two-column-layout {
    display: flex;
    flex: 1;
    height: 100%;
}

.sidebar {
    width: 33.333%;
    min-width: 300px;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 1rem;
    flex-shrink: 0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.parts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #dee2e6;
}

.parts-header h2 {
    margin: 0;
    font-size: 1.125rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}
.header-actions button {
    color: #444;
    background-color: white;
    border: 1px solid #dee2e6;
    font-size: 0.85rem;
    font-family: "input-sans", sans-serif;
}

.download-parts-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    line-height: 1;
}

.download-parts-btn:hover {
    color: white;
    background-color: #5a6268;
}

.load-parts-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
    line-height: 1;
}

.load-parts-btn:hover {
    color: white;
    background-color: #138496;
}



.toc-category {
    margin-bottom: 0.5rem;
}

.toc-category-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
}



.parts-container {
    flex: 1;
    overflow-y: auto;
}

/* TOC-style parts list */
.toc-category {
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.toc-category-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s;
}

/* Category-specific background colors for category headers (lightened with rgba alpha) */
.toc-category[data-category="Introduction"] .toc-category-header {
    background-color: rgba(59, 130, 246, 0.2);
}

.toc-category[data-category="Context"] .toc-category-header {
    background-color: rgba(16, 185, 129, 0.2);
}

.toc-category[data-category="Instructions"] .toc-category-header {
    background-color: rgba(245, 158, 11, 0.2);
}

.toc-category[data-category="Examples"] .toc-category-header {
    background-color: rgba(139, 92, 246, 0.2);
}

.toc-category[data-category="Constraints"] .toc-category-header {
    background-color: rgba(239, 68, 68, 0.2);
}

.toc-category[data-category="Output Format"] .toc-category-header {
    background-color: rgba(6, 182, 212, 0.2);
}

.toc-category[data-category="Persona"] .toc-category-header {
    background-color: rgba(132, 204, 22, 0.2);
}

.toc-category[data-category="Background"] .toc-category-header {
    background-color: rgba(107, 114, 128, 0.2);
}

.toc-category[data-category="Requirements"] .toc-category-header {
    background-color: rgba(249, 115, 22, 0.2);
}

.toc-category[data-category="Limitations"] .toc-category-header {
    background-color: rgba(236, 72, 153, 0.2);
}

.toc-category[data-category="Style Guide"] .toc-category-header {
    background-color: rgba(99, 102, 241, 0.2);
}

.toc-category[data-category="Tone"] .toc-category-header {
    background-color: rgba(20, 184, 166, 0.2);
}

.toc-category[data-category="Audience"] .toc-category-header {
    background-color: rgba(244, 63, 94, 0.2);
}

.toc-category[data-category="Goal"] .toc-category-header {
    background-color: rgba(34, 197, 94, 0.2);
}

.toc-category[data-category="Success Criteria"] .toc-category-header {
    background-color: rgba(168, 85, 247, 0.2);
}

.toc-category[data-category="Uncategorized"] .toc-category-header {
    background-color: rgba(107, 114, 128, 0.2);
}

.toc-category-header:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.toc-category-header.expanded {
    color: white;
    border-color: #0056b3;
}

/* Category-specific expanded background colors (full alpha) */
.toc-category[data-category="Introduction"] .toc-category-header.expanded {
    background-color: rgb(59, 130, 246);
}

.toc-category[data-category="Context"] .toc-category-header.expanded {
    background-color: rgb(16, 185, 129);
}

.toc-category[data-category="Instructions"] .toc-category-header.expanded {
    background-color: rgb(245, 158, 11);
}

.toc-category[data-category="Examples"] .toc-category-header.expanded {
    background-color: rgb(139, 92, 246);
}

.toc-category[data-category="Constraints"] .toc-category-header.expanded {
    background-color: rgb(239, 68, 68);
}

.toc-category[data-category="Output Format"] .toc-category-header.expanded {
    background-color: rgb(6, 182, 212);
}

.toc-category[data-category="Persona"] .toc-category-header.expanded {
    background-color: rgb(132, 204, 22);
}

.toc-category[data-category="Background"] .toc-category-header.expanded {
    background-color: rgb(107, 114, 128);
}

.toc-category[data-category="Requirements"] .toc-category-header.expanded {
    background-color: rgb(249, 115, 22);
}

.toc-category[data-category="Limitations"] .toc-category-header.expanded {
    background-color: rgb(236, 72, 153);
}

.toc-category[data-category="Style Guide"] .toc-category-header.expanded {
    background-color: rgb(99, 102, 241);
}

.toc-category[data-category="Tone"] .toc-category-header.expanded {
    background-color: rgb(20, 184, 166);
}

.toc-category[data-category="Audience"] .toc-category-header.expanded {
    background-color: rgb(244, 63, 94);
}

.toc-category[data-category="Goal"] .toc-category-header.expanded {
    background-color: rgb(34, 197, 94);
}

.toc-category[data-category="Success Criteria"] .toc-category-header.expanded {
    background-color: rgb(168, 85, 247);
}

.toc-category[data-category="Uncategorized"] .toc-category-header.expanded {
    background-color: rgb(107, 114, 128);
}

.toc-category-header .category-name {
    flex: 1;
    text-align: left;
    font-weight: 600;
}

.toc-category-header .category-count {
    font-size: 0.8rem;
    opacity: 0.8;
}

.toc-category-header .toggle-icon {
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.toc-category-header.expanded .toggle-icon {
    transform: rotate(90deg);
}

.toc-parts {
    display: none;
}

.toc-category.expanded .toc-parts {
    display: block;
}

/* Search result styling */
.toc-category.hidden {
    display: none;
}

.toc-category.no-results {
    opacity: 0.5;
}

.toc-category.no-results .toc-category-header {
    background-color: #f8f9fa;
    color: #6c757d;
}

.toc-category.no-results .toc-category-header .category-count {
    opacity: 0.6;
}

.toc-part {
    padding: 0.75rem 1rem;
    margin: 0;
    border-bottom: 1px solid #f1f3f4;
    cursor: pointer;
    font-size: 0.875rem;
    color: #495057;
    transition: all 0.2s;
    background-color: white;
}

.toc-part:last-child {
    border-bottom: none;
}

.toc-part:hover {
    background-color: #f8f9fa;
}

.toc-part.active {
    background-color: #e3f2fd;
    border-left: 3px solid #2196f3;
}

/* Part item styling within TOC */
.part-item {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin: 1rem;
    background-color: transparent;
}

.part-item .part-header {
    margin-bottom: 0.5rem;
}

.part-item .part-title-display {
    font-weight: 600;
    color: #212529;
}

.part-item .part-text {
    color: #6c757d;
    line-height: 1.4;
}

.part-item .part-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f3f4;
}

.part-item .part-actions {
    gap: 0.25rem;
}

.part-item .edit-part-btn,
.part-item .delete-part-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}





.part-form {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.search-container {
    margin-bottom: 1rem;
}

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

.search-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 0.75rem 2.5rem 0.75rem 0.75rem;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: #f8f9fa;
    transition: all 0.2s;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    background-color: white;
}

.search-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.clear-search-btn {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.2rem;
    border-radius: 4px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
}

.clear-search-btn:hover {
    background-color: #e9ecef;
    color: #495057;
}

.clear-search-btn:active {
    background-color: #dee2e6;
}

.search-results-summary {
    margin-top: 0.5rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

.search-results-summary.no-results {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.part-title-input {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    background-color: #f8f9fa;
}

.part-title-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    background-color: white;
}

.part-category-select {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    background-color: #f8f9fa;
}

.part-category-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
    background-color: white;
}

.part-title-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.part-form textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 60px;
}

.part-form textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.part-actions {
    display: flex;
    gap: 0.5rem;
}

.part-actions button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.save-part-btn {
    background-color: #28a745;
    border-color: #28a745;
}

.save-part-btn:hover {
    background-color: #218838;
    color: white;
    border-color: #1e7e34;
}

.clear-part-btn {
    background-color: #6c757d;
    border-color: #6c757d;
}

.clear-part-btn:hover {
    background-color: #5a6268;
    color: white;
    border-color: #545b62;
}

.part-item {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    cursor: grab;
    transition: all 0.2s;
}

.part-header {
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f1f3f4;
}

.part-title-display {
    font-weight: 600;
    color: #495057;
    font-size: 0.9rem;
    margin: 0;
}

.part-title-edit {
    width: 100%;
    border: 1px solid #007bff;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    background-color: white;
}

.part-title-edit:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.part-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transform: translateY(-1px);
}

.part-item:active {
    cursor: grabbing;
}

.part-item.dragging {
    opacity: 0.5;
    transform: rotate(5deg);
}

.part-text {
    margin: 0 0 0.75rem 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.875rem;
    line-height: 1.4;
}

.part-text.editing {
    display: none;
}

.part-edit-textarea {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 0.75rem;
    display: none;
}

.part-edit-textarea.editing {
    display: block;
}

.part-edit-textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.part-edit-category {
    margin-top: 0.75rem;
}

.part-category-edit-select {
    width: 100%;
    border: 1px solid #ced4da;
    border-radius: 4px;
    padding: 0.5rem;
    font-family: inherit;
    font-size: 0.875rem;
    background-color: white;
}

.part-category-edit-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.part-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.75rem;
    color: #6c757d;
}

.part-actions-inline {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.edit-part-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.edit-part-btn:hover {
    color: #0056b3;
}

.delete-part-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.875rem;
    transition: color 0.2s;
}

.delete-part-btn:hover {
    color: #c82333;
}

.part-edit-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.part-edit-actions button {
    padding: 0.375rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.save-edit-btn {
    background-color: #28a745;
    color: white;
    border-color: #28a745;
}

.save-edit-btn:hover {
    background-color: #218838;
    border-color: #1e7e34;
}

.cancel-edit-btn {
    background-color: #6c757d;
    color: white;
    border-color: #6c757d;
}

.cancel-edit-btn:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
}

.resize-handle:hover,
.resize-handle.resizing {
    background-color: #007bff;
}

.resize-handle::after {
    content: '';
    position: absolute;
    right: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background-color: #dee2e6;
    border-radius: 1px;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.content-sections {
    display: flex;
    flex: 1;
    height: 100%;
}

.workbench-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #f8f9fa;
    border-right: 1px solid #e9ecef;
    position: relative;
}

.preview-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #fff;
    position: relative;
}

.section-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: white;
    flex-shrink: 0;
}

.section-header h2 {
    margin: 0 0 0.25rem 0;
    font-size: 1.125rem;
}

.section-header p {
    margin: 0 0 0.75rem 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.build-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.build-actions button {
    padding: 0.375rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: "input-sans", sans-serif;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
}

.save-build-btn {
    background-color: #28a745;
    border-color: #28a745;
}

.save-build-btn:hover {
    background-color: #218838;
    color: white;
    border-color: #1e7e34;
}

.open-build-btn {
    background-color: #fd7e14;
    border-color: #fd7e14;
}

.open-build-btn:hover {
    background-color: #e8690b;
    color: white;
    border-color: #d63384;
}

.load-builds-btn {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.load-builds-btn:hover {
    background-color: #138496;
    color: white;
    border-color: #117a8b;
}

.export-builds-btn {
    background-color: #6c757d;
    border-color: #6c757d;
}

.export-builds-btn:hover {
    background-color: #5a6268;
    color: white;
    border-color: #545b62;
}

.clear-workbench-btn {
    background-color: #dc3545;
    border-color: #dc3545;
}

.clear-workbench-btn:hover {
    background-color: #c82333;
    color: white;
    border-color: #bd2130;
}

.workbench-container,
.preview-container {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    min-height: 200px;
}

/* Checkerboard garage floor for the Assembly panel */
.preview-container {
    background-color: #f7f7f7;
    background-image:
        linear-gradient(45deg, rgba(0,0,0,0.045) 25%, transparent 25%),
        linear-gradient(-45deg, rgba(0,0,0,0.045) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, rgba(0,0,0,0.045) 75%),
        linear-gradient(-45deg, transparent 75%, rgba(0,0,0,0.045) 75%);
    background-size: 24px 24px;
    background-position: 0 0, 0 12px, 12px -12px, -12px 0px;
}

.workbench-placeholder,
.preview-placeholder {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.workbench-item {
    background-color: white;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: grab;
    transition: all 0.2s;
    position: webkit-sticky;
    position: sticky;
}

/* Collapsed workbench item state */
.workbench-item.collapsed {
}
.workbench-item.collapsed .part-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em; /* fallback for browsers that don't support line-clamp */
}
.workbench-item .toggle-collapse-btn {
    border: 1px solid #dee2e6;
    background: white;
    color: #444;
    border-radius: 4px;
    padding: 0.125rem 0.375rem;
    font-size: 0.875rem;
    line-height: 1;
    cursor: pointer;
}
.workbench-item .toggle-collapse-btn:hover {
    background: #f1f3f5;
}

/* Category-based border colors for workbench items */
.workbench-item[data-category="Introduction"] {
    border-color: #3B82F6;
}

.workbench-item[data-category="Context"] {
    border-color: #10B981;
}

.workbench-item[data-category="Instructions"] {
    border-color: #F59E0B;
}

.workbench-item[data-category="Examples"] {
    border-color: #8B5CF6;
}

.workbench-item[data-category="Constraints"] {
    border-color: #EF4444;
}

.workbench-item[data-category="Output Format"] {
    border-color: #06B6D4;
}

.workbench-item[data-category="Persona"] {
    border-color: #84CC16;
}

.workbench-item[data-category="Background"] {
    border-color: #6B7280;
}

.workbench-item[data-category="Requirements"] {
    border-color: #F97316;
}

.workbench-item[data-category="Limitations"] {
    border-color: #EC4899;
}

.workbench-item[data-category="Style Guide"] {
    border-color: #6366F1;
}

.workbench-item[data-category="Tone"] {
    border-color: #14B8A6;
}

.workbench-item[data-category="Audience"] {
    border-color: #F43F5E;
}

.workbench-item[data-category="Goal"] {
    border-color: #22C55E;
}

.workbench-item[data-category="Success Criteria"] {
    border-color: #A855F7;
}

.workbench-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.workbench-item:active {
    cursor: grabbing;
}

.workbench-item.dragging {
    opacity: 0.5;
}

/* Prompt Blob styles */
.prompt-blob textarea.blob-textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    padding: 0.5rem;
}

.prompt-blob .blob-actions button {
    border: 1px solid #dee2e6;
    background-color: #fff;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
}

.prompt-blob .blob-actions button:hover {
    background-color: #f8f9fa;
}

/* Highlighted delimiter backdrop */

.prompt-blob .blob-editor { position: relative; }
.prompt-blob .blob-ce {
    min-height: 10rem;
    padding: 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
    outline: none;
    white-space: pre-wrap;
}

/* Inline delimiter styling */
.prompt-blob .blob-delim-inline { color: red; background-color: yellow; font-weight: 700; }

.drop-indicator {
    height: 3px;
    background-color: #007bff;
    border-radius: 2px;
    margin: 0.5rem 0;
    position: relative;
    z-index: 10;
    box-shadow: 0 0 8px rgba(0, 123, 255, 0.6);
    animation: dropIndicatorPulse 1.5s ease-in-out infinite;
}

@keyframes dropIndicatorPulse {
    0%, 100% {
        opacity: 1;
        transform: scaleX(1);
    }
    50% {
        opacity: 0.8;
        transform: scaleX(1.1);
    }
}

.workbench-container.drag-over {
    background-color: #e3f2fd;
    transition: background-color 0.2s ease;
}

.build-selection-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 6px 6px 0 0;
}

.build-selection-header h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    color: #333;
}

.build-selection-header p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.builds-list {
    padding: 1rem;
}

.build-selection-item {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    transition: all 0.2s;
    background-color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.build-item-content {
    flex: 1;
    cursor: pointer;
}

.build-selection-item:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.build-selection-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #333;
}

.build-selection-item p {
    margin: 0;
    font-size: 0.875rem;
    color: #6c757d;
}

.delete-build-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    font-size: 1rem;
    border-radius: 4px;
    transition: all 0.2s;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

.delete-build-btn:hover {
    background-color: #fef2f2;
    color: #c82333;
}

.delete-build-btn:active {
    background-color: #fee2e2;
}

.build-selection-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    background-color: #f8f9fa;
    border-radius: 0 0 6px 6px;
}

.load-from-file-btn {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.load-from-file-btn:hover {
    background-color: #138496;
}

.cancel-build-selection-btn {
    background-color: #6c757d;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: background-color 0.2s;
}

.cancel-build-selection-btn:hover {
    background-color: #5a6268;
}

.workbench-item .part-text {
    margin: 0;
    display: -webkit-box;
/*    -webkit-line-clamp: 2;
    line-clamp: 2;*/
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.workbench-item .part-meta {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e9ecef;
}

.workbench-item .part-title-meta {
    font-size: 0.7rem;
    color: #6c757d;
    font-style: italic;
    line-height: 1;
    margin: 0;
}

.part-version {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    background-color: #e9ecef;
    padding: 0.125rem 0.375rem;
    border-radius: 3px;
    border: 1px solid #dee2e6;
}

.part-category {
    font-size: 0.65rem;
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.75rem;
    margin-left: 0.5rem;
    font-weight: 500;
}

.part-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.workbench-item .part-info {
    flex-direction: row;
    gap: 0.25rem;
    align-items: center;
}

.workbench-item .part-version {
    font-size: 0.65rem;
    line-height: 1;
    margin: 0;
}

.part-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.remove-from-workbench-btn {
    background: none;
    border: none !important;
    color: #dc3545;
    cursor: pointer;
    padding: 0.125rem;
    font-size: 0.875rem;
    font-weight: bold;
    transition: color 0.2s;
    line-height: 1;
}

.remove-from-workbench-btn:hover {
    color: #c82333;
}

.resize-handle-vertical {
    width: 6px;
    background-color: transparent;
    cursor: col-resize;
    transition: background-color 0.2s;
    flex-shrink: 0;
    position: relative;
}

.resize-handle-vertical:hover,
.resize-handle-vertical.resizing {
    background-color: #007bff;
}

.resize-handle-vertical::after {
    content: '';
    position: absolute;
    left: 2px;
    top: 50%;
    transform: translateY(-50%);
    width: 2px;
    height: 20px;
    background-color: #dee2e6;
    border-radius: 1px;
}

.preview-content {
    background-color: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.6;
    min-height: 200px;
    position: relative;
}

.preview-header {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 10;
}

.copy-prompt-btn {
    padding: 0.375rem 0.5rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background-color: white;
    color: #333;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
    display: block;
    align-items: center;
    gap: 0.25rem;
    line-height: 1;
}

.copy-prompt-btn:hover {
    background-color: #f8f9fa;
    border-color: #007bff;
}

.preview-text {
    padding: 1.5rem;
    white-space: pre-wrap;
    word-wrap: break-word;
}

footer {
    background-color: #f8f9fa;
    padding: 0.75rem 1rem;
    text-align: center;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
    font-size: 0.875rem;
}

/* Responsive design */
@media (max-width: 768px) {
    .two-column-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e9ecef;
        padding: 1rem;
    }
    
    .resize-handle {
        display: none;
    }
    
    .content-sections {
        flex-direction: column;
    }
    
    .resize-handle-vertical {
        display: none;
    }
    
    .workbench-section,
    .preview-section {
        border-right: none;
        border-bottom: 1px solid #e9ecef;
    }
    
    header, footer {
        padding: 0.5rem 1rem;
    }
    
    h1 { font-size: 1.25rem; }
    h2 { font-size: 1.125rem; }
}