* {
    box-sizing: border-box;
}

.chat {
    position: relative;
    margin: 40px auto 0;
    height: 400px;
    width: 50%;
}

.chat-msgs {
    padding: 10px 0;
    height: 400px;
    overflow-x: hidden;
    overflow-y: auto;
}

#main::-webkit-scrollbar-track {
    border: 0px solid #FFF;
    background-color: #FFF;
}

#main::-webkit-scrollbar {
    width: 5px;
    background-color: #FFF;
}

#main::-webkit-scrollbar-thumb {
    background-color: #FFF;
}

.chat-fade {
    position: absolute;
    height: 30px;
    width: 100%;
    z-index: 10;
}

.chat-fade.start {
    top: 0;
    left: 0;
}

.chat-fade.end {
    bottom: 0;
    left: 0;
}

.msg {
    display: flex;
    opacity: 0;
    animation: 0.5s cubic-bezier(.22, .91, .34, 1.13) 1s msg-enter;
    animation-fill-mode: forwards;
    animation-delay: 0.2s;
}

.msg-visitor {
    flex-direction: row-reverse;
}

@keyframes msg-enter {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-avatar {
    border-radius: 24px;
    height: 40px;
    width: 40px;
    margin: 0;
    border: 2px solid #ccc8cd;
}

.msg-avatar img {
    border-radius: 20px;
    height: 36px;
    width: 36px;
}

.msg-content {
    padding: 12px 15px;
    margin: 20px;
    position: relative;
    font-size: 16px;
    line-height: 20px;
}

.msg-andrew .msg-content {
    border-radius: 0 5px 5px 5px;
    max-width: 300px;
    background: #354B5E;
    color: #fff;
}

.msg-andrew .msg-content:before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    left: -10px;
    top: 0;
    border-top: 10px solid #354B5E;
    border-left: 10px solid transparent;
}

.msg-visitor .msg-content {
    border-radius: 5px 0 5px 5px;
    max-width: 300px;
    background: #F0EAF3;
    color: #3e3e3e;
    font-size: 16px;
    line-height: 20px;
}

.msg-visitor .msg-content:before {
    content: '';
    position: absolute;
    width: 0;
    height: 0;
    right: -10px;
    top: 0;
    border-top: 10px solid #F0EAF3;
    border-right: 10px solid transparent;
}

@keyframes blink {
    from,
    to {
        border-color: transparent
    }
    50% {
        border-color: black
    }
}

.blinking {
    border-left: 1px solid black;
    animation: 1s blink step-end infinite;
}

.content {
    display: none;
}

.speech-center {
    margin-top: 10px;
    text-align: center;
}


#score {
    font-size: 16px;
    font-weight: bold;
    color: #27ae60; /* green */
    margin-top: 20px;
    text-align: center;
}



 .result-area {
            max-width: 980px;
            margin: 90px auto 80px auto;
            text-align: center;
            clear: both;
        }

        .result-back-link {
            display: none;
            margin: 0 0 22px 0;
            font-size: 18px;
            line-height: 1.4;
        }

        #score {
            display: none;
            width: min(980px, calc(100% - 32px));
            margin: 24px auto 32px auto;
            color: #f8fafc;
            font-size: 16px;
            font-weight: 600;
            line-height: 1.4;
            position: static;
        }

        .score-breakdown {
            overflow: hidden;
            border: 1px solid rgba(148, 163, 184, 0.34);
            border-radius: 16px;
            background: rgba(15, 23, 42, 0.94);
            box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
            text-align: left;
        }

        .score-breakdown-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            padding: 18px 20px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.22);
        }

        .score-breakdown-title {
            margin: 0;
            color: #f8fafc;
            font-size: 18px;
            font-weight: 700;
        }

        .score-final-points {
            color: #86efac;
            font-size: 24px;
            font-weight: 800;
            white-space: nowrap;
        }

        .score-points-grid {
            display: grid;
            grid-template-columns: repeat(6, minmax(110px, 1fr));
            gap: 1px;
            background: rgba(148, 163, 184, 0.18);
        }

        .score-point-card {
            min-height: 92px;
            padding: 14px;
            background: rgba(15, 23, 42, 0.98);
        }

        .score-point-label {
            display: block;
            margin-bottom: 8px;
            color: #94a3b8;
            font-size: 12px;
            font-weight: 700;
            letter-spacing: 0.04em;
            text-transform: uppercase;
        }

        .score-point-value {
            display: block;
            color: #f8fafc;
            font-size: 21px;
            font-weight: 800;
        }

        .score-point-value.positive { color: #86efac; }
        .score-point-value.negative { color: #fca5a5; }
        .score-point-value.custom-positive { color: #93c5fd; }
        .score-point-value.custom-negative { color: #f9a8d4; }

        .score-feedback {
            padding: 16px 20px;
            color: #cbd5e1;
            font-size: 16px;
            font-weight: 500;
            line-height: 1.65;
        }

        .score-feedback-text {
            margin-top: 5px;
        }


        .score-adjustment-group-title.bonus {
            color: #86efac;
        }

        .score-adjustment-group-title.penalty {
            color: #fca5a5;
        }

        .score-adjustment-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 20px;
            padding: 7px 0;
            border-bottom: 1px solid rgba(148, 163, 184, 0.12);
            color: #cbd5e1;
        }

        .score-adjustment-row:last-child {
            border-bottom: 0;
        }

        .adjustment-positive {
            color: #86efac;
        }

        .adjustment-negative {
            color: #fca5a5;
        }

        @media (max-width: 560px) {
            .score-adjustment-row {
                align-items: flex-start;
                flex-direction: column;
                gap: 3px;
            }
        }

        .score-default-badge {
            display: inline-flex;
            margin-top: 10px;
            padding: 4px 9px;
            border: 1px solid rgba(250, 204, 21, 0.35);
            border-radius: 999px;
            color: #fde68a;
            background: rgba(113, 63, 18, 0.28);
            font-size: 12px;
        }

        @media (max-width: 900px) {
            .score-points-grid {
                grid-template-columns: repeat(3, minmax(110px, 1fr));
            }
        }

        @media (max-width: 560px) {
            .score-breakdown-header {
                align-items: flex-start;
                flex-direction: column;
            }

            .score-points-grid {
                grid-template-columns: repeat(2, minmax(100px, 1fr));
            }
        }

        .score-completion-message {
            padding: 16px 20px;
            border-bottom: 1px solid rgba(148, 163, 184, 0.22);
            background: rgba(22, 101, 52, 0.24);
            color: #bbf7d0;
            font-size: 20px;
            font-weight: 800;
            text-align: center;
        }

        #feedbackPanel {
            display: none;
            width: 100%;
            margin: 0 auto;
            border: 2px solid #4caf50;
            border-radius: 16px;
            background: #f8fff8;
            padding: 28px 34px;
            box-sizing: border-box;
            text-align: center;
        }

        #feedbackPanel h3 {
            margin: 0 0 12px 0;
            color: #2e7d32;
            font-size: 24px;
            font-weight: 700;
        }

        #feedbackPanel hr {
            margin: 12px 0 24px 0;
            border: 0;
            border-top: 1px solid #bfd8bf;
        }

        #conversation-summary {
            white-space: normal;
            line-height: 1.9;
            font-size: 16px;
            color: #222;
        }

        .summary-section-title {
            display: block;
            font-weight: 700;
            margin-top: 22px;
            margin-bottom: 10px;
            color: #1b5e20;
            font-size: 18px;
        }

        .summary-list {
            margin: 10px auto 14px auto;
            padding-left: 28px;
            display: inline-block;
            text-align: left;
            max-width: 760px;
        }

        .summary-list li {
            margin-bottom: 8px;
        }

        .route-tree {
            margin-top:24px;
            padding:16px;
            border:1px solid #ccc;
            background:#fff;
            text-align:left;
        }

        .route-node {
            margin:8px 0;
            padding:10px 12px;
            border-left:5px solid #ccc;
            background:#f5f5f5;
        }

        .route-node.chosen {
            border-left-color:#2faa5a;
            background:#eaf8ef;
        }

        .route-node.option {
            margin-left:28px;
        }

        .route-node.try {
            border-left-color:#f59e0b;
            background:#fff7e6;
        }

        .route-label {
            font-weight:bold;
        }