/* Collection Compose Interface Styles */

/* Main Container */
.collection-compose-container {
    min-height: 100vh;
    background: #f8fafc;
}

/* Page header uses .journal-page-toolbar--compose in journal.css */

/* Main Content Layout */
.compose-main-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 2rem;
    min-height: 600px;
}

/* Left Panel: Prompt Builder */
.compose-left-panel {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.compose-left-panel h3 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Preset Prompts */
.preset-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
}

.preset-card {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
    text-align: center;
    flex-shrink: 0;
}

.preset-card:hover {
    background: #f1f5f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.preset-card.active {
    border-color: #8b9d83;
    background: rgba(139, 157, 131, 0.05);
}

.preset-icon {
    font-size: 2rem;
    margin-bottom: 0.75rem;
}

.preset-title {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.preset-description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.4;
}

/* Persona Selector */
.persona-selector {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
}

.tradition-group {
    border-bottom: 1px solid #e2e8f0;
}

.tradition-group:last-child {
    border-bottom: none;
}

.tradition-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    font-weight: 600;
    color: #374151;
    border-bottom: 1px solid #e2e8f0;
}

.tradition-personas {
    padding: 0.5rem;
}

.persona-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 0.5rem;
}

.persona-option:hover {
    background: #f8fafc;
}

.persona-option:last-child {
    margin-bottom: 0;
}

.persona-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.persona-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.persona-info {
    flex: 1;
}

.persona-name {
    font-weight: 500;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.persona-description {
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.3;
    white-space: pre-line;
}

.persona-radio {
    flex-shrink: 0;
}

.persona-radio input[type="radio"] {
    display: none;
}

.persona-radio label {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.persona-radio input[type="radio"]:checked + label {
    border-color: #8b9d83;
    background: #8b9d83;
}

.persona-radio input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Custom Prompt */
.prompt-builder {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.prompt-textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.2s ease;
}

.prompt-textarea:focus {
    outline: none;
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
}

.prompt-templates {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.template-btn {
    background: #f8fafc;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.template-btn:hover {
    background: #e2e8f0;
    border-color: #8b9d83;
    color: #8b9d83;
}

/* Options Accordion */
.options-accordion {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.option-group label {
    font-weight: 500;
    color: #374151;
    font-size: 0.9rem;
}

.option-group .form-control {
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.option-group .form-control:focus {
    outline: none;
    border-color: #8b9d83;
    box-shadow: 0 0 0 3px rgba(139, 157, 131, 0.1);
}

/* Right Panel: Model Selection & Cost */
.compose-right-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Model Selector */
.model-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.model-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.model-selector {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.model-option {
    background: #f8fafc;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.model-option:hover {
    background: #f1f5f9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.model-option:has(input:checked) {
    border-color: #8b9d83;
    background: rgba(139, 157, 131, 0.05);
}

.model-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.model-info {
    flex: 1;
}

.model-name {
    font-weight: 600;
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.model-subtitle {
    color: #64748b;
    font-size: 0.9rem;
}

.model-badge {
    background: #8b9d83;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.model-details {
    margin-bottom: 1rem;
}

.model-specs {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.spec {
    background: rgba(139, 157, 131, 0.1);
    color: #2d3748;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.model-token-estimate {
    background: rgba(139, 157, 131, 0.15);
    border: 1px solid rgba(139, 157, 131, 0.3);
    border-radius: 0.5rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.token-estimate-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: #4a5568;
}

.token-estimate-value {
    font-size: 1rem;
    font-weight: 600;
    color: #2d3748;
}

.model-description {
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.4;
}

.model-radio {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.model-radio input[type="radio"] {
    display: none;
}

.model-radio label {
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.model-radio input[type="radio"]:checked + label {
    border-color: #8b9d83;
    background: #8b9d83;
}

.model-radio input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Cost Analysis */
.cost-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.cost-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cost-breakdown {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cost-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.cost-item.total {
    background: rgba(139, 157, 131, 0.1);
    border-color: #8b9d83;
    font-weight: 600;
}

.cost-label {
    color: #374151;
}

.cost-value {
    font-weight: 600;
    color: #2d3748;
}

.cost-warning {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.cost-warning.moderate-cost {
    background: #fef3c7;
    border-color: #f59e0b;
    color: #92400e;
}

.cost-warning.high-cost {
    background: #fee;
    border-color: #f56565;
    color: #dc2626;
}

.cost-warning i {
    color: #f59e0b;
}

.cost-warning.high-cost i {
    color: #f56565;
}

.cost-recommendations {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.recommendation-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f0f9ff;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    color: #1e40af;
}

.recommendation-item i {
    color: #3b82f6;
}

/* Model Intelligence */
.intelligence-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

.intelligence-section h3 {
    margin: 0 0 1.5rem 0;
    color: #2d3748;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.recommendations {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.recommendation-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.recommendation-item i {
    color: #8b9d83;
    margin-top: 0.125rem;
    flex-shrink: 0;
}

/* Run Section */
.run-section {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    text-align: center;
}

.btn-run {
    width: 100%;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

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

.run-info {
    margin-top: 0.75rem;
    color: #6b7280;
    font-size: 0.85rem;
}

/* Results Panel */
.results-panel {
    max-width: 1400px;
    margin: 2rem auto 0;
    padding: 0 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.results-panel.results-empty .results-meta,
.results-panel.results-empty .results-footer {
    opacity: 0.5;
}

.results-panel.results-empty .results-actions {
    opacity: 0.6;
}

.results-panel.results-empty .results-actions button,
.results-panel.results-loading .results-actions button {
    pointer-events: none;
}

.results-panel.results-loading .results-actions {
    opacity: 0.55;
}

.results-header {
    padding: 2rem 2rem 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.results-title h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.results-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.results-meta .model-badge {
    background: #8b9d83;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8rem;
    font-weight: 500;
}

.processing-time {
    color: #64748b;
    font-size: 0.9rem;
}

.results-actions {
    display: flex;
    gap: 0.75rem;
}

.results-content {
    padding: 2rem;
}

.results-placeholder {
    min-height: 220px;
    border: 1px dashed #d1d5db;
    border-radius: 0.75rem;
    background: #f3f4f6;
    color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-align: center;
}

.results-placeholder i {
    font-size: 1.75rem;
    color: #9ca3af;
}

.results-placeholder p {
    margin: 0;
    font-size: 0.95rem;
}

.analysis-loading-state,
.analysis-error-state {
    min-height: 320px;
    border: 1px solid #dbe3ed;
    border-radius: 8px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    color: #334155;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    text-align: left;
}

.analysis-loading-spinner {
    width: 3.5rem;
    height: 3.5rem;
    border: 4px solid rgba(139, 157, 131, 0.18);
    border-top-color: #607656;
    border-radius: 50%;
    flex: 0 0 auto;
    animation: spin 0.9s linear infinite;
}

.analysis-loading-copy h4,
.analysis-error-state h4 {
    margin: 0 0 0.35rem;
    color: #172033;
    font-size: 1.15rem;
    line-height: 1.25;
}

.analysis-loading-copy p,
.analysis-error-state p {
    margin: 0;
    color: #64748b;
    font-size: 0.95rem;
    line-height: 1.5;
}

.analysis-error-state {
    border-color: #f2c4c4;
    background: #fff8f8;
}

.analysis-error-state i {
    color: #b42318;
    font-size: 1.75rem;
    flex: 0 0 auto;
}

.analysis-output {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.analysis-result-card {
    --speaker-color: #607656;
    --speaker-text-color: #ffffff;
    position: relative;
    overflow: hidden;
    width: 100%;
    border: 1px solid rgba(15, 23, 42, 0.1);
    border-left: 5px solid var(--speaker-color);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.96)),
        linear-gradient(135deg, color-mix(in srgb, var(--speaker-color) 16%, transparent), transparent 34%);
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.1);
    color: #1f2937;
}

.analysis-result-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    background: linear-gradient(90deg, var(--speaker-color), color-mix(in srgb, var(--speaker-color) 45%, white));
}

.analysis-result-card .bubble-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    display: flex;
    gap: 0.45rem;
    margin: 0;
}

.analysis-result-card .btn-bubble-action {
    width: 2.1rem;
    height: 2.1rem;
    border: 1px solid color-mix(in srgb, var(--speaker-color) 25%, #cbd5e1);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.88);
    color: var(--speaker-color);
    box-shadow: 0 2px 7px rgba(15, 23, 42, 0.1);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.analysis-result-card .btn-bubble-action:hover {
    transform: translateY(-1px);
    background: #ffffff;
    box-shadow: 0 5px 14px rgba(15, 23, 42, 0.15);
}

.analysis-speaker-header {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 1.25rem;
    align-items: center;
    padding: 1.8rem 10rem 1.6rem 1.8rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
    background: linear-gradient(90deg, color-mix(in srgb, var(--speaker-color) 11%, white), rgba(255, 255, 255, 0.55));
}

.analysis-speaker-art {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    padding: 4px;
    background: linear-gradient(135deg, var(--speaker-color), color-mix(in srgb, var(--speaker-color) 30%, white));
    box-shadow: 0 8px 22px color-mix(in srgb, var(--speaker-color) 22%, transparent);
}

.analysis-speaker-art img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    background: #ffffff;
}

.analysis-speaker-copy {
    min-width: 0;
}

.analysis-eyebrow {
    margin-bottom: 0.35rem;
    color: var(--speaker-color);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.analysis-speaker-name {
    margin: 0;
    color: #172033;
    font-size: 1.45rem;
    line-height: 1.2;
}

.analysis-speaker-copy p {
    max-width: 72ch;
    margin: 0.45rem 0 0;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.45;
}

.analysis-document {
    padding: 2rem 2.2rem 1.5rem;
    color: #263244;
    font-size: 1rem;
    line-height: 1.75;
}

.analysis-document > *:first-child {
    margin-top: 0;
}

.analysis-document h2,
.analysis-document h3,
.analysis-document h4,
.analysis-document h5 {
    margin: 1.55rem 0 0.65rem;
    color: #172033;
    line-height: 1.25;
    letter-spacing: 0;
}

.analysis-document h2 {
    padding-bottom: 0.45rem;
    border-bottom: 1px solid color-mix(in srgb, var(--speaker-color) 22%, #e2e8f0);
    font-size: 1.28rem;
}

.analysis-document h3 {
    font-size: 1.12rem;
}

.analysis-document h4,
.analysis-document h5 {
    font-size: 1rem;
}

.analysis-document p {
    margin: 0 0 1rem;
}

.analysis-document strong {
    color: #142033;
    font-weight: 700;
}

.analysis-document em {
    color: #475569;
}

.analysis-document code {
    padding: 0.12rem 0.28rem;
    border-radius: 4px;
    background: #eef2f7;
    color: #334155;
    font-size: 0.92em;
}

.analysis-document ul,
.analysis-document ol {
    margin: 0.65rem 0 1.15rem;
    padding-left: 1.35rem;
}

.analysis-document li {
    margin: 0.4rem 0;
    padding-left: 0.15rem;
}

.analysis-document hr {
    margin: 1.6rem 0;
    border: 0;
    border-top: 1px solid color-mix(in srgb, var(--speaker-color) 18%, #e2e8f0);
}

.analysis-table-wrap {
    overflow-x: auto;
    margin: 1.1rem 0 1.45rem;
    border: 1px solid #dce4ee;
    border-radius: 8px;
    background: #ffffff;
}

.analysis-table-wrap table {
    width: 100%;
    min-width: 620px;
    border-collapse: collapse;
}

.analysis-table-wrap th,
.analysis-table-wrap td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e7edf5;
    text-align: left;
    vertical-align: top;
}

.analysis-table-wrap th {
    background: color-mix(in srgb, var(--speaker-color) 10%, #f8fafc);
    color: #172033;
    font-size: 0.82rem;
    font-weight: 700;
}

.analysis-table-wrap td {
    color: #334155;
    font-size: 0.94rem;
}

.analysis-table-wrap tbody tr:last-child td {
    border-bottom: 0;
}

.analysis-result-card .message-timestamp {
    margin: 0;
    padding: 0 2.2rem 1.5rem;
    color: #64748b;
    font-size: 0.86rem;
    text-align: right;
}

.output-content {
    background: #f8fafc;
    padding: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    line-height: 1.6;
    color: #374151;
    font-size: 1rem;
}

.output-citations h4 {
    margin: 0 0 1rem 0;
    color: #2d3748;
    font-size: 1.1rem;
}

.citation-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.citation-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0.75rem;
    background: #f8fafc;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
    gap: 1rem;
}

.citation-text {
    flex: 1;
    color: #374151;
    font-size: 0.9rem;
    line-height: 1.4;
}

.citation-source {
    color: #8b9d83;
    font-size: 0.8rem;
    font-weight: 500;
    flex-shrink: 0;
}

.results-footer {
    padding: 1rem 2rem 2rem;
    border-top: 1px solid #e2e8f0;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.rating-label {
    color: #374151;
    font-weight: 500;
}

.rating-stars {
    display: flex;
    gap: 0.25rem;
}

.rating-stars i {
    color: #d1d5db;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2rem;
}

.rating-stars i:hover,
.rating-stars i.active {
    color: #f59e0b;
}

/* Mobile Responsive */
@media (max-width: 1200px) {
    .compose-main-content {
        grid-template-columns: 1fr 350px;
        gap: 1.5rem;
    }
}

@media (max-width: 992px) {
    .compose-main-content {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .compose-main-content {
        padding: 0 1rem;
    }
    
    .compose-left-panel {
        padding: 1.5rem;
    }
    
    .preset-carousel {
        flex-direction: column;
    }
    
    .preset-card {
        min-width: auto;
    }
    
    .model-option {
        padding: 1rem;
    }
    
    .model-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    
    .model-radio {
        position: static;
        align-self: flex-end;
    }
    
    .results-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .results-actions {
        justify-content: center;
    }
    
    .citation-item {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .rating-section {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
    }

    .analysis-loading-state,
    .analysis-error-state {
        min-height: 260px;
        flex-direction: column;
        text-align: center;
    }

    .analysis-result-card .bubble-actions {
        position: static;
        justify-content: flex-end;
        padding: 0.85rem 0.9rem 0;
    }

    .analysis-speaker-header {
        grid-template-columns: 64px minmax(0, 1fr);
        gap: 0.85rem;
        padding: 1rem 0.95rem 1.1rem;
    }

    .analysis-speaker-art {
        width: 64px;
        height: 64px;
    }

    .analysis-speaker-name {
        font-size: 1.16rem;
    }

    .analysis-speaker-copy p {
        font-size: 0.87rem;
    }

    .analysis-document {
        padding: 1.25rem 1rem 1rem;
        font-size: 0.95rem;
        line-height: 1.65;
    }

    .analysis-result-card .message-timestamp {
        padding: 0 1rem 1.1rem;
        text-align: left;
    }
}

/* Animation Classes */
@keyframes slideInFromLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.preset-card {
    animation: slideInFromLeft 0.3s ease;
}

.model-option {
    animation: fadeIn 0.3s ease;
}

/* Loading States */
.btn-run:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-run .fa-spinner {
    animation: spin 1s linear infinite;
}

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

/* Status Indicators */
.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    margin-top: 1rem;
}

.status-green {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.status-green i {
    color: #16a34a;
}

.status-yellow {
    background: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}

.status-yellow i {
    color: #d97706;
}

.status-orange {
    background: #fed7aa;
    color: #9a3412;
    border: 1px solid #fdba74;
}

.status-orange i {
    color: #ea580c;
}

.status-red {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.status-red i {
    color: #dc2626;
}

/* Token breakdown styles */
.token-breakdown {
    margin-bottom: 1rem;
}

.token-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
}

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

.token-item.total {
    font-weight: 600;
    background: #f8fafc;
    padding: 0.75rem;
    border-radius: 0.5rem;
    margin-top: 0.5rem;
}

.token-label {
    color: #64748b;
    font-size: 0.875rem;
}

.token-value {
    font-weight: 600;
    color: #1e293b;
}

/* Subtle compose energy strip */
.compose-energy-strip {
    margin-top: 1rem;
}

.compose-energy-label {
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6c757d;
    opacity: 0.9;
}

.compose-energy-pct {
    font-size: 0.78rem;
}

.compose-energy-track {
    background: rgba(139, 157, 131, 0.12);
    padding: 0.4rem 0.55rem 0.45rem;
    border: 1px solid rgba(0, 0, 0, 0.06);
}

.compose-energy-progress {
    height: 10px;
    border-radius: 0.35rem;
    background-color: rgba(255, 255, 255, 0.65);
}

.compose-energy-reset {
    font-size: 0.78rem;
}

.compose-energy-reset small {
    opacity: 0.88;
}

.run-warning {
    margin-top: 0.6rem;
    color: #92400e;
}

/* Compose workflow refresh */
.collection-compose-workflow {
    --collection-ink: #233a30;
    --collection-muted: #64746b;
    --collection-green: #315f4b;
    --collection-green-deep: #244b3a;
    --collection-gold: #b58a45;
    --collection-paper: #fbfaf6;
    --collection-sage: #edf4ee;
    --collection-line: #d9e3dc;
    min-height: 100vh;
    padding: 2rem 0 4rem;
    background:
        radial-gradient(circle at 86% 9%, rgba(181, 138, 69, 0.08), transparent 22%),
        linear-gradient(180deg, #fbfcfa 0%, #f5f6f2 100%);
    color: var(--collection-ink);
}

.collection-compose-workflow .journal-page-toolbar--compose {
    position: relative;
    width: min(1180px, calc(100% - 2rem));
    max-width: none;
    min-height: 270px;
    margin: 0 auto 1.25rem;
    padding: clamp(1.7rem, 4.5vw, 3.25rem);
    overflow: hidden;
    border: 1px solid rgba(49, 95, 75, 0.15);
    border-radius: 28px;
    background:
        radial-gradient(circle at 88% 10%, rgba(181, 138, 69, 0.22), transparent 31%),
        linear-gradient(135deg, #f5f2e8, #edf4ee);
    box-shadow: 0 20px 55px rgba(39, 63, 51, 0.09);
}

.collection-compose-workflow .journal-page-toolbar--compose::after {
    content: "";
    position: absolute;
    right: -105px;
    bottom: -205px;
    width: 400px;
    height: 400px;
    border: 1px solid rgba(49, 95, 75, 0.12);
    border-radius: 50%;
    pointer-events: none;
}

.collection-compose-workflow .journal-page-toolbar__row {
    position: relative;
    z-index: 1;
    align-items: center;
}

.collection-compose-workflow .journal-page-toolbar__title {
    margin: 0.55rem 0 0.65rem;
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: clamp(2.5rem, 5.5vw, 4rem);
    font-weight: 500;
    line-height: 1;
    letter-spacing: -0.04em;
}

.collection-compose-workflow .journal-page-toolbar__title i {
    display: inline-grid;
    width: 48px;
    height: 48px;
    margin-right: 0.55rem;
    place-items: center;
    border-radius: 14px;
    background: rgba(49, 95, 75, 0.1);
    color: var(--collection-green);
    font-size: 1.25rem;
    vertical-align: 0.18em;
}

.collection-compose-workflow .journal-page-toolbar__subtitle {
    max-width: 690px;
    color: #53675d;
    font-size: 1rem;
    line-height: 1.65;
}

.collection-compose-workflow .compose-collection-meta {
    margin-top: 0.9rem;
}

.collection-compose-workflow .compose-collection-meta > span {
    padding: 0.38rem 0.65rem;
    border: 1px solid rgba(49, 95, 75, 0.12);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.68);
    color: #53675d;
}

.collection-compose-workflow .journal-page-toolbar__actions .journal-toolbar-btn {
    min-height: 47px;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    font-weight: 750;
}

.collection-compose-workflow .compose-main-content {
    grid-template-columns: minmax(0, 1fr) 350px;
    width: min(1180px, calc(100% - 2rem));
    max-width: none;
    min-height: 0;
    margin: 0 auto;
    padding: 0;
    gap: 1.25rem;
    align-items: start;
}

.collection-compose-workflow .compose-left-panel {
    gap: 1rem;
    padding: clamp(1rem, 2.5vw, 1.5rem);
    border: 1px solid var(--collection-line);
    border-radius: 24px;
    background:
        radial-gradient(circle at 100% 0%, rgba(181, 138, 69, 0.09), transparent 24%),
        rgba(250, 249, 245, 0.94);
    box-shadow: 0 16px 44px rgba(39, 63, 51, 0.07);
}

.collection-compose-workflow .prompt-section,
.collection-compose-workflow .preset-section,
.collection-compose-workflow .options-section,
.collection-compose-workflow .persona-section {
    padding: clamp(1.1rem, 3vw, 1.6rem);
    border: 1px solid var(--collection-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 8px 24px rgba(39, 63, 51, 0.045);
}

.collection-compose-workflow .compose-left-panel h3,
.collection-compose-workflow .model-section h3,
.collection-compose-workflow .cost-section h3,
.collection-compose-workflow .run-section h3 {
    margin: 0.35rem 0 0.85rem;
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 500;
}

.collection-compose-workflow .compose-left-panel h3 i,
.collection-compose-workflow .model-section h3 i,
.collection-compose-workflow .cost-section h3 i {
    color: var(--collection-green);
    font-size: 0.95rem;
}

.compose-section-intro {
    max-width: 68ch;
    margin: -0.35rem 0 1rem;
    color: var(--collection-muted);
    font-size: 0.91rem;
    line-height: 1.55;
}

.collection-compose-workflow .prompt-textarea {
    min-height: 150px;
    padding: 1rem 1.05rem;
    border: 1px solid #cfdbd3;
    border-radius: 14px;
    background: #fcfdfb;
    color: var(--collection-ink);
    line-height: 1.65;
}

.collection-compose-workflow .prompt-textarea:focus {
    border-color: var(--collection-green);
    box-shadow: 0 0 0 4px rgba(49, 95, 75, 0.1);
}

.collection-compose-workflow .template-cards {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.65rem;
}

.collection-compose-workflow .preset-section .template-card,
.collection-compose-workflow .preset-card {
    min-width: 0;
    padding: 1rem;
    border: 1px solid var(--collection-line);
    border-radius: 14px;
    background: #fbfcfa;
    box-shadow: none;
}

.collection-compose-workflow .preset-section .template-card:hover,
.collection-compose-workflow .preset-card:hover {
    border-color: rgba(49, 95, 75, 0.4);
    background: var(--collection-sage);
    box-shadow: 0 8px 20px rgba(39, 63, 51, 0.08);
}

.collection-compose-workflow .preset-card.active {
    border-color: var(--collection-green);
    background: linear-gradient(145deg, #edf4ee, #f7f3e9);
    box-shadow: inset 0 0 0 1px var(--collection-green);
}

.collection-compose-workflow .preset-carousel {
    gap: 0.65rem;
    padding: 0.75rem 0 0.25rem;
    scrollbar-color: rgba(49, 95, 75, 0.3) transparent;
}

.collection-compose-workflow .preset-icon {
    margin-bottom: 0.35rem;
    font-size: 1.35rem;
}

.collection-compose-workflow .option-group .form-control {
    min-height: 48px;
    border-color: #cfdbd3;
    border-radius: 12px;
    background: #fbfcfa;
}

.collection-compose-workflow .persona-section .speakers-filter {
    margin: 0.9rem 0;
    padding: 0.75rem;
    border-radius: 14px;
    background: var(--collection-sage);
}

.collection-compose-workflow .persona-section .speakers-filter .btn {
    border-radius: 999px;
}

.collection-compose-workflow .persona-section .speakers-grid {
    grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    max-height: 420px;
    overflow-y: auto;
    gap: 0.7rem;
    padding: 0.2rem 0.25rem 0.2rem 0;
}

.collection-compose-workflow .persona-section .speaker-card {
    min-height: 145px;
    padding: 0.85rem;
    border: 1px solid var(--collection-line);
    border-radius: 16px;
    background: #fff;
}

.collection-compose-workflow .persona-section .speaker-card:hover {
    border-color: rgba(49, 95, 75, 0.4);
    box-shadow: 0 10px 24px rgba(39, 63, 51, 0.1);
}

.collection-compose-workflow .persona-section .speaker-card.selected {
    border: 2px solid var(--collection-green) !important;
    background: linear-gradient(150deg, #edf4ee, #faf7ee);
    box-shadow: 0 10px 25px rgba(49, 95, 75, 0.16) !important;
}

.collection-compose-workflow .persona-section .speaker-image {
    width: 68px;
    height: 68px;
}

.collection-compose-workflow .compose-right-panel {
    position: sticky;
    top: 1rem;
    gap: 0.85rem;
}

.collection-compose-workflow .model-section,
.collection-compose-workflow .cost-section,
.collection-compose-workflow .run-section {
    padding: 1.2rem;
    border: 1px solid var(--collection-line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 10px 30px rgba(39, 63, 51, 0.07);
}

.collection-compose-workflow .model-options {
    display: grid;
    gap: 0.55rem;
}

.collection-compose-workflow .model-option {
    padding: 0.8rem 0.85rem;
    border: 1px solid var(--collection-line);
    border-radius: 13px;
    background: #fbfcfa;
}

.collection-compose-workflow .model-option:has(input:checked) {
    border-color: var(--collection-green);
    background: linear-gradient(135deg, #edf4ee, #f8f4ea);
    box-shadow: inset 3px 0 0 var(--collection-green);
}

.collection-compose-workflow .model-option input {
    accent-color: var(--collection-green);
}

.collection-compose-workflow .model-option label {
    cursor: pointer;
}

.collection-compose-workflow .model-name {
    color: var(--collection-ink);
    font-size: 0.95rem;
}

.collection-compose-workflow .model-desc {
    display: block;
    margin-top: 0.15rem;
    color: var(--collection-muted);
    font-size: 0.77rem;
    line-height: 1.35;
}

.collection-compose-workflow .token-item {
    padding: 0.65rem 0;
    border-bottom-color: #e2e9e4;
}

.collection-compose-workflow .token-item.total {
    padding: 0.75rem;
    border: 1px solid rgba(49, 95, 75, 0.14);
    background: var(--collection-sage);
}

.collection-compose-workflow .compose-energy-track {
    border-color: rgba(49, 95, 75, 0.12);
    background: #eef3ef;
}

.collection-compose-workflow .run-section {
    position: relative;
    overflow: hidden;
    padding: 1.3rem;
    background:
        radial-gradient(circle at 95% 0%, rgba(181, 138, 69, 0.2), transparent 40%),
        linear-gradient(145deg, #f5f2e8, #edf4ee);
}

.compose-ready-mark {
    display: grid;
    width: 40px;
    height: 40px;
    margin: 0 auto 0.35rem;
    place-items: center;
    border-radius: 50%;
    background: rgba(49, 95, 75, 0.11);
    color: var(--collection-green);
}

.collection-compose-workflow .run-section h3 {
    font-size: 1.2rem;
    text-align: center;
}

.collection-compose-workflow .btn-run {
    min-height: 52px;
    border: 0;
    border-radius: 13px;
    background: var(--collection-green);
    box-shadow: 0 10px 24px rgba(49, 95, 75, 0.22);
}

.collection-compose-workflow .btn-run:hover,
.collection-compose-workflow .btn-run:focus-visible {
    background: var(--collection-green-deep);
    transform: translateY(-1px);
}

.collection-compose-workflow .results-panel {
    width: min(1180px, calc(100% - 2rem));
    max-width: none;
    margin: 1.25rem auto 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--collection-line);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 48px rgba(39, 63, 51, 0.09);
}

.collection-compose-workflow .results-header {
    padding: 1.4rem 1.5rem;
    border-bottom-color: var(--collection-line);
    background: linear-gradient(135deg, #f5f2e8, #edf4ee);
}

.collection-compose-workflow .results-title h3 {
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

.collection-compose-workflow .results-content {
    padding: clamp(1rem, 3vw, 1.75rem);
}

.collection-compose-workflow .results-panel.results-empty .results-meta,
.collection-compose-workflow .results-panel.results-empty .results-actions,
.collection-compose-workflow .results-panel.results-empty .results-footer {
    display: none;
}

.collection-compose-workflow .results-placeholder {
    min-height: 300px;
    padding: 2rem;
    border: 1px dashed rgba(49, 95, 75, 0.28);
    border-radius: 18px;
    background:
        radial-gradient(circle at center, rgba(237, 244, 238, 0.86), rgba(250, 249, 245, 0.76));
    color: var(--collection-muted);
}

.results-placeholder-icon {
    display: grid;
    width: 62px;
    height: 62px;
    place-items: center;
    border-radius: 50%;
    background: #fff;
    color: var(--collection-green);
    box-shadow: 0 9px 25px rgba(39, 63, 51, 0.1);
}

.collection-compose-workflow .results-placeholder h4 {
    margin: 0.25rem 0 -0.25rem;
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 500;
}

.collection-compose-workflow .results-placeholder p {
    max-width: 480px;
    line-height: 1.55;
}

.collection-compose-workflow .analysis-loading-state {
    min-height: 360px;
    border-color: rgba(49, 95, 75, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at center, rgba(237, 244, 238, 0.95), rgba(250, 249, 245, 0.88));
    text-align: center;
}

.collection-compose-workflow .analysis-loading-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.analysis-loading-orbit {
    position: relative;
    display: grid;
    width: 88px;
    height: 88px;
    margin-bottom: 1rem;
    place-items: center;
    border: 1px solid rgba(49, 95, 75, 0.22);
    border-radius: 50%;
    color: var(--collection-green);
    font-size: 1.35rem;
    animation: compose-breathe 2.4s ease-in-out infinite;
}

.analysis-loading-orbit::before {
    content: "";
    position: absolute;
    inset: 10px;
    border: 1px dashed rgba(181, 138, 69, 0.55);
    border-radius: 50%;
    animation: compose-spin 8s linear infinite;
}

.analysis-loading-orbit span {
    position: absolute;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--collection-gold);
}

.analysis-loading-orbit span:first-child { top: 7px; left: 21px; }
.analysis-loading-orbit span:nth-child(2) { right: 8px; bottom: 22px; background: var(--collection-green); }

.collection-compose-workflow .analysis-loading-copy h4 {
    color: var(--collection-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.5rem;
    font-weight: 500;
}

.analysis-loading-journey {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
}

.analysis-loading-journey span {
    padding: 0.45rem 0.7rem;
    border: 1px solid #d9e3dc;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    color: #66766d;
    font-size: 0.78rem;
    animation: compose-stage 3.6s ease-in-out infinite;
}

.analysis-loading-journey span:nth-child(2) { animation-delay: 1.2s; }
.analysis-loading-journey span:nth-child(3) { animation-delay: 2.4s; }

.analysis-loading-journey i {
    margin-right: 0.3rem;
}

.collection-compose-workflow .analysis-result-card {
    border-radius: 18px;
    box-shadow: 0 16px 38px rgba(39, 63, 51, 0.1);
}

.collection-compose-workflow .analysis-speaker-header {
    background: linear-gradient(90deg, color-mix(in srgb, var(--speaker-color) 10%, #f5f2e8), rgba(255, 255, 255, 0.7));
}

.collection-compose-workflow .analysis-speaker-name,
.collection-compose-workflow .analysis-document h2,
.collection-compose-workflow .analysis-document h3 {
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
}

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

@keyframes compose-breathe {
    0%, 100% { box-shadow: 0 0 0 0 rgba(49, 95, 75, 0.08); transform: scale(1); }
    50% { box-shadow: 0 0 0 12px rgba(49, 95, 75, 0); transform: scale(1.04); }
}

@keyframes compose-stage {
    0%, 28%, 100% { border-color: #d9e3dc; background: rgba(255, 255, 255, 0.82); color: #66766d; }
    36%, 62% { border-color: var(--collection-green); background: var(--collection-green); color: #fff; }
}

@media (max-width: 992px) {
    .collection-compose-workflow .compose-main-content {
        grid-template-columns: 1fr;
    }

    .collection-compose-workflow .compose-right-panel {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .collection-compose-workflow .run-section {
        grid-column: 1 / -1;
    }
}

@media (max-width: 700px) {
    .collection-compose-workflow {
        padding-top: 0.5rem;
    }

    .collection-compose-workflow .journal-page-toolbar--compose,
    .collection-compose-workflow .compose-main-content,
    .collection-compose-workflow .results-panel {
        width: calc(100% - 1rem);
    }

    .collection-compose-workflow .journal-page-toolbar--compose {
        border-radius: 20px;
    }

    .collection-compose-workflow .journal-page-toolbar__actions,
    .collection-compose-workflow .journal-page-toolbar__actions .journal-toolbar-btn {
        width: 100% !important;
    }

    .collection-compose-workflow .journal-page-toolbar__actions {
        flex-direction: column;
        align-items: stretch;
    }

    .collection-compose-workflow .journal-page-toolbar__actions .journal-toolbar-btn {
        flex: 0 0 auto;
    }

    .collection-compose-workflow .template-cards,
    .collection-compose-workflow .compose-right-panel {
        grid-template-columns: 1fr;
    }

    .collection-compose-workflow .persona-section .speakers-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 480px;
    }

    .collection-compose-workflow .results-header {
        gap: 1rem;
    }

    .collection-compose-workflow .results-actions {
        width: 100%;
    }

    .collection-compose-workflow .results-actions .btn {
        flex: 1;
    }
}

@media (max-width: 440px) {
    .collection-compose-workflow .persona-section .speakers-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .analysis-loading-orbit,
    .analysis-loading-orbit::before,
    .analysis-loading-journey span,
    .collection-compose-workflow .preset-card,
    .collection-compose-workflow .model-option {
        animation: none;
        transition: none;
    }
}
