/* ================================================================
   ГИД ПО ВИДАМ НАУЧНЫХ ИССЛЕДОВАНИЙ
   ================================================================ */

.rdg-root {
    padding: 28px 32px;
}

@media (max-width: 640px) {
    .rdg-root { padding: 18px 14px; }
}

/* ---------- Тулбар ---------- */
.rdg-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px dashed var(--line, #E8E2DA);
}

.rdg-toolbar__left,
.rdg-toolbar__right {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rdg-toolbar__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #6B6470;
    margin-right: 4px;
}

.rdg-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border: 1.5px solid #E8E2DA;
    background: #fff;
    border-radius: 999px;
    font-family: 'Manrope', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #2A1745;
    cursor: pointer;
    transition: border-color .2s, background .2s, color .2s, transform .15s;
    white-space: nowrap;
}

.rdg-btn:hover:not(:disabled) {
    border-color: #6B3FA0;
    background: #EDE4FF;
    transform: translateY(-1px);
}

.rdg-btn:disabled {
    opacity: .4;
    cursor: not-allowed;
}

.rdg-btn--view.is-active {
    background: #2A1745;
    color: #FFD23F;
    border-color: #2A1745;
}

/* ---------- Дерево ---------- */
.rdg-tree-wrap {
    position: relative;
    width: 100%;
    height: 480px;
    background: linear-gradient(180deg, #FAF6F0 0%, #F0E9DC 100%);
    border-radius: 16px;
    border: 1px solid #E8E2DA;
    margin-bottom: 22px;
    overflow: hidden;
}

@media (max-width: 640px) {
    .rdg-tree-wrap { height: 400px; }
}

.rdg-tree {
    display: block;
    width: 100%;
    height: 100%;
}

/* --- Ствол --- */
.rdg-stem {
    fill: none;
    stroke: #8B6F47;
    stroke-width: 8;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .12));
}

/* --- Ветки --- */
.rdg-branch {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
    opacity: 0;
    animation: rdgGrow .55s ease forwards;
}

@keyframes rdgGrow {
    to { opacity: 1; }
}

.rdg-branch--selected {
    stroke: #6B3FA0;
    stroke-width: 5;
}

.rdg-branch--option {
    stroke: #A89BB8;
    stroke-width: 2.5;
    stroke-dasharray: 3 5;
    opacity: 0;
    animation: rdgGrow .5s ease forwards;
}

.rdg-branch--active {
    stroke: #6B3FA0;
    stroke-width: 4;
    stroke-dasharray: 6 4;
    animation: rdgGrow .5s ease forwards, rdgDash 4s linear infinite;
}

@keyframes rdgDash {
    to { stroke-dashoffset: -100; }
}

/* --- Узлы на стволе --- */
.rdg-node {
    fill: #fff;
    stroke: #6B3FA0;
    stroke-width: 2;
}

.rdg-node--root {
    fill: #2A1745;
    stroke: #FFD23F;
    stroke-width: 3;
}

.rdg-node--crown {
    fill: #C6F432;
    stroke: #2E7D32;
    stroke-width: 2.5;
}

/* --- Бутоны на невыбранных ветках --- */
.rdg-bud {
    fill: #E8E2DA;
    stroke: #A89BB8;
    stroke-width: 1.5;
    opacity: 0;
    animation: rdgGrow .5s ease .2s forwards;
}

/* --- Листья --- */
.rdg-leaf {
    opacity: 0;
    animation: rdgLeafGrow .5s ease forwards;
}

.rdg-leaf--small {
    fill: url(#rdgLeafGradient);
    stroke: #7CB342;
    stroke-width: 1;
    animation-delay: .1s;
}

.rdg-leaf--crown {
    fill: url(#rdgLeafGradientCrown);
    stroke: #2E7D32;
    stroke-width: 1.5;
    transform-origin: center bottom;
}

@keyframes rdgLeafGrow {
    from { opacity: 0; transform: scale(.2); }
    to   { opacity: 1; }
}

/* --- Подписи веток --- */
.rdg-branch-label {
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    fill: #6B6470;
    pointer-events: none;
    opacity: 0;
    animation: rdgGrow .6s ease .3s forwards;
}

.rdg-branch-label--active {
    font-size: 11.5px;
    fill: #2A1745;
    font-weight: 700;
}

/* ---------- Текущий вопрос ---------- */
.rdg-question {
    padding: 22px 24px;
    background: #fff;
    border: 1.5px solid #E8E2DA;
    border-radius: 16px;
    margin-bottom: 18px;
    animation: rdgFadeIn .35s ease;
}

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

.rdg-question__step {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: #6B3FA0;
    margin-bottom: 8px;
    font-weight: 700;
}

.rdg-question__title {
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 22px;
    color: #2A1745;
    margin: 0 0 8px;
    line-height: 1.2;
    letter-spacing: -.02em;
}

.rdg-question__desc {
    font-size: 14.5px;
    line-height: 1.5;
    color: #6B6470;
    margin: 0 0 18px;
}

.rdg-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 10px;
}

.rdg-option {
    text-align: left;
    padding: 16px 18px;
    background: #FAF6F0;
    border: 1.5px solid #E8E2DA;
    border-radius: 12px;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.45;
    color: #1A1420;
    transition: border-color .2s, background .2s, transform .15s;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rdg-option:hover {
    border-color: #6B3FA0;
    background: #EDE4FF;
    transform: translateY(-2px);
}

.rdg-option__label {
    font-weight: 600;
    color: #2A1745;
}

.rdg-option__hint {
    font-size: 12.5px;
    color: #6B6470;
    line-height: 1.4;
}

/* ---------- Хлебные крошки ---------- */
.rdg-path {
    padding: 12px 18px;
    background: #FAF6F0;
    border-radius: 12px;
    border: 1px dashed #E8E2DA;
    margin-bottom: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    font-size: 13px;
}

.rdg-path__item {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #fff;
    border: 1px solid #E8E2DA;
    border-radius: 999px;
    color: #2A1745;
    font-weight: 500;
}

.rdg-path__sep {
    color: #6B6470;
    font-weight: 700;
}

/* ---------- Результат ---------- */
.rdg-result {
    padding: 28px 30px;
    background: linear-gradient(135deg, #FAF6F0 0%, #EDE4FF 100%);
    border: 2px solid #6B3FA0;
    border-radius: 18px;
    animation: rdgFadeIn .4s ease;
    margin-bottom: 18px;
}

@media (max-width: 640px) {
    .rdg-result { padding: 20px 16px; }
}

.rdg-result__tag {
    display: inline-block;
    padding: 5px 14px;
    background: #C6F432;
    color: #2A1745;
    border-radius: 999px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    margin-bottom: 14px;
}

.rdg-result__title {
    font-family: 'Fraunces', serif;
    font-weight: 900;
    font-size: 28px;
    color: #2A1745;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -.02em;
}

@media (max-width: 640px) {
    .rdg-result__title { font-size: 22px; }
}

.rdg-result__desc {
    font-size: 15px;
    line-height: 1.6;
    color: #1A1420;
    margin: 0 0 22px;
}

.rdg-result__section { margin-bottom: 18px; }
.rdg-result__section:last-child { margin-bottom: 0; }

.rdg-result__section-title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    margin-bottom: 8px;
}

.rdg-result__section-title--pros { color: #2E7D32; }
.rdg-result__section-title--cons { color: #C0392B; }
.rdg-result__section-title--examples { color: #6B3FA0; }

.rdg-result__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.rdg-result__list li {
    position: relative;
    padding: 8px 12px 8px 32px;
    margin-bottom: 6px;
    background: rgba(255, 255, 255, .65);
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    color: #1A1420;
}

.rdg-result__list li::before {
    content: '✓';
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.rdg-result__list--pros li::before { background: #C8E6C9; color: #1B5E20; content: '+'; }
.rdg-result__list--cons li::before { background: #FFCDD2; color: #B71C1C; content: '−'; }
.rdg-result__list--examples li::before { background: #E1BEE7; color: #4A148C; content: '★'; }

.rdg-result__cta {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px dashed rgba(107, 63, 160, .3);
}

.rdg-result__cta p {
    margin: 0 0 12px;
    font-size: 14px;
    color: #6B6470;
}

/* ---------- Адаптив ---------- */
@media (max-width: 640px) {
    .rdg-options { grid-template-columns: 1fr; }
    .rdg-question__title { font-size: 18px; }
    .rdg-stem { stroke-width: 6; }
    .rdg-branch { stroke-width: 3; }
    .rdg-branch--selected { stroke-width: 4; }
    .rdg-branch--option { stroke-width: 2; }
    .rdg-branch-label { font-size: 9.5px; }
}

/* ---------- Печать ---------- */
@media print {
    .nav, .footer, .cursor-dot, .cursor-ring, .mobile-menu,
    .feedback-modal, #feedbackModal, #feedbackToast,
    .rdg-toolbar, .rdg-tree-wrap, .tool-details, .cell--wide,
    .cell--section-title .tag, .cell--section-title p,
    .cell--section-title a { display: none !important; }
    body { background: #fff !important; color: #000 !important; cursor: auto; }
    .wrap { max-width: 100%; padding: 0; margin: 0; }
    .bento { display: block !important; gap: 0 !important; }
    .cell { border: none !important; padding: 0 !important; margin: 0 0 16pt 0 !important; background: #fff !important; }
    .cell--section-title h2 { font-size: 16pt; color: #000 !important; border-bottom: 1pt solid #333; padding-bottom: 8pt; margin-bottom: 12pt; }
    .cell--section-title h2::after { content: " — рекомендованный дизайн"; }
    .rdg-result { background: #fff !important; border: 1pt solid #333 !important; page-break-inside: avoid; }
    .rdg-result__title { color: #000 !important; }
    .rdg-result__list li { background: #f9f9f9 !important; border: 1pt solid #ccc !important; }
    .rdg-result__cta { display: none !important; }
}