/**
 * Experiment CSS - Participant-facing experiment pages
 * Dark futuristic theme using Happy Hues Palette 14
 * Calm, neutral, focused. Dark and unobtrusive.
 */

/* =====================================
   ROOT VARIABLES - Happy Hues Palette 14
   ===================================== */

:root {
    --color-background: #16161a;
    --color-surface: #242629;
    --color-surface-alt: #2e3035;
    --color-headline: #fffffe;
    --color-paragraph: #94a1b2;
    --color-button: #7f5af0;
    --color-button-hover: #6b47d6;
    --color-button-text: #fffffe;
    --color-stroke: rgba(255, 255, 254, 0.08);
    --color-stroke-light: rgba(255, 255, 254, 0.1);
    --color-highlight: #7f5af0;
    --color-secondary: #72757e;
    --color-tertiary: #2cb67d;
    --color-error: #ef4444;
    --color-warning: #f59e0b;
    --font-primary: 'Space Grotesk', 'Inter', sans-serif;
    --font-mono: 'SF Mono', 'Fira Code', monospace;
}

/* =====================================
   EXPERIMENT LOADING SCREEN
   ===================================== */

.experiment-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: var(--color-background);
    font-family: 'Inter', sans-serif;
}

.loading-content {
    text-align: center;
    color: var(--color-headline);
    max-width: 350px;
    padding: 30px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-stroke);
    transition: all 0.3s ease;
}

.loading-content:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.logo-container {
    margin-bottom: 20px;
}

.logo {
    position: relative;
    display: inline-block;
    margin-bottom: 20px;
}

.logo-image {
    width: 60px;
    height: 60px;
    opacity: 0.9;
}

.logo-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 80px;
    height: 80px;
    transform: translate(-50%, -50%);
    border: 2px solid rgba(127, 90, 240, 0.3);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.1);
        opacity: 0.4;
    }
    100% {
        transform: translate(-50%, -50%) scale(0.8);
        opacity: 0.7;
    }
}


.loading-content h2 {
    font-size: 1.8em;
    margin-bottom: 15px;
    font-weight: bold;
    color: var(--color-headline);
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.experiment-description {
    font-size: 1em;
    margin-bottom: 30px;
    opacity: 0.9;
    line-height: 1.5;
    color: var(--color-paragraph);
    font-weight: normal;
}

.loading-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-surface-alt);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
    border: 1px solid var(--color-stroke);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    width: 0%;
    transition: width 0.2s ease;
    border-radius: 2px;
    box-shadow: 0 0 10px rgba(127, 90, 240, 0.3);
}

.loading-text {
    font-size: 1em;
    opacity: 0.8;
    margin: 0;
    color: var(--color-paragraph);
    font-weight: normal;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 0.3; }
}

/* =====================================
   EXPERIMENT CONTAINER
   ===================================== */

.experiment-container {
    height: 100vh;
    overflow: hidden;
    width: 100%;
}

.experiment-content {
    height: 100vh;
    width: 100%;
}

.experiment-content.survey-active {
    background: rgba(0, 0, 0, 0.5);
}

/* =====================================
   EXPERIMENT LAYOUT (Based on Chat Room)
   ===================================== */

.experiment-layout {
    display: flex;
    height: 100vh;
    background: var(--color-background);
}

.chat-column {
    display: flex;
    flex-direction: column;
}

.user-column {
    width: 280px;
    background: var(--color-surface);
    color: var(--color-headline);
    padding: 20px;
    border-right: 1px solid var(--color-stroke);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.chat-window-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
}

.partner-column {
    width: 280px;
    background: var(--color-surface);
    color: var(--color-headline);
    padding: 20px;
    border-left: 1px solid var(--color-stroke);
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.2);
}

/* =====================================
   CHAT HEADER
   ===================================== */

.chat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-stroke);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.chat-header h2 {
    margin: 0;
    color: var(--color-headline);
    font-size: 1.5em;
}

@keyframes blink {
    50% { opacity: 0.5; }
}

/* =====================================
   PARTICIPANT INFO
   ===================================== */

.chat-avatar-container {
    text-align: center;
    margin-bottom: 30px;
}

.chat-avatar-container h3 {
    margin: 0 0 20px 0;
    font-size: 1.3em;
}

.participant-avatar {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.7;
    color: var(--color-secondary);
}

.user-info, .partner-info {
    background: var(--color-surface-alt);
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    border: 1px solid var(--color-stroke);
}

.user-status, .partner-status {
    margin: 0 0 10px 0;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9em;
    letter-spacing: 1px;
}

.participant-id, .partner-type {
    margin: 5px 0;
    opacity: 0.8;
    font-size: 0.9em;
}

/* =====================================
   CHAT MESSAGES
   ===================================== */

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px 30px;
    background: var(--color-background);
}

.system-message {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-stroke);
}

.system-message p {
    margin: 10px 0;
}

.system-message strong {
    font-weight: bold;
    color: var(--color-headline);
}

.channel-info {
    font-size: 0.9em;
    opacity: 0.9;
    margin-top: 15px !important;
    font-style: italic;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 10px;
    max-width: 70%;
}

.user-message {
    background: rgba(127, 90, 240, 0.08);
    color: var(--color-headline);
    margin-left: auto;
    border-bottom-right-radius: 5px;
    max-width: 85%;
}

.user-message .chat-message-with-avatar {
    flex-direction: row-reverse;
}

.user-message .chat-message-content {
    text-align: right;
}

.user-message .chat-sender-name {
    color: var(--color-highlight);
}

.partner-message {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
    margin-right: auto;
    border-bottom-left-radius: 5px;
    max-width: 85%;
}

/* AI Assistant messages */
.ai-message {
    background: rgba(127, 90, 240, 0.1);
    border-left: 3px solid var(--color-highlight);
    color: var(--color-paragraph);
    margin-right: auto;
    padding: 10px 14px;
    border-radius: 12px 12px 12px 4px;
    margin: 4px 0;
    max-width: 80%;
}

.ai-message .message-sender {
    color: var(--color-highlight);
    font-weight: 600;
}

/* Processor suggestions (private AI messages) */
.processor-message {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid var(--color-warning);
    color: var(--color-paragraph);
    margin-right: auto;
    padding: 8px 12px;
    border-radius: 8px;
    margin: 4px 0;
    max-width: 80%;
    font-style: italic;
}

.processor-message::before {
    content: '💡 ';
}

/* =====================================
   MEDIATOR ACTIONS (PRD 9.1.2.6)
   ===================================== */

/* Disabled chat input state */
.chat-input.chat-disabled,
.chat-send-btn.chat-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--color-surface-alt);
}

.chat-input.chat-disabled::placeholder {
    color: var(--color-secondary);
    font-style: italic;
}

/* Chat disabled indicator */
.chat-disabled-indicator {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

.disabled-indicator-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-warning);
    font-size: 0.9em;
}

.disabled-indicator-content i {
    font-size: 1.2em;
    color: var(--color-warning);
}

/* Chat enabled notification */
.chat-enabled-notification {
    background: rgba(44, 182, 125, 0.1);
    border: 1px solid rgba(44, 182, 125, 0.3);
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

.enabled-notification-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-tertiary);
    font-size: 0.9em;
}

.enabled-notification-content i {
    font-size: 1.2em;
    color: var(--color-tertiary);
}

.chat-enabled-notification.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

/* Mediator prompt (private message from facilitator) */
.mediator-prompt {
    position: fixed;
    bottom: 100px;
    right: 20px;
    max-width: 350px;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    animation: slideInRight 0.3s ease-out;
}

.mediator-prompt-content {
    padding: 16px;
}

.prompt-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--color-stroke);
}

.prompt-header i {
    color: var(--color-warning);
    font-size: 1.1em;
}

.prompt-header span {
    font-weight: 600;
    color: var(--color-headline);
    flex: 1;
}

.prompt-dismiss {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--color-secondary);
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.prompt-dismiss:hover {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
}

.prompt-message {
    color: var(--color-paragraph);
    line-height: 1.5;
    margin: 0;
}

.mediator-prompt.prompt-encouragement {
    border-left: 4px solid var(--color-tertiary);
}

.mediator-prompt.prompt-question {
    border-left: 4px solid #3b82f6;
}

.mediator-prompt.prompt-suggestion {
    border-left: 4px solid var(--color-highlight);
}

.mediator-prompt.fade-out {
    animation: fadeOutRight 0.5s ease-out forwards;
}

/* Highlighted message */
.message-highlighted {
    animation: highlightPulse 1s ease-in-out infinite;
}

.message-highlighted.highlight-emphasis {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.5);
}

.message-highlighted.highlight-important {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.5);
    background-color: rgba(239, 68, 68, 0.15);
}

/* Attention indicator */
.attention-indicator {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1001;
    animation: bounceIn 0.5s ease-out;
    max-width: 300px;
}

.attention-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
}

.attention-indicator.attention-gentle {
    border-left: 4px solid var(--color-warning);
}

.attention-indicator.attention-gentle i {
    color: var(--color-warning);
    font-size: 1.3em;
}

.attention-indicator.attention-urgent {
    border-left: 4px solid var(--color-error);
    animation: urgentPulse 0.5s ease-in-out infinite;
}

.attention-indicator.attention-urgent i {
    color: var(--color-error);
    font-size: 1.3em;
}

.attention-indicator.fade-out {
    animation: fadeOutUp 0.5s ease-out forwards;
}

/* Animations for mediator actions */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes fadeOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(20px);
    }
}

@keyframes fadeOutUp {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes highlightPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.9);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes urgentPulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(239, 68, 68, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(239, 68, 68, 0.5);
    }
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9em;
}

.timestamp {
    opacity: 0.7;
    font-size: 0.8em;
}

.message-content {
    line-height: 1.4;
}

/* =====================================
   INPUT AREAS
   ===================================== */

.chat-input-area {
    padding: 20px 30px;
    background: var(--color-surface);
    border-top: 1px solid var(--color-stroke);
}

.message-input-container {
    display: flex;
    gap: 15px;
    align-items: flex-end;
}

#message-input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 12px;
    resize: vertical;
    font-family: inherit;
    font-size: 1em;
    line-height: 1.4;
    min-height: 50px;
    transition: border-color 0.3s ease;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

#message-input:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.input-buttons {
    display: flex;
    gap: 10px;
}

/* =====================================
   SURVEY STYLES
   ===================================== */

.survey-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 800px;
    width: 90vw;
    max-height: 85vh;
    padding: 40px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    overflow-y: auto;
    z-index: 1000;
    border: 1px solid var(--color-stroke);
}

.survey-header {
    text-align: center;
    margin-bottom: 40px;
}

.survey-header h2 {
    color: var(--color-headline);
    margin-bottom: 15px;
}

.survey-content {
    margin-bottom: 40px;
}

.survey-question {
    margin-bottom: 30px;
    padding: 25px;
    background: var(--color-surface-alt);
    border-radius: 10px;
    border-left: 4px solid var(--color-highlight);
}

.survey-question label {
    display: block;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--color-headline);
}

.survey-question input[type="text"] {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 5px;
    font-size: 1em;
    background: var(--color-surface);
    color: var(--color-headline);
}

.radio-option {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.scale-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.scale-container input[type="range"] {
    flex: 1;
}

.survey-actions {
    text-align: center;
}

/* =====================================
   COMPLETION & ERROR SCREENS
   ===================================== */

.completion-container, .error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--color-background);
}

.error-container {
    background: var(--color-background);
}

.completion-content, .error-content {
    text-align: center;
    color: var(--color-headline);
    max-width: 500px;
    padding: 40px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-stroke);
}

.completion-icon, .error-icon {
    font-size: 4em;
    margin-bottom: 20px;
    color: var(--color-highlight);
}

.error-icon {
    color: var(--color-error);
}

.completion-content h2, .error-content h2 {
    font-size: 2.5em;
    margin-bottom: 20px;
}

.completion-actions, .error-actions {
    margin-top: 30px;
}

/* =====================================
   BUTTONS
   ===================================== */

.primary-button {
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: var(--color-headline);
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-size: 1em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    font-family: 'Inter', sans-serif;
}

.primary-button:hover {
    background: linear-gradient(135deg, var(--color-button-hover) 0%, var(--color-highlight) 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

.secondary-button {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
    border: 1px solid var(--color-stroke);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-family: 'Inter', sans-serif;
}

.secondary-button:hover {
    background: var(--color-stroke);
    border-color: rgba(255, 255, 254, 0.15);
    transform: translateY(-1px);
}

/* =====================================
   RESPONSIVE DESIGN
   ===================================== */

@media (max-width: 768px) {
    .experiment-layout {
        flex-direction: column;
    }

    .user-column, .partner-column {
        width: 100%;
        height: 150px;
        padding: 15px;
    }

    .chat-window-column {
        flex: 1;
        min-height: 0;
    }

    .chat-header {
        padding: 15px 20px;
    }

    .chat-header h2 {
        font-size: 1.2em;
    }

    .chat-messages {
        padding: 15px 20px;
    }

    .chat-input-area {
        padding: 15px 20px;
    }

    .message-input-container {
        flex-direction: column;
        gap: 10px;
    }

    .survey-container {
        width: 95vw;
        max-height: 90vh;
        padding: 20px;
        margin: 0;
    }
}

/* =====================================
   PLACEHOLDER SCREENS
   ===================================== */

.placeholder-screen {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background: var(--color-background);
}

.placeholder-content {
    text-align: center;
    color: var(--color-headline);
    max-width: 500px;
    padding: 40px;
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid var(--color-stroke);
}

.placeholder-content h2 {
    font-size: 2em;
    margin-bottom: 20px;
    color: var(--color-headline);
}

.placeholder-content p {
    font-size: 1.2em;
    margin-bottom: 20px;
    opacity: 0.8;
    color: var(--color-paragraph);
}

/* Matching spinner */
.matching-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--color-stroke);
    border-top-color: var(--color-highlight);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 20px;
}

/* Animated loading dots */
.loading-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 8px;
}

.loading-dots .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-highlight);
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loading-dots .dot:nth-child(2) {
    animation-delay: 0.16s;
}

.loading-dots .dot:nth-child(3) {
    animation-delay: 0.32s;
}

@keyframes dotBounce {
    0%, 80%, 100% {
        opacity: 0.3;
        transform: scale(0.8);
    }
    40% {
        opacity: 1;
        transform: scale(1);
    }
}

/* Live matching wait screen — elapsed timer, rotating reassurance, ETA hint */
.placeholder-content .matching-elapsed {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin-top: 16px;
    margin-bottom: 8px;
    opacity: 1;
}

.placeholder-content .matching-reassurance {
    font-size: 1.05em;
    margin-bottom: 12px;
    min-height: 1.4em;
    transition: opacity 0.3s ease;
}

.placeholder-content .matching-hint {
    font-size: 0.95em;
    opacity: 0.6;
    margin-bottom: 0;
}

/* =====================================
   ANIMATIONS
   ===================================== */

.experiment-layout {
    animation: slideIn 0.5s ease-out;
}

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

.message {
    animation: messageAppear 0.3s ease-out;
}

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

/* =====================================
   ENHANCED PROGRESS DISPLAY
   PRD Section 10.2.1: Progress Display
   ===================================== */

.progress-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-stroke);
}

.progress-section h3 {
    font-size: 14px;
    color: var(--color-headline);
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.progress-info {
    text-align: center;
}

.progress-indicator {
    margin-bottom: 15px;
}

.progress-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 1px solid var(--color-stroke-light);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

.progress-number {
    font-size: 20px;
    font-weight: bold;
    color: white;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.progress-bar-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.progress-bar-inner {
    flex: 1;
    height: 10px;
    background: var(--color-surface-alt);
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid var(--color-stroke);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-button), var(--color-button-hover));
    transition: width 0.5s ease;
}

.progress-percent {
    font-size: 12px;
    font-weight: bold;
    color: var(--color-highlight);
    min-width: 35px;
}

/* Chamber Info Section */
.chamber-info-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-stroke);
}

.chamber-info-section h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.chamber-name-display {
    font-size: 16px;
    font-weight: bold;
    color: var(--color-headline);
    margin-bottom: 10px;
    font-family: 'Space Grotesk', 'Inter', sans-serif;
}

.chamber-details-mini {
    font-size: 12px;
    color: var(--color-secondary);
}

.chamber-details-mini i {
    margin-right: 5px;
    color: var(--color-highlight);
}

/* Participant Section */
.participant-section {
    text-align: center;
}

.participant-section h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.participant-avatar-mini {
    font-size: 36px;
    margin-bottom: 10px;
}

.user-status.online {
    color: var(--color-tertiary);
    font-weight: bold;
    font-size: 13px;
}

.participant-id-mini {
    font-size: 10px;
    color: var(--color-secondary);
    font-family: 'SF Mono', 'Fira Code', monospace;
}

/* Chat Header Enhanced */
.chat-header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.chamber-badge {
    background: var(--color-highlight);
    color: var(--color-headline);
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
}

.chat-header-right {
    display: flex;
    align-items: center;
}

/* Partner Column Enhanced */
.partner-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-stroke);
}

.partner-section h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.participants-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.participant-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: var(--color-surface-alt);
    border-radius: 10px;
}

.participant-info-mini {
    display: flex;
    flex-direction: column;
}

.partner-name {
    font-weight: bold;
    font-size: 14px;
    color: var(--color-headline);
}

.partner-status {
    font-size: 11px;
}

.partner-status.online {
    color: var(--color-tertiary);
}

.partner-status.offline {
    color: var(--color-error);
}

/* Timeline Section */
.timeline-section {
    padding-top: 10px;
}

.timeline-section h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.timeline-mini {
    padding: 10px 0;
}

.timeline-steps {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.timeline-step {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    background: var(--color-surface-alt);
    transition: all 0.3s ease;
}

.timeline-step.completed {
    background: rgba(44, 182, 125, 0.1);
}

.timeline-step.current {
    background: rgba(127, 90, 240, 0.15);
    color: var(--color-headline);
    box-shadow: 0 2px 8px rgba(127, 90, 240, 0.2);
}

.timeline-step.pending {
    background: var(--color-surface-alt);
    opacity: 0.7;
}

.step-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.timeline-step.completed .step-icon {
    background: var(--color-tertiary);
    color: white;
}

.timeline-step.current .step-icon {
    background: var(--color-highlight);
    color: white;
}

.timeline-step.pending .step-icon {
    background: var(--color-stroke);
    color: var(--color-secondary);
}

.step-label {
    font-size: 12px;
    flex: 1;
}

/* Send button enhancement */
#send-button {
    display: flex;
    align-items: center;
    gap: 8px;
}

#send-button i {
    font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .user-column,
    .partner-column {
        display: none;
    }

    .chat-window-column {
        width: 100%;
    }

    .chat-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* =====================================
   MEDIATOR INTERFACE STYLES
   PRD 10.5.1: Mediator Interface
   ===================================== */

.mediator-layout {
    display: flex;
    height: 100vh;
}

.mediator-control-column {
    width: 280px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-stroke);
    padding: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.mediator-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-stroke);
}

.mediator-header h3 {
    font-size: 14px;
    color: var(--color-headline);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mediator-header h3 i {
    color: var(--color-highlight);
}

.role-badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.role-badge.mediator {
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
}

.role-badge.processor {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

.broadcast-controls {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-stroke);
}

.broadcast-controls h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.broadcast-mode-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mode-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--color-surface-alt);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 12px;
    color: var(--color-paragraph);
}

.mode-option:hover {
    background: var(--color-stroke);
}

.mode-option.active {
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
}

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

.mode-option i {
    font-size: 14px;
}

.synthesis-panel {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 10px;
}

.synthesis-panel h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.synthesis-panel h4 i {
    color: var(--color-highlight);
}

.synthesis-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.btn-synthesis {
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-synthesis:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

#synthesis-output {
    width: 100%;
    min-height: 60px;
    padding: 10px;
    border: 1px solid var(--color-stroke);
    border-radius: 8px;
    resize: none;
    font-size: 12px;
    background: var(--color-surface);
    color: var(--color-headline);
}

.btn-broadcast-synthesis {
    background: var(--color-highlight);
    color: var(--color-headline);
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-broadcast-synthesis:disabled {
    background: var(--color-surface-alt);
    color: var(--color-secondary);
    cursor: not-allowed;
}

.btn-broadcast-synthesis:not(:disabled):hover {
    background: var(--color-button-hover);
}

.mediator-stats {
    margin-top: auto;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 10px;
}

.mediator-stats h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--color-stroke);
    font-size: 12px;
}

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

.stat-label {
    color: var(--color-secondary);
}

.stat-value {
    font-weight: bold;
    color: var(--color-highlight);
}

/* All Messages View */
.all-messages-column {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
}

.all-messages-view {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: var(--color-background);
}

.message-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-stroke);
    transition: all 0.2s ease;
}

.message-item:hover {
    border-color: rgba(127, 90, 240, 0.3);
    box-shadow: 0 2px 8px rgba(127, 90, 240, 0.1);
}

.message-item.own-message {
    background: rgba(127, 90, 240, 0.1);
}

.message-select {
    display: flex;
    align-items: flex-start;
    padding-top: 3px;
}

.message-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--color-highlight);
}

.message-item .message-content {
    flex: 1;
}

.message-item .message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
}

.sender-name {
    font-weight: bold;
    color: var(--color-headline);
    font-size: 13px;
}

.message-time {
    font-size: 11px;
    color: var(--color-secondary);
}

.message-text {
    color: var(--color-paragraph);
    font-size: 14px;
    line-height: 1.5;
}

.message-filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: var(--color-surface-alt);
    border-top: 1px solid var(--color-stroke);
    font-size: 12px;
}

.filter-count {
    color: var(--color-highlight);
    font-weight: bold;
}

/* Broadcast Composer */
.broadcast-composer-column {
    width: 320px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-stroke);
    display: flex;
    flex-direction: column;
}

.composer-header {
    padding: 20px;
    border-bottom: 1px solid var(--color-stroke);
}

.composer-header h3 {
    margin: 0;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--color-headline);
}

.composer-header h3 i {
    color: var(--color-highlight);
}

.broadcast-preview {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-stroke);
}

.broadcast-preview h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.preview-content {
    min-height: 80px;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 10px;
    border: 1px solid var(--color-stroke);
}

.preview-placeholder {
    color: var(--color-secondary);
    font-style: italic;
    font-size: 13px;
}

.preview-active {
    color: var(--color-headline);
    font-size: 14px;
}

.broadcast-input-area {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.broadcast-type-selector {
    display: flex;
    gap: 8px;
}

.broadcast-type {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 10px 8px;
    border-radius: 8px;
    background: var(--color-surface-alt);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 11px;
    text-align: center;
    color: var(--color-paragraph);
}

.broadcast-type:hover {
    background: var(--color-stroke);
}

.broadcast-type.active,
.broadcast-type:has(input:checked) {
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
}

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

.broadcast-type i {
    font-size: 16px;
}

#broadcast-message {
    flex: 1;
    min-height: 120px;
    padding: 15px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 10px;
    resize: none;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

#broadcast-message:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.broadcast-actions {
    display: flex;
    gap: 10px;
}

.btn-preview {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--color-highlight);
    background: transparent;
    color: var(--color-highlight);
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-preview:hover {
    background: rgba(127, 90, 240, 0.1);
}

.btn-send-broadcast {
    flex: 2;
    padding: 12px;
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-send-broadcast:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

/* =====================================
   PROCESSOR INTERFACE STYLES
   PRD 10.5.1: Processor Interface
   ===================================== */

.processor-layout {
    display: flex;
    height: 100vh;
}

.draft-preview-column {
    width: 300px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-stroke);
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.processor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-stroke);
}

.processor-header h3 {
    font-size: 14px;
    color: var(--color-headline);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.processor-header h3 i {
    color: #3b82f6;
}

.target-selector {
    margin-bottom: 15px;
}

.target-selector h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
}

.target-selector select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

.target-selector select:focus {
    outline: none;
    border-color: #3b82f6;
}

.draft-preview-area {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 10px;
    margin-bottom: 15px;
}

.draft-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--color-secondary);
    text-align: center;
}

.draft-placeholder i {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.draft-item {
    background: var(--color-surface);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    border: 1px solid var(--color-stroke);
}

.draft-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.draft-author {
    font-weight: bold;
    font-size: 12px;
    color: var(--color-headline);
}

.draft-status {
    font-size: 11px;
    color: #3b82f6;
    animation: pulse 1.5s infinite;
}

.draft-content {
    font-size: 14px;
    color: var(--color-paragraph);
    line-height: 1.5;
    padding: 10px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 6px;
    margin-bottom: 10px;
}

.draft-actions {
    text-align: right;
}

.btn-suggest {
    padding: 6px 12px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.btn-suggest:hover {
    background: #2563eb;
}

.draft-stats {
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 10px;
}

/* Suggestion Panel */
.suggestion-panel-column {
    width: 300px;
    background: var(--color-surface);
    border-left: 1px solid var(--color-stroke);
    display: flex;
    flex-direction: column;
    padding: 20px;
    overflow-y: auto;
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-stroke);
}

.suggestion-header h3 {
    font-size: 14px;
    color: var(--color-headline);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.suggestion-header h3 i {
    color: var(--color-warning);
}

.auto-suggest-toggle {
    font-size: 11px;
}

.auto-suggest-toggle label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--color-paragraph);
}

.suggestion-mode {
    margin-bottom: 20px;
}

.suggestion-mode h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.mode-options {
    display: flex;
    gap: 8px;
}

.mode-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 8px;
    border-radius: 8px;
    background: var(--color-surface-alt);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 10px;
    text-align: center;
    color: var(--color-paragraph);
}

.mode-btn:hover {
    background: var(--color-stroke);
}

.mode-btn.active,
.mode-btn:has(input:checked) {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
}

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

.mode-btn i {
    font-size: 14px;
}

.suggestion-templates {
    margin-bottom: 20px;
}

.suggestion-templates h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.template-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.template-btn {
    padding: 10px 8px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 8px;
    cursor: pointer;
    font-size: 11px;
    color: #3b82f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.template-btn:hover {
    background: rgba(59, 130, 246, 0.2);
    transform: translateY(-1px);
}

.template-btn i {
    font-size: 14px;
}

.custom-suggestion {
    margin-bottom: 20px;
}

.custom-suggestion h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

#custom-suggestion {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 8px;
    resize: none;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 10px;
    transition: border-color 0.2s ease;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

#custom-suggestion:focus {
    outline: none;
    border-color: #3b82f6;
}

.suggestion-target {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
}

.suggestion-target label {
    color: var(--color-secondary);
}

.suggestion-target select {
    flex: 1;
    padding: 8px;
    border: 1px solid var(--color-stroke);
    border-radius: 6px;
    font-size: 12px;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

.btn-send-suggestion {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.btn-send-suggestion:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.suggestion-history {
    flex: 1;
    min-height: 0;
}

.suggestion-history h4 {
    font-size: 12px;
    color: var(--color-secondary);
    margin-bottom: 10px;
    text-transform: uppercase;
}

.history-list {
    max-height: 200px;
    overflow-y: auto;
    background: var(--color-surface-alt);
    border-radius: 8px;
    padding: 10px;
}

.empty-history {
    color: var(--color-secondary);
    font-size: 12px;
    text-align: center;
    font-style: italic;
}

.history-item {
    padding: 8px;
    background: var(--color-surface);
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 11px;
    border-left: 3px solid #3b82f6;
}

.history-target {
    color: #3b82f6;
    font-weight: bold;
    display: block;
    margin-bottom: 4px;
}

.history-suggestion {
    color: var(--color-paragraph);
    display: block;
    margin-bottom: 4px;
}

.history-time {
    color: var(--color-secondary);
    font-size: 10px;
}

/* Private mode indicator */
.chat-input-area.private-mode {
    background: rgba(245, 158, 11, 0.1);
    border-top-color: rgba(245, 158, 11, 0.3);
}

.private-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--color-warning);
    font-size: 11px;
    font-weight: bold;
    margin-top: 8px;
}

/* Processor layout — override the old flex layout with CSS grid */
.processor-layout {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto 1fr;
    height: 100%;
    width: 100%;
}

/* No-chat variant — single column */
.processor-layout.processor-no-chat {
    grid-template-columns: 1fr;
}

.processor-layout.processor-no-chat .processor-instructions-column {
    max-width: 700px;
    margin: 0 auto;
    width: 100%;
}

/* Mode banner — full-width row */
.processor-mode-banner {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--color-surface, #f0f4f8);
    border-bottom: 1px solid var(--color-stroke, #ddd);
    font-size: 0.9rem;
    min-height: 44px;
}

.processor-mode-banner .mode-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.processor-mode-banner .banner-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Chat observation column */
.chat-observation-column {
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-stroke, #ddd);
    overflow: hidden;
    min-width: 0;
}

.chat-observation-column .chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid var(--color-stroke, #ddd);
    flex-shrink: 0;
}

.chat-observation-column .chat-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-observation-column .chat-header h2 {
    font-size: 1rem;
    margin: 0;
}

.chat-observation-column .chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.read-only-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    border-radius: 4px;
    background: var(--warning-bg, #fff3cd);
    color: var(--warning-text, #856404);
    white-space: nowrap;
}

/* Instructions / feedback column */
.processor-instructions-column {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 16px;
    gap: 14px;
    min-width: 0;
}

.processor-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.processor-panel-header h3 {
    margin: 0;
    font-size: 1rem;
}

.draft-preview-area {
    background: var(--color-surface, #f8f9fa);
    border: 1px solid var(--color-stroke, #ddd);
    border-radius: 8px;
    padding: 16px;
    min-height: 100px;
}

.draft-placeholder {
    text-align: center;
    color: var(--text-secondary, #999);
    font-size: 0.9rem;
}

.draft-placeholder i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    display: block;
}

.target-selector {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.target-selector label {
    font-size: 0.85rem;
    font-weight: 600;
}

.target-selector select {
    padding: 6px 10px;
    border: 1px solid var(--color-stroke, #ddd);
    border-radius: 6px;
    font-size: 0.9rem;
}

.processor-feedback-input {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.processor-feedback-input textarea {
    border: 1px solid var(--color-stroke, #ddd);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.9rem;
    resize: vertical;
}

.processor-action-buttons {
    display: flex;
    gap: 8px;
}

.btn-send-suggestion {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: var(--color-primary, #6c5ce7);
    color: white;
    cursor: pointer;
    font-size: 0.9rem;
    width: 100%;
}

.btn-send-suggestion:hover {
    opacity: 0.9;
}

.suggestion-history h4 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #999);
    margin: 0 0 6px 0;
}

.history-list {
    background: var(--color-surface, #f8f9fa);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.85rem;
    color: var(--text-secondary, #999);
}

.empty-history {
    text-align: center;
    font-style: italic;
    margin: 0;
}

/* Processor chat segment wrapper */
.processor-chat-segment {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.processor-chat-segment .processor-layout {
    flex: 1;
    min-height: 0;
}

/* Mediator message style (legacy chat bubble) */
.mediator-message {
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
    margin-left: auto;
    border-bottom-right-radius: 5px;
}

/* =====================================
   SYSTEM BROADCAST STYLES
   Centred system-announcement banner
   ===================================== */
.system-broadcast {
    width: 100%;
    max-width: none;
    margin: 16px 0;
    text-align: center;
    animation: broadcastFadeIn 0.35s ease-out;
}

@keyframes broadcastFadeIn {
    from { opacity: 0; transform: scale(0.97); }
    to   { opacity: 1; transform: scale(1); }
}

/* Decorative horizontal rule lines */
.system-broadcast .system-broadcast-line {
    display: flex;
    align-items: center;
    justify-content: center;
}
.system-broadcast .system-broadcast-line span {
    display: block;
    width: 60%;
    height: 1px;
    background: currentColor;
    opacity: 0.2;
}

/* Icon + sender label row */
.system-broadcast .system-broadcast-body {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 4px 0 2px;
}

.system-broadcast .system-broadcast-icon {
    font-size: 12px;
    opacity: 0.7;
}

.system-broadcast .system-broadcast-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.65;
}

/* Message text */
.system-broadcast .system-broadcast-text {
    font-size: 14px;
    line-height: 1.5;
    padding: 4px 20px 6px;
}

/* --- Style variants --- */
.system-broadcast.facilitator-style {
    color: var(--color-tertiary);
}
.system-broadcast.announcement-style {
    color: var(--color-warning);
}
.system-broadcast.system-style {
    color: var(--color-secondary);
}

/* --- Font size variants --- */
.system-broadcast.broadcast-font-small .system-broadcast-text {
    font-size: 12px;
}
.system-broadcast.broadcast-font-large .system-broadcast-text {
    font-size: 18px;
}
.system-broadcast.broadcast-font-x-large .system-broadcast-text {
    font-size: 22px;
}

/* --- Priority variants --- */
.system-broadcast.priority-important .system-broadcast-text {
    font-weight: 600;
}
.system-broadcast.priority-urgent .system-broadcast-text {
    font-weight: 700;
}
.system-broadcast.priority-urgent {
    animation: broadcastFadeIn 0.35s ease-out, broadcastPulse 2s ease-in-out infinite;
}
@keyframes broadcastPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.7; }
}

.mediator-message.broadcast {
    border-left: 4px solid var(--color-warning);
}

/* PRD 9.1.3.5: Agent Mediator Broadcast Styles */
.mediator-message.broadcast.facilitator-style {
    background: linear-gradient(135deg, #2cb67d, #1e8a5e);
    border-left-color: var(--color-tertiary);
}

.mediator-message.broadcast.announcement-style {
    background: linear-gradient(135deg, var(--color-warning), #d97706);
    border-left-color: var(--color-warning);
}

.mediator-message.broadcast.system-style {
    background: linear-gradient(135deg, var(--color-secondary), #5a5d65);
    border-left-color: var(--color-secondary);
}

/* Priority-based styling */
.mediator-message.priority-important {
    animation: pulse-important 2s ease-in-out infinite;
}

.mediator-message.priority-urgent {
    animation: pulse-urgent 1s ease-in-out infinite;
    border-width: 3px;
}

@keyframes pulse-important {
    0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0); }
}

@keyframes pulse-urgent {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.6); }
    50% { box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
}

/* Broadcast Notification Styles */
.broadcast-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    z-index: 1000;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

.broadcast-notification.fade-out {
    animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

.broadcast-notification .notification-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 15px;
}

.broadcast-notification i {
    font-size: 24px;
    color: var(--color-highlight);
}

.broadcast-notification .notification-text {
    flex: 1;
}

.broadcast-notification .notification-text strong {
    display: block;
    margin-bottom: 5px;
    color: var(--color-headline);
}

.broadcast-notification .notification-text p {
    margin: 0;
    color: var(--color-paragraph);
    font-size: 14px;
}

.broadcast-notification .notification-dismiss {
    background: none;
    border: none;
    font-size: 20px;
    color: var(--color-secondary);
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

.broadcast-notification .notification-dismiss:hover {
    color: var(--color-headline);
}

.broadcast-notification.priority-normal {
    border-left: 4px solid var(--color-highlight);
}

.broadcast-notification.priority-important {
    border-left: 4px solid var(--color-warning);
    animation: slideIn 0.3s ease-out, glow-important 2s infinite;
}

.broadcast-notification.priority-urgent {
    border-left: 4px solid var(--color-error);
    animation: slideIn 0.3s ease-out, glow-urgent 1s infinite;
}

@keyframes glow-important {
    0%, 100% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3); }
    50% { box-shadow: 0 4px 30px rgba(245, 158, 11, 0.6); }
}

@keyframes glow-urgent {
    0%, 100% { box-shadow: 0 4px 20px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 4px 30px rgba(239, 68, 68, 0.8); }
}

/* Private message style */
.user-message.private {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid var(--color-warning);
}

/* Responsive adjustments for role interfaces */
@media (max-width: 1200px) {
    .mediator-control-column,
    .broadcast-composer-column,
    .draft-preview-column,
    .suggestion-panel-column {
        width: 250px;
    }
}

@media (max-width: 900px) {
    .mediator-layout,
    .processor-layout {
        flex-direction: column;
    }

    .mediator-control-column,
    .broadcast-composer-column,
    .draft-preview-column,
    .suggestion-panel-column {
        width: 100%;
        max-height: 40vh;
    }

    .all-messages-column,
    .chat-window-column {
        flex: 1;
        min-height: 0;
    }
}

/* =====================================
   SUGGESTION POPUP & NOTIFICATION STYLES
   PRD 10.5.1: Processor Feedback Display
   ===================================== */

.suggestion-popup .popup-content {
    padding: 0;
}

.suggestion-popup .popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border-radius: 10px 10px 0 0;
}

.suggestion-popup .popup-header i {
    color: var(--color-warning);
}

.suggestion-popup .popup-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    padding: 0 5px;
}

.suggestion-popup .popup-close:hover {
    opacity: 0.8;
}

.suggestion-popup .popup-body {
    padding: 15px;
}

.suggestion-popup .popup-body p {
    margin: 0;
    color: var(--color-paragraph);
    line-height: 1.5;
}

.suggestion-notification .notification-icon {
    font-size: 20px;
    color: var(--color-warning);
}

.suggestion-notification .notification-content {
    flex: 1;
    font-size: 13px;
    line-height: 1.4;
}

.suggestion-notification .notification-content strong {
    display: block;
    margin-bottom: 4px;
}

/* Suggestion message in chat */
.suggestion-message {
    background: rgba(245, 158, 11, 0.1);
    color: var(--color-warning);
    border-left: 4px solid var(--color-warning);
    margin-right: auto;
    border-radius: 10px;
}

.suggestion-message.inline {
    max-width: 85%;
}

/* Animation keyframes */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* =====================================================
   SEGMENT SYSTEM STYLES - PRD 10.2.1.1
   ===================================================== */

/* Segment Layout */
.segment-layout {
    display: flex;
    height: 100vh;
    background: var(--color-background);
}

.segment-sidebar {
    width: 280px;
    background: var(--color-surface);
    border-right: 1px solid var(--color-stroke);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.segment-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
    min-height: 0;
}

.segment-main--align-center {
    justify-content: center;
}

.segment-main--align-center > .segment-content,
.segment-main--align-end > .segment-content {
    flex: none;
}

.segment-main--align-end {
    justify-content: flex-end;
}

.segment-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    min-height: 0;
}

/* Segment Info Box */
.segment-info {
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: white;
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--color-stroke-light);
}

.segment-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
}

.segment-current {
    display: flex;
    align-items: center;
    gap: 10px;
}

.segment-index {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.segment-name {
    font-size: 14px;
}

/* Segment Progress Indicator */
.segment-progress-indicator {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
}

.segment-progress-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    position: relative;
    transition: all 0.3s ease;
}

.segment-progress-item.active {
    background: rgba(127, 90, 240, 0.15);
    border-radius: 8px;
    margin: 0 -10px;
    padding: 10px 20px;
}

.segment-progress-item.completed .segment-progress-icon {
    background: var(--color-tertiary);
    color: white;
}

.segment-progress-item.active .segment-progress-icon {
    background: var(--color-highlight);
    color: white;
    animation: pulse 2s infinite;
}

.segment-progress-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--color-stroke);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--color-secondary);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.segment-progress-label {
    font-size: 13px;
    color: var(--color-paragraph);
    font-weight: 500;
}

.segment-progress-item.completed .segment-progress-label {
    color: var(--color-tertiary);
}

.segment-progress-item.active .segment-progress-label {
    color: var(--color-highlight);
    font-weight: bold;
}

.segment-progress-connector {
    position: absolute;
    left: 25px;
    bottom: -10px;
    width: 2px;
    height: 20px;
    background: var(--color-stroke);
    z-index: -1;
}

.segment-progress-item.completed .segment-progress-connector {
    background: var(--color-tertiary);
}

/* Segment Timer */
.segment-timer-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
    font-size: 24px;
    font-weight: bold;
    color: var(--color-paragraph);
    transition: opacity 200ms ease;
}

.segment-timer-container[data-state="transitioning"] {
    opacity: 0;
}

.segment-timer-next-label {
    margin-left: 8px;
    font-size: 0.85em;
    color: var(--muted-text-color, #888);
    font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
    .segment-timer-container {
        transition: none;
    }
}

.segment-timer-container i {
    font-size: 20px;
}

#segment-timer.timer-warning {
    color: var(--color-warning);
}

#segment-timer.timer-critical {
    color: var(--color-error);
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Participant List */
.participant-list-container {
    margin-top: 20px;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
}

.participant-list-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
    color: var(--color-headline);
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-stroke);
}

.participant-list-header i {
    color: #3b82f6;
}

.participant-list-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.participant-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--color-surface);
    border-radius: 8px;
    border: 1px solid var(--color-stroke);
    font-size: 13px;
    transition: all 0.2s ease;
}

.participant-list-item:hover {
    border-color: rgba(59, 130, 246, 0.3);
    background: rgba(59, 130, 246, 0.05);
}

.participant-list-item.current-user {
    border-color: rgba(127, 90, 240, 0.3);
    background: rgba(127, 90, 240, 0.05);
}

.participant-list-item.participant-ai {
    border-left: 4px solid var(--color-highlight);
}

.participant-list-item.participant-bot {
    border-left: 4px solid var(--color-warning);
}

.participant-list-item.participant-human {
    border-left: 4px solid #3b82f6;
}

.participant-avatar {
    font-size: 18px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-alt);
    border-radius: 50%;
    overflow: hidden;
}

.participant-avatar .avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.participant-name {
    flex: 1;
    font-weight: 500;
    color: var(--color-headline);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.participant-list-item.is-offline {
    opacity: 0.55;
}

.participant-list-item.is-offline .participant-avatar {
    filter: grayscale(0.7);
}

.participant-list-item.is-offline .participant-name {
    color: var(--color-paragraph, var(--color-headline));
}

.participant-offline-badge {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--color-surface-alt);
    color: var(--color-paragraph, var(--color-headline));
    border: 1px solid var(--color-stroke);
    flex-shrink: 0;
}

/* Segment Navigation */
.segment-navigation {
    padding: 20px;
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid var(--color-stroke);
    background: var(--color-surface-alt);
}

.segment-advance-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: white;
    border: 1px solid var(--color-stroke-light);
    border-radius: 12px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.segment-advance-button:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.4);
}

.segment-advance-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.segment-advance-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.min-duration-hint {
    font-size: 12px;
    color: var(--color-secondary);
    font-style: italic;
}

/* Slide Segment */
.slide-segment {
    padding: 40px;
    display: flex;
    flex-direction: column;
    min-height: 100%;
}

.slide-segment.layout-center {
    justify-content: center;
    align-items: center;
    text-align: center;
}

.slide-segment.layout-left {
    justify-content: flex-start;
    align-items: flex-start;
}

.slide-content {
    max-width: 800px;
    font-size: 18px;
    line-height: 1.8;
    color: var(--color-paragraph);
}

.slide-content h1, .slide-content h2, .slide-content h3 {
    margin-bottom: 20px;
    color: var(--color-headline);
}

.slide-content p {
    margin-bottom: 15px;
}

.slide-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 20px 0;
}

/* Instruction Segment */
.instruction-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-height: 0;
    padding: 30px 20px;
    overflow-y: auto;
}
.instruction-segment.instruction-align-left {
    align-items: flex-start;
}
.instruction-content {
    line-height: 1.8;
    font-size: 16px;
    padding: 0 10px;
    color: var(--color-paragraph);
    width: 100%;
    max-width: 800px;
    /* margin-block:auto keeps content vertically centered when it fits,
       and collapses safely so long content scrolls from the top without clipping. */
    margin-block: auto;
}
.instruction-width-medium .instruction-content {
    max-width: 1000px;
}
.instruction-width-wide .instruction-content {
    max-width: none;
}
.instruction-content h1,
.instruction-content h2,
.instruction-content h3 {
    margin-top: 16px;
    margin-bottom: 8px;
    color: var(--color-headline);
}
.instruction-content h1 { font-size: 1.6em; }
.instruction-content h2 { font-size: 1.3em; }
.instruction-content h3 { font-size: 1.1em; }
.instruction-content p {
    margin-bottom: 12px;
}
.instruction-content ul,
.instruction-content ol {
    padding-left: 24px;
    margin: 8px 0;
}
.instruction-content li {
    margin-bottom: 4px;
}
.instruction-content code {
    background: rgba(255, 255, 254, 0.06);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
    font-family: 'SF Mono', 'Fira Code', monospace;
}
.instruction-content hr {
    border: none;
    border-top: 1px solid var(--color-stroke);
    margin: 16px 0;
}
.instruction-actions {
    flex-shrink: 0;
    padding-top: 16px;
    text-align: center;
    border-top: 1px solid var(--color-stroke);
    width: 100%;
    max-width: 800px;
}
.instruction-width-medium .instruction-actions {
    max-width: 1000px;
}
.instruction-width-wide .instruction-actions {
    max-width: none;
}
.segment-proceed-btn {
    min-width: 160px;
    padding: 10px 24px;
    font-size: 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: opacity 0.2s;
    background: var(--color-highlight);
    color: var(--color-headline);
    border: none;
    font-weight: 600;
}
.segment-proceed-btn:hover:not(:disabled) {
    background: var(--color-button-hover);
}
.segment-proceed-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Chat Segment */
.chat-segment {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.chat-prompt {
    padding: 15px 20px;
    background: rgba(59, 130, 246, 0.1);
    border-bottom: 1px solid rgba(59, 130, 246, 0.2);
    font-size: 14px;
    color: #3b82f6;
}

.chat-messages-container {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

.chat-input-area {
    padding: 15px 20px;
    border-top: 1px solid var(--color-stroke);
    background: var(--color-surface-alt);
    width: 100%;
    box-sizing: border-box;
}

.chat-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    width: 100%;
}

.chat-input-wrapper textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 12px;
    font-size: 14px;
    resize: none;
    max-height: 120px;
    transition: border-color 0.2s ease;
    background: var(--color-surface);
    color: var(--color-headline);
}

.chat-input-wrapper textarea:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.send-button {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.send-button:hover {
    transform: scale(1.1);
}

/* Typing bubble — rendered as a message bubble inside #chatMessages */
.typing-bubble {
    opacity: 0.75;
}

.typing-bubble .message-content.typing-animation {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 0;
}

.typing-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-secondary);
    display: inline-block;
    animation: typingBounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingBounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Selection Segment */
.selection-segment {
    padding: 40px;
}

.selection-prompt {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-headline);
    margin-bottom: 25px;
}

.selection-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.selection-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.selection-option:hover {
    border-color: rgba(127, 90, 240, 0.3);
    background: rgba(127, 90, 240, 0.05);
}

.selection-option input {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-highlight);
}

.selection-option label {
    font-size: 14px;
    color: var(--color-paragraph);
    cursor: pointer;
    flex: 1;
}

.selection-hint {
    font-size: 12px;
    color: var(--color-secondary);
    margin-top: 15px;
}

/* Slider Selection Mode */
.selection-slider-container {
    padding: 20px 0;
}

.selection-slider-container input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: var(--color-surface-alt, #242629);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.selection-slider-container input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-highlight, #7f5af0);
    border: 2px solid var(--color-background, #16161a);
    box-shadow: 0 2px 8px rgba(127, 90, 240, 0.4);
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.selection-slider-container input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 2px 12px rgba(127, 90, 240, 0.6);
}

.selection-slider-container input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-highlight, #7f5af0);
    border: 2px solid var(--color-background, #16161a);
    box-shadow: 0 2px 8px rgba(127, 90, 240, 0.4);
    cursor: pointer;
}

.slider-value-display {
    text-align: center;
    margin-bottom: 8px;
}

.slider-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--color-highlight, #7f5af0);
    min-width: 48px;
    text-align: center;
}

.slider-track-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.slider-track-row input[type="range"] {
    flex: 1;
}

.slider-bound {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-paragraph, #94a1b2);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Legacy layout (kept for standalone rendering) */
.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-paragraph, #94a1b2);
}

.slider-label-left,
.slider-label-right {
    max-width: 40%;
    opacity: 0.8;
}

/* Slider Results */
.slider-results-stats {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.slider-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 16px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 8px;
    flex: 1;
    min-width: 60px;
}

.slider-stat-label {
    font-size: 11px;
    color: var(--color-paragraph, #94a1b2);
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.slider-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--color-headline, #fffffe);
    margin-top: 2px;
}

.slider-results-bar {
    margin-top: 8px;
}

.slider-results-track {
    position: relative;
    height: 12px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 6px;
}

.slider-results-indicator {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: var(--color-highlight, #7f5af0);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(127, 90, 240, 0.5);
}

.slider-results-indicator-label {
    position: absolute;
    top: -22px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 11px;
    font-weight: 600;
    color: var(--color-highlight, #7f5af0);
    white-space: nowrap;
}

.slider-results-bar-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 6px;
    font-size: 12px;
    color: var(--color-paragraph, #94a1b2);
    opacity: 0.6;
}

/* Markdown Content in Selection Prompts */
.selection-prompt.markdown-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 10px 0;
}

.selection-prompt.markdown-content a {
    color: var(--color-highlight, #7f5af0);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.selection-prompt.markdown-content a:hover {
    opacity: 0.8;
}

.selection-prompt.markdown-content h1,
.selection-prompt.markdown-content h2,
.selection-prompt.markdown-content h3 {
    margin: 8px 0;
    color: var(--color-headline, #fffffe);
}

.selection-prompt.markdown-content h1 { font-size: 22px; }
.selection-prompt.markdown-content h2 { font-size: 18px; }
.selection-prompt.markdown-content h3 { font-size: 16px; }

.selection-prompt.markdown-content p {
    margin: 6px 0;
    line-height: 1.6;
}

.selection-prompt.markdown-content strong {
    color: var(--color-headline, #fffffe);
}

.selection-prompt.markdown-content code {
    background: var(--color-surface-alt, #242629);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

/* Ranking Segment */
.ranking-segment {
    padding: 40px;
}

.ranking-prompt {
    font-size: 18px;
    font-weight: bold;
    color: var(--color-headline);
    margin-bottom: 25px;
}

.ranking-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: var(--color-surface);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    cursor: grab;
    transition: all 0.2s ease;
}

.ranking-item:hover {
    border-color: rgba(127, 90, 240, 0.3);
    box-shadow: 0 2px 8px rgba(127, 90, 240, 0.2);
}

.ranking-item.dragging {
    opacity: 0.5;
    border-style: dashed;
}

.ranking-handle {
    color: var(--color-secondary);
    cursor: grab;
}

.ranking-handle:active {
    cursor: grabbing;
}

.ranking-number {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.ranking-label {
    flex: 1;
    font-size: 14px;
    color: var(--color-paragraph);
}

/* Input Segment */
.input-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    min-height: 0;
    padding: 40px 20px;
    overflow-y: auto;
}

.input-prompt {
    font-size: 1.15em;
    font-weight: 600;
    line-height: 1.7;
    color: var(--color-paragraph);
    margin-bottom: 28px;
    width: 100%;
    max-width: 640px;
}

.input-container {
    width: 100%;
    max-width: 640px;
}

.input-container input,
.input-container textarea {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font-primary);
    line-height: 1.6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: var(--color-background);
    color: var(--color-headline);
    box-sizing: border-box;
}

.input-container textarea {
    min-height: 120px;
    resize: vertical;
}

.input-container input:focus,
.input-container textarea:focus {
    outline: none;
    border-color: var(--color-highlight);
    box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.15);
}

.input-container input::placeholder,
.input-container textarea::placeholder {
    color: var(--color-secondary);
}

.input-hint {
    font-size: 12px;
    color: var(--color-secondary);
    margin-top: 10px;
    width: 100%;
    max-width: 640px;
}

.input-segment .segment-navigation {
    border-top: none;
    background: none;
    padding: 24px 0 0;
    width: 100%;
    max-width: 640px;
    justify-content: flex-end;
}

/* Media Segment */
.media-segment {
    padding: 20px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.media-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.media-container video,
.media-container audio,
.media-container img,
.media-container iframe {
    max-width: 100%;
    max-height: 100%;
}

.media-container iframe {
    width: 100%;
    height: 100%;
    min-height: 400px;
}

/* Timer Segment */
.timer-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.timer-message {
    font-size: 20px;
    color: var(--color-headline);
    margin-bottom: 30px;
}

.timer-display {
    font-size: 72px;
    font-weight: bold;
    color: var(--color-highlight);
    font-family: 'SF Mono', 'Fira Code', monospace;
    margin-bottom: 30px;
}

.timer-progress {
    width: 100%;
    max-width: 400px;
    height: 8px;
    background: var(--color-surface-alt);
    border-radius: 4px;
    overflow: hidden;
}

.timer-progress-bar {
    height: 100%;
    background: linear-gradient(135deg, var(--color-button), var(--color-button-hover));
    transition: width 1s linear;
}

/* Process Segment */
.process-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
}

.process-spinner {
    font-size: 48px;
    color: var(--color-highlight);
    margin-bottom: 30px;
}

.process-message {
    font-size: 20px;
    color: var(--color-headline);
    max-width: 480px;
}

/* Task Segment */
.task-segment {
    padding: 40px;
}

.task-instructions {
    font-size: 16px;
    color: var(--color-paragraph);
    margin-bottom: 25px;
    line-height: 1.6;
    padding: 15px;
    background: rgba(245, 158, 11, 0.1);
    border-radius: 12px;
    border-left: 4px solid var(--color-warning);
}

.task-iframe-container {
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-stroke);
}

.task-iframe {
    width: 100%;
    border: none;
    display: block;
}

.task-submission-area {
    margin-bottom: 20px;
}

.task-textarea-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-paragraph);
    margin-bottom: 8px;
}

.task-textarea {
    width: 100%;
    min-height: 150px;
    padding: 14px;
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.task-textarea:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.task-textarea:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.task-char-count {
    font-size: 12px;
    color: var(--color-paragraph);
    opacity: 0.6;
    margin-top: 6px;
    text-align: right;
}

.task-min-hint {
    color: var(--color-warning);
}

.task-submit-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.task-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.4);
}

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

.task-submitted-confirmation {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    padding: 10px 16px;
    background: rgba(46, 204, 113, 0.15);
    color: #2ecc71;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
}

/* Segment results area (shared across interactive segment types) */
.segment-results-area {
    margin-top: 20px;
    padding: 16px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
}

.segment-results-area h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--color-paragraph);
    opacity: 0.8;
}

.segment-submission-count {
    font-size: 13px;
    color: var(--color-paragraph);
    opacity: 0.7;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.segment-submission-count .spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-stroke);
    border-top-color: var(--color-highlight);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.waiting-for-submissions-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 12px 0;
    padding: 10px 14px;
    background: var(--color-background);
    border: 1px solid var(--color-stroke);
    border-radius: 6px;
    color: var(--color-paragraph);
    font-size: 13px;
}

.waiting-for-submissions-banner .spinner-sm {
    width: 14px;
    height: 14px;
    border: 2px solid var(--color-stroke);
    border-top-color: var(--color-highlight);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

@keyframes selection-required-shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

.selection-required-flash {
    animation: selection-required-shake 0.5s ease-in-out;
    outline: 2px solid var(--color-highlight, #ffb86b);
    outline-offset: 4px;
    border-radius: 6px;
}

/* Read-only freeze after the participant has submitted and is waiting for
   others. We disable inputs in JS (no clicks/toggles); these styles add a
   visual cue and a not-allowed cursor. Critically: only the interactive
   elements get pointer-events restrictions, never the segment container
   itself, so the page remains scrollable via wheel / touch / keyboard. */
.segment-frozen .selection-option,
.segment-frozen .ranking-item {
    cursor: not-allowed;
    opacity: 0.65;
    transition: opacity 0.2s ease;
}

.segment-frozen .selection-option:hover,
.segment-frozen .ranking-item:hover {
    /* Suppress the normal hover affordance so it feels inert. */
    background: inherit;
    transform: none;
}

.segment-frozen .selection-option input,
.segment-frozen .selection-option label {
    cursor: not-allowed;
}

.segment-frozen .ranking-item {
    /* The draggable attribute is also removed via JS, so the cursor reflects that. */
    cursor: default;
}

/* Survey Segment */
.survey-segment {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

/* Allow segment-content to scroll when it contains a survey */
.segment-content:has(.survey-segment) {
    overflow-y: auto;
}

#segment-survey-container {
    min-height: 400px;
}

/* Sync Waiting Overlay */
.sync-waiting-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(22, 22, 26, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.sync-waiting-content {
    text-align: center;
}

.sync-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--color-surface-alt);
    border-top-color: var(--color-highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.sync-waiting-content p {
    font-size: 14px;
    color: var(--color-secondary);
}

/* Responsive adjustments for segment system */
@media (max-width: 900px) {
    .segment-layout {
        flex-direction: column;
    }

    .segment-sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--color-stroke);
        flex-direction: row;
        flex-wrap: wrap;
        padding: 15px;
    }

    .segment-info {
        flex: 1;
        min-width: 200px;
    }

    .segment-progress-indicator {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px;
    }

    .segment-progress-item {
        flex-direction: column;
        padding: 8px;
    }

    .segment-progress-connector {
        display: none;
    }

    .segment-timer-container {
        width: auto;
    }

    .slide-segment,
    .selection-segment,
    .ranking-segment,
    .input-segment,
    .task-segment {
        padding: 20px;
    }

    .timer-display {
        font-size: 48px;
    }
}

/* =====================================
   IDENTITY SETUP SCREEN (PRD 6.2 A1.5)
   ===================================== */

.identity-setup-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    background: var(--color-background);
    box-sizing: border-box;
}

.identity-setup-card {
    background: var(--color-surface);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    max-width: 500px;
    width: 100%;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    border: 1px solid var(--color-stroke);
}

.identity-setup-header {
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

.identity-setup-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.identity-setup-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 14px;
}

.identity-setup-form {
    padding: 30px;
}

.identity-setup-form .form-group {
    margin-bottom: 25px;
    position: relative;
}

.identity-setup-form label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--color-headline);
    margin-bottom: 10px;
    font-size: 14px;
}

.identity-setup-form .label-hint {
    font-weight: 400;
    font-size: 12px;
    color: var(--color-secondary);
}

.identity-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--color-stroke-light);
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    box-sizing: border-box;
    background: var(--color-surface-alt);
    color: var(--color-headline);
}

.identity-input:focus {
    outline: none;
    border-color: var(--color-highlight);
    box-shadow: 0 0 0 3px rgba(127, 90, 240, 0.1);
}

.identity-input.invalid {
    border-color: var(--color-error);
}

.char-count {
    position: absolute;
    right: 12px;
    top: 48px;
    font-size: 12px;
    color: var(--color-secondary);
}

.input-error {
    display: block;
    color: var(--color-error);
    font-size: 12px;
    margin-top: 6px;
    min-height: 18px;
}

/* Avatar Gallery */
.avatar-gallery-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-secondary);
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.avatar-gallery-toggle:hover {
    border-color: var(--color-highlight);
    color: var(--color-headline);
}

.avatar-gallery-toggle .toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
}

.avatar-gallery-toggle .selected-avatar-preview {
    font-size: 20px;
    line-height: 1;
}

.avatar-gallery-toggle .toggle-chevron {
    transition: transform 0.2s ease;
    font-size: 12px;
}

.avatar-gallery-toggle .toggle-chevron.open {
    transform: rotate(180deg);
}

.avatar-gallery {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
    max-height: 280px;
    overflow-y: auto;
}

.avatar-gallery.collapsed {
    display: none;
}

.avatar-category-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.avatar-category-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-text-secondary);
    padding-left: 4px;
}

.avatar-category-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
}

.avatar-option-svg .avatar-svg-img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.avatar-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 3px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.avatar-option:hover {
    transform: scale(1.1);
    border-color: var(--color-highlight);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

.avatar-option.selected {
    border-color: var(--color-highlight);
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.4);
}

.avatar-option.selected .avatar-emoji {
    filter: brightness(1.1);
}

.avatar-emoji {
    font-size: 28px;
    line-height: 1;
}

/* Identity Preview */
.identity-preview {
    margin-top: 20px;
    padding: 15px;
    background: var(--color-surface-alt);
    border-radius: 12px;
    border: 2px dashed var(--color-stroke-light);
}

.identity-preview label {
    margin-bottom: 10px;
}

.preview-message {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--color-surface);
    border-radius: 12px;
    border: 1px solid var(--color-stroke);
}

.preview-avatar {
    font-size: 32px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface-alt);
    border-radius: 50%;
}

.preview-name {
    font-weight: 600;
    color: var(--color-highlight);
}

.preview-text {
    color: var(--color-secondary);
    font-style: italic;
}

/* Submit Button */
.identity-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--color-button) 0%, var(--color-button-hover) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

.identity-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(127, 90, 240, 0.4);
}

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

/* Chat Message Avatar Styling */
.chat-message-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background: var(--color-surface-alt);
    flex-shrink: 0;
    border: 1px solid var(--color-stroke);
    overflow: hidden;
}

.chat-message-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.chat-message-with-avatar {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.chat-message-content {
    flex: 1;
}

.chat-sender-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-highlight);
    margin-bottom: 4px;
}

/* Responsive */
@media (max-width: 600px) {
    .identity-setup-container {
        padding: 10px;
        align-items: flex-start;
    }

    .identity-setup-card {
        max-height: calc(100vh - 20px);
        border-radius: 12px;
    }

    .identity-setup-header {
        padding: 20px;
    }

    .identity-setup-header h2 {
        font-size: 20px;
    }

    .identity-setup-form {
        padding: 16px;
    }

    .avatar-gallery {
        max-height: 200px;
    }

    .avatar-category-grid {
        grid-template-columns: repeat(5, 1fr);
        gap: 8px;
    }

    .avatar-option {
        width: 42px;
        height: 42px;
    }

    .avatar-emoji {
        font-size: 22px;
    }
}
/* =============================================================================
   PRD 9.1.1.2: Chat Input Control Styles
   ============================================================================= */

.chat-input-disabled {
    position: relative;
}

.chat-input-disabled-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(22, 22, 26, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    z-index: 10;
}

.chat-input-disabled-overlay .disabled-message {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--color-secondary);
    font-size: 14px;
    padding: 12px 20px;
    background: var(--color-surface);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.chat-input-disabled-overlay .disabled-message i {
    color: var(--color-secondary);
    font-size: 16px;
}

.input-disabled {
    background: var(--color-surface-alt) !important;
    cursor: not-allowed !important;
    opacity: 0.7;
}

.btn-disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

/* Toast notification */
.experiment-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.experiment-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.experiment-toast.toast-success {
    background: linear-gradient(135deg, #2cb67d, #1e8a5e);
}

.experiment-toast.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.experiment-toast.toast-warning {
    background: linear-gradient(135deg, var(--color-warning), #d97706);
}

.experiment-toast.toast-error {
    background: linear-gradient(135deg, var(--color-error), #dc2626);
}

/* =============================================================================
   Emoji Reactions & Message Reporting
   ============================================================================= */

/* Action bar beneath message content */
.message-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

/* Smiley trigger button — hidden until message hover */
.reaction-trigger,
.report-btn {
    background: none;
    border: none;
    color: var(--color-secondary);
    cursor: pointer;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.message:hover .reaction-trigger,
.message:hover .report-btn {
    opacity: 1;
}

.reaction-trigger:hover {
    color: var(--color-highlight);
    background: rgba(127, 90, 240, 0.1);
}

/* Reaction picker — inline row that expands within the message */
.reaction-picker {
    display: none;
    background: var(--color-surface);
    border: 1px solid var(--color-stroke);
    border-radius: 8px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.reaction-picker.visible {
    display: flex;
}

.reaction-btn {
    background: none;
    border: none;
    font-size: 20px;
    padding: 4px 6px;
    cursor: pointer;
    border-radius: 4px;
    transition: transform 0.15s, background 0.15s;
}

.reaction-btn:hover {
    transform: scale(1.25);
    background: rgba(127, 90, 240, 0.1);
}

/* Reaction display badges */
.reaction-display {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.reaction-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 12px;
    background: var(--color-surface-alt);
    border: 1px solid var(--color-stroke);
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.reaction-badge:hover {
    background: rgba(127, 90, 240, 0.1);
    border-color: var(--color-highlight);
}

.reaction-badge.active {
    background: rgba(127, 90, 240, 0.15);
    border-color: var(--color-highlight);
}

/* Report button */
.report-btn {
    margin-left: auto;
}

.report-btn:hover {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
}

.report-btn.reported {
    opacity: 1;
    color: var(--color-error, #ef4444);
    cursor: default;
    font-size: 11px;
    gap: 4px;
    font-size: 12px;
    pointer-events: none;
}

/* Report dialog modal */
.report-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.report-dialog {
    background: var(--color-surface);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    padding: 24px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

.report-dialog h4 {
    margin: 0 0 16px 0;
    color: var(--color-headline);
    font-size: 16px;
}

.report-dialog .form-group {
    margin-bottom: 12px;
}

.report-dialog label {
    display: block;
    font-size: 13px;
    color: var(--color-paragraph);
    margin-bottom: 4px;
}

.report-dialog select,
.report-dialog textarea {
    width: 100%;
    padding: 8px 10px;
    border-radius: 6px;
    border: 1px solid var(--color-stroke);
    background: var(--color-surface-alt);
    color: var(--color-headline);
    font-family: var(--font-primary);
    font-size: 14px;
    box-sizing: border-box;
}

.report-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
}

.report-cancel-btn,
.report-submit-btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}

.report-cancel-btn {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
}

.report-cancel-btn:hover {
    background: var(--color-stroke);
}

.report-submit-btn {
    background: var(--color-error);
    color: var(--color-button-text);
}

.report-submit-btn:hover {
    background: #dc2626;
}

/* ── Chat Toast Notification ── */
.chat-toast {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: var(--color-surface-alt, #2a2a3e);
    color: var(--color-paragraph, #ccc);
    border: 1px solid var(--color-stroke, #444);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
    z-index: 100;
    white-space: nowrap;
}

.chat-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* =====================================
   PROCESSOR MODE STYLES
   Review, Generate, Real-time Assist
   ===================================== */

/* Processor active banner — shown at top of chat when a processor is active */
.processor-active-banner {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    border-radius: 10px;
    margin-bottom: 10px;
    animation: slideIn 0.3s ease-out;
}

.processor-active-banner.mode-review {
    background: rgba(255, 152, 0, 0.1);
    border: 1px solid rgba(255, 152, 0, 0.25);
}

.processor-active-banner.mode-generate {
    background: rgba(127, 90, 240, 0.1);
    border: 1px solid rgba(127, 90, 240, 0.25);
}

.processor-active-banner.mode-real-time-assist {
    background: rgba(44, 182, 125, 0.1);
    border: 1px solid rgba(44, 182, 125, 0.25);
}

.processor-banner-content {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

.processor-active-banner.mode-review .processor-banner-content > i {
    color: #ffb74d;
    font-size: 1.1rem;
}

.processor-active-banner.mode-generate .processor-banner-content > i {
    color: #a78bfa;
    font-size: 1.1rem;
}

.processor-active-banner.mode-real-time-assist .processor-banner-content > i {
    color: #2cb67d;
    font-size: 1.1rem;
}

.processor-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.processor-banner-text strong {
    font-size: 0.85rem;
    color: var(--text-primary, #e0e0e0);
}

.processor-banner-text span {
    font-size: 0.78rem;
    color: var(--text-secondary, #999);
    line-height: 1.4;
}

/* Mode indicator badge */
.processor-mode-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 8px;
}

.processor-mode-indicator.mode-review {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.processor-mode-indicator.mode-generate {
    background: rgba(127, 90, 240, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(127, 90, 240, 0.3);
}

.processor-mode-indicator.mode-real-time-assist {
    background: rgba(44, 182, 125, 0.15);
    color: #2cb67d;
    border: 1px solid rgba(44, 182, 125, 0.3);
}

/* Review feedback panel */
.processor-review-panel {
    background: var(--color-surface);
    border: 1px solid rgba(255, 152, 0, 0.3);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    animation: slideIn 0.3s ease-out;
}

.review-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-weight: 600;
    color: #ffb74d;
}

.review-panel-header i {
    font-size: 1rem;
}

.review-mandatory-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-left: auto;
}

.review-panel-body {
    margin-bottom: 16px;
}

.review-feedback-text {
    color: var(--color-paragraph);
    line-height: 1.5;
    margin: 0;
}

.review-suggested-edit {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(127, 90, 240, 0.1);
    border-radius: 8px;
    border-left: 3px solid var(--color-highlight);
    color: var(--color-paragraph);
    font-size: 0.9rem;
}

.review-panel-actions {
    display: flex;
    gap: 8px;
}

.review-btn {
    padding: 6px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.review-btn.review-accept {
    background: var(--color-tertiary);
    color: white;
}

.review-btn.review-accept:hover {
    background: #22a06b;
}

.review-btn.review-edit {
    background: var(--color-highlight);
    color: white;
}

.review-btn.review-edit:hover {
    background: var(--color-button-hover);
}

.review-btn.review-reject {
    background: var(--color-surface-alt);
    color: var(--color-paragraph);
    border: 1px solid var(--color-stroke);
}

.review-btn.review-reject:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

/* Generate button */
.processor-generate-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--color-highlight), #a78bfa);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    white-space: nowrap;
}

.processor-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(127, 90, 240, 0.3);
}

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

/* Real-time suggestion overlay */
.processor-suggestion-overlay {
    background: var(--color-surface);
    border: 1px solid rgba(44, 182, 125, 0.3);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
    max-height: 180px;
    overflow-y: auto;
}

.suggestion-overlay-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-tertiary);
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-stroke);
}

.suggestion-overlay-list .empty-suggestions {
    color: var(--color-secondary);
    font-size: 0.8rem;
    font-style: italic;
    margin: 0;
}

/* Real-time suggestion card */
.rta-suggestion-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 12px;
    background: var(--color-surface-alt);
    border-radius: 8px;
    margin-bottom: 6px;
    animation: slideIn 0.2s ease-out;
}

.rta-suggestion-text {
    flex: 1;
    color: var(--color-paragraph);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

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

.rta-suggestion-actions button {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.rta-accept {
    background: rgba(44, 182, 125, 0.2);
    color: var(--color-tertiary);
}

.rta-accept:hover {
    background: var(--color-tertiary);
    color: white;
}

.rta-dismiss {
    background: rgba(239, 68, 68, 0.15);
    color: var(--color-error);
}

.rta-dismiss:hover {
    background: var(--color-error);
    color: white;
}

/* Processor review request (processor-side view) */
.processor-review-request {
    background: var(--color-surface-alt);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.review-request-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #ffb74d;
    margin-bottom: 12px;
}

.review-request-from {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--color-secondary);
    font-weight: 400;
}

.review-request-draft blockquote {
    margin: 8px 0;
    padding: 10px 14px;
    background: var(--color-surface);
    border-left: 3px solid var(--color-highlight);
    border-radius: 6px;
    color: var(--color-headline);
    font-style: italic;
}

.review-request-context {
    margin-top: 12px;
}

.review-request-context h5 {
    font-size: 0.8rem;
    color: var(--color-secondary);
    margin-bottom: 6px;
}

.context-messages {
    max-height: 120px;
    overflow-y: auto;
    padding: 8px;
    background: var(--color-surface);
    border-radius: 8px;
}

.context-msg {
    font-size: 0.8rem;
    color: var(--color-paragraph);
    margin-bottom: 4px;
    line-height: 1.4;
}

/* Processor phase item (experiment builder) */
.processor-phase-item {
    background: var(--color-surface-alt, #f5f5f5);
    border: 1px solid var(--color-stroke, #e0e0e0);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}

.phase-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.phase-number {
    font-weight: 600;
    font-size: 0.85rem;
}

.btn-remove-phase {
    background: none;
    border: none;
    color: var(--color-error, #ef4444);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 2px 6px;
    border-radius: 4px;
}

.btn-remove-phase:hover {
    background: rgba(239, 68, 68, 0.1);
}

.btn-add-phase {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--color-button, #7f5af0);
    color: var(--color-button-text, white);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
}

.btn-add-phase:hover {
    background: var(--color-button-hover, #6b47d6);
}

/* ================================================================
   Results Visualization Styles
   ================================================================ */

/* Bar chart (selection results) */
.result-bar-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.result-bar-label {
    min-width: 100px;
    font-size: 13px;
    color: var(--color-paragraph);
    text-align: right;
    flex-shrink: 0;
}

.result-bar-track {
    flex: 1;
    height: 22px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 6px;
    overflow: hidden;
}

.result-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-highlight) 0%, var(--color-button-hover) 100%);
    border-radius: 6px;
    transition: width 0.4s ease;
    min-width: 2px;
}

.result-bar-count {
    min-width: 70px;
    font-size: 12px;
    color: var(--color-paragraph);
    opacity: 0.7;
}

/* Ranking results */
.result-rank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.result-rank-num {
    min-width: 40px;
    font-size: 18px;
    font-weight: 700;
    color: var(--color-highlight);
    text-align: center;
}

.result-rank-label {
    font-size: 14px;
    color: var(--color-paragraph);
}

/* Input results list */
.result-input-list {
    max-height: 200px;
    overflow-y: auto;
}

.result-input-entry {
    padding: 8px 12px;
    margin-bottom: 6px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 8px;
    font-size: 13px;
    color: var(--color-paragraph);
    line-height: 1.5;
}

/* Individual results (shared across selection, slider, ranking) */
.result-individual-list {
    max-height: 250px;
    overflow-y: auto;
}

.result-individual-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px;
    margin-bottom: 4px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 6px;
    font-size: 13px;
}

.result-individual-name {
    color: var(--color-highlight);
    font-weight: 600;
    flex-shrink: 0;
    margin-right: 12px;
}

.result-individual-value {
    color: var(--color-paragraph);
    text-align: right;
}

/* Individual ranking blocks */
.result-individual-block {
    padding: 8px 12px;
    margin-bottom: 8px;
    background: var(--color-surface, #1a1a2e);
    border-radius: 8px;
    border-left: 3px solid var(--color-highlight);
}

.result-individual-block-name {
    font-weight: 600;
    font-size: 13px;
    color: var(--color-highlight);
    margin-bottom: 4px;
}

.result-ranking-items {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.result-ranking-item {
    font-size: 12px;
    color: var(--color-paragraph);
    opacity: 0.85;
}

/* Slider individual dots */
.slider-individual-track {
    position: relative;
}

.slider-individual-dot {
    position: absolute;
    top: 50%;
    width: 12px;
    height: 12px;
    background: var(--color-highlight);
    border: 2px solid var(--color-background, #16161a);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: default;
    transition: left 0.3s ease;
    z-index: 2;
}

.slider-individual-dot:hover {
    transform: translate(-50%, -50%) scale(1.3);
    z-index: 3;
}

/* Reveal animation */
.segment-results-revealed {
    animation: resultsReveal 0.6s ease;
}

@keyframes resultsReveal {
    0% { opacity: 0; transform: translateY(10px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* ================================================================
   Embedded Segment Inline Card (within chat message flow)
   ================================================================ */

.segment-inline-card {
    background: var(--color-surface, #242629);
    border: 1px solid rgba(127, 90, 240, 0.3);
    border-left: 4px solid var(--color-highlight, #7f5af0);
    border-radius: 10px;
    margin: 8px auto;
    width: 75%;
    overflow: hidden;
    animation: inlineCardSlideIn 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* Pinned active card: sticks to the top of the chat scroll viewport so it
   stays in view while messages scroll underneath, until the segment completes
   (the class is removed on completion). */
.segment-inline-card.segment-inline-card-pinned {
    position: sticky;
    top: 8px;
    z-index: 5;
}

/* position:sticky resolves against the nearest scroll-container ancestor.
   .chat-messages declares overflow-y:auto, which would otherwise capture the
   sticky card instead of the real scroller (.chat-messages-container). While a
   pinned card is present, drop that overflow so the card sticks to the chat
   viewport. :has() makes this auto-revert the moment the pin is removed. */
.chat-messages:has(> .segment-inline-card-pinned) {
    overflow-y: visible;
}

/* ── Split-screen embedded layout ────────────────────────────────────────
   Used when a (non-chat) embedded segment has config.embeddedLayout==='split'.
   The chat region is reshaped into a flex row: content pane (flex-grow) on the
   left, the chamber's live chat docked to a fixed-width column on the right. */
.segment-split {
    display: flex;
    gap: 12px;
    width: 100%;
    height: 100%;
    min-height: 0;
    flex: 1 1 auto;
}

.segment-split #splitContentPane {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-background, #16161a);
    border: 1px solid var(--color-stroke, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    overflow: hidden;
}

.segment-split #splitContentPane > .segment-split-pane-content {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
}

.segment-split #splitContentPane > .segment-split-pane-actions {
    flex: 0 0 auto;
    padding: 8px 12px;
    border-top: 1px solid var(--color-stroke, rgba(255, 255, 255, 0.1));
}

/* The docked chat column. The chat DOM is moved here as-is by
   mountSplitContentPane and restored on unmount. */
.segment-split-chat {
    flex: 0 0 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    background: var(--color-surface, #242629);
    border: 1px solid var(--color-stroke, rgba(255, 255, 255, 0.1));
    border-radius: 8px;
    overflow: hidden;
}

/* A split-mounted PDF/media iframe should fill its pane. */
.segment-split #splitContentPane .pdf-segment,
.segment-split #splitContentPane .pdf-segment iframe,
.segment-split #splitContentPane .media-segment,
.segment-split #splitContentPane .media-segment iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Immersive custom-app task: the iframe IS the segment — full-bleed (no parent
   40px padding/instructions) and filling all available height. */
.task-segment--customapp {
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.task-segment--customapp .task-customapp-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}
/* Immersive (standalone) custom-app task: the iframe fills the flex container
   rather than a fixed `vh`, so an instruction bar of any length shrinks the
   iframe instead of pushing the bottom of the canvas off-screen. The ancestor
   chain is height-bounded (segment-layout 100vh -> segment-main -> segment-content
   -> task-segment--customapp 100%), so 100% resolves correctly. Mirrors the
   split-pane rule below. */
.task-segment--customapp .task-customapp-frame,
.task-segment--customapp iframe.task-customapp-frame {
    width: 100%;
    height: 100% !important;
    border: none;
}
.task-segment--customapp .task-customapp-instructions {
    flex: 0 0 auto;
    padding: 10px 16px;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-paragraph, #94a1b2);
    border-bottom: 1px solid var(--color-stroke, rgba(255, 255, 255, 0.1));
}

/* A split-mounted custom-app iframe should fill its pane. The task wrapper must
   fill the scroll pane and lay out as a column so the app container can flex to
   fill the space below the instructions; the runtime also sets an inline
   height:<N>px for the standalone layout, so override it with !important when
   split-mounted. */
.segment-split #splitContentPane .task-segment {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.segment-split #splitContentPane .task-customapp-container {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
}
.segment-split #splitContentPane .task-customapp-frame,
.segment-split #splitContentPane iframe.task-customapp-frame {
    width: 100%;
    height: 100% !important;
    border: none;
}

@keyframes inlineCardSlideIn {
    0% { opacity: 0; transform: translateY(8px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Header: icon + title + timer + minimize */
.segment-inline-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--color-surface-alt, #2e3035);
    border-bottom: 1px solid var(--color-stroke, #2a2a3e);
    user-select: none;
    font-size: 12px;
}

.segment-inline-card-header > i {
    font-size: 11px;
    color: var(--color-highlight, #7f5af0);
}

.inline-card-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-headline, #fffffe);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.inline-card-timer {
    font-size: 12px;
    color: var(--color-paragraph);
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 4px;
}

.inline-card-minimize-btn {
    width: 22px;
    height: 22px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--color-paragraph);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    flex-shrink: 0;
    font-size: 10px;
}

.inline-card-minimize-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Content */
.segment-inline-card-content {
    padding: 8px 12px;
    max-height: 240px;
    overflow-y: auto;
}

/* Actions */
.segment-inline-card-actions {
    border-top: 1px solid var(--color-stroke, #2a2a3e);
}

.segment-inline-card-actions .segment-navigation {
    padding: 6px 12px;
    background: transparent;
    border-top: none;
}

/* Minimized — collapses to slim header bar */
.segment-inline-card.segment-inline-card-minimized .segment-inline-card-header {
    border-bottom: none;
}

/* Locked — visually dimmed; interactive controls are disabled in JS, but
   wheel/scroll and the minimize toggle remain functional so participants
   can scroll the card's inner overflow:auto area to see results and
   collapse/expand the card. */
.segment-inline-card.segment-inline-card-locked {
    opacity: 0.6;
}

/* Retired — a chained embedded segment that has completed and remains in
   the chat flow above the now-active card. Subtler than locked so it reads
   as conversation history rather than a disabled control. Auto-minimized
   on retire (see retireOverlayPanel) so the inner content's overflow:auto
   doesn't capture wheel events meant for the chat. The minimize button
   stays clickable so participants can expand the card to review it. */
.segment-inline-card.segment-inline-card-retired {
    opacity: 0.7;
}
.segment-inline-card.segment-inline-card-retired .segment-inline-card-header {
    background: var(--bg-secondary, rgba(0, 0, 0, 0.04));
}

/* Compact overrides for segment content inside inline cards */
.segment-inline-card .selection-segment,
.segment-inline-card .ranking-segment,
.segment-inline-card .input-segment,
.segment-inline-card .task-segment {
    padding: 0;
}

.segment-inline-card .selection-prompt {
    font-size: 13px;
    margin-bottom: 6px;
}

.segment-inline-card .selection-option {
    padding: 6px 10px;
    gap: 8px;
    border-radius: 8px;
}

.segment-inline-card .selection-option label {
    font-size: 13px;
}

.segment-inline-card .selection-slider-container {
    padding: 2px 0;
}

.segment-inline-card .slider-value {
    font-size: 15px;
}

.segment-inline-card .slider-value-display {
    margin-bottom: 2px;
}

.segment-inline-card .slider-bound {
    font-size: 11px;
}

.segment-inline-card .segment-nav-btn {
    padding: 6px 16px;
    font-size: 12px;
}

.segment-inline-card .ranking-item {
    padding: 6px 10px;
    font-size: 13px;
}

/* =====================================
   ATTENTION CHECK SEGMENT
   ===================================== */

.attention-check-segment {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    text-align: center;
}

.attention-check-segment h3 {
    margin-bottom: 16px;
    font-size: 20px;
    color: var(--color-headline);
}

/* Survey-mode attention check behaves like a regular survey segment —
   full card width, left-aligned, scrollable. The 600px centered column
   above is sized for the face/captcha modes' camera preview. */
.attention-check-segment.attention-check-survey {
    /* margin:0 (not auto): inside the flex-column .segment-content, auto
       cross-axis margins defeat align-items:stretch and shrink-wrap the
       survey to its min content width. */
    margin: 0;
    width: 100%;
    max-width: none;
    text-align: left;
    overflow-y: auto;
    flex: 1;
    min-height: 0;
}

.attention-check-segment.attention-check-survey h3 {
    text-align: center;
}

.segment-content:has(.attention-check-survey) {
    overflow-y: auto;
}

.camera-preview-container {
    width: 100%;
    max-width: 480px;
    margin: 16px auto;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    position: relative;
}

.camera-preview-container video {
    width: 100%;
    display: block;
    transform: scaleX(-1);
}

#attention-check-status {
    font-size: 16px;
    margin: 12px 0;
    color: var(--color-headline);
}

#attention-check-error {
    color: var(--color-error, #e74c3c);
    padding: 16px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 8px;
    margin-top: 12px;
    text-align: center;
}

.presence-progress-bar {
    height: 8px;
    background: var(--color-surface-alt, #eee);
    border-radius: 4px;
    overflow: hidden;
    margin: 8px auto;
    max-width: 300px;
}

.presence-progress-fill {
    height: 100%;
    background: var(--color-button, #7f5af0);
    border-radius: 4px;
    transition: width 0.1s linear;
}

.presence-timer {
    font-size: 13px;
    color: var(--color-paragraph);
}

.liveness-current-action {
    font-size: 22px;
    font-weight: 600;
    margin: 12px 0;
    color: var(--color-button, #7f5af0);
}

.liveness-time-remaining {
    font-size: 14px;
    color: var(--color-paragraph);
    margin-bottom: 12px;
}

.liveness-action-list {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 8px;
}

.liveness-action-item {
    font-size: 13px;
    padding: 4px 8px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.liveness-action-item.action-done {
    color: var(--color-success, #27ae60);
}

.liveness-action-item.action-current {
    color: var(--color-button, #7f5af0);
    font-weight: 600;
}

.liveness-action-item.action-pending {
    color: var(--color-paragraph);
    opacity: 0.6;
}

.attention-check-feedback {
    margin-top: 16px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.feedback-correct {
    color: var(--color-success, #27ae60);
    padding: 4px 0;
}

.feedback-incorrect {
    color: var(--color-error, #e74c3c);
    padding: 4px 0;
}

/* =====================================
   BACKGROUND FACE MONITORING
   ===================================== */

.face-monitor-indicator {
    position: fixed;
    bottom: 16px;
    right: 16px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    z-index: 1000;
    transition: background-color 0.3s;
}

.face-monitor-indicator.active {
    background-color: var(--color-success, #27ae60);
}

.face-monitor-indicator.absent {
    background-color: var(--color-error, #e74c3c);
}

.face-monitor-warning-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.face-monitor-warning-box {
    background: var(--color-surface, #242629);
    border-radius: 12px;
    padding: 32px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.face-monitor-warning-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.face-monitor-warning-box h3 {
    margin-bottom: 8px;
    font-size: 20px;
    color: var(--color-headline);
}

.face-monitor-warning-box p {
    color: var(--color-paragraph);
    margin-bottom: 8px;
}

/* ── Processor Feedback Panel (communicator-side) ── */
.processor-feedback-panel {
    padding: 8px 12px;
    background: var(--surface-alt, #f8f9fa);
    border-top: 1px solid var(--border, #ddd);
    display: none;
}

.processor-feedback-panel .feedback-item {
    padding: 8px;
    background: white;
    border-radius: 6px;
    border-left: 3px solid var(--primary, #4a90d9);
}

.processor-feedback-panel .feedback-attribution {
    font-size: 0.8rem;
    color: var(--text-secondary, #666);
    margin-bottom: 4px;
    display: block;
}

.processor-feedback-panel .feedback-content {
    margin: 6px 0;
}

.processor-feedback-panel .feedback-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.processor-feedback-panel .feedback-actions button {
    padding: 4px 12px;
    border-radius: 4px;
    border: 1px solid var(--border, #ddd);
    cursor: pointer;
    font-size: 0.85rem;
}

.btn-accept-feedback {
    background: var(--success, #28a745);
    color: white;
    border-color: var(--success, #28a745) !important;
}

.btn-dismiss-feedback {
    background: #f0f0f0;
    color: #333;
    border-color: #ccc !important;
}

.btn-dismiss-feedback:hover {
    background: #e0e0e0;
}

/* =====================================
   MEDIATOR PANEL  (PRD 10.5.1)
   Used for the dedicated mediator UI and for experimenter observer mode.
   ===================================== */

.mediator-segment {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    color: var(--color-headline);
}

.mediator-panel {
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    padding: 16px;
}

.mediator-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--color-stroke);
}

.mediator-banner .role-badge.mediator {
    background: var(--color-highlight);
    color: var(--color-button-text);
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.mediator-banner .chamber-badge {
    color: var(--color-paragraph);
    font-size: 0.88rem;
}

.mediator-banner .observer-pill {
    background: var(--color-warning);
    color: #1a1a1a;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.74rem;
    font-weight: 600;
    margin-left: auto;
}

.mediator-banner .observer-pill[hidden] {
    display: none;
}

.mediator-body {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
}

@media (max-width: 900px) {
    .mediator-body {
        grid-template-columns: 1fr;
    }
}

.mediator-left,
.mediator-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.mediator-chat-log {
    background: var(--color-surface-alt);
    border: 1px solid var(--color-stroke-light);
    border-radius: 8px;
    padding: 10px 12px;
    max-height: 48vh;
    overflow-y: auto;
    font-size: 0.9rem;
    line-height: 1.4;
}

.mediator-chat-log:empty::before {
    content: 'No messages yet.';
    color: var(--color-secondary);
    font-style: italic;
}

.mediator-chat-log .chat-log-row {
    display: flex;
    gap: 8px;
    padding: 4px 0;
}

.mediator-chat-log .chat-log-row .sender {
    color: var(--color-paragraph);
    font-weight: 600;
    flex: 0 0 auto;
}

.mediator-chat-log .chat-log-row .body {
    color: var(--color-headline);
    word-break: break-word;
}

/* System notifications (e.g. peer advanced to next segment) — muted +
   italic to differentiate from participant messages. */
.mediator-chat-log .chat-log-row.sender-system {
    color: var(--color-secondary);
    font-style: italic;
    font-size: 0.86rem;
    padding: 6px 0;
    border-top: 1px dashed var(--color-stroke-light);
    border-bottom: 1px dashed var(--color-stroke-light);
}

.mediator-chat-log .chat-log-row.sender-system .sender,
.mediator-chat-log .chat-log-row.sender-system .body {
    color: var(--color-secondary);
}

.mediator-participants h4,
.mediator-restrictions h4 {
    margin: 0 0 8px 0;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-secondary);
}

#mediatorParticipantList,
#mediatorRestrictionList {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#mediatorParticipantList li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background: var(--color-surface-alt);
    border-radius: 6px;
}

.mediator-broadcast-composer {
    display: flex;
    gap: 8px;
    align-items: flex-end;
}

.mediator-broadcast-composer textarea {
    flex: 1;
    background: var(--color-surface-alt);
    color: var(--color-headline);
    border: 1px solid var(--color-stroke);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.92rem;
    resize: vertical;
    min-height: 44px;
}

.mediator-broadcast-composer textarea:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.mediator-broadcast-composer .btn-primary {
    background: var(--color-button);
    color: var(--color-button-text);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    cursor: pointer;
}

.mediator-broadcast-composer .btn-primary:hover {
    background: var(--color-button-hover);
}

/* Observer mode hides write-side affordances. */
.mediator-segment.observer-mode .mediator-broadcast-composer,
.mediator-segment.observer-mode .participant-kebab {
    display: none !important;
}

.restriction-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: rgba(245, 158, 11, 0.16);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: var(--color-warning);
    border-radius: 6px;
    font-size: 0.86rem;
}

.restriction-badge .btn-link {
    background: transparent;
    border: none;
    color: var(--color-highlight);
    cursor: pointer;
    padding: 0;
    font-size: 0.86rem;
}

.restriction-badge .btn-link:hover {
    text-decoration: underline;
}

.participant-kebab {
    position: relative;
    background: transparent;
    border: 1px solid var(--color-stroke);
    color: var(--color-headline);
    border-radius: 6px;
    padding: 2px 8px;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.participant-kebab:hover {
    background: var(--color-surface);
}

.participant-kebab-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--color-surface);
    border: 1px solid var(--color-stroke);
    border-radius: 8px;
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    z-index: 50;
    min-width: 160px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

.participant-kebab-menu[hidden] {
    display: none;
}

.participant-kebab-action {
    background: transparent;
    border: none;
    color: var(--color-headline);
    text-align: left;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.88rem;
}

.participant-kebab-action:hover {
    background: var(--color-surface-alt);
}

/* Mediator modal (prompt / disable). */
.mediator-modal.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}

.mediator-modal .modal-dialog {
    background: var(--color-surface);
    color: var(--color-headline);
    border: 1px solid var(--color-stroke);
    border-radius: 12px;
    padding: 20px 22px;
    min-width: 360px;
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mediator-modal .modal-dialog h3 {
    margin: 0;
    font-size: 1.05rem;
}

.mediator-modal .modal-target {
    color: var(--color-paragraph);
    font-size: 0.88rem;
}

.mediator-modal label {
    color: var(--color-paragraph);
    font-size: 0.82rem;
    margin-top: 4px;
}

.mediator-modal textarea,
.mediator-modal input[type="text"],
.mediator-modal input[type="number"],
.mediator-modal select {
    background: var(--color-surface-alt);
    color: var(--color-headline);
    border: 1px solid var(--color-stroke);
    border-radius: 8px;
    padding: 8px 10px;
    font-family: inherit;
    font-size: 0.92rem;
}

.mediator-modal textarea:focus,
.mediator-modal input:focus,
.mediator-modal select:focus {
    outline: none;
    border-color: var(--color-highlight);
}

.mediator-modal .modal-buttons {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.mediator-modal .btn-primary,
.mediator-modal .btn-secondary {
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.9rem;
}

.mediator-modal .btn-primary {
    background: var(--color-button);
    color: var(--color-button-text);
}

.mediator-modal .btn-primary:hover {
    background: var(--color-button-hover);
}

.mediator-modal .btn-secondary {
    background: var(--color-surface-alt);
    color: var(--color-headline);
    border: 1px solid var(--color-stroke);
}

.mediator-modal .btn-secondary:hover {
    background: var(--color-surface);
}

.observer-error-banner {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-error);
    color: var(--color-button-text);
    padding: 10px 18px;
    border-radius: 8px;
    z-index: 300;
    font-weight: 600;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
}

/* ================================================================
   SOCIAL FEED SEGMENT (type 'social')
   Deliberately mimics consumer photo-app vernacular (system fonts,
   light cards) for ecological validity — intentionally not themed
   to the app's dark palette. layout-instagram / layout-facebook.
   ================================================================ */

.social-seg {
    --sf-bg: #fafafa;
    --sf-card: #ffffff;
    --sf-ink: #262626;
    --sf-ink-2: #737373;
    --sf-ink-3: #a8a8a8;
    --sf-line: #dbdbdb;
    --sf-blue: #0095f6;
    --sf-red: #ed4956;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: var(--sf-ink);
    background: var(--sf-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    padding: 24px 12px 48px;
    border-radius: 12px;
    max-height: 72vh;
    overflow-y: auto;
    width: 100%;
    box-sizing: border-box;
}
.social-seg *, .social-seg *::before, .social-seg *::after { box-sizing: border-box; }

.social-seg .sf-post {
    background: var(--sf-card);
    border: 1px solid var(--sf-line);
    border-radius: 12px;
    overflow: hidden;
    width: min(480px, 100%);
    flex: 0 0 auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .04);
}

.social-seg .sf-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
}
.social-seg .sf-avatar {
    width: 32px; height: 32px;
    border-radius: 50%;
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    user-select: none;
}
.social-seg .sf-avatar-sm { width: 28px; height: 28px; font-size: 12px; }
.social-seg .sf-uname { font-weight: 600; margin-right: 6px; }
.social-seg .sf-head-time { color: var(--sf-ink-3); }
.social-seg .sf-head-time::before { content: "•"; margin-right: 6px; }
.social-seg .sf-follow {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--sf-blue);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 8px;
    font-family: inherit;
}
.social-seg .sf-follow.following { color: var(--sf-ink); }

.social-seg .sf-media {
    position: relative;
    width: 100%;
    aspect-ratio: 5 / 4;
    background: #10131c;
    cursor: pointer;
    user-select: none;
    overflow: hidden;
}
.social-seg .sf-photo { width: 100%; height: 100%; display: block; object-fit: cover; }
.social-seg .sf-burst {
    position: absolute;
    top: 50%; left: 50%;
    width: 96px; height: 96px;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
    color: #fff;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, .35));
}
.social-seg .sf-burst.go { animation: sf-burst .9s cubic-bezier(.17, .89, .32, 1.28); }
@keyframes sf-burst {
    0%   { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    15%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    30%  { transform: translate(-50%, -50%) scale(.95); }
    45%  { transform: translate(-50%, -50%) scale(1); opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(.2); opacity: 0; }
}

.social-seg .sf-actions {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 10px 14px 0;
}
.social-seg .sf-abtn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--sf-ink);
    padding: 2px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: inherit;
    font-size: 14px;
}
.social-seg .sf-abtn svg { width: 24px; height: 24px; display: block; }
.social-seg .sf-abtn:active { opacity: .5; }
.social-seg .sf-abtn .hi { display: none; color: var(--sf-red); }
.social-seg .sf-abtn.on .hi { display: block; }
.social-seg .sf-abtn.on .lo { display: none; }
.social-seg .sf-save.on .hi { color: var(--sf-ink); }
.social-seg .sf-spacer { flex: 1; }
.social-seg .layout-instagram .sf-abtn-label,
.social-seg.layout-instagram .sf-abtn-label { display: none; }

.social-seg .sf-likes-line { font-weight: 600; padding: 8px 14px 0; }
.social-seg .sf-caption { padding: 6px 14px 0; word-wrap: break-word; }
.social-seg .sf-view-all {
    background: none;
    border: none;
    color: var(--sf-ink-2);
    font-size: 14px;
    cursor: pointer;
    padding: 2px 14px 8px;
    display: block;
    text-align: left;
    font-family: inherit;
}
.social-seg .sf-comments { padding: 6px 14px 4px; }
.social-seg .sf-crow { display: flex; gap: 10px; margin-bottom: 12px; }
.social-seg .sf-cbody { flex: 1 1 auto; min-width: 0; }
.social-seg .sf-ctext { word-wrap: break-word; }
.social-seg .sf-cmeta {
    display: flex;
    gap: 14px;
    margin-top: 4px;
    font-size: 12px;
    color: var(--sf-ink-2);
    align-items: center;
}
.social-seg .sf-cmeta button {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    color: var(--sf-ink-2);
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.social-seg .sf-replies { padding-left: 38px; }
.social-seg .sf-replies .sf-crow { margin-bottom: 10px; }
.social-seg .sf-new { animation: sf-slidein .3s ease-out; }
@keyframes sf-slidein {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.social-seg .sf-reply-chip {
    display: none;
    align-items: center;
    gap: 8px;
    background: #efefef;
    color: var(--sf-ink-2);
    font-size: 12px;
    padding: 6px 14px;
    border-top: 1px solid var(--sf-line);
}
.social-seg .sf-reply-chip.show { display: flex; }
.social-seg .sf-reply-chip button {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--sf-ink-2);
    font-size: 16px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.social-seg .sf-composer {
    display: flex;
    align-items: center;
    gap: 10px;
    border-top: 1px solid var(--sf-line);
    padding: 10px 14px;
}
.social-seg .sf-composer input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: var(--sf-ink);
}
.social-seg .sf-composer input::placeholder { color: var(--sf-ink-3); }
.social-seg .sf-post-btn {
    background: none;
    border: none;
    color: var(--sf-blue);
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    opacity: .35;
    pointer-events: none;
    padding: 4px;
    font-family: inherit;
}
.social-seg .sf-post-btn.ready { opacity: 1; pointer-events: auto; }

.sf-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(8px);
    background: #262626;
    color: #fff;
    font-size: 13px;
    padding: 9px 16px;
    border-radius: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s, transform .25s;
    z-index: 3000;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.sf-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (prefers-reduced-motion: reduce) {
    .social-seg .sf-burst.go, .social-seg .sf-new { animation: none; }
    .social-seg .sf-burst.go { opacity: 0; }
    .sf-toast { transition: none; }
}

/* ── facebook layout variant ─────────────────────────────────────
   Same data flow and recorded actions; presentation only. Caption
   sits above the image (DOM order set by the runtime), the action
   row is a labeled three-button bar, comments render as bubbles. */

.social-seg.layout-facebook { background: #f0f2f5; }
.social-seg.layout-facebook .sf-post { border-radius: 8px; width: min(560px, 100%); }
.social-seg.layout-facebook .sf-caption { padding: 2px 14px 10px; }
.social-seg.layout-facebook .sf-caption .sf-uname { display: none; }
.social-seg.layout-facebook .sf-media { aspect-ratio: 16 / 10; cursor: default; }
.social-seg.layout-facebook .sf-likes-line {
    font-weight: 400;
    color: var(--sf-ink-2);
    font-size: 13px;
    padding: 8px 14px;
}
.social-seg.layout-facebook .sf-likes-line::before { content: "👍 "; }
.social-seg.layout-facebook .sf-actions {
    border-top: 1px solid var(--sf-line);
    border-bottom: 1px solid var(--sf-line);
    margin: 0 14px;
    padding: 4px 0;
    gap: 0;
}
.social-seg.layout-facebook .sf-abtn {
    flex: 1;
    justify-content: center;
    color: var(--sf-ink-2);
    font-weight: 600;
    padding: 8px 0;
    border-radius: 6px;
}
.social-seg.layout-facebook .sf-abtn:hover { background: #f0f2f5; }
.social-seg.layout-facebook .sf-abtn svg { width: 18px; height: 18px; }
.social-seg.layout-facebook .sf-abtn.on { color: #1877f2; }
.social-seg.layout-facebook .sf-abtn.on .hi { color: #1877f2; }
.social-seg.layout-facebook .sf-abtn-label { display: inline; }
.social-seg.layout-facebook .sf-spacer { display: none; }
.social-seg.layout-facebook .sf-burst { display: none; }
.social-seg.layout-facebook .sf-follow { color: #1877f2; }
.social-seg.layout-facebook .sf-view-all { padding-top: 8px; }
.social-seg.layout-facebook .sf-ctext {
    background: #f0f2f5;
    border-radius: 14px;
    padding: 7px 12px;
    display: inline-block;
}
.social-seg.layout-facebook .sf-ctext .sf-uname { display: block; margin: 0 0 1px; font-size: 13px; }
.social-seg.layout-facebook .sf-cmeta { padding-left: 12px; }
.social-seg.layout-facebook .sf-reply-chip { border-top: none; }
.social-seg.layout-facebook .sf-composer { border-top: none; padding-top: 4px; }
.social-seg.layout-facebook .sf-composer input {
    background: #f0f2f5;
    border-radius: 18px;
    padding: 8px 14px;
}
.social-seg.layout-facebook .sf-post-btn { color: #1877f2; }

/* ── full-viewport platform takeover ─────────────────────────────
   The social segment covers the entire screen (mock platform chrome
   replaces the Carrier segment UI). Advancement is time-based; the
   remaining time shows as an unobtrusive pill in the top bar. */

.social-platform {
    position: fixed;
    inset: 0;
    z-index: 500;
    display: flex;
    flex-direction: column;
    background: #fafafa;
    color: #262626;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
.social-platform.layout-facebook { background: #f0f2f5; }

.social-platform .sp-topbar {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 10px 20px;
    background: #ffffff;
    border-bottom: 1px solid #dbdbdb;
    flex: 0 0 auto;
}
.social-platform .sp-brand {
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.5px;
    user-select: none;
    margin-right: auto;
}
.social-platform.layout-facebook .sp-topbar {
    background: #1877f2;
    border-bottom: none;
    color: #fff;
}
.social-platform.layout-facebook .sp-brand {
    font-family: inherit;
    font-style: normal;
    font-weight: 800;
    letter-spacing: -0.8px;
    text-transform: lowercase;
}
.social-platform .sp-icons { display: flex; gap: 18px; opacity: .9; }
.social-platform .sp-icons svg { display: block; }

.social-platform .sp-timer {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(0, 0, 0, .06);
    color: inherit;
    user-select: none;
}
.social-platform.layout-facebook .sp-timer { background: rgba(255, 255, 255, .22); }
.social-platform .sp-timer.warn { background: #f59e0b; color: #fff; }

.social-platform .sp-continue {
    background: none;
    border: 1px solid currentColor;
    border-radius: 999px;
    color: inherit;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    cursor: pointer;
}

.social-platform .sp-feed {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;      /* override the inline-card .social-seg cap */
    border-radius: 0;
}

/* neutral stub rendered in the (covered) standard layout underneath */
.social-seg-underlay { min-height: 40vh; }
