/* Component Styles */

/* Progress Stepper - Elegant Premium Design */
progress-stepper {
    display: block;
    margin-bottom: 24px;
}

.progress-stepper-theme {
    position: absolute;
    top: -10px;
    right: 0;
    z-index: 2;
}

.progress-stepper-header {
    position: absolute;
    z-index: 2;
}

.progress-stepper-theme .theme-toggle-btn {
    width: 32px;
    height: 32px;
}

.progress-stepper-container {
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    padding: 20px 16px;
    border-bottom: 1px solid var(--gold-border);
    position: relative;
    z-index: 100;
    top: 0;
    box-shadow: var(--shadow-md);
}

@media (max-width: 767px) {
    .progress-stepper-container {
        padding: 12px 8px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.progress-stepper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 0;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    position: relative;
    gap: 0;
    overflow: visible;
}

.step-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    min-width: 0;
}

.step-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

/* Clickable step styling */
.step-content.clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 4px;
    border-radius: 8px;
}

.step-content.clickable:hover {
    background: rgba(245, 200, 106, 0.1);
    transform: translateY(-2px);
}

.step-content.clickable:hover .step-indicator {
    transform: scale(1.05);
}

.step-content.clickable:hover .step-label {
    color: #F5C86A;
}

.step-indicator {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
}

.step-indicator.completed {
    background: var(--primary-gradient);
    color: var(--text-on-accent);
    box-shadow: 0 4px 16px rgba(245, 200, 106, 0.4), 0 0 0 4px rgba(245, 200, 106, 0.1);
    transform: scale(1);
}

.step-indicator.active {
    background: var(--primary-gradient);
    color: var(--text-on-accent);
    box-shadow: 0 6px 24px rgba(245, 200, 106, 0.5), 0 0 0 6px rgba(245, 200, 106, 0.15);
    transform: scale(1.1);
    animation: pulse-active 2s ease-in-out infinite;
}

.step-pulse {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--primary-gradient);
    opacity: 0;
    animation: ripple 2s ease-out infinite;
}

@keyframes pulse-active {

    0%,
    100% {
        box-shadow: 0 6px 24px rgba(245, 200, 106, 0.5), 0 0 0 6px rgba(245, 200, 106, 0.15);
    }

    50% {
        box-shadow: 0 8px 32px rgba(245, 200, 106, 0.6), 0 0 0 8px rgba(245, 200, 106, 0.2);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }

    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

.step-indicator.pending {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border: 2px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.step-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.step-checkmark svg {
    width: 20px;
    height: 20px;
    stroke: var(--text-on-accent);
}

.step-number {
    font-weight: 700;
    letter-spacing: -0.02em;
}

.step-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    transition: all 0.3s ease;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.step-label.active {
    color: var(--gold-primary);
    font-weight: 700;
    text-shadow: 0 0 8px rgba(245, 200, 106, 0.3);
}

.step-label.completed {
    color: var(--text-secondary);
}

.step-connector {
    position: absolute;
    top: 22px;
    left: calc(50% + 22px);
    right: calc(-50% + 22px);
    height: 2px;
    z-index: 1;
    min-width: 20px;
    pointer-events: none;
}

.connector-line {
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.step-connector.completed .connector-line {
    background: linear-gradient(90deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    box-shadow: 0 0 8px rgba(245, 200, 106, 0.4);
}

.step-connector.completed .connector-line::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@media (min-width: 768px) {
    .progress-stepper-container {
        padding: 24px 20px;
    }

    .step-indicator {
        width: 52px;
        height: 52px;
        font-size: 18px;
    }

    .step-label {
        font-size: 12px;
    }

    .step-connector {
        top: 26px;
        left: calc(50% + 26px);
        right: calc(-50% + 26px);
    }
}

@media (max-width: 767px) {
    .progress-stepper-container {
        padding: 16px 8px;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .progress-stepper {
        gap: 0;
        padding: 0 4px;
        justify-content: space-between;
        width: 100%;
    }

    .step-wrapper {
        min-width: 0;
        flex: 1 1 0;
        position: relative;
    }

    .step-indicator {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }

    .step-label {
        font-size: 8px;
        max-width: 45px;
        white-space: normal;
        line-height: 1.1;
        word-break: break-word;
        hyphens: auto;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .step-connector {
        top: 16px;
        left: calc(50% + 16px);
        right: calc(-50% + 16px);
        min-width: 8px;
    }

    .step-checkmark svg {
        width: 14px;
        height: 14px;
    }

    .step-content {
        gap: 4px;
        min-width: 45px;
    }
}

/* Extra small mobile devices (320px - 375px) */
@media (max-width: 375px) {
    .progress-stepper-container {
        padding: 12px 4px;
    }

    .progress-stepper {
        padding: 0 2px;
        width: 100%;
    }

    .step-indicator {
        width: 28px;
        height: 28px;
        font-size: 11px;
    }

    .step-label {
        font-size: 7px;
        max-width: 38px;
        line-height: 1.0;
        letter-spacing: 0.02em;
    }

    .step-connector {
        top: 14px;
        left: calc(50% + 14px);
        right: calc(-50% + 14px);
        min-width: 4px;
    }

    .step-content {
        gap: 3px;
        min-width: 38px;
    }

    .step-checkmark svg {
        width: 12px;
        height: 12px;
    }
}

/* Chat Screen - Premium Design */
.premium-chat {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: var(--surface-base);
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
    position: relative;
}

.premium-header {
    background: var(--surface-base);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* Back Button - Generic style for all screens */
.btn-back-premium,
.chat-back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 16px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
    flex-shrink: 0;
}

.btn-back-premium:hover,
.chat-back-btn:hover {
    background: rgba(245, 200, 106, 0.15);
    border-color: rgba(245, 200, 106, 0.3);
    color: #F5C86A;
    transform: translateX(-2px);
}

.btn-back-premium .back-arrow,
.chat-back-btn .back-arrow {
    font-size: 18px;
    font-weight: 700;
}

.btn-back-premium .back-text,
.chat-back-btn .back-text {
    font-size: 14px;
}

.chat-back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.back-arrow {
    font-size: 18px;
    line-height: 1;
}

.back-text {
    font-size: 15px;
}

/* AI Case Assistant Card */
.ai-assistant-card {
    flex: 1;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    border-radius: 16px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.3);
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

@media (min-width: 768px) {
    .ai-assistant-card {
        padding: 12px 16px;
        gap: 12px;
    }
}

.ai-brain-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    flex-shrink: 0;
}

.ai-brain-icon svg {
    width: 18px;
    height: 18px;
}

.ai-card-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.ai-card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-on-accent);
    margin: 0;
    line-height: 1.2;
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ai-card-subtitle {
    font-size: 12px;
    color: rgba(11, 11, 12, 0.8);
    font-weight: 500;
    margin: 0;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 767px) {
    .ai-brain-icon {
        width: 28px;
        height: 28px;
    }

    .ai-brain-icon svg {
        width: 16px;
        height: 16px;
    }

    .ai-card-title {
        font-size: 13px;
    }

    .ai-card-subtitle {
        font-size: 10px;
    }
}

@media (max-width: 375px) {
    .ai-brain-icon {
        width: 24px;
        height: 24px;
    }

    .ai-brain-icon svg {
        width: 14px;
        height: 14px;
    }

    .ai-card-title {
        font-size: 12px;
    }

    .ai-card-subtitle {
        font-size: 9px;
    }
}

@media (max-width: 320px) {
    .ai-brain-icon {
        width: 20px;
        height: 20px;
    }

    .ai-brain-icon svg {
        width: 12px;
        height: 12px;
    }

    .ai-card-subtitle {
        display: none;
    }
}

/* Voice Button in Header (Inside AI Card) */
.voice-btn-header {
    background: rgba(11, 11, 12, 0.15);
    border: 1px solid rgba(11, 11, 12, 0.2);
    border-radius: 10px;
    padding: 6px 10px;
    color: var(--text-on-accent);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}

.voice-btn-header:hover {
    background: rgba(11, 11, 12, 0.25);
    border-color: rgba(11, 11, 12, 0.3);
}

.voice-btn-header.recording {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
    }
}

.voice-btn-header .mic-icon-small {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.voice-btn-header span {
    white-space: nowrap;
}

.chat-header-center {
    display: flex;
    align-items: center;
    gap: 12px;
}

.chloe-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(245, 200, 106, 0.3) 0%, rgba(245, 200, 106, 0.1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 2px solid rgba(245, 200, 106, 0.3);
}

.chloe-avatar::before {
    content: 'C';
    font-size: 20px;
    font-weight: 700;
    color: var(--gold-primary);
}

.avatar-glow {
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 200, 106, 0.4) 0%, transparent 70%);
    animation: avatarPulse 2s ease-in-out infinite;
    z-index: -1;
}

@keyframes avatarPulse {

    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

.chloe-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.chloe-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.chloe-status {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
}

.chat-header {
    background: var(--surface-card);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding: 18px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.chat-back-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 22px;
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: all 0.2s ease;
    font-weight: 500;
}

.chat-back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-header-center {
    flex: 1;
    text-align: center;
}

.chat-header-center h2 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.01em;
}

.chat-header-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    min-height: 0;
}

/* Chat Widget */
ai-chat-widget {
    display: block;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--surface-base);
    scroll-behavior: smooth;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .chat-messages {
        padding: 20px 16px;
        gap: 16px;
    }
}

.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.message {
    max-width: 85%;
    padding: 14px 18px;
    border-radius: 18px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    line-height: 1.5;
    font-size: 15px;
    animation: messageSlideIn 0.3s ease-out;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .message {
        max-width: 90%;
        padding: 12px 16px;
        font-size: 14px;
    }
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message.user {
    align-self: flex-end;
    background: var(--primary-gradient);
    color: var(--text-on-accent);
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.2);
    border-radius: 18px 18px 4px 18px;
}

/* Message Wrapper for AI messages with icon on left */
.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 16px;
    width: 100%;
    max-width: 100%;
}

.ai-message-icon-left {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 4px;
}

.ai-message-icon-left svg {
    width: 16px;
    height: 16px;
}

.message.ai,
.premium-ai-message {
    align-self: flex-start;
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-weight: 400;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    position: relative;
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    max-width: calc(100% - 34px);
    flex: 1;
}

.premium-ai-message p {
    margin: 0;
    line-height: 1.5;
}

.message.user,
.selected-response {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--text-on-accent);
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.3);
    border-radius: 20px 20px 4px 20px;
    padding: 12px 16px;
    max-width: 85%;
}

.voice-transcript {
    align-self: flex-end;
    background: rgba(245, 200, 106, 0.15);
    color: var(--text-primary);
    font-weight: 500;
    border: 1px solid rgba(245, 200, 106, 0.3);
    border-radius: 20px 20px 4px 20px;
    padding: 12px 16px;
    max-width: 85%;
    font-style: italic;
    opacity: 0.8;
}

.voice-transcript p {
    margin: 0;
}

.selected-response p {
    margin: 0;
}

.message p {
    margin: 0;
    line-height: 1.5;
}

/* Options Container - appears below message, not inside */
.message-options-container {
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
    padding-left: 34px;
    /* Align with message text (icon width + gap) */
    box-sizing: border-box;
}

.message-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
    max-width: calc(100% - 34px);
    box-sizing: border-box;
}

@media (max-width: 480px) {
    .message-options {
        gap: 8px;
    }

    .option-btn {
        padding: 10px 14px;
        font-size: 14px;
    }
}

@media (max-width: 375px) {
    .message-wrapper {
        gap: 6px;
    }

    .ai-message-icon-left {
        width: 18px;
        height: 18px;
    }

    .ai-message-icon-left svg {
        width: 12px;
        height: 12px;
    }

    .premium-ai-message {
        max-width: calc(100% - 24px);
        padding: 12px 14px;
        font-size: 13px;
    }

    .message-options-container {
        padding-left: 24px;
    }

    .message-options {
        grid-template-columns: 1fr;
        gap: 8px;
        max-width: calc(100% - 24px);
    }

    .option-btn {
        padding: 12px 16px;
        font-size: 14px;
        width: 100%;
    }
}

.option-btn {
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 500;
    border-radius: 16px;
    white-space: nowrap;
    transition: all 0.2s ease;
    background: var(--surface-card);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.option-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.option-btn.selected {
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--text-on-accent);
    border-color: transparent;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.3);
}

.message.typing {
    background: var(--surface-card);
    font-style: italic;
    color: var(--text-muted);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    font-weight: 400;
}

.chat-input-container {
    padding: 16px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: var(--surface-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    width: 100%;
    box-sizing: border-box;
    flex-shrink: 0;
}

.chat-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.premium-input {
    flex-direction: column;
    align-items: center;
    padding: 32px 20px;
    gap: 16px;
}

/* Large Microphone Button - Primary CTA */
.microphone-btn-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(245, 200, 106, 0.4);
    position: relative;
    overflow: visible;
}

.microphone-btn-large:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(245, 200, 106, 0.5);
}

.microphone-btn-large:active:not(:disabled) {
    transform: scale(0.95);
}

.microphone-btn-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.microphone-btn-large.recording {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
    animation: recordingPulse 1.5s ease-in-out infinite;
}

@keyframes recordingPulse {

    0%,
    100% {
        box-shadow: 0 8px 24px rgba(239, 68, 68, 0.5);
    }

    50% {
        box-shadow: 0 8px 32px rgba(239, 68, 68, 0.8);
    }
}

.mic-icon-wrapper {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mic-icon {
    width: 32px;
    height: 32px;
    stroke: var(--text-on-accent);
    stroke-width: 2;
    fill: none;
}

.microphone-btn-large.recording .mic-icon {
    stroke: #ffffff;
    animation: micPulse 0.8s ease-in-out infinite;
}

@keyframes micPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

.mic-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-on-accent);
    letter-spacing: 0.02em;
}

.microphone-btn-large.recording .mic-label {
    color: #ffffff;
}

.text-input-wrapper {
    width: 100%;
    max-width: 600px;
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Speech Visualization */
.speech-visualization {
    align-self: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    margin: 20px 0;
}

.speech-waves {
    display: flex;
    gap: 6px;
    align-items: center;
    height: 40px;
}

.wave {
    width: 4px;
    height: 20px;
    background: var(--gold-primary);
    border-radius: 2px;
    animation: waveAnimation 1.2s ease-in-out infinite;
}

.wave:nth-child(1) {
    animation-delay: 0s;
}

.wave:nth-child(2) {
    animation-delay: 0.2s;
    height: 32px;
}

.wave:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes waveAnimation {

    0%,
    100% {
        transform: scaleY(0.5);
        opacity: 0.6;
    }

    50% {
        transform: scaleY(1);
        opacity: 1;
    }
}

.speech-hint {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.speech-preview {
    opacity: 0.7;
    animation: previewFadeIn 0.3s ease-out;
}

@keyframes previewFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 0.7;
        transform: translateY(0);
    }
}

/* AI Thinking Animation */
.message.thinking {
    background: var(--surface-card);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 16px 20px;
}

.thinking-dots {
    display: flex;
    gap: 6px;
    align-items: center;
}

.thinking-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gold-primary);
    animation: thinkingDot 1.4s ease-in-out infinite;
}

.thinking-dots span:nth-child(1) {
    animation-delay: 0s;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes thinkingDot {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    border-radius: 28px;
    background: var(--surface-base);
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 400;
    font-family: 'Inter', sans-serif;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.chat-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(245, 200, 106, 0.1);
}

.chat-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.chat-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-voice-btn,
.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--text-on-accent);
    border: none;
    cursor: pointer;
    display: inline-grid;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: visible;
}

.chat-send-btn svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 3;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    position: relative;
    z-index: 10;
}

.chat-voice-btn:hover,
.chat-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.3);
}

.chat-voice-btn:active,
.chat-send-btn:active {
    transform: scale(0.95);
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.recording-indicator {
    animation: blink 1s infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Pain Mapping Screen - Premium Full-Screen Design */
.premium-pain-mapping {
    height: 100vh;
    min-height: 100vh;
    background: var(--surface-base);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

@supports (-webkit-touch-callout: none) {
    .premium-pain-mapping {
        height: -webkit-fill-available;
        min-height: -webkit-fill-available;
    }
}

.progress-stepper-container {
    flex-shrink: 0;
}

.pain-mapping-container.fullscreen {
    max-width: 100%;
    width: 100%;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

/* 3D Mannequin Container */
.mannequin-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: var(--surface-card);
    box-sizing: border-box;
    overflow: hidden;
    z-index: 0;
}

.mannequin-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    padding: 0;
}

/* 3D Mannequin Zoom Controls (mobile + desktop) */
.body3d-zoom-controls {
    position: absolute;
    right: 16px;
    bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 5;
    pointer-events: auto;
}

.body3d-zoom-controls .zoom-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.7);
    background: rgba(15, 23, 42, 0.95);
    color: #e5e7eb;
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    transition: background 0.2s ease, transform 0.1s ease, border-color 0.2s ease;
}

.body3d-zoom-controls .zoom-btn:hover {
    background: rgba(30, 64, 175, 0.95);
    border-color: rgba(191, 219, 254, 0.9);
    transform: translateY(-1px);
}

.body3d-zoom-controls .zoom-btn:active {
    transform: translateY(0);
}

@media (max-width: 767px) {
    .body3d-zoom-controls {
        right: 12px;
        top: 30%;
    }

    .body3d-zoom-controls .zoom-btn {
        width: 34px;
        height: 34px;
        font-size: 16px;
    }
}

@media (max-width: 767px) {
    .mannequin-wrapper {
        min-height: 300px;
        align-items: baseline;
        /* Align to baseline in mobile view */
    }
}

.mannequin-3d {
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    position: relative;
}


.mannequin-2d {
    width: 100%;
    height: 100%;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 20px;
}

@media (max-width: 767px) {
    .mannequin-3d {
        min-height: calc(100vh - 350px);
        /* Account for progress stepper + UI panels */
        height: calc(100vh - 350px);
        /* Ensure full body is visible - no padding that would cut off legs */
        padding-bottom: 0;
    }

    .mannequin-2d {
        min-height: 300px;
        padding: 10px;
    }
}

.body-3d-container {
    width: 100% !important;
    height: 100% !important;
    min-width: 100% !important;
    min-height: 100% !important;
    position: relative;
    cursor: grab;
    touch-action: none;
    background: var(--surface-card);
    display: block;
    visibility: visible;
    opacity: 1;
}

.body-3d-container canvas {
    display: block;
    width: 100% !important;
    height: 100% !important;
}

.body3d-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--gold-primary);
    font-size: 16px;
    z-index: 1;
    text-align: center;
}

.body3d-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {

    0%,
    20% {
        content: '.';
    }

    40% {
        content: '..';
    }

    60%,
    100% {
        content: '...';
    }
}

.body-3d-container:active {
    cursor: grabbing;
}

.body-3d-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block;
    outline: none;
}

.rotation-hint {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(245, 200, 106, 0.3);
    border-radius: 20px;
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--gold-primary);
    font-size: 14px;
    font-weight: 500;
    animation: fadeInUp 0.5s ease-out;
    z-index: 5;
    pointer-events: none;
}

.rotation-hint .hint-icon {
    font-size: 16px;
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

@media (max-width: 767px) {
    .body-3d-container {
        min-height: 300px;
    }

    .rotation-hint {
        bottom: 12px;
        padding: 6px 12px;
        font-size: 12px;
    }
}

.mannequin-svg {
    width: 100%;
    max-width: 350px;
    height: auto;
    min-height: 600px;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.3));
    box-sizing: border-box;
    display: block;
    background: transparent;
}

@media (max-width: 767px) {
    .mannequin-svg {
        max-width: 250px;
        min-height: 500px;
    }

    .mannequin-wrapper {
        padding: 10px 0;
    }
}

@media (max-width: 375px) {
    .mannequin-svg {
        max-width: 200px;
        min-height: 400px;
    }
}

@media (max-width: 320px) {
    .mannequin-svg {
        max-width: 180px;
        min-height: 360px;
    }
}

.body-part {
    fill: rgba(255, 255, 255, 0.1);
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.body-part:hover {
    fill: rgba(245, 200, 106, 0.3);
    stroke: var(--gold-primary);
    stroke-width: 3;
    filter: drop-shadow(0 0 8px rgba(245, 200, 106, 0.5));
}

.body-part.selected {
    fill: var(--gold-primary);
    stroke: var(--gold-light);
    stroke-width: 3;
    filter: drop-shadow(0 0 12px rgba(245, 200, 106, 0.8));
    animation: selectedPulse 2s ease-in-out infinite;
}

@keyframes selectedPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 12px rgba(245, 200, 106, 0.8));
    }

    50% {
        filter: drop-shadow(0 0 16px rgba(245, 200, 106, 1));
    }
}

/* Selected Parts Badge */
/* Selected Body Parts List */
.selected-parts-list {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 50vh;
    padding: 16px;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    background: rgba(28, 28, 30, 0.95);
    border-top: 1px solid rgba(245, 200, 106, 0.2);
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10;
    overflow-y: auto;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
    transform: translateY(0);
    transition: transform 0.3s ease-out;
}


/* Desktop: Position on right side */
@media (min-width: 768px) {
    .selected-parts-list {
        position: absolute;
        right: auto;
        left: 20px;
        bottom: 16px !important;
        width: 320px;
        max-width: calc(100% - 40px);
        height: 340px;
        border-radius: 12px;
        border-top: 1px solid rgba(245, 200, 106, 0.2);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        transform: none;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .selected-parts-items {
        overflow-y: auto;
        overflow-x: hidden;
        flex: 1;
        min-height: 0;
        /* Allow flex item to shrink */
        /* Height for items: container height (340px) minus header (~50px) and padding (~32px) */
        max-height: calc(340px - 82px);
        /* Fixed height minus header and padding */
    }
}

.selected-parts-list-header {
    margin-bottom: 12px;
    flex-shrink: 0;
    /* Keep header fixed, don't shrink */
}

.selected-parts-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--gold-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0;
}

.selected-parts-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    overflow-x: hidden;
    flex: 1;
    min-height: 0;
    /* Allow flex item to shrink below content size */
    -webkit-overflow-scrolling: touch;
    /* Smooth scrolling on iOS */
    /* Custom scrollbar styling */
    scrollbar-width: thin;
    scrollbar-color: rgba(245, 200, 106, 0.5) rgba(255, 255, 255, 0.1);
}

.selected-parts-items::-webkit-scrollbar {
    width: 6px;
}

.selected-parts-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.selected-parts-items::-webkit-scrollbar-thumb {
    background: rgba(245, 200, 106, 0.5);
    border-radius: 3px;
}

.selected-parts-items::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 200, 106, 0.7);
}

.selected-part-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Mobile: Compact list items */
@media (max-width: 767px) {
    .selected-part-item {
        padding: 8px 10px;
        min-height: 48px;
    }

    .selected-parts-items {
        gap: 6px;
    }
}

.selected-part-item:hover {
    background: rgba(245, 200, 106, 0.1);
    border-color: rgba(245, 200, 106, 0.3);
}

.part-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}

.part-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.part-pain-level {
    font-size: 12px;
    color: var(--text-secondary);
    font-weight: 500;
}

.btn-remove-part {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    flex-shrink: 0;
}

/* Mobile: Larger touch targets */
@media (max-width: 767px) {
    .btn-remove-part {
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
    }
}

.btn-remove-part:hover {
    background: rgba(255, 77, 77, 0.2);
    border-color: rgba(255, 77, 77, 0.4);
    color: #ff4d4d;
    transform: scale(1.1);
}

.btn-remove-part svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

@media (max-width: 767px) {
    .selected-parts-list {
        margin: 16px 12px;
        padding: 12px;
    }

    .selected-part-item {
        padding: 10px 12px;
    }

    .part-name {
        font-size: 14px;
    }

    .part-pain-level {
        font-size: 11px;
    }

    .btn-remove-part {
        width: 28px;
        height: 28px;
    }

    .btn-remove-part svg {
        width: 16px;
        height: 16px;
    }
}

.selected-parts-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.95) 0%, rgba(245, 200, 106, 0.95) 100%);
    border: 2px solid rgba(255, 215, 0, 0.8);
    z-index: 6;
    border-radius: 24px;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4), 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: badgeSlideIn 0.4s ease-out;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
    z-index: 10;
    backdrop-filter: blur(10px);
    font-size: 12px;
}

@media (min-width: 375px) {
    .selected-parts-badge {
        top: 12px;
        right: 12px;
        padding: 9px 16px;
        gap: 9px;
        font-size: 13px;
    }
}

@media (min-width: 768px) {
    .selected-parts-badge {
        top: 60px;
        left: 20px;
        padding: 10px 18px;
        gap: 10px;
        font-size: 14px;
        right: auto;
    }
}

.selected-parts-badge .badge-count {
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-weight: 700;
    font-size: 16px;
    min-width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.selected-parts-badge .badge-text {
    color: #000;
    font-weight: 600;
    font-size: 14px;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

@media (max-width: 767px) {
    .selected-parts-badge {
        top: 12px;
        right: 12px;
        padding: 6px 12px;
        font-size: 12px;
        max-width: calc(100% - 24px);
    }
}

@media (max-width: 375px) {
    .selected-parts-badge {
        top: 10px;
        right: 10px;
        padding: 5px 10px;
        font-size: 11px;
        gap: 6px;
    }

    .badge-text {
        font-size: 11px;
    }
}

@keyframes badgeSlideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.badge-count {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--gold-primary);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

.badge-text {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 600;
}

/* Pain Slider Section */
.pain-slider-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
    background: var(--surface-card);
    border-top: 1px solid var(--border-subtle);
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-sizing: border-box;
    z-index: 10;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    /* No scrolling needed */
}

/* Mobile: Consolidated stacking rules - Compact UI, don't cover legs */
@media (max-width: 767px) {

    /* Ensure mannequin is visible - give it space at bottom for legs */
    .mannequin-container {
        padding-bottom: 0;
        /* Ensure full height is available for mannequin */
        min-height: calc(100vh - 80px);
        /* Account for progress stepper */
    }

    /* Navigation always at bottom - compact */
    .pain-navigation {
        bottom: 0 !important;
        z-index: 11;
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        max-height: 70px;
    }

    /* Slider above navigation - compact */
    .pain-slider-section {
        bottom: 70px !important;
        z-index: 10;
        padding: 12px 14px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
        max-height: 160px;
        /* Reduced to leave more space for mannequin */
        overflow: hidden;
        /* No scrolling needed */
    }

    /* Hide selected body parts list on mobile - not properly adjusted */
    .selected-parts-list {
        display: none !important;
        /* Hide on mobile view */
    }

    /* Make sure mannequin area is visible above UI - ensure full body fits */
    .mannequin-3d {
        min-height: calc(100vh - 350px);
        /* Account for progress stepper + UI */
        height: calc(100vh - 350px);
    }

    /* Instructions positioned above UI panels */
    .pain-instructions {
        bottom: 260px !important;
        /* Above UI panels */
        z-index: 5;
        font-size: 11px;
        padding: 10px 16px;
    }

    /* Ensure body-3d-container shows full mannequin */
    .body-3d-container {
        min-height: calc(100vh - 350px);
        height: calc(100vh - 350px);
    }
}

/* Desktop: Position on right side */
@media (min-width: 768px) {
    .pain-slider-section {
        position: absolute;
        bottom: 100px;
        right: 20px;
        left: auto;
        width: 320px;
        max-width: calc(100% - 40px);
        padding: 24px 20px;
        border-radius: 12px;
        border-top: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
    }
}

.pain-slider-card {
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* Mobile: Compact slider card */
@media (max-width: 767px) {
    .pain-slider-card {
        padding: 0;
    }

    .pain-slider-header {
        margin-bottom: 12px;
        flex-wrap: wrap;
    }

    .pain-value-large {
        font-size: 32px;
    }

    .pain-max {
        font-size: 16px;
    }

    .pain-label {
        font-size: 14px;
    }

    .pain-slider-wrapper {
        margin-bottom: 8px;
    }
}

.pain-slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

@media (max-width: 767px) {
    .pain-slider-header {
        margin-bottom: 20px;
        gap: 12px;
    }
}

.pain-label {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.pain-value-large {
    font-size: 48px;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
    transition: all 0.3s ease;
}

.pain-value-large.high-pain {
    color: var(--gold-primary);
    text-shadow: 0 0 20px rgba(245, 200, 106, 0.5);
}

.pain-max {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-muted);
    margin-left: 4px;
}

.pain-slider-wrapper {
    position: relative;
    margin-bottom: 16px;
    width: 100%;
    box-sizing: border-box;
}

.pain-slider.premium-slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-sizing: border-box;
    max-width: 100%;
}

@media (max-width: 767px) {
    .pain-slider.premium-slider {
        height: 6px;
    }
}

.pain-slider.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-primary);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.4);
    transition: all 0.3s ease;
    border: 3px solid var(--surface-base);
}

.pain-slider.premium-slider.high-pain::-webkit-slider-thumb {
    background: var(--gold-primary);
    box-shadow: 0 4px 20px rgba(245, 200, 106, 0.8);
    animation: thumbGlow 2s ease-in-out infinite;
}

@keyframes thumbGlow {

    0%,
    100% {
        box-shadow: 0 4px 20px rgba(245, 200, 106, 0.8);
    }

    50% {
        box-shadow: 0 4px 30px rgba(245, 200, 106, 1);
    }
}

.pain-slider.premium-slider::-moz-range-thumb {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--gold-primary);
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.4);
    border: 3px solid var(--surface-base);
    transition: all 0.3s ease;
}

.pain-slider.premium-slider.high-pain::-moz-range-thumb {
    box-shadow: 0 4px 20px rgba(245, 200, 106, 0.8);
}

.pain-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .pain-scale-labels {
        font-size: 11px;
    }
}

@media (max-width: 375px) {
    .pain-scale-labels {
        font-size: 10px;
    }
}

/* Pain Confirmation */
.pain-confirmation {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 8px;
    animation: confirmationSlideIn 0.4s ease-out;
}

@keyframes confirmationSlideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.checkmark {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
}

.confirmation-text {
    font-size: 13px;
    color: var(--success);
    font-weight: 600;
}

/* Instructions */
.pain-instructions {
    position: absolute;
    bottom: 120px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    padding: 12px 20px;
    background: rgba(28, 28, 30, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: instructionsFadeIn 0.6s ease-out;
    max-width: calc(100% - 32px);
    width: auto;
    box-sizing: border-box;
    word-wrap: break-word;
    z-index: 5;
    font-size: 12px;
}

/* Mobile-first: Instructions positioned above bottom UI */
@media (min-width: 375px) {
    .pain-instructions {
        bottom: 100px;
        padding: 14px 22px;
        font-size: 13px;
    }
}

@media (min-width: 768px) {
    .pain-instructions {
        bottom: 120px;
        padding: 16px 24px;
        font-size: 14px;
    }
}

@keyframes instructionsFadeIn {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.instruction-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
}

/* Navigation */
.pain-navigation {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    padding: 16px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    background: rgba(28, 28, 30, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 11;
    /* Highest z-index for navigation */
    box-sizing: border-box;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile: Compact navigation */
@media (max-width: 767px) {
    .pain-navigation {
        padding: 10px 12px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
        max-height: 70px;
    }

    .btn-continue {
        padding: 12px 20px;
        font-size: 14px;
        min-height: 44px;
    }
}

/* Desktop: Position on right side */
@media (min-width: 768px) {
    .pain-navigation {
        position: absolute;
        bottom: 20px !important;
        /* Override mobile bottom */
        right: 20px;
        left: auto;
        width: 320px;
        max-width: calc(100% - 40px);
        padding: 20px;
        border-radius: 12px;
        border-top: 1px solid rgba(255, 255, 255, 0.06);
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
}

.btn-continue {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
    color: var(--text-on-accent);
    border: none;
    border-radius: 16px;
    min-height: 48px;
    /* Touch-friendly */
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(245, 200, 106, 0.4);
    transition: all 0.3s ease;
    box-sizing: border-box;
}

@media (max-width: 767px) {
    .btn-continue {
        min-height: 52px;
        /* Larger on mobile */
        font-size: 15px;
        padding: 14px 28px;
    }
}

.btn-continue:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245, 200, 106, 0.5);
}

.btn-continue:active {
    transform: translateY(0);
}

@media (max-width: 767px) {
    .btn-continue {
        max-width: 100%;
        padding: 14px 24px;
        font-size: 15px;
    }
}

@media (max-width: 375px) {
    .btn-continue {
        padding: 12px 20px;
        font-size: 14px;
    }
}

.body-diagram-section {
    margin-bottom: 24px;
}

.body-diagram-container {
    background: var(--surface-card);
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pain-indicators {
    margin-top: 24px;
    display: flex;
    justify-content: space-around;
    gap: 16px;
    padding: 16px;
    background: var(--surface-card);
    border-radius: 12px;
}

.pain-indicator-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.indicator-label {
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.indicator-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--success);
    font-family: monospace;
}

.pain-scale-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

/* Pain Selector - Interactive 3D Body Diagram */
pain-selector {
    display: block;
    width: 100%;
}

.body-diagram-wrapper {
    background: var(--surface-card);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.view-toggle-container {
    text-align: center;
    margin-bottom: 16px;
}

.btn-view-toggle {
    background: var(--surface-hover);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-view-toggle:hover {
    background: var(--surface-hover);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.body-diagram-info {
    text-align: center;
    margin-bottom: 20px;
}

.diagram-label {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.diagram-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.body-svg-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    margin-top: 16px;
}

.body-svg {
    width: 100%;
    max-width: 300px;
    height: auto;
    cursor: pointer;
}

.body-part {
    fill: rgba(245, 200, 106, 0.2);
    stroke: var(--gold-primary);
    stroke-width: 2;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.body-part:hover {
    fill: rgba(245, 200, 106, 0.4);
    stroke: var(--gold-light);
    stroke-width: 3;
    opacity: 1;
    transform: scale(1.05);
    transform-origin: center;
}

.body-part.selected {
    fill: var(--gold-primary);
    stroke: var(--gold-light);
    stroke-width: 3;
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(245, 200, 106, 0.6));
}

.part-label {
    font-size: 8px;
    fill: var(--text-muted);
    pointer-events: none;
    font-weight: 500;
}

.body-part.selected+.part-label {
    fill: #ffffff;
    font-weight: 700;
}

/* Body parts list (fallback) */
.body-parts-list {
    display: none;
    /* Hide button list, use SVG instead */
}

/* File Upload Widget - Enhanced */
file-upload-widget {
    display: block;
    margin-bottom: 16px;
}

.upload-zone {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    padding: 32px 20px;
    text-align: center;
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.upload-zone.drag-over {
    border-color: var(--gold-primary);
    background: rgba(245, 200, 106, 0.1);
    border-style: solid;
    transform: scale(1.02);
}

.upload-zone:hover {
    border-color: var(--gold-primary);
    background: rgba(245, 200, 106, 0.05);
}

.upload-icon {
    font-size: 40px;
    margin-bottom: 8px;
    color: var(--gold-primary);
}

.upload-text {
    color: var(--text-primary);
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 4px;
}

.upload-hint {
    color: var(--text-muted);
    font-size: 12px;
}

.upload-progress {
    margin-top: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--text-secondary);
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--surface-hover);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-gradient);
    width: 0%;
    animation: progress 2s infinite;
}

@keyframes progress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* Document Upload Options */
.upload-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.upload-option-item {
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.upload-option-item h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Uploaded Files Grid */
.uploaded-files-section {
    margin-top: 24px;
}

.uploaded-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.uploaded-file-item {
    position: relative;
    background: var(--surface-hover);
    border-radius: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.uploaded-file-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.file-preview {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 8px;
    background: var(--surface-card);
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon {
    font-size: 48px;
    color: var(--text-muted);
}

.file-info {
    text-align: center;
}

.file-name {
    font-size: 12px;
    color: var(--text-primary);
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-type {
    font-size: 10px;
    color: var(--text-muted);
    text-transform: uppercase;
}

.btn-remove-file {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--error);
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    transition: all 0.2s ease;
}

.btn-remove-file:hover {
    transform: scale(1.1);
    background: #dc2626;
}

/* Score Card */
score-card {
    display: block;
    width: 100%;
}

.score-card {
    background: var(--primary-gradient);
    border-radius: 16px;
    padding: 48px;
    text-align: center;
    color: var(--text-on-accent);
    box-shadow: var(--shadow-gold);
}

.score-number {
    font-size: 120px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 16px;
}

.score-value-range {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 24px;
}

.score-breakdown {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
}

.score-breakdown-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .score-number {
        font-size: 140px;
    }

    .score-value-range {
        font-size: 36px;
    }
}

@media (min-width: 1024px) {
    .score-number {
        font-size: 160px;
    }

    .score-value-range {
        font-size: 40px;
    }
}

/* Loading Spinner */
loading-spinner {
    display: block;
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--gold-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.spinner.small {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

.spinner.medium {
    width: 48px;
    height: 48px;
}

.spinner.large {
    width: 64px;
    height: 64px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.spinner-message {
    margin-top: 16px;
    text-align: center;
    color: #cccccc;
}

.spinner-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Partner Card */
partner-card {
    display: block;
}

.partner-card {
    background: var(--surface-elevated);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
}

.partner-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 24px;
}

.partner-name {
    font-size: 1.5rem;
    margin-bottom: 24px;
    color: var(--gold-primary);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

.video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background: rgba(245, 200, 106, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-accent);
    font-size: 32px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-gold);
}

.play-button:hover {
    background: var(--gold-primary);
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: var(--shadow-gold-hover);
}

/* Case Summary */
case-summary {
    display: block;
}

.summary-section {
    background: var(--surface-elevated);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 24px;
}

.summary-section h3 {
    color: var(--gold-primary);
    margin-bottom: 16px;
}

.summary-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.summary-item:last-child {
    border-bottom: none;
}

.summary-label {
    color: #cccccc;
    font-weight: 500;
}

.summary-value {
    color: #ffffff;
    text-align: right;
}

.summary-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.factors-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.factors-list li {
    padding: 8px 0;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.factors-list li:last-child {
    border-bottom: none;
}

.factors-list li::before {
    content: "• ";
    color: var(--gold-primary);
    font-weight: bold;
    margin-right: 8px;
}

.flags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.flag-badge {
    display: inline-block;
    padding: 6px 12px;
    background: rgba(255, 215, 0, 0.2);
    color: var(--gold-primary);
    border: 1px solid var(--gold-primary);
    border-radius: 16px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Form Field */
form-field {
    display: block;
    margin-bottom: 20px;
}

.form-field-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #cccccc;
}

.form-field-label.required::after {
    content: ' *';
    color: #ff4444;
}

.form-field-input {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: var(--surface-card);
    color: white;
    font-size: 16px;
}

.form-field-input:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px var(--gold-glow);
}

.form-field-input.auto-filled {
    border-color: var(--gold-primary);
    background: rgba(245, 200, 106, 0.1);
}

.form-field-error {
    color: #ff4444;
    font-size: 14px;
    margin-top: 4px;
}

/* Score Screen */

.score-container {
    max-width: 600px;
    margin: 0 auto;
}

.injury-details {
    margin-top: 32px;
    width: 100%;
    padding: 24px;
    background: var(--surface-card);
    border-radius: 12px;
    border: 1px solid var(--border-card);
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-subtle);
}

.detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 600;
    text-align: right;
}

/* Video Modal */
.video-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.video-modal {
    background: var(--surface-card);
    border-radius: 20px;
    max-width: 1000px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.video-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.2s ease;
}

.video-modal-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.video-modal-content {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.video-modal-player-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-modal-player-wrap .embed-responsive {
    width: 100%;
    max-width: 100%;
}

.video-player-placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, rgba(245, 200, 106, 0.1) 0%, rgba(11, 11, 12, 0.3) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.video-placeholder-content {
    text-align: center;
    padding: 40px;
    color: var(--text-primary);
}

.play-icon-large {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: var(--primary-gradient);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(245, 200, 106, 0.4);
    color: var(--text-on-accent);
}

.play-icon-large svg {
    width: 40px;
    height: 40px;
    margin-left: 4px;
}

.video-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.video-description {
    font-size: 18px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    font-weight: 500;
}

.video-note {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    font-style: italic;
}

@media (max-width: 767px) {
    .video-modal {
        max-width: 95%;
        border-radius: 16px;
    }

    .video-placeholder-content {
        padding: 24px;
    }

    .play-icon-large {
        width: 60px;
        height: 60px;
    }

    .play-icon-large svg {
        width: 30px;
        height: 30px;
    }

    .video-title {
        font-size: 20px;
    }

    .video-description {
        font-size: 16px;
    }
}

/* Premium Error Message */
.premium-error {
    background: var(--surface-card);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    max-width: 500px;
    margin: 40px auto;
    box-shadow: 0 8px 24px rgba(239, 68, 68, 0.1);
}

.premium-error .error-icon {
    font-size: 48px;
    margin-bottom: 16px;
    display: block;
}

.premium-error h3 {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.premium-error p {
    font-size: 15px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.6;
}

/* Image Viewer Modal - Elegant Premium Design */
.image-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.image-viewer-modal {
    background: var(--surface-card);
    border-radius: 20px;
    max-width: 90vw;
    max-height: 90vh;
    width: auto;
    height: auto;
    overflow: hidden;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 200, 106, 0.1);
    animation: slideUp 0.3s ease;
    display: flex;
    flex-direction: column;
}

.image-viewer-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    transition: all 0.2s ease;
    padding: 0;
}

.image-viewer-close svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.image-viewer-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
    border-color: rgba(245, 200, 106, 0.3);
}

.image-viewer-header {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(245, 200, 106, 0.15);
    background: linear-gradient(180deg, rgba(11, 11, 12, 0.95) 0%, rgba(11, 11, 12, 0.85) 100%);
}

.image-viewer-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    text-align: center;
}

.image-viewer-content {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.3);
    min-height: 300px;
    max-height: calc(90vh - 100px);
    overflow: auto;
}

.viewer-image {
    max-width: 100%;
    max-height: calc(90vh - 140px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    background: rgba(255, 255, 255, 0.02);
}

.viewer-video {
    max-width: 100%;
    max-height: calc(90vh - 140px);
    width: auto;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    background: rgba(0, 0, 0, 0.9);
}

.viewer-pdf {
    width: min(90vw, 900px);
    height: min(78vh, 900px);
    border: 0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Clickable Preview Hint - Override for document scan */
.document-scan-screen .capture-preview {
    position: relative;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.document-scan-screen .capture-preview:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(245, 200, 106, 0.2);
}

.document-scan-screen .capture-preview:hover .view-image-hint {
    opacity: 1;
}

/* Video placeholder styling for document scan preview */
.document-scan-screen .capture-video-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: radial-gradient(circle at 50% 0%, rgba(245, 200, 106, 0.16), transparent 60%),
        linear-gradient(135deg, rgba(10, 10, 10, 0.96), rgba(0, 0, 0, 0.98));
}

.document-scan-screen .video-icon-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-primary), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 30px rgba(245, 200, 106, 0.65);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.document-scan-screen .video-icon-play {
    display: inline-block;
    font-size: 34px;
    color: var(--text-on-accent);
    margin-left: 4px;
    /* optical centering for triangle */
}

.document-scan-screen .capture-preview:hover .video-icon-circle {
    transform: scale(1.07);
    box-shadow: 0 14px 40px rgba(245, 200, 106, 0.85);
}

.document-scan-screen .video-placeholder-text {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.view-image-hint {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    padding: 8px 16px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 12px;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
    border: 1px solid rgba(245, 200, 106, 0.2);
}

.view-image-hint svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
}

/* Document Viewer Placeholder (for PDFs) */
.document-viewer-placeholder {
    padding: 60px 40px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.document-placeholder-icon {
    width: 120px;
    height: 120px;
    margin-bottom: 24px;
    color: var(--primary-color);
    opacity: 0.6;
}

.document-placeholder-icon svg {
    width: 100%;
    height: 100%;
    stroke: currentColor;
}

.document-placeholder-text {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 12px 0;
}

.document-placeholder-note {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 32px 0;
}

.document-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: var(--primary-gradient);
    color: var(--text-on-accent);
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.3);
}

.document-download-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.document-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(245, 200, 106, 0.4);
}

@media (max-width: 767px) {
    .image-viewer-modal {
        max-width: 95vw;
        border-radius: 16px;
    }

    .image-viewer-header {
        padding: 16px 20px;
    }

    .image-viewer-title {
        font-size: 18px;
    }

    .image-viewer-content {
        padding: 16px;
        min-height: 250px;
    }

    .viewer-image {
        max-height: calc(90vh - 120px);
    }

    .image-viewer-close {
        width: 40px;
        height: 40px;
        top: 12px;
        right: 12px;
    }

    .document-viewer-placeholder {
        padding: 40px 24px;
        min-height: 300px;
    }

    .document-placeholder-icon {
        width: 80px;
        height: 80px;
        margin-bottom: 20px;
    }

    .document-placeholder-text {
        font-size: 18px;
    }

    .document-download-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* Lawyer Profile Modal - Premium responsive popup */
.lawyer-profile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.88);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: var(--space-md, 16px);
    animation: fadeIn 0.25s ease;
    overflow-y: auto;
}

.lawyer-profile-modal {
    background: var(--surface-card);
    border-radius: var(--radius-xl, 20px);
    max-width: 440px;
    width: 100%;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(245, 200, 106, 0.08);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin: auto;
}

.lawyer-profile-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.2s ease;
    padding: 0;
}

.lawyer-profile-close svg {
    width: 20px;
    height: 20px;
}

.lawyer-profile-close:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.08);
    border-color: rgba(245, 200, 106, 0.25);
}

.lawyer-profile-inner {
    padding: 28px 24px 24px;
}

.lawyer-profile-header {
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}

.lawyer-profile-avatar {
    max-width: 120px;
    max-height: 120px;
    min-width: 48px;
    min-height: 48px;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    background: var(--surface-hover);
    border: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lawyer-profile-avatar.has-logo img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lawyer-profile-avatar:not(.has-logo) {
    width: 72px;
    height: 72px;
}

.lawyer-profile-initials {
    font-size: 28px;
    font-weight: 700;
    color: var(--gold-primary, #F5C86A);
    letter-spacing: -0.02em;
}

.lawyer-profile-badges {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
}

.lawyer-profile-badge {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    border-radius: var(--radius-full, 9999px);
    background: rgba(245, 200, 106, 0.15);
    color: var(--gold-primary, #F5C86A);
    border: 1px solid rgba(245, 200, 106, 0.25);
}

.lawyer-profile-badge.union {
    background: rgba(16, 185, 129, 0.15);
    color: var(--success, #10b981);
    border-color: rgba(16, 185, 129, 0.3);
}

.lawyer-profile-badge.recommended {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info, #3b82f6);
    border-color: rgba(59, 130, 246, 0.3);
}

.lawyer-profile-name {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin: 0 0 4px 0;
}

.lawyer-profile-specialty {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 8px 0;
    font-weight: 500;
}

.lawyer-profile-tagline {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0 0 12px 0;
    line-height: 1.5;
    font-style: italic;
}

.lawyer-profile-meta {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    line-height: 1.5;
}

.lawyer-profile-meta-sep {
    margin: 0 4px;
}

.lawyer-profile-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}

.lawyer-profile-detail-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--surface-hover);
    border-radius: var(--radius-md, 12px);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s ease, color 0.2s ease;
    border: 1px solid transparent;
}

.lawyer-profile-detail-row:hover {
    background: var(--surface-elevated, #242426);
    color: var(--text-primary);
    border-color: rgba(245, 200, 106, 0.2);
}

.lawyer-profile-detail-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    color: var(--gold-primary, #F5C86A);
}

.lawyer-profile-actions {
    padding-top: 8px;
}

.btn-lawyer-profile-chat {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 20px;
    font-size: 15px;
    font-weight: 600;
    border-radius: var(--radius-md, 12px);
    background: var(--primary-gradient);
    color: var(--text-on-accent);
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px rgba(245, 200, 106, 0.35);
}

.btn-lawyer-profile-chat:hover {
    box-shadow: 0 6px 24px rgba(245, 200, 106, 0.45);
    transform: translateY(-2px);
}

.btn-lawyer-profile-chat .btn-icon {
    width: 20px;
    height: 20px;
}

@media (max-width: 480px) {
    .lawyer-profile-overlay {
        padding: 12px;
        align-items: flex-start;
    }

    .lawyer-profile-modal {
        max-height: calc(100vh - 24px);
        border-radius: var(--radius-lg, 16px);
    }

    .lawyer-profile-inner {
        padding: 24px 20px 20px;
    }

    .lawyer-profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        margin-bottom: 14px;
    }

    .lawyer-profile-badges {
        justify-content: center;
    }

    .lawyer-profile-name {
        font-size: 20px;
        text-align: center;
    }

    .lawyer-profile-specialty,
    .lawyer-profile-tagline,
    .lawyer-profile-meta {
        text-align: center;
    }

    .lawyer-profile-detail-row {
        padding: 10px 12px;
        font-size: 13px;
    }
}

/* UISI Questionnaire Styles */
/* Premium UISI Questionnaire Styles */
.uisi-questionnaire-screen {
    background: var(--surface-base);
    min-height: 100vh;
    padding-bottom: 80px;
}

.questionnaire-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

.questionnaire-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 20px;
}

.questionnaire-title {
    font-size: 32px;
    font-weight: 800;
    color: #FFFFFF;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.questionnaire-subtitle {
    color: #E8E8E8;
    font-size: 16px;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
}

.questionnaire-form {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.question-section {
    background: var(--surface-card);
    border-radius: 20px;
    padding: 32px;
    border: 1px solid rgba(245, 200, 106, 0.15);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.question-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #F5C86A 0%, #E8B04A 100%);
    opacity: 0.6;
}

.question-section:hover {
    border-color: rgba(245, 200, 106, 0.25);
    box-shadow: 0 6px 28px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.section-number {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: 800;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.3);
}

.section-title-wrapper {
    flex: 1;
}

.section-title {
    color: #F5C86A;
    font-size: 22px;
    margin: 0 0 4px 0;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.section-weight {
    color: #B0B0B0;
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.triage-card {
    background: var(--surface-card);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 24px;
}

.triage-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #FFFFFF;
    margin-bottom: 12px;
    text-align: center;
    letter-spacing: -0.02em;
}

.triage-card .text-muted {
    color: #E8E8E8;
    font-size: 16px;
    text-align: center;
    margin-bottom: 32px;
    font-weight: 400;
}

.form-group {
    margin-bottom: 32px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.question-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    color: #FFFFFF;
    font-size: 17px;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.6;
    cursor: default;
}

.question-number {
    color: #F5C86A;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 28px;
}

.question-note {
    display: block;
    color: #B0B0B0;
    font-size: 14px;
    font-weight: 400;
    margin-top: 6px;
    font-style: italic;
}

.form-group label {
    display: block;
    color: #FFFFFF;
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    line-height: 1.5;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.radio-label,
.checkbox-label {
    display: flex !important;
    align-items: center;
    padding: 16px 20px;
    background: rgba(40, 40, 40, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: #E8E8E8;
    position: relative;
    font-size: 15px;
    line-height: 1.5;
    min-height: 56px;
}

.radio-label:hover,
.checkbox-label:hover {
    background: rgba(50, 50, 50, 0.7);
    border-color: rgba(245, 200, 106, 0.3);
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.radio-label input[type="radio"],
.checkbox-label input[type="checkbox"] {
    margin-right: 16px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    border: 2px solid rgba(245, 200, 106, 0.6);
    border-radius: 50%;
    background: rgba(40, 40, 40, 0.8);
    position: relative;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    transition: all 0.3s ease;
}

.radio-label input[type="radio"]:checked {
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    border-color: #F5C86A;
    box-shadow: 0 0 0 4px rgba(245, 200, 106, 0.2);
}

.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--surface-base);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.checkbox-label input[type="checkbox"] {
    border-radius: 6px;
}

.checkbox-label input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    border-color: #F5C86A;
    box-shadow: 0 0 0 4px rgba(245, 200, 106, 0.2);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-primary);
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
    display: block;
    width: 100%;
    height: 100%;
    text-align: center;
}

.radio-label input[type="radio"]:checked+span,
.checkbox-label input[type="checkbox"]:checked+span {
    color: #E8E8E8;
    font-weight: 500;
}

.radio-label:has(input[type="radio"]:checked),
.checkbox-label:has(input[type="checkbox"]:checked) {
    background: rgba(60, 60, 60, 0.8);
    border-color: rgba(245, 200, 106, 0.5);
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.2);
    transform: translateX(4px);
}

.radio-label:has(input[type="radio"]:checked) span,
.checkbox-label:has(input[type="checkbox"]:checked) span {
    color: #FFFFFF;
    font-weight: 600;
}

.slider-group {
    padding: 28px;
    background: var(--surface-card);
    border-radius: 16px;
    border: 2px solid var(--border-card);
    position: relative;
    transition: all 0.3s ease;
}

.slider-group:hover {
    border-color: var(--gold-border);
    background: var(--surface-hover);
}

.slider-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 4px;
}

.slider-track-row {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 36px;
}

.slider-wrapper {
    flex: 1;
    min-width: 0;
    padding: 0 6px 0 6px;
    display: flex;
    align-items: center;
}

.slider {
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: var(--input-bg);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    position: relative;
    cursor: pointer;
    margin: 0;
    padding: 0;
    display: block;
    box-sizing: border-box;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.4);
    border: 2px solid var(--text-on-accent);
    position: relative;
    z-index: 2;
    margin-top: -8px;
    transition: all 0.2s ease;
}

.slider::-webkit-slider-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.5);
}

.slider::-webkit-slider-thumb:active {
    transform: scale(1.1);
}

.slider::-webkit-slider-runnable-track {
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
    position: relative;
}

/* Create filled portion using a pseudo-element approach */
.slider-wrapper {
    position: relative;
}

/* Fill uses same effective track as native thumb (track minus 24px thumb width) so fill doesn't extend past thumb */
.slider-wrapper::before {
    content: '';
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-4px);
    height: 8px;
    width: calc((var(--slider-progress, 50) / 100) * (100% - 52px));
    max-width: calc(100% - 52px);
    background: linear-gradient(90deg, #F5C86A 0%, #E8B04A 100%);
    border-radius: 4px 0 0 4px;
    pointer-events: none;
    z-index: 1;
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    cursor: pointer;
    border: 2px solid var(--text-on-accent);
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.4);
    transition: all 0.2s ease;
}

.slider::-moz-range-thumb:hover {
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.5);
}

.slider::-moz-range-track {
    height: 8px;
    background: var(--input-bg);
    border-radius: 4px;
}

.slider::-moz-range-progress {
    height: 8px;
    background: linear-gradient(90deg, #F5C86A 0%, #E8B04A 100%);
    border-radius: 4px;
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0 8px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 500;
    line-height: 1.2;
}

.slider-labels span:first-child {
    text-align: left;
}

.slider-labels span:last-child {
    text-align: right;
}

.slider-value {
    flex-shrink: 0;
    min-width: 56px;
    max-width: 56px;
    text-align: center;
    font-size: 28px;
    font-weight: 800;
    color: #F5C86A;
    line-height: 1;
    background: rgba(245, 200, 106, 0.1);
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px solid rgba(245, 200, 106, 0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-group:has(input:focus) .slider-value {
    border-color: var(--gold-border);
    background: var(--gold-bg-subtle);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
}

.form-actions .btn {
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    letter-spacing: 0.3px;
}

.btn-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

/* Universal Navigation Button Styles - Consistent across all pages */
.document-navigation,
.pain-navigation,
.score-navigation,
.match-navigation,
.summary-navigation {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(255, 255, 255, 0.08);
}

.document-navigation .btn,
.pain-navigation .btn,
.score-navigation .btn,
.match-navigation .btn,
.summary-navigation .btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    letter-spacing: 0.3px;
}

.btn-back {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 0 1 auto;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-back .btn-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

.btn-back:hover {
    background: rgba(245, 200, 106, 0.14);
    border-color: rgba(245, 200, 106, 0.45);
    color: #F5C86A;
    transform: translateX(-2px);
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.15);
}

.btn-back:hover .btn-icon {
    transform: translateX(-2px);
}

.btn-skip {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex: 0 1 auto;
    min-width: 120px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn-skip .btn-icon {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    transition: transform 0.3s ease;
}

.btn-skip:hover {
    background: rgba(245, 200, 106, 0.14);
    border-color: rgba(245, 200, 106, 0.45);
    color: #F5C86A;
    box-shadow: 0 4px 12px rgba(245, 200, 106, 0.15);
}

.btn-skip:hover .btn-icon {
    transform: translateX(2px);
}

/* Form-actions Back/Skip: ensure border and look not overridden by .form-actions .btn */
.form-actions .btn-back,
.form-actions .btn-skip {
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-actions .btn-primary {
    background: linear-gradient(135deg, #F5C86A 0%, #E8B04A 100%);
    color: var(--text-on-accent);
    box-shadow: 0 4px 16px rgba(245, 200, 106, 0.4);
    flex: 1;
    max-width: 280px;
}

.form-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(245, 200, 106, 0.5);
    background: linear-gradient(135deg, #F6D17A 0%, #E9C05A 100%);
}

.form-actions .btn-primary:hover:not(:disabled) .btn-icon {
    transform: translateX(4px);
}

.form-actions .btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Mobile Responsive Styles */
@media (max-width: 767px) {
    .questionnaire-container {
        padding: 16px;
    }

    .questionnaire-header {
        margin-bottom: 32px;
        padding: 0 8px;
    }

    .questionnaire-title {
        font-size: 26px;
        margin-bottom: 10px;
    }

    .questionnaire-subtitle {
        font-size: 14px;
    }

    .questionnaire-form {
        gap: 24px;
    }

    .question-section {
        padding: 24px 20px;
        border-radius: 16px;
    }

    .section-header {
        gap: 16px;
        margin-bottom: 24px;
        padding-bottom: 16px;
    }

    .section-number {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-weight {
        font-size: 12px;
    }

    .form-group {
        margin-bottom: 28px;
    }

    .question-label {
        font-size: 16px;
        gap: 10px;
        margin-bottom: 14px;
    }

    .question-number {
        min-width: 24px;
        font-size: 16px;
    }

    .question-note {
        font-size: 13px;
    }

    .radio-label,
    .checkbox-label {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 52px;
        border-radius: 10px;
    }

    .radio-label input[type="radio"],
    .checkbox-label input[type="checkbox"] {
        width: 22px;
        height: 22px;
        margin-right: 14px;
    }

    .slider-group {
        padding: 20px;
    }

    .slider-content {
        gap: 10px;
    }

    .slider-track-row {
        min-height: 40px;
        gap: 16px;
    }

    .slider-wrapper {
        width: 100%;
    }

    .slider {
        width: 100%;
        margin: 0;
    }

    .slider-labels {
        font-size: 11px;
        padding: 0 4px;
    }

    .slider-value {
        font-size: 28px;
        min-width: 56px;
        padding: 8px 12px;
    }

    .form-actions {
        flex-direction: column;
        gap: 12px;
        margin-top: 40px;
        padding-top: 24px;
    }

    .form-actions .btn {
        max-width: 100%;
        width: 100%;
        padding: 16px 24px;
    }

    .document-navigation,
    .pain-navigation,
    .score-navigation,
    .match-navigation,
    .summary-navigation {
        flex-direction: column;
        gap: 12px;
        margin-top: 24px;
        padding-top: 10px;
    }

    .document-navigation .btn,
    .pain-navigation .btn,
    .score-navigation .btn,
    .match-navigation .btn,
    .summary-navigation .btn {
        width: 100%;
        max-width: 100%;
        padding: 16px 24px;
    }

    .btn-back,
    .btn-skip {
        min-width: auto;
    }

    .triage-card {
        padding: 24px 20px;
    }

    .triage-card h2 {
        font-size: 24px;
    }

    .triage-card .text-muted {
        font-size: 14px;
    }
}

/* Tablet Styles */
@media (min-width: 768px) and (max-width: 1024px) {
    .questionnaire-container {
        max-width: 750px;
        padding: 24px;
    }

    .question-section {
        padding: 28px;
    }
}

/* Desktop (1024px+) - Enhanced Layout */
@media (min-width: 1024px) {
    .questionnaire-container {
        max-width: 1100px;
        padding: 40px 60px;
        margin: 0 auto;
    }

    .questionnaire-header {
        margin-bottom: 48px;
    }

    .questionnaire-title {
        font-size: 36px;
    }

    .questionnaire-subtitle {
        font-size: 18px;
    }

    .questionnaire-form {
        gap: 40px;
    }

    .question-section {
        padding: 40px 48px;
        border-radius: 24px;
    }

    .section-header {
        margin-bottom: 32px;
        padding-bottom: 24px;
    }

    .section-number {
        width: 56px;
        height: 56px;
        font-size: 28px;
    }

    .section-title {
        font-size: 24px;
    }

    .section-weight {
        font-size: 14px;
    }

    .form-group {
        margin-bottom: 36px;
    }

    .question-label {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .radio-label,
    .checkbox-label {
        padding: 20px 24px;
        font-size: 16px;
        min-height: 64px;
    }

    .radio-label input[type="radio"],
    .checkbox-label input[type="checkbox"] {
        width: 26px;
        height: 26px;
        margin-right: 18px;
    }

    .slider-group {
        padding: 32px;
    }

    .slider-content {
        gap: 16px;
    }

    .slider-value {
        font-size: 40px;
        min-width: 72px;
        padding: 12px 18px;
    }

    .form-actions {
        margin-top: 56px;
        padding-top: 40px;
        gap: 20px;
    }

    .form-actions .btn {
        padding: 18px 36px;
        font-size: 17px;
    }

    .document-navigation,
    .pain-navigation,
    .score-navigation,
    .match-navigation,
    .summary-navigation {
        max-width: 800px;
        margin-left: auto;
        margin-right: auto;
        margin-top: 40px;
        padding-top: 32px;
    }
}

/* Desktop Large Screen Optimization (1440px+) */
@media (min-width: 1440px) {
    .questionnaire-container {
        max-width: 1200px;
        padding: 50px 80px;
    }

    .question-section {
        padding: 48px 56px;
    }

    .section-number {
        width: 64px;
        height: 64px;
        font-size: 32px;
    }

    .section-title {
        font-size: 26px;
    }

    .question-label {
        font-size: 19px;
    }

    .radio-label,
    .checkbox-label {
        padding: 22px 28px;
        font-size: 17px;
    }
}

/* Brand Logo Directive Styles - Elegant Premium Design */
brand-logo {
    display: block;
}

.brand-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
}

.brand-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
}

.brand-logo-image {
    max-width: 100%;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    filter: drop-shadow(0 4px 12px rgba(245, 200, 106, 0.3));
    transition: all 0.3s ease;
}

.brand-logo-image:hover {
    filter: drop-shadow(0 6px 20px rgba(245, 200, 106, 0.5));
    transform: scale(1.02);
}

.brand-logo-container.brand-logo-small .brand-logo-image {
    max-height: 40px;
}

.brand-logo-container.brand-logo-medium .brand-logo-image {
    max-height: 60px;
}

.brand-logo-container.brand-logo-large .brand-logo-image {
    max-height: 100px;
}

/* Elegant Logo with Icon */
.brand-logo-with-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    position: relative;
}

.brand-logo-container.brand-logo-small .brand-logo-with-icon {
    gap: 8px;
}

.brand-logo-container.brand-logo-large .brand-logo-with-icon {
    gap: 24px;
}

/* Logo Icon Mark - Elegant SVG */
.logo-icon-mark {
    position: relative;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoIconFloat 3s ease-in-out infinite;
}

.brand-logo-container.brand-logo-small .logo-icon-mark {
    width: 40px;
    height: 40px;
}

.brand-logo-container.brand-logo-medium .logo-icon-mark {
    width: 60px;
    height: 60px;
}

.brand-logo-container.brand-logo-large .logo-icon-mark {
    width: 100px;
    height: 100px;
}

.logo-icon-svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 4px 16px rgba(245, 200, 106, 0.4));
    animation: logoIconRotate 20s linear infinite;
}

.logo-ring-outer {
    animation: logoRingPulse 3s ease-in-out infinite;
}

.logo-shape-main {
    animation: logoShapeGlow 2s ease-in-out infinite;
}

.logo-cross-vertical,
.logo-cross-horizontal {
    animation: logoCrossPulse 2s ease-in-out infinite;
    animation-delay: 0.5s;
}

.logo-ring-inner {
    animation: logoRingRotate 8s linear infinite;
}

.logo-shimmer {
    animation: logoShimmer 3s ease-in-out infinite;
    mask: radial-gradient(circle at 30% 30%, black 20%, transparent 60%);
}

@keyframes logoIconFloat {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes logoIconRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes logoRingPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.6;
        transform: scale(1.05);
    }
}

@keyframes logoShapeGlow {

    0%,
    100% {
        opacity: 1;
        filter: drop-shadow(0 0 8px rgba(245, 200, 106, 0.6));
    }

    50% {
        opacity: 0.9;
        filter: drop-shadow(0 0 16px rgba(245, 200, 106, 0.8));
    }
}

@keyframes logoCrossPulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.7;
    }
}

@keyframes logoRingRotate {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(-360deg);
    }
}

@keyframes logoShimmer {

    0%,
    100% {
        opacity: 0.1;
    }

    50% {
        opacity: 0.3;
    }
}

/* Elegant Text Logo */
.brand-logo-text {
    margin: 0;
    position: relative;
}

.elegant-logo {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 10px;
    position: relative;
}

.elegant-part1 {
    background: linear-gradient(135deg, #06b6d4 0%, #0891b2 50%, #0e7490 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 12px rgba(6, 182, 212, 0.5));
    position: relative;
    font-weight: 800;
    letter-spacing: -0.02em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 30px rgba(6, 182, 212, 0.3);
}

.elegant-part1::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: 0;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.4) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
    filter: blur(10px);
}

.elegant-logo:hover .elegant-part1::before {
    opacity: 1;
}

.elegant-logo:hover .elegant-part1 {
    filter: drop-shadow(0 4px 20px rgba(6, 182, 212, 0.7));
    transform: translateY(-2px);
}

.elegant-part2 {
    background: linear-gradient(135deg, #10b981 0%, #059669 50%, #047857 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    filter: drop-shadow(0 2px 12px rgba(16, 185, 129, 0.5));
    position: relative;
    font-weight: 800;
    letter-spacing: -0.02em;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}

.elegant-part2::before {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: 0;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.4) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: -1;
    filter: blur(10px);
}

.elegant-logo:hover .elegant-part2::before {
    opacity: 1;
}

.elegant-logo:hover .elegant-part2 {
    filter: drop-shadow(0 4px 20px rgba(16, 185, 129, 0.7));
    transform: translateY(-2px);
}

/* Elegant Tagline */
.elegant-tagline {
    margin-top: 16px;
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    padding-top: 16px;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.elegant-tagline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
    opacity: 0.6;
}

.brand-logo-container:hover .elegant-tagline {
    color: var(--text-secondary);
    opacity: 1;
}

.brand-logo-container:hover .elegant-tagline::before {
    width: 100px;
    opacity: 1;
}

.brand-logo-container.brand-logo-small .elegant-tagline {
    font-size: 11px;
    margin-top: 8px;
    padding-top: 8px;
    letter-spacing: 0.06em;
}

.brand-logo-container.brand-logo-small .elegant-tagline::before {
    width: 40px;
}

.brand-logo-container.brand-logo-medium .elegant-tagline {
    font-size: 13px;
    margin-top: 12px;
    padding-top: 12px;
}

.brand-logo-container.brand-logo-medium .elegant-tagline::before {
    width: 50px;
}

.brand-logo-container.brand-logo-large .elegant-tagline {
    font-size: 17px;
    margin-top: 20px;
    padding-top: 20px;
    letter-spacing: 0.1em;
}

.brand-logo-container.brand-logo-large .elegant-tagline::before {
    width: 80px;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .logo-icon-mark {
        width: 50px;
        height: 50px;
    }

    .brand-logo-container.brand-logo-large .logo-icon-mark {
        width: 70px;
        height: 70px;
    }

    .elegant-tagline {
        font-size: 12px;
    }
}

/* Simplified Document Upload UI Styles */
.upload-section {
    margin: 2rem 0;
}

.upload-header {
    text-align: center;
    margin-bottom: 2rem;
}

.upload-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary, #ffffff);
}

.upload-description {
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    font-size: 0.95rem;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.upload-area {
    border: 2px dashed var(--border-color, rgba(245, 200, 106, 0.3));
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    background: var(--background-secondary, rgba(255, 255, 255, 0.05));
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    position: relative;
}

.upload-area.has-files {
    border-color: var(--primary-color, #f5c86a);
    background: var(--background-primary, rgba(255, 255, 255, 0.03));
}

.upload-area.uploading {
    border-color: var(--primary-color, #f5c86a);
    background: var(--background-primary, rgba(255, 255, 255, 0.03));
}

.upload-input {
    display: none;
}

.upload-button-large {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
    padding: 1rem;
    transition: opacity 0.2s ease;
}

.upload-button-large:hover {
    opacity: 0.8;
}

.upload-icon-large {
    width: 64px;
    height: 64px;
    color: var(--primary-color, #f5c86a);
}

.upload-button-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.upload-hint {
    font-size: 0.875rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.upload-progress {
    margin-top: 1rem;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.progress-bar {
    height: 4px;
    background: var(--border-color, rgba(245, 200, 106, 0.2));
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color, #f5c86a);
    width: 60%;
    animation: progressPulse 1.5s ease-in-out infinite;
}

@keyframes progressPulse {

    0%,
    100% {
        width: 60%;
    }

    50% {
        width: 80%;
    }
}

.uploaded-files-section {
    margin-top: 2rem;
}

.files-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary, #ffffff);
}

.uploaded-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.uploaded-file-card {
    border: 1px solid var(--border-color, rgba(245, 200, 106, 0.3));
    border-radius: 8px;
    padding: 1rem;
    background: var(--background-secondary, rgba(255, 255, 255, 0.05));
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.uploaded-file-card:hover {
    border-color: var(--primary-color, #f5c86a);
    box-shadow: 0 2px 8px rgba(245, 200, 106, 0.2);
    transform: translateY(-2px);
}

.file-thumbnail {
    width: 100%;
    height: 120px;
    border-radius: 4px;
    overflow: hidden;
    background: var(--background-primary, rgba(255, 255, 255, 0.03));
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-icon-fallback {
    width: 48px;
    height: 48px;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
}

.file-info {
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary, #ffffff);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
}

.file-meta {
    font-size: 0.75rem;
    color: var(--text-secondary, rgba(255, 255, 255, 0.7));
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.file-type {
    text-transform: capitalize;
}

.file-remove-btn {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.uploaded-file-card:hover .file-remove-btn {
    opacity: 1;
}

.file-remove-btn:hover {
    transform: scale(1.1);
    background: rgba(239, 68, 68, 1);
}

.file-remove-btn svg {
    width: 16px;
    height: 16px;
}

/* Responsive adjustments for upload UI */
@media (max-width: 767px) {
    .upload-area {
        padding: 2rem 1rem;
    }

    .upload-title {
        font-size: 1.25rem;
    }

    .upload-description {
        font-size: 0.875rem;
    }

    .uploaded-files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 0.75rem;
    }

    .uploaded-file-card {
        padding: 0.75rem;
    }

    .file-thumbnail {
        height: 100px;
    }
}

/* Lawyer Chat: three parts — header (fixed), body (scrollable), footer (fixed) */
.lawyer-chat-screen {
    min-height: 100vh;
    height: 100vh;
    background: radial-gradient(circle at top left, rgba(212, 175, 55, 0.18), transparent 55%),
        radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.15), transparent 55%),
        var(--bg-primary, #050507);
    color: var(--text-primary, #fff);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.lawyer-chat-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-card);
    background: var(--surface-card);
    box-shadow: var(--shadow-md);
    z-index: 10;
}

.lawyer-chat-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lawyer-chat-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-back-inline {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--gold-primary, #d4af37);
    cursor: pointer;
    border-radius: 8px;
}

.lawyer-chat-back-btn {
    display: grid !important;
}

.btn-back-inline:hover {
    background: var(--gold-bg-subtle);
}

.btn-back-inline .btn-icon {
    width: 24px;
    height: 24px;
}

.lawyer-chat-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.lawyer-chat-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 12px;
    background: linear-gradient(145deg, #facc6b 0%, #b8860b 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.08), 0 8px 20px rgba(0, 0, 0, 0.4);
    overflow: hidden;
}

.lawyer-chat-avatar--logo {
    background: var(--surface-card);
    border: 1px solid var(--border-card);
}

.lawyer-chat-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.lawyer-chat-avatar-initial {
    font-weight: 700;
    font-size: 1.15rem;
    color: #0b0b0c;
    letter-spacing: -0.02em;
}

.lawyer-chat-title .lawyer-chat-name {
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 180px;
}

.lawyer-chat-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #f8fafc;
    letter-spacing: -0.01em;
}

/* ── Read-only mode ── */
.lc-readonly-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #F5C86A;
    background: rgba(245, 200, 106, 0.1);
    border: 1px solid rgba(245, 200, 106, 0.22);
    padding: 2px 8px;
    border-radius: 8px;
    margin-left: 8px;
    vertical-align: middle;
    text-transform: uppercase;
}

.lc-readonly-sub {
    color: rgba(245, 200, 106, 0.6) !important;
}

.lawyer-chat-footer .lc-locked-banner {
    margin: 0;
    padding: 12px 0 0;
    border-top: none;
    background: transparent;
    border-radius: 0;
}

.lc-locked-banner {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    padding: 14px 0;
    background: rgba(245, 200, 106, 0.04);
    border-radius: 12px;
}

.lc-locked-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.lc-locked-text {
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.42);
    line-height: 1.4;
}

.btn-refresh-messages {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 6px 16px;
    font-size: 0.8rem;
    background: rgba(250, 250, 250, 0.06);
    color: #f9fafb;
    border: 1px solid rgba(148, 163, 184, 0.6);
    border-radius: 999px;
    cursor: pointer;
    font-weight: 500;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.7);
}

.btn-refresh-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-refresh-icon svg {
    width: 18px;
    height: 18px;
}

.btn-refresh-messages:hover:not(:disabled) {
    background: rgba(15, 23, 42, 0.9);
    border-color: rgba(248, 250, 252, 0.9);
}

.btn-lawyer-chat-proceed {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, var(--gold-primary, #f5c86a), #d5a953);
    color: #111827;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-lawyer-chat-proceed-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lawyer-chat-proceed-icon svg {
    width: 18px;
    height: 18px;
}

.btn-lawyer-chat-proceed:hover {
    background: linear-gradient(135deg, #ffe08c, #e0b75e);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
}

.btn-lawyer-chat-proceed:active {
    transform: translateY(1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

/* Body: scrollable area only */
.lawyer-chat-body {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.lawyer-chat-card {
    width: 100%;
    max-width: 820px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.04), transparent 60%),
        rgba(10, 10, 17, 0.96);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    box-shadow:
        0 22px 45px rgba(0, 0, 0, 0.65),
        0 0 0 1px rgba(255, 255, 255, 0.02);
    padding: 16px 16px 12px;
    backdrop-filter: blur(14px);
}

.lawyer-chat-card-header {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px 10px;
    margin-bottom: 4px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
}

.lawyer-chat-status-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.7);
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.2);
}

.lawyer-chat-status-dot.online {
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
}

.lawyer-chat-status-dot.offline {
    background: #f97373;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.3);
}

.lawyer-chat-status-text {
    font-weight: 400;
}

.lawyer-chat-container {
    display: block;
    max-width: 640px;
    margin: 0 auto;
    width: 100%;
    padding: 12px 12px 8px;
}

.lawyer-chat-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    color: var(--text-secondary);
}

.lawyer-chat-messages {
    padding: 16px 0;
    display: block;
}

.lawyer-chat-msg-wrapper {
    margin-bottom: 12px;
}

.lawyer-chat-msg-user .lawyer-chat-msg {
    margin-left: auto;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.18) 0%, rgba(184, 134, 11, 0.12) 100%);
    border: 1px solid rgba(245, 200, 106, 0.25);
    border-radius: 14px 14px 4px 14px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.lawyer-chat-msg-lawyer .lawyer-chat-msg {
    margin-right: auto;
    background: var(--surface-hover);
    border: 1px solid var(--border-card);
    border-radius: 14px 14px 14px 4px;
    box-shadow: var(--shadow-sm);
}

.lawyer-chat-msg {
    max-width: 85%;
    padding: 12px 16px;
}

.lawyer-chat-msg-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gold-primary, #d4af37);
    margin-bottom: 4px;
}

.lawyer-chat-msg-label-lawyer {
    color: var(--text-secondary);
}

.lawyer-chat-msg-body {
    margin: 0 0 4px 0;
    line-height: 1.4;
}

.lawyer-chat-msg-body a {
    color: #60a5fa;
    text-decoration: underline;
    word-break: break-all;
}

.lawyer-chat-msg-body a:hover {
    color: #93c5fd;
}

.lawyer-chat-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.lawyer-chat-empty {
    margin: auto;
    text-align: center;
    padding: 32px 24px;
    max-width: 320px;
}

.lawyer-chat-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: rgba(245, 200, 106, 0.12);
    border: 1px solid rgba(245, 200, 106, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold-primary, #F5C86A);
}

.lawyer-chat-empty-icon svg {
    width: 28px;
    height: 28px;
}

.lawyer-chat-empty-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #f9fafb;
    margin: 0 0 8px 0;
}

.lawyer-chat-empty-text {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.45;
}

/* Footer: fixed at bottom (composer or read-only banner) */
.lawyer-chat-footer {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(12, 10, 28, 0.6), rgba(8, 8, 18, 0.98));
    backdrop-filter: blur(12px);
}

.lawyer-chat-input-row,
.lawyer-chat-composer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    flex-shrink: 0;
}

.lawyer-chat-composer {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
}

/* Composer: soft elevated bar, no heavy borders */
.lawyer-chat-composer-bar {
    display: flex;
    align-items: stretch;
    gap: 0;
    background: rgba(18, 18, 24, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 10px 12px 10px 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 1px 0 rgba(255, 255, 255, 0.02) inset;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    min-height: 56px;
}

.lawyer-chat-composer-bar:focus-within {
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.04), 0 1px 0 rgba(255, 255, 255, 0.03) inset;
}

.lawyer-chat-input-wrap {
    flex: 1;
    min-width: 0;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-right: 12px;
    margin-right: 12px;
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.lawyer-chat-textarea {
    resize: vertical;
    min-height: 36px;
    max-height: 120px;
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-radius: 0;
    padding: 8px 0 4px;
    font-size: 0.9375rem;
    line-height: 1.5;
    overflow-y: auto;
    background: transparent;
}

.lawyer-chat-input-wrap .lawyer-chat-char-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0;
    min-height: 16px;
}

.lawyer-chat-char-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 4px;
}

.lawyer-chat-char-count {
    font-size: 0.65rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.28);
    text-transform: uppercase;
}

.lawyer-chat-char-count.lawyer-chat-char-over {
    color: #f87171;
    font-weight: 600;
}

.lawyer-chat-char-error {
    font-size: 0.7rem;
    color: #f87171;
    flex: 1;
    min-width: 0;
}

.lawyer-chat-composer .btn-lawyer-chat-send {
    flex-shrink: 0;
    min-width: 48px;
    width: 48px;
    height: 48px;
    min-height: 48px;
    align-self: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border-radius: 14px;
}

.lawyer-chat-composer .btn-lawyer-chat-send:has(.btn-lawyer-chat-send-loading) {
    width: auto;
    padding: 0 14px;
}

.lawyer-chat-msg-system .lawyer-chat-msg {
    margin-left: auto;
    margin-right: auto;
    background: linear-gradient(180deg, rgba(34, 197, 94, 0.14) 0%, rgba(22, 163, 74, 0.08) 100%);
    border: 1px solid rgba(34, 197, 94, 0.3);
    border-radius: 14px;
    max-width: 90%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.lawyer-chat-msg-label-system {
    color: rgba(34, 197, 94, 0.95);
}

.lawyer-chat-input {
    flex: 1;
    min-width: 0;
    padding: 8px 0 4px;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #f1f5f9;
    font-size: 0.9375rem;
    line-height: 1.5;
    transition: none;
}

.lawyer-chat-input::placeholder {
    color: rgba(255, 255, 255, 0.42);
}

.lawyer-chat-input:focus {
    outline: none;
}

.btn-lawyer-chat-send-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-lawyer-chat-send-icon svg {
    width: 17px;
    height: 17px;
    opacity: 0.95;
}

.btn-lawyer-chat-send-loading {
    font-weight: 500;
    opacity: 0.9;
}

.btn-lawyer-chat-send {
    flex-shrink: 0;
    padding: 0;
    min-height: 48px;
    box-sizing: border-box;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 235, 220, 0.98) 100%);
    color: var(--text-primary);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 14px;
    font-weight: 600;
    font-size: 0.875rem;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn-lawyer-chat-send:hover:not(:disabled) {
    background: linear-gradient(180deg, #fff 0%, rgba(252, 250, 245, 0.98) 100%);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
    transform: translateY(-1px);
}

.btn-lawyer-chat-send:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.3) inset;
}

.btn-lawyer-chat-send:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(26, 26, 26, 0.6);
}

.lawyer-chat-error {
    padding: 12px 20px;
    margin: 0 16px 16px;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    border-radius: 8px;
    color: #fca5a5;
}

.lawyer-chat-error-banner {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.16);
    border: 1px solid rgba(239, 68, 68, 0.6);
}

.lawyer-chat-error-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #fecaca;
}

.lawyer-chat-error-text {
    font-size: 0.8rem;
    color: #fecaca;
}

@media (max-width: 768px) {
    .lawyer-chat-header {
        padding: 10px 12px;
        gap: 8px;
    }

    .lawyer-chat-header-left {
        gap: 10px;
        min-width: 0;
    }

    .lawyer-chat-title {
        gap: 10px;
        min-width: 0;
    }

    .lawyer-chat-title .lawyer-chat-name {
        font-size: 1rem;
        max-width: 120px;
    }

    .lawyer-chat-avatar {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
        border-radius: 10px;
    }

    .lawyer-chat-header-right {
        gap: 8px;
    }

    /* Mobile: icon-only buttons (no text) */
    .btn-refresh-messages {
        padding: 0;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 50%;
    }

    .btn-refresh-messages .btn-refresh-text {
        display: none;
    }

    .btn-refresh-messages .btn-refresh-icon svg {
        width: 20px;
        height: 20px;
    }

    .btn-lawyer-chat-proceed {
        padding: 0;
        width: 40px;
        height: 40px;
        min-width: 40px;
        min-height: 40px;
        border-radius: 50%;
    }

    .btn-lawyer-chat-proceed .btn-proceed-text {
        display: none;
    }

    .btn-lawyer-chat-proceed-icon svg {
        width: 20px;
        height: 20px;
    }

    .lawyer-chat-body {
        padding: 12px 8px;
    }

    .lawyer-chat-card {
        padding: 12px 10px 10px;
        border-radius: 16px;
    }

    .lawyer-chat-footer {
        padding: 10px 12px 12px;
    }

    .lawyer-chat-composer-bar {
        min-height: 48px;
        padding: 8px 10px 8px 14px;
    }

    .lawyer-chat-composer .btn-lawyer-chat-send {
        min-width: 44px;
        width: 44px;
        height: 44px;
        min-height: 44px;
    }
}

/* Body and match screen scroll lock when lawyer chat panel is open - scroll only inside modal */
body.lawyer-chat-panel-open {
    overflow: hidden;
    height: 100%;
}

body.lawyer-chat-panel-open .match-screen,
body.lawyer-chat-panel-open .match-container {
    overflow: hidden;
    height: 100%;
}

/* Lawyer Chat Slide-in Panel (match screen) */
.lawyer-chat-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100vh;
    z-index: 1100;
    pointer-events: none;
}

.lawyer-chat-panel--open {
    pointer-events: auto;
}

.lawyer-chat-panel-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.lawyer-chat-panel--open .lawyer-chat-panel-backdrop {
    opacity: 1;
}

.lawyer-chat-panel-drawer {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 560px;
    height: 100vh;
    background: var(--surface-base);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.lawyer-chat-panel--open .lawyer-chat-panel-drawer {
    transform: translateX(0);
}

.lawyer-chat-panel-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 12;
    width: 40px;
    height: 40px;
    border: none;
    background: var(--surface-hover);
    color: var(--text-primary);
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lawyer-chat-panel-close:hover {
    background: var(--surface-elevated);
}

.lawyer-chat-panel-close svg {
    width: 22px;
    height: 22px;
}

.lawyer-chat-panel-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.lawyer-chat-panel-content .lawyer-chat-screen {
    /* min-height: 0; */
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
}

.lawyer-chat-panel-content .lawyer-chat-header {
    flex-shrink: 0;
}

.lawyer-chat-panel-content .lawyer-chat-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    padding: 12px 10px;
}

.lawyer-chat-panel-content .lawyer-chat-card {
    display: flex;
    flex-direction: column;
    padding: 12px 12px 0;
    height: 100%;
}

.lawyer-chat-panel-content .lawyer-chat-container {
    padding: 10px 10px 8px;
}

.lawyer-chat-panel-content .lawyer-chat-messages {
    padding: 16px 0;
    display: block;
}

.lawyer-chat-panel-content .lawyer-chat-footer {
    padding: 10px 12px 12px;
}

.lawyer-chat-panel-content .lawyer-chat-composer {
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .lawyer-chat-panel-drawer {
        max-width: 100%;
    }

    .lawyer-chat-panel-close {
        top: 10px;
        right: 10px;
    }
}

/* Match screen: Chat button on lawyer card */
.lawyer-select-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-lawyer-chat-link {
    padding: 8px 14px;
    background: transparent;
    color: var(--gold-primary, #d4af37);
    border: 1px solid var(--gold-primary, #d4af37);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-lawyer-chat-link:hover {
    background: rgba(212, 175, 55, 0.15);
}

/* Case preview (lawyer short-link view) */
.case-preview-screen {
    min-height: 100vh;
    background: var(--surface-base, #0B0B0C);
    padding: 24px 16px;
    box-sizing: border-box;
}

.case-preview-card {
    max-width: 560px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 28px 24px;
}

.case-preview-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #E5E5E7);
}

.case-preview-loading p {
    margin-top: 16px;
    font-size: 15px;
}

.case-preview-error {
    text-align: center;
    color: var(--text-secondary, #E5E5E7);
}

.case-preview-error h2 {
    font-size: 1.25rem;
    margin-bottom: 8px;
    color: var(--text-primary, #fff);
}

.case-preview-help {
    margin-top: 16px;
    font-size: 14px;
    opacity: 0.85;
}

.case-preview-content .case-preview-title {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text-primary, #fff);
}

.case-preview-intro {
    margin-bottom: 20px;
    color: var(--text-secondary, #E5E5E7);
    font-size: 15px;
    line-height: 1.5;
}

.case-preview-section {
    margin-bottom: 20px;
}

.case-preview-section h3 {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gold-primary, #F5C86A);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.case-preview-text {
    color: var(--text-secondary, #E5E5E7);
    font-size: 15px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

.case-preview-no-detail {
    color: var(--text-muted, #999);
    font-size: 14px;
    margin-bottom: 20px;
}

.case-preview-cta {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 14px;
    color: var(--text-muted, #999);
    line-height: 1.5;
}

/* ========== Chat list (WhatsApp-style) ========== */
.chat-list-screen.whatsapp-style {
    min-height: 100vh;
    background: var(--surface-base, #0B0B0C);
    display: flex;
    flex-direction: column;
    color: var(--text-primary, #f1f5f9);
}

.chat-list-sidebar-top {
    flex-shrink: 0;
    padding: 10px 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.chat-list-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 12px;
    border: none;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
}

.chat-list-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-list-back-btn:focus-visible {
    outline: 2px solid rgba(245, 200, 106, 0.5);
    outline-offset: 2px;
}

.chat-list-back-btn svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.chat-list-back-label {
    white-space: nowrap;
}

.chat-list-layout {
    flex: 1;
    display: flex;
    min-height: 0;
    position: relative;
}

.chat-list-sidebar {
    width: 100%;
    max-width: 380px;
    border-right: 1px solid var(--border-card);
    background: var(--surface-card);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.chat-list-search-wrap {
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface-hover);
    border-radius: 10px;
    margin: 10px 12px;
    cursor: text;
}

.chat-list-search-icon {
    display: inline-flex;
    color: var(--text-muted);
}

.chat-list-search-icon svg {
    width: 20px;
    height: 20px;
}

.chat-list-search-placeholder {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chat-list-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-list-search-input::placeholder {
    color: var(--text-muted);
}

.chat-list-conversations {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.chat-list-conv-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
    transition: background 0.15s;
}

.chat-list-conv-item:hover {
    background: var(--surface-hover);
}

.chat-list-conv-item.selected {
    background: var(--surface-elevated);
    border-left: 3px solid var(--gold-primary);
}

/* Signed lawyer: only the badge (.chat-list-signed-chip) distinguishes; no row background so "selected" is clear */

.chat-list-signed-chip {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(245, 200, 106, 0.16);
    color: var(--gold-primary, #F5C86A);
}

.chat-list-conv-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold-bg-subtle) 0%, var(--surface-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    border: none;
    cursor: pointer;
}

.chat-list-conv-avatar.has-logo {
    background: rgba(255, 255, 255, 0.08);
}

.chat-list-conv-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-list-conv-initial {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-primary, #F5C86A);
}

.chat-list-conv-body {
    flex: 1;
    min-width: 0;
}

.chat-list-conv-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}

.chat-list-conv-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-conv-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.chat-list-conv-preview {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-list-conv-firm {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
    opacity: 0.85;
}

.chat-list-empty-list,
.chat-list-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
    text-align: center;
}

.chat-list-empty-icon,
.chat-list-welcome-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(245, 200, 106, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.chat-list-empty-icon svg,
.chat-list-welcome-icon svg {
    width: 36px;
    height: 36px;
    color: var(--gold-primary, #F5C86A);
}

.chat-list-empty-title,
.chat-list-welcome-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 8px 0;
}

.chat-list-empty-text,
.chat-list-welcome-text {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

.chat-list-loading p {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.chat-list-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--surface-base);
}

.chat-list-chat-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 20px;
    background: rgba(18, 18, 20, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.chat-list-back-to-list {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.chat-list-back-to-list:hover {
    background: rgba(255, 255, 255, 0.1);
}

.chat-list-back-to-list svg {
    width: 22px;
    height: 22px;
}

.chat-list-chat-avatar {
    width: 48px;
    height: 48px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(245, 200, 106, 0.2) 0%, rgba(11, 11, 12, 0.4) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-list-chat-avatar:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 1px rgba(245, 200, 106, 0.32);
}

.chat-list-chat-avatar.has-logo {
    background: rgba(255, 255, 255, 0.08);
}

.chat-list-chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-list-chat-info {
    flex: 1;
    min-width: 0;
}

.chat-list-chat-name {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 2px 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-list-header-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.chat-list-header-badge--signed {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.35);
}

.chat-list-header-badge--readonly {
    background: rgba(148, 163, 184, 0.15);
    color: rgba(226, 232, 240, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

.chat-list-chat-firm {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin: 0 0 2px 0;
}

.chat-list-chat-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 2px 0 0 0;
    opacity: 0.9;
}

.chat-list-chat-hint--readonly {
    color: rgba(148, 163, 184, 0.9);
}

.chat-list-messages-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat-list-error-banner {
    padding: 10px 16px;
    background: rgba(239, 68, 68, 0.15);
    border-bottom: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    font-size: 0.875rem;
}

.chat-list-loading-msg {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chat-list-loading-msg p {
    margin-top: 12px;
    color: var(--text-muted);
}

.chat-list-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.chat-list-msg-wrapper {
    display: flex;
    width: 100%;
}

.chat-list-msg-wrapper.out {
    justify-content: flex-end;
}

.chat-list-msg-wrapper.in {
    justify-content: flex-start;
}

.chat-list-msg-wrapper.system {
    justify-content: right;
}

.chat-list-msg-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 14px;
    position: relative;
}

.chat-list-msg-wrapper.out .chat-list-msg-bubble {
    background: linear-gradient(180deg, rgba(245, 200, 106, 0.25) 0%, rgba(245, 200, 106, 0.12) 100%);
    border: 1px solid rgba(245, 200, 106, 0.3);
    border-bottom-right-radius: 4px;
}

.chat-list-msg-wrapper.in .chat-list-msg-bubble {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 4px;
}

.chat-list-msg-wrapper.system .chat-list-msg-bubble {
    background: rgba(34, 197, 94, 0.12);
    border: 1px solid rgba(34, 197, 94, 0.25);
}

.chat-list-msg-body {
    margin: 0 0 4px 0;
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text-primary);
}

.chat-list-msg-body a {
    color: var(--gold-primary, #F5C86A);
}

.chat-list-msg-time {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.chat-list-no-msg {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.chat-list-no-msg p {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.chat-list-composer {
    padding: 20px 24px 24px;
    background: linear-gradient(180deg, rgba(18, 18, 20, 0.98) 0%, rgba(11, 11, 12, 1) 100%);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
}

.chat-list-composer-readonly {
    padding: 14px 18px;
    text-align: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
}

.chat-list-composer-readonly-text {
    font-size: 0.82rem;
    color: var(--text-muted);
}

.chat-list-composer-bar {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 12px 14px 12px 20px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-list-composer-bar:focus-within {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(245, 200, 106, 0.35);
    box-shadow: 0 0 0 1px rgba(245, 200, 106, 0.15), 0 4px 20px rgba(0, 0, 0, 0.2);
}

.chat-list-input-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}

.chat-list-input {
    width: 100%;
    min-height: 48px;
    max-height: 120px;
    padding: 12px 0 4px 0;
    border: none;
    background: transparent;
    color: var(--text-primary, #f1f5f9);
    font-size: 0.95rem;
    line-height: 1.5;
    resize: none;
    font-family: inherit;
}

.chat-list-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.chat-list-input:focus {
    outline: none;
}

.chat-list-char-count {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.35);
    letter-spacing: 0.02em;
}

.chat-list-send-btn {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 16px;
    background: linear-gradient(145deg, #f0c14b 0%, #d4a02a 100%);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.8rem;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: 0 2px 10px rgba(212, 160, 42, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.chat-list-send-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(212, 160, 42, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.3);
    background: linear-gradient(145deg, #f5c86a 0%, #e0ad30 100%);
}

.chat-list-send-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.chat-list-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    box-shadow: none;
    background: rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.5);
}

.chat-list-send-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.chat-list-send-icon svg {
    width: 22px;
    height: 22px;
}

.chat-list-send-loading {
    font-size: 0.75rem;
}

.chat-list-welcome {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
    background: var(--surface-base);
}

@media (max-width: 767px) {
    .chat-list-sidebar {
        max-width: 100%;
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 2;
        transition: transform 0.25s ease;
    }

    .chat-list-sidebar.has-selection {
        transform: translateX(-100%);
    }

    .chat-list-back-to-list {
        display: inline-flex;
    }

    .chat-list-main {
        position: absolute;
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        z-index: 1;
    }

    .chat-list-welcome {
        display: none;
    }
}

/* ========== LIGHT THEME – Pain Mapping Screen Overrides ========== */

/* Instructions hint pill */
[data-theme="light"] .pain-instructions {
    background: rgba(251, 246, 239, 0.95);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-md);
    color: var(--text-primary);
}

[data-theme="light"] .instruction-text {
    color: var(--text-secondary);
}

/* Navigation bar (Continue button area) */
[data-theme="light"] .pain-navigation {
    background: rgba(251, 246, 239, 0.97);
    border-top-color: var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(160, 120, 64, 0.1);
}

/* Desktop nav (right-side card) */
@media (min-width: 768px) {
    [data-theme="light"] .pain-navigation {
        background: var(--surface-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
        border-top: 1px solid var(--border-subtle);
    }

    [data-theme="light"] .pain-slider-section {
        background: var(--surface-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
    }

    [data-theme="light"] .selected-parts-list {
        background: var(--surface-card);
        border: 1px solid var(--border-subtle);
        box-shadow: var(--shadow-md);
    }
}

/* Pain slider track */
[data-theme="light"] .pain-slider.premium-slider {
    background: rgba(160, 120, 64, 0.15);
}

/* Selected parts list panel */
[data-theme="light"] .selected-parts-list {
    background: rgba(251, 246, 239, 0.97);
    border-top-color: var(--gold-border);
    box-shadow: 0 -4px 20px rgba(160, 120, 64, 0.1);
}

/* Selected part list items */
[data-theme="light"] .selected-part-item {
    background: var(--surface-hover);
    border-color: var(--border-card);
}

[data-theme="light"] .selected-part-item:hover {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border);
}

/* Remove-part button */
[data-theme="light"] .btn-remove-part {
    background: var(--surface-base);
    border-color: var(--border-card);
    color: var(--text-muted);
}

[data-theme="light"] .btn-remove-part:hover {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.3);
    color: #dc2626;
}

/* Scrollbar in light mode */
[data-theme="light"] .selected-parts-items {
    scrollbar-color: rgba(200, 169, 110, 0.5) rgba(160, 120, 64, 0.1);
}

[data-theme="light"] .selected-parts-items::-webkit-scrollbar-track {
    background: rgba(160, 120, 64, 0.08);
}

[data-theme="light"] .selected-parts-items::-webkit-scrollbar-thumb {
    background: rgba(200, 169, 110, 0.5);
}

/* 3D Zoom buttons */
[data-theme="light"] .body3d-zoom-controls .zoom-btn {
    background: rgba(251, 246, 239, 0.95);
    border-color: var(--gold-border);
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
}

[data-theme="light"] .body3d-zoom-controls .zoom-btn:hover {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border-hover);
    color: var(--gold-dark);
}

/* Rotation hint tooltip */
[data-theme="light"] .rotation-hint {
    background: rgba(251, 246, 239, 0.95);
    border-color: var(--gold-border);
    color: var(--gold-dark);
    box-shadow: var(--shadow-sm);
}

/* 3D Loading text */
[data-theme="light"] .body3d-loading {
    color: var(--text-secondary);
}

/* Pain slider card background */
[data-theme="light"] .pain-slider-section {
    background: rgba(251, 246, 239, 0.97);
    border-top-color: var(--border-subtle);
    box-shadow: 0 -4px 20px rgba(160, 120, 64, 0.1);
}

/* AI thinking message border */
[data-theme="light"] .message.thinking {
    border-color: var(--border-subtle);
}

/* Chat input border */
[data-theme="light"] .chat-input {
    border-color: var(--border-card);
    background: var(--surface-card);
}

[data-theme="light"] .chat-input:focus {
    border-color: var(--gold-primary);
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.15);
}

/* ========== LIGHT THEME – UISI Questionnaire (Refine Score) ========== */

/* Page subtitle: white → warm muted brown */
[data-theme="light"] .questionnaire-subtitle {
    color: var(--text-secondary);
}

/* Question card (section) */
[data-theme="light"] .question-section {
    background: var(--surface-card);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .question-section:hover {
    border-color: var(--gold-border-hover);
    box-shadow: var(--shadow-md);
}

/* Section header divider */
[data-theme="light"] .section-header {
    border-bottom-color: var(--border-subtle);
}

/* Section weight subtitle */
[data-theme="light"] .section-weight {
    color: var(--text-muted);
}

/* Question label: white → dark brown */
[data-theme="light"] .question-label {
    color: var(--text-primary);
}

/* Question note: grey → soft muted */
[data-theme="light"] .question-note {
    color: var(--text-muted);
}

/* Form group label */
[data-theme="light"] .form-group label {
    color: var(--text-primary);
}

/* ── Radio / Checkbox option rows (the big dark grey boxes) ── */
[data-theme="light"] .radio-label,
[data-theme="light"] .checkbox-label {
    background: var(--surface-hover);
    border-color: var(--border-card);
    color: var(--text-primary);
}

[data-theme="light"] .radio-label:hover,
[data-theme="light"] .checkbox-label:hover {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border);
    box-shadow: var(--shadow-sm);
    color: var(--text-primary);
}

/* Radio button circle */
[data-theme="light"] .radio-label input[type="radio"],
[data-theme="light"] .checkbox-label input[type="checkbox"] {
    background: var(--surface-base);
    border-color: var(--gold-border);
}

/* Selected row */
[data-theme="light"] .radio-label:has(input[type="radio"]:checked),
[data-theme="light"] .checkbox-label:has(input[type="checkbox"]:checked) {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border-hover);
    box-shadow: 0 4px 12px rgba(200, 169, 110, 0.2);
}

[data-theme="light"] .radio-label:has(input[type="radio"]:checked) span,
[data-theme="light"] .checkbox-label:has(input[type="checkbox"]:checked) span {
    color: var(--text-primary);
    font-weight: 600;
}

/* Triage card */
[data-theme="light"] .triage-card {
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .triage-card h2 {
    color: var(--text-primary);
}

[data-theme="light"] .triage-card .text-muted {
    color: var(--text-secondary);
}

/* ========== LIGHT THEME – Lawyer Chat Screen ========== */

/* Screen bg: replace dark radial on #050507 */
[data-theme="light"] .lawyer-chat-screen {
    background:
        radial-gradient(circle at top left, rgba(200, 169, 110, 0.12), transparent 55%),
        radial-gradient(circle at bottom right, rgba(212, 168, 54, 0.08), transparent 55%),
        var(--surface-base);
    color: var(--text-primary);
}

/* Chat card: replace dark glass with ivory */
[data-theme="light"] .lawyer-chat-card {
    background: var(--surface-card);
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-md);
    backdrop-filter: none;
}

/* Card header (status bar) */
[data-theme="light"] .lawyer-chat-card-header {
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-subtle);
}

/* Lawyer name in header */
[data-theme="light"] .lawyer-chat-name {
    color: var(--text-primary);
}

/* Refresh button */
[data-theme="light"] .btn-refresh-messages {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border-color: var(--border-card);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .btn-refresh-messages:hover:not(:disabled) {
    background: var(--gold-bg-subtle);
    border-color: var(--gold-border);
    color: var(--gold-dark);
}

/* Avatar ring on light */
[data-theme="light"] .lawyer-chat-avatar {
    box-shadow: 0 0 0 2px var(--border-card), 0 4px 12px rgba(160, 120, 64, 0.2);
}

/* Footer: replace dark gradient */
[data-theme="light"] .lawyer-chat-footer {
    background: var(--surface-card);
    border-top-color: var(--border-card);
    backdrop-filter: none;
}

/* Composer bar */
[data-theme="light"] .lawyer-chat-composer-bar {
    background: var(--surface-hover);
    border-color: var(--border-card);
    box-shadow: var(--shadow-sm);
}

[data-theme="light"] .lawyer-chat-composer-bar:focus-within {
    border-color: var(--gold-border);
    box-shadow: 0 0 0 2px rgba(200, 169, 110, 0.15);
}

/* Input text + placeholder */
[data-theme="light"] .lawyer-chat-input {
    color: var(--text-primary);
}

[data-theme="light"] .lawyer-chat-input::placeholder {
    color: var(--text-muted);
}

/* Input wrap divider */
[data-theme="light"] .lawyer-chat-input-wrap {
    border-right-color: var(--border-subtle);
}

/* Char count */
[data-theme="light"] .lawyer-chat-char-count {
    color: var(--text-muted);
}

/* Empty state */
[data-theme="light"] .lawyer-chat-empty-title {
    color: var(--text-primary);
}

[data-theme="light"] .lawyer-chat-empty-text {
    color: var(--text-secondary);
}

/* Locked banner text */
[data-theme="light"] .lc-locked-text {
    color: var(--text-muted);
}

/* User message bubble: warmer amber on cream */
[data-theme="light"] .lawyer-chat-msg-user .lawyer-chat-msg {
    background: linear-gradient(135deg, rgba(200, 169, 110, 0.15) 0%, rgba(180, 140, 70, 0.08) 100%);
    border-color: rgba(200, 169, 110, 0.3);
    box-shadow: var(--shadow-sm);
}