.survey-templates-controls {
    margin-top: 18px;
}
.survey-templates-controls > div {
    margin-bottom: 12px;
}

.survey-templates-panel {
    margin-top: 12px;
    padding: 0;
    background: #fff;
    border: 1px solid #e4eaec;
    border-radius: 8px;
    overflow: hidden;
}

.survey-templates-panel[hidden] {
    display: none !important;
}

.survey-templates {
    margin: 0;
}

.survey-templates__nav {
    display: flex;
    flex-direction: column;
    background: #f3f7f9;
    border-right: 1px solid #e4eaec;
    padding: 0;
}

.survey-templates__nav-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px 14px;
    background: #fff;
    border-bottom: 1px solid #e4eaec;
}

.survey-templates__nav-head h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #37474f;
}

.survey-templates__nav-meta {
    font-size: 12px;
    color: #76838f;
    white-space: nowrap;
}

.survey-templates__tree,
.survey-templates__children {
    list-style: none;
    margin: 0;
    padding: 0;
}

.survey-templates__tree {
    padding: 8px 0 16px;
}

.survey-templates__item.is-collapsed > .survey-templates__children {
    display: none;
}

.survey-templates__row {
    display: flex;
    align-items: stretch;
    position: relative;
}

.survey-templates__item > .survey-templates__row:has(> .survey-templates__node.is-selected)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: #3e8ef7;
}

.survey-templates__item[data-level="1"] > .survey-templates__row { padding-left: 6px; }
.survey-templates__item[data-level="2"] > .survey-templates__row { padding-left: 18px; }
.survey-templates__item[data-level="3"] > .survey-templates__row { padding-left: 30px; }

.survey-templates__toggle,
.survey-templates__toggle-spacer {
    width: 24px;
    flex-shrink: 0;
    border: 0;
    background: transparent;
    padding: 0;
    color: #76838f;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.survey-templates__toggle:hover,
.survey-templates__toggle:focus {
    color: #3e8ef7;
    outline: none;
}

.survey-templates__toggle i {
    display: inline-block;
    font-size: 11px;
    transition: transform 0.15s ease;
}

.survey-templates__item.is-collapsed > .survey-templates__row .survey-templates__toggle i {
    transform: rotate(-90deg);
}

.survey-templates__node {
    flex: 1;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    margin: 1px 8px 1px 0;
    padding: 7px 10px 7px 8px;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #526069;
    text-align: left;
    cursor: pointer;
    line-height: 1.35;
    font-size: 15px;
}

.survey-templates__node:hover,
.survey-templates__node:focus {
    background: #e8f1fd;
    outline: none;
}

.survey-templates__node.is-selected {
    background: #e8f1fd;
    color: #3e8ef7;
}

.survey-templates__name {
    flex: 1;
    min-width: 0;
}

.survey-templates__count {
    margin-left: auto;
    min-width: 18px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e4eaec;
    color: #76838f;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
}

.survey-templates__node.is-selected .survey-templates__count {
    background: #c6dafc;
    color: #3e8ef7;
}

.survey-templates__preview {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #fff;
}

.survey-templates__preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    justify-content: end;
}

.survey-templates__device-switch {
    display: inline-flex;
    padding: 2px;
    border: 1px solid #d8e0e4;
    border-radius: 6px;
    background: #f3f7f9;
}

.survey-templates__device-switch button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: #76838f;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.3;
}

.survey-templates__device-switch i {
    font-size: 17px;
}

.survey-templates__device-switch .fa-mobile {
    font-size: 21px;
}

.survey-templates__device-switch button:hover,
.survey-templates__device-switch button:focus {
    color: #3e8ef7;
    outline: none;
}

.survey-templates__device-switch button.is-active {
    background: #fff;
    color: #3e8ef7;
    box-shadow: 0 1px 3px rgba(55, 71, 79, 0.16);
}

.survey-templates__preview-actions .btn {
    white-space: nowrap;
}

.survey-templates__preview-body {
    flex: 1;
    padding: 24px;
    background: #f3f7f9;
}

[data-preview-text] {
    margin: 0 0 16px;
    color: #76838f;
    font-size: 14px;
    line-height: 1.45;
    text-align: left;
}

[data-preview-widget] {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: hidden;
    transition: width 0.2s ease;
}

[data-preview-widget].is-mobile {
    width: 375px;
}

.survey-templates__folder-hint,
.survey-templates__stub {
    margin: 0;
}

.survey-templates__folder-hint[hidden],
.survey-templates__folder-contents[hidden],
.survey-templates__stub[hidden],
.survey-templates__preview-actions[hidden],
.survey-templates__preview .btn[hidden],
[data-preview-text][hidden] {
    display: none !important;
}

.survey-templates__folder-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 180px;
    padding: 24px 16px;
    border: 1px dashed #c6dafc;
    border-radius: 8px;
    background: #f3f8ff;
    color: #76838f;
    text-align: center;
}

.survey-templates__folder-hint i {
    font-size: 36px;
    color: #589ffc;
    margin-bottom: 8px;
}

.survey-templates__folder-title {
    margin: 0 0 14px;
    font-size: 18px;
    font-weight: 600;
    color: #37474f;
}

.survey-templates__folder-empty {
    margin: 0;
    color: #76838f;
    font-size: 14px;
}

.survey-templates__folder-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.survey-templates__folder-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #e4eaec;
    border-radius: 8px;
    background: #fff;
    color: #526069;
    text-align: left;
    cursor: pointer;
    line-height: 1.35;
    font-size: 15px;
}

.survey-templates__folder-list-item:hover,
.survey-templates__folder-list-item:focus {
    border-color: #c6dafc;
    background: #f8fbff;
    outline: none;
}

.survey-templates__folder-list-item > i {
    flex-shrink: 0;
    margin-top: 2px;
    font-size: 18px;
    color: #589ffc;
}

.survey-templates__folder-list-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.survey-templates__folder-list-name {
    font-weight: 600;
    color: #37474f;
}

.survey-templates__folder-list-desc {
    font-size: 13px;
    color: #76838f;
}

.survey-templates__folder-list-count {
    flex-shrink: 0;
    min-width: 18px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e4eaec;
    color: #76838f;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
    align-self: center;
}

.survey-templates__mock {
    padding: 22px 20px 18px;
    border: 1px solid #e4eaec;
    border-radius: 8px;
    background: linear-gradient(180deg, #f8fbff 0%, #fff 48%);
}

.survey-templates__mock-q {
    height: 12px;
    width: 78%;
    border-radius: 4px;
    background: #d7e6fb;
    margin-bottom: 18px;
}

.survey-templates__mock-scale {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
}

.survey-templates__mock-scale span {
    flex: 1;
    height: 28px;
    border-radius: 4px;
    background: #e8f1fd;
    border: 1px solid #c6dafc;
}

.survey-templates__mock-opts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
}

.survey-templates__mock-opts i {
    display: block;
    height: 10px;
    border-radius: 4px;
    background: #eef3f7;
    position: relative;
    padding-left: 0;
    margin-left: 22px;
}

.survey-templates__mock-opts i:before {
    content: "";
    position: absolute;
    left: -22px;
    top: -2px;
    width: 14px;
    height: 14px;
    border: 2px solid #c6dafc;
    border-radius: 50%;
    background: #fff;
}

.survey-templates__mock-opts i:first-child {
    width: 62%;
}

.survey-templates__mock-opts i:nth-child(2) {
    width: 48%;
}

.survey-templates__mock-opts i:nth-child(3) {
    width: 55%;
}

.survey-templates__mock-caption {
    display: block;
    text-align: center;
    font-size: 13px;
    color: #a3afb7;
}

@media (max-width: 767.98px) {
    .survey-templates-panel {
        padding: 0;
    }

    .survey-templates__nav {
        border-right: none;
        border-bottom: 1px solid #e4eaec;
        margin-bottom: 0;
    }

    .survey-templates__preview-actions .btn {
        width: auto;
    }

    .survey-templates__preview-body {
        padding: 16px;
    }
}
