* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(5deg, hsl(0 0% 100% / 1), #006cff);
    background-position: center;
    min-height: 100vh;
    background-attachment: fixed;
    background-size: contain;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

/* Parallax Cloud Layers */
.parallax-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: calc(100% + 100vh);
    pointer-events: none;
    z-index: 1;
}

#cloudsLayer1 {
    z-index: 1;
}

#cloudsLayer2 {
    z-index: 2;
}

#cloudsLayer3 {
    z-index: 3;
}

#cloudsLayer4 {
    z-index: 4;
}

.cloud {
    position: absolute;
    pointer-events: none;
    /* drift + bob handled by JS */
    will-change: transform;
}

.layer-fill {
    position: fixed;
    /* top: 0; */
    /* left: 0; */
    width: 100%;
    height: 100%;
    pointer-events: none;
    fill-opacity: 1;
}
.layer-fill-overlay{
    background: linear-gradient(0deg, #a2ecff, #0098ff0f);
    opacity: 1;
}
.layer-fill-far {
    background-color: #5995c900;
}

.layer-fill-medium {
    background-color: #5995c93b;
}

.layer-fill-close {
    background-color: #5995c92b;
}

.cloud-far {
    width: 75px;
    height: auto;
}

.cloud-medium {
    width: 250px;
    height: auto;
}

.cloud-close {
    width: 400px;
    height: auto;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) translateX(0px);
    }
    25% {
        transform: translateY(-10px) translateX(5px);
    }
    50% {
        transform: translateY(0px) translateX(10px);
    }
    75% {
        transform: translateY(10px) translateX(5px);
    }
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    /* overflow: hidden; */
    position: relative;
    z-index: 10;
}

h1 {
    color: #275985;
    margin: 0;
    font-size: 2rem;
}

.header-image {
    width: 100%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 7px 7px 0px 0px;
}

.header {
    margin-bottom: 0;
    text-align: center;
}

/* Filter Bar */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.filter-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-bar label {
    font-weight: 600;
    color: #555;
}

.category-select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 150px;
}

.category-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.category-text-input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.9rem;
    min-width: 150px;
}

.category-text-input::placeholder {
    color: #999;
    font-style: italic;
}

.btn-add {
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-add:hover {
    filter: brightness(1.1);
}

.btn-add:active {
    transform: translateY(0);
}

.btn-toggle-all {
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    /* margin-left: 10px; */
    line-height: 1;
}

.btn-toggle-all:hover {
    background: #1976D2;
    transform: scale(1.05);
}

.response-count {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: normal;
    margin-left: 8px;
}

/* Floating Action Button */
.fab {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 40px;
}

.fab:hover {
    filter: brightness(1.1);
}

.fab:active {
    transform: translateY(0);
}

/* Cloud Control Slider */
.cloud-control {
    position: fixed;
    bottom: 30px;
    right: 110px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 8px 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
}

.cloud-label {
    font-size: 16px;
    margin: 0;
    opacity: 0.8;
}

.cloud-slider {
    width: 100px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

.cloud-slider::-webkit-slider-thumb {
    appearance: none;
    width: 16px;
    height: 16px;
    background: #5995c9;
    border-radius: 50%;
    cursor: pointer;
}

.cloud-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #5995c9;
    border-radius: 50%;
    border: none;
    cursor: pointer;
}

.cloud-randomize-btn {
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cloud-randomize-btn:hover {
    background: #4a7ba7;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: #cccccc;
    margin: 5% auto;
    padding: 16px;
    border-radius: 7PX;
    max-width: 500px;
    max-height: 88vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.close {
    position: absolute;
    right: 15px;
    top: 10px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: #333;
}

h2 {
    color: #555;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.form-group {
    /* margin-bottom: 25px; */
}

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 600;
    font-size: 0.7rem;
}

input[type="text"],
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s;
}

input[type="text"]:focus,
textarea:focus {
    outline: none;
    border-color: #4a90e2;
}

textarea {
    min-height: 120px;
    resize: vertical;
}

.btn-submit {
    width: 100%;
    margin-top: 8px;
    padding: 14px;
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 5PX;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-submit:hover {
    background: #8abeeb;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: space-between;
    margin-top: 15px;
}

.btn-delete {
    padding: 14px;
    background: #f44336;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-delete:hover {
    background: #da190b;
}

.btn-delete:active {
    transform: translateY(1px);
}

.auth-error {
    margin-top: 15px;
    padding: 10px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    font-size: 0.9rem;
    text-align: center;
}
.condition-title-section{
    width:100%;
}
.message {
    margin: 20px 40px 0 40px;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    display: none;
}

.message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

#entriesList {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 0 40px 40px 40px;
}

.scenario-group {
    background: #5995c9;
    padding-top: 4px;
    padding-right: 4px;
    padding-left: 4px;
    /* padding-bottom: 4px; */
    border-radius: 5px;
}

.scenario-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
    cursor: pointer;
    padding: 3px 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.scenario-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.scenario-title-section {
    display: flex;
    flex-direction: column;
    width:100%;
}

.scenario-toggle-arrow {
    margin-left: 8px;
    font-size: 0.8rem;
    transition: transform 0.3s ease;
    color: rgba(255, 255, 255, 0.8);
}

.scenario-group.collapsed .scenario-toggle-arrow {
    transform: rotate(-90deg);
}

.scenario-title {
    font-weight: 600;
    color: #ffffff;
    margin: 0;
    font-size: 1rem;
    margin-left: 6px;
}

.scenario-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.scenario-buttons .scenario-category {
    font-size: 0.6rem;
    font-weight: 500;
    opacity: 0.9;
    margin-right: 4px;
}

/* Hamburger Menu Styles */
.hamburger-menu {
    position: relative;
    display: inline-block;
}

.hamburger-btn {
    border: none;
    border-radius: 4px;
    padding: 0;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 30px;
    height: 21px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    line-height: 1;
    font-family: monospace;
}

.hamburger-btn:hover {
    filter: brightness(1.2);
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 5px);
    background: white;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    min-width: 160px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    border-bottom: 1px solid #f0f0f0;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.dropdown-item:first-child {
    border-radius: 6px 6px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 6px 6px;
}

.dropdown-icon {
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

.dropdown-text {
    font-size: 0.85rem;
    color: #333;
    font-weight: 500;
}

.btn-add-response {
    background: #93caff;
    color: #185183;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-add-response:hover {
    background: #357abd;
    transform: scale(1.05);
}

.btn-add-response:active {
    transform: scale(0.95);
}

.responses-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
    /* max-height: 1000px; */
    overflow: hidden;
    transition: max-height 0.3s ease;
    /* margin-top: 4px; */
    /* padding-top: 1px; */
}

.responses-list.menu-open {
    overflow: visible;
}

.scenario-group.collapsed .responses-list {
    max-height: 0;
    margin-bottom: 0;
}

/* Condition Styles */
.condition-group {
    margin-top: 5px;
    border-radius: 4px;
    /* border-left: 3px solid #93caff; */
    /* border: 2px solid black; */
    background: #00000024 !important;
}

.condition-group.collapsed .condition-responses {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.condition-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.condition-header:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.condition-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #ffffff;
    margin: 0;
}

.condition-description {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 2px 0 0 20px;
    font-style: italic;
}

.condition-buttons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.condition-responses {
    padding-left: 20px;
    padding-right: 5px;
    /* max-height: 1000px; */
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.condition-responses.menu-open {
    overflow: visible;
}

/* Nested condition indentation */
.condition-depth-1 {
    margin-left: 15px;
    border-left-color: #76b4ff;
}

.condition-depth-2 {
    margin-left: 30px;
    border-left-color: #5a9eff;
}

.condition-depth-3 {
    margin-left: 45px;
    border-left-color: #3d88ff;
}
.single-response-wrapper:first-child{
    margin-top:4px;
    
}
.single-response-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    /* margin-bottom: 5px; */
}

/* Action response type */
/* Outer wrapper matches single-response-wrapper layout */
.action-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.action-wrapper:first-child {
    margin-top: 4px;
}

.action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    /* flex: 1; */
    background: #fff8e1;
    /* border-left: 4px solid #f59e0b; */
    border-radius: 6px;
    padding: 3px 10px 3px 8px;
    margin: 2px 0;
}

.action-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.15));
}

.action-text {
    flex: 1;
    font-weight: bold;
    font-size: 0.8rem;
    color: #92400e;
    line-height: 1.5;
    font-style: italic;
}

.action-wrapper:hover .rating-btn,
.action-wrapper:hover .edit-btn {
    opacity: 1;
}

.global-action-wrapper {
    display: flex;
    align-items: flex-start;
    margin: 2px 0;
}

.global-action-wrapper:first-child {
    margin-top: 4px;
}

.global-action-item {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    background: #fff8e1;
    border-top: 3px solid #f59e0b;
    border-bottom: 3px solid #f59e0b;
    padding: 6px 10px;
    border-radius: 5px;
    margin-left: 9px;
}

.global-action-icon-outer {
    flex-shrink: 0;
    margin-left: 5px;
    /* margin-top: -2px; */
}

.globe-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.global-action-wrapper:hover .rating-btn,
.global-action-wrapper:hover .edit-btn {
    opacity: 1;
}

.speaking-head {
    flex-shrink: 0;
    margin-top: -4px;
    margin-left: 5px;
    position: relative;
}

.speaking-head .head-play-btn,
.message-head .head-play-btn {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 0.75rem;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s ease;
    padding: 0;
    line-height: 1;
}

.speaking-head:hover .head-play-btn,
.message-head:hover .head-play-btn {
    opacity: 1;
}

.head-play-btn.head-play-playing {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.65);
}

.head-image {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.response-item {
    background: white;
    padding: 2px 6px;
    border-radius: 3px;
    /* border-left: 3px solid #ddd; */
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    padding-right: 3px;
    transition: all 0.3s ease;
}

.response-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.response-inline-action {
    display: flex;
    align-items: flex-start;
    gap: 4px;
    margin-top: 4px;
    font-size: 0.72rem;
    color: #92400e;
    font-style: italic;
    opacity: 0.85;
    font-weight: bold;
}

.response-inline-action-icon {
    flex-shrink: 0;
    font-style: normal;
    font-size: 0.75rem;
    line-height: 1.4;
}

.label-optional {
    font-size: 0.75rem;
    font-weight: normal;
    color: #999;
}

.response-item.speech-bubble {
    position: relative;
    border-radius: 8px;
    padding: 4px 12px;
}

.response-item.speech-bubble::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 9px;
    width: 0;
    height: 0;
    border-top: 8px solid transparent;
    border-bottom: 8px solid transparent;
    border-right: 8px solid white;
    z-index: 1;
}

.response-item.highlight {
    background: #fffacd;
    transform: scale(1.02);
}

.scenario-group.highlight {
    background: #fffacd;
    transform: scale(1.01);
    transition: all 0.4s ease;
}

.response-text {
    color: #555;
    line-height: 1.5;
    flex: 1;
    font-weight: bold;
    font-size: 0.8rem;
}

.rating-section {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.score {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 30px;
    text-align: center;
    transition: all 0.3s ease;
}

.score.positive {
    color: #28a745;
}

.score.negative {
    color: #dc3545;
}

.score.neutral {
    color: #666;
}

.rating-buttons {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.rating-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 2px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    transition: all 0.2s;
    opacity: 0;
}

.response-item:hover .rating-btn,
.conversation-item:hover .rating-btn,
.single-response-wrapper:hover .rating-btn {
    opacity: 1;
}

.rating-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.edit-btn {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1px 2px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s, all 0.2s;
}

.response-item:hover .edit-btn,
.conversation-item:hover .edit-btn,
.single-response-wrapper:hover .edit-btn {
    opacity: 1;
}

.edit-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.rating-btn:active {
    transform: scale(0.95);
}

.rating-btn span {
    font-weight: 600;
    color: #666;
}

.no-entries {
    text-align: center;
    color: #999;
    padding: 40px;
    font-style: italic;
}

.no-responses {
    text-align: center;
    color: #ffffff;
    padding: 20px;
    font-style: italic;
    font-size: 0.9rem;
}

@media (max-width: 600px) {
    .container {
        padding: 25px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

/* Conversation Display Styles */
.conversation-item {
    border-radius: 5px;
    padding: 2px;
    margin: 0px 0;
    /* border: 2px solid #e9ecef; */
    display: flex;
    align-items: flex-start;
    /* gap: 15px; */
    margin-bottom: 10px;
}

.conversation-content {
    flex: 1;
    /* max-height: 300px; */
    overflow-y: auto;
    font-size: 0.8em;
    font-weight: bold;
    padding: 5px;
}

.conversation-item .conversation-messages {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.message-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: 80%;
}

.message-wrapper-left {
    align-self: flex-start;
    flex-direction: row;
}

.message-wrapper-right {
    align-self: flex-end;
    flex-direction: row-reverse;
}

/* Action step inside a conversation */
.message-wrapper-action {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff8e1;
    border-left: 3px solid #f59e0b;
    border-radius: 5px;
    padding: 4px 10px;
    font-style: italic;
    color: #92400e;
    max-width: 80%;
}

/* Full-width global action */
.message-wrapper-action-overall {
    align-self: stretch;
    max-width: 100%;
    justify-content: center;
    text-align: center;
    border-left: none;
    border-top: 3px solid #f59e0b;
    border-bottom: 3px solid #f59e0b;
    border-radius: 4px;
}

/* Left-aligned action (left speaker did something) */
.message-wrapper-action-left {
    align-self: flex-start;
}

/* Right-aligned action (right speaker did something) */
.message-wrapper-action-right {
    align-self: flex-end;
    border-left: none;
    border-right: 3px solid #f59e0b;
}

.conv-action-icon {
    font-style: normal;
    flex-shrink: 0;
}

.conv-action-icon .globe-image {
    width: 24px;
    height: 24px;
}

.message-head {
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}

.head-image-conversation {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.conversation-item .rating-section {
    align-items: flex-start;
    gap: 10px;
    padding-right: 0;
    transition: all 0.3s ease;
}

.message-bubble {
    max-width: none;
    flex: 1;
    padding: 6px 10px;
    border-radius: 8px;
    word-wrap: break-word;
    position: relative;
}

.message-left {
    background: #ffffff;
    color: #333;
    border-bottom-left-radius: 4px;
}

.message-left::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 8px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-right: 6px solid #ffffff;
}

.message-right {
    background: #ffffff;
    color: #272727;
    border-bottom-right-radius: 4px;
}

.message-right::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 8px;
    width: 0;
    height: 0;
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
    border-left: 6px solid #ffffff;
}



/* Conversation Builder Styles */
.response-fields {
    margin-top: 15px;
}

.conversation-message {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 4px;
    margin-bottom: 10px;
    background: #dfdfdf;
}

.conversation-message:last-child {
    margin-bottom: 15px;
}

.message-side {
    width: 100%;
    padding: 2px 4px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: white;
    margin-bottom: 10px;
}

.message-text {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    resize: vertical;
    font-size: 14px;
    font-family: inherit;
}

/* =============================================
   LanguageTool grammar panel
   ============================================= */

.lt-panel {
    margin-top: 4px;
    border-radius: 5px;
    overflow: hidden;
    border: 1px solid #f0a040;
    background: #fffbf4;
    font-size: 0.8rem;
}

.lt-summary {
    display: block;
    width: 100%;
    text-align: left;
    background: #fff3d0;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #7a4a00;
    font-weight: 600;
}

.lt-summary:hover {
    background: #ffe9a0;
}

.lt-issue-list {
    display: none;
    max-height: 260px;
    overflow-y: auto;
    padding: 4px 0;
}

.lt-panel-open .lt-issue-list {
    display: block;
}

.lt-issue {
    padding: 6px 10px;
    border-bottom: 1px solid #f0ddb0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.lt-issue:last-child {
    border-bottom: none;
}

.lt-issue-msg {
    color: #444;
}

.lt-issue-context {
    color: #888;
    word-break: break-all;
}

.lt-issue-context mark {
    background: #ffe08a;
    border-radius: 2px;
    padding: 0 1px;
    color: #333;
}

.lt-fixes {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.lt-fix-btn {
    background: #4caf501a;
    border: 1px solid #4caf50;
    color: #2a6a2a;
    border-radius: 3px;
    padding: 1px 7px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: background 0.15s;
}

.lt-fix-btn:hover {
    background: #4caf5030;
}

.add-message-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    margin-bottom: 15px;
    transition: background-color 0.3s;
}

.add-message-btn:hover {
    background: #45a049;
}

.remove-message-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    float: right;
    margin-top: -10px;
    margin-right: -10px;
}

.remove-message-btn:hover {
    background: #da190b;
}

#responseType {
    width: 100%;
    padding: 3px 4px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    background: white;
}

/* ============================================
   Minecraft Item Picker
   ============================================ */

.mc-picker {
    position: relative;
    margin-top: 6px;
}

.mc-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    font-size: 12px;
    color: #555;
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.mc-toggle-btn:hover {
    background: #e2eaf8;
    border-color: #4a90e2;
    color: #2060c0;
}

.mc-toggle-btn.active {
    background: #d8e8fb;
    border-color: #4a90e2;
    color: #2060c0;
}

.mc-search {
    width: 100%;
    margin-top: 6px;
    padding: 7px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 13px;
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.mc-search:focus {
    border-color: #4a90e2;
    background: white;
}

.mc-results {
    display: none;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    padding: 8px;
    margin-top: 4px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    position: relative;
    z-index: 20;
}

.mc-result-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
    text-align: center;
    border: 1px solid transparent;
}

.mc-result-item:hover {
    background: #e8f0fe;
    border-color: #4a90e2;
}

.mc-result-icon {
    width: 32px;
    height: 32px;
    image-rendering: pixelated;
    object-fit: contain;
}

.mc-result-label {
    font-size: 10px;
    color: #444;
    margin-top: 3px;
    line-height: 1.2;
    word-break: break-word;
    max-width: 72px;
}

.mc-no-results {
    grid-column: 1 / -1;
    text-align: center;
    color: #888;
    font-size: 13px;
    padding: 10px;
}

/* Inline MC icons rendered in response text */
.mc-icon {
    width: 16px;
    height: 16px;
    image-rendering: pixelated;
    vertical-align: -3px;
    margin: 0 1px;
    object-fit: contain;
}

/* =============================================
   Drag and Drop
   ============================================= */

.drag-handle {
    cursor: grab;
    color: rgba(255, 255, 255, 0.35);
    font-size: 15px;
    padding: 2px 5px;
    user-select: none;
    flex-shrink: 0;
    border-radius: 3px;
    transition: color 0.15s, background 0.15s;
    line-height: 1;
}

.drag-handle:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.12);
}

.drag-handle:active {
    cursor: grabbing;
}

.scenario-drag-handle {
    color: rgba(255, 255, 255, 0.25);
    font-size: 16px;
    margin-right: 2px;
}

/* Multi-select */
[data-drag-type="entry"].item-selected {
    box-shadow: 0 0 0 2px #4a90e2;
    border-radius: 4px;
}

.condition-group.item-selected > .condition-header {
    box-shadow: 0 0 0 2px #4a90e2;
    border-radius: 4px;
}

.scenario-group.item-selected > .scenario-header {
    box-shadow: 0 0 0 2px #4a90e2;
    border-radius: 4px;
}

[data-drag-type].dragging,
.condition-group.dragging,
.scenario-group.dragging {
    opacity: 0.4;
    pointer-events: none;
}

[data-drop-zone].drag-over {
    outline: 2px dashed rgba(255, 255, 255, 0.55);
    outline-offset: -2px;
    background: rgba(255, 255, 255, 0.07) !important;
    border-radius: 4px;
}

/* Root drop zone — promote a condition to a scenario */
body.is-dragging-condition .container {
    outline: 2px dashed rgba(255, 255, 255, 0.15);
    outline-offset: -4px;
    border-radius: 8px;
    transition: outline-color 0.15s;
}

.container.root-drag-over {
    outline: 2px dashed rgba(255, 255, 255, 0.6) !important;
    background: rgba(255, 255, 255, 0.04) !important;
}

/* ============================================
   Tab Navigation
   ============================================ */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #5995c9;
    margin: 0 0 0 0;
}

.tab-btn {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    padding: 10px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #888;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    border-radius: 6px 6px 0 0;
}

.tab-btn:hover {
    color: #5995c9;
}

.tab-btn.active {
    color: #5995c9;
    border-bottom-color: #5995c9;
    background: rgba(89, 149, 201, 0.06);
}

/* ============================================
   Record Tab
   ============================================ */
#recordList {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 16px 20px 40px 20px;
}

.record-loading {
    padding: 20px;
    text-align: center;
    color: #888;
    font-style: italic;
}

.record-section {
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.record-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 7px 12px;
}

.record-crumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
}

.record-crumb-scenario {
    color: #fff;
}

.record-crumb-condition {
    color: rgba(255,255,255,0.85);
    font-weight: 500;
}

.record-crumb-sep {
    color: rgba(255,255,255,0.5);
    font-size: 0.8rem;
}

.record-header-count {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.7);
    background: rgba(0,0,0,0.15);
    border-radius: 10px;
    padding: 1px 8px;
    flex-shrink: 0;
}

.record-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    font-size: 0.9rem;
    line-height: 1.5;
}

.record-row:last-child {
    border-bottom: none;
}

.record-row-side {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    width: 80px;
    padding-top: 2px;
}

.record-row-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.record-row-emoji {
    font-size: 1.1rem;
    line-height: 1;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.record-row-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.record-row-text {
    flex: 1;
    color: #333;
    word-break: break-word;
}

.record-row-inline-action {
    margin-top: 4px;
    font-size: 0.8rem;
    color: #92400e;
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 4px;
}

.record-inline-icon {
    font-size: 0.9rem;
}

/* Subtle background tints per row type */
.record-row-action,
.record-row-action-left,
.record-row-action-right {
    background: #fffbf0;
}

.record-row-global-action {
    background: #fffbf0;
    border-left: 3px solid #f59e0b;
}

.record-row-right {
    background: #f8fbff;
}

/* ============================================
   Dropbox config bar
   ============================================ */
.dropbox-config {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: #f0f4f8;
    border-bottom: 1px solid #dde6ef;
    font-size: 0.85rem;
    flex-wrap: wrap;
}

#dropboxConnected,
#dropboxSetup {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    width: 100%;
}

.dropbox-status-text {
    color: #555;
    font-weight: 500;
    white-space: nowrap;
}

.dropbox-token-input {
    flex: 1;
    min-width: 180px;
    max-width: 360px;
    padding: 5px 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.85rem;
}

.dropbox-save-btn,
.dropbox-disconnect-btn {
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 5px 14px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: filter 0.2s;
}

.dropbox-save-btn:hover,
.dropbox-disconnect-btn:hover {
    filter: brightness(1.12);
}

.dropbox-disconnect-btn {
    background: #e57373;
}

/* ============================================
   Record/Play buttons on rows
   ============================================ */
.record-row-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding-top: 1px;
    margin-left: 4px;
}

.record-row-play-btn,
.record-row-record-btn {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 3px 8px;
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1.5;
}

.record-row-play-btn {
    color: #5995c9;
    border-color: #5995c9;
}

.record-row-play-btn:hover {
    background: #5995c9;
    color: white;
}

.record-row-record-btn {
    color: #e53935;
    border-color: #e53935;
}

.record-row-record-btn:hover {
    background: #e53935;
    color: white;
}

/* ============================================
   Audio Recording Modal
   ============================================ */
.audio-record-modal-content {
    max-width: 400px;
    text-align: center;
}

.record-modal-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: -6px 0 10px;
    word-break: break-word;
    line-height: 1.4;
}

.record-modal-path {
    font-size: 0.75rem;
    color: #000000;
    letter-spacing: 0.01em;
}

.record-modal-response {
    font-size: 0.95rem;
    color: #0062ff;
    font-weight: 500;
}

.record-visualizer {
    background: #1a1a2e;
    border-radius: 8px;
    padding: 20px 16px;
    margin: 12px 0;
    min-height: 82px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.record-status {
    color: #aaa;
    font-size: 0.88rem;
}

.record-timer {
    color: #fff;
    font-size: 2rem;
    font-weight: 300;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.06em;
    line-height: 1;
}

.record-pulse {
    width: 14px;
    height: 14px;
    background: #e53935;
    border-radius: 50%;
    animation: recordPulse 0.9s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.5); opacity: 0.55; }
}

.record-modal-controls {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 4px;
    flex-wrap: wrap;
}

.btn-record {
    background: #e53935;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-record:hover {
    filter: brightness(1.1);
}

.btn-record:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.btn-record.recording {
    background: #555;
    animation: recordBtnPulse 1s ease-in-out infinite;
}

@keyframes recordBtnPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.65; }
}

.btn-record-preview {
    background: #5995c9;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-record-preview:hover {
    filter: brightness(1.1);
}

.btn-record-upload {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: filter 0.2s;
}

.btn-record-upload:hover {
    filter: brightness(1.1);
}

.btn-record-upload:disabled {
    background: #aaa;
    cursor: not-allowed;
}

.takes-list {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 260px;
    overflow-y: auto;
}

.take-row {
    display: flex;
    flex-direction: column;
    background: #f5f5f5;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 0.88rem;
    gap: 6px;
}

.take-row-saved {
    background: #eaf3fb;
    border-left: 3px solid #4a90e2;
}

.take-row-header {
    display: flex;
    align-items: center;
    gap: 8px;
}

.take-num {
    font-weight: 600;
    min-width: 52px;
    color: #333;
}

.take-duration {
    color: #888;
    min-width: 34px;
    font-variant-numeric: tabular-nums;
}

.take-play-btn {
    background: #4a90e2;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.82rem;
}

.take-play-btn:hover { background: #357abd; }

.take-upload-btn {
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.82rem;
    margin-left: auto;
}

.take-upload-btn:hover { background: #219150; }
.take-upload-btn:disabled { background: #aaa; cursor: not-allowed; }
.take-upload-btn.uploaded { background: #888; cursor: default; }

.take-upload-all-btn {
    display: block;
    width: 100%;
    background: #27ae60;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

.take-upload-all-btn:hover { background: #219150; }
.take-upload-all-btn:disabled { background: #aaa; cursor: not-allowed; }

.take-primary-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    opacity: 0.3;
    padding: 2px 4px;
    border-radius: 4px;
    color: #888;
    line-height: 1;
}

.take-primary-btn:hover { opacity: 0.8; color: #f5a623; }

.take-primary-btn.is-primary {
    opacity: 1;
    color: #f5a623;
}

.take-delete-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    padding: 2px 4px;
    border-radius: 4px;
}

.take-delete-btn:hover { opacity: 1; background: #fde8e8; }

.take-waveform {
    display: block;
    width: 100%;
    height: 48px;
    border-radius: 5px;
    object-fit: fill;
}

.waveform-canvas {
    display: block;
    width: 100%;
    height: 64px;
    background: #1a1a2e;
    border-radius: 8px;
    margin-bottom: 8px;
}

