/* «Древо за 2 минуты» (FZ-RF 1086): золотые рамки на тёмном лесу, как на главной. */
.gt-page {
    --gt-gold: #e8c252;
    --gt-gold-soft: rgba(232, 194, 82, 0.55);
    --gt-ink: #f3e7c6;
    --gt-muted: #c9bc95;
    --gt-panel: rgba(16, 28, 13, 0.92);
    position: relative;
    margin: 0 auto 32px;
    max-width: 1100px;
    padding: 22px 20px 26px;
    border-radius: 26px;
    color: var(--gt-ink);
    background:
        linear-gradient(180deg, rgba(8, 16, 6, 0.82), rgba(8, 16, 6, 0.9)),
        url("../tree/hero-tree-1600.5343cb240578.webp") center top / cover no-repeat,
        #0f1d0c;
    border: 1px solid rgba(232, 194, 82, 0.35);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
    overflow: hidden;
}
.gt-head { text-align: center; max-width: 760px; margin: 0 auto 10px; }
.gt-head h1 { color: var(--gt-gold); font-size: clamp(1.6rem, 4vw, 2.4rem); margin-bottom: 6px; }
.gt-lead { color: var(--gt-ink); margin-bottom: 8px; }
.gt-privacy, .gt-note {
    display: inline-block; font-size: 0.86rem; color: var(--gt-muted); background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(232, 194, 82, 0.25); border-radius: 12px; padding: 6px 12px; margin: 4px 0;
}
.gt-privacy i { color: var(--gt-gold); margin-right: 4px; }

/* Древо */
.gt-board { position: relative; display: flex; flex-direction: column; gap: 34px; padding: 22px 0 12px; }
.gt-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.gt-lines path { fill: none; stroke: rgba(232, 194, 82, 0.6); stroke-width: 2; }
.gt-lines path.is-empty { stroke: rgba(232, 194, 82, 0.22); stroke-dasharray: 5 6; }
.gt-lines path.gt-couple { stroke-width: 2.5; }
.gt-row { position: relative; display: flex; justify-content: center; gap: 18px; flex-wrap: wrap; z-index: 1; }
.gt-row-grand { gap: 40px; }
.gt-pair { position: relative; display: flex; gap: 12px; }
.gt-pair-label {
    position: absolute; top: -20px; left: 0; right: 0; text-align: center; font-size: 0.72rem; letter-spacing: 0.06em;
    text-transform: uppercase; color: var(--gt-muted);
}
.gt-frame {
    width: 132px; min-height: 150px; padding: 10px 8px; border-radius: 18px; border: 2px solid var(--gt-gold-soft);
    background: var(--gt-panel); color: var(--gt-ink); display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35); transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s;
    text-align: center; line-height: 1.2;
}
.gt-frame:hover, .gt-frame:focus-visible { transform: translateY(-2px); border-color: var(--gt-gold); box-shadow: 0 10px 26px rgba(232, 194, 82, 0.25); outline: none; }
.gt-frame.is-empty { border-style: dashed; background: rgba(16, 28, 13, 0.6); color: var(--gt-muted); }
.gt-frame.is-waiting { opacity: 0.55; }
.gt-frame-me { border-width: 3px; }
.gt-frame-me.is-empty { border-color: var(--gt-gold); animation: gt-glow 1.8s ease-in-out infinite; }
@keyframes gt-glow { 0%, 100% { box-shadow: 0 0 0 0 rgba(232, 194, 82, 0.5); } 50% { box-shadow: 0 0 0 8px rgba(232, 194, 82, 0); } }
.gt-photo {
    width: 74px; height: 74px; border-radius: 50%; border: 2px solid var(--gt-gold); display: flex; align-items: center;
    justify-content: center; overflow: hidden; font-size: 1.5rem; font-weight: 700; color: #fff; background: #5d7d4e; flex: none;
}
.gt-photo.is-f { background: #a8714a; }
.gt-photo img { width: 100%; height: 100%; object-fit: cover; }
.gt-frame.is-empty .gt-photo { background: rgba(232, 194, 82, 0.08); border-style: dashed; color: var(--gt-gold); font-size: 1.6rem; font-weight: 400; }
.gt-role { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gt-gold); font-weight: 700; }
.gt-name { font-weight: 600; font-size: 0.9rem; word-break: break-word; }
.gt-years { font-size: 0.78rem; color: var(--gt-muted); }
.gt-add-kid { min-height: 150px; width: 132px; }

/* Панель «Сохранить» */
.gt-bar {
    position: sticky; bottom: 10px; z-index: 5; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: center;
    margin: 18px auto 0; max-width: 760px; padding: 12px 16px; border-radius: 18px; background: rgba(10, 18, 8, 0.94);
    border: 1px solid rgba(232, 194, 82, 0.4); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.gt-progress { flex: 1 1 220px; font-size: 0.9rem; color: var(--gt-ink); }
.gt-progress-line { display: block; height: 6px; margin-top: 6px; border-radius: 3px; background: rgba(232, 194, 82, 0.18); overflow: hidden; }
.gt-progress-line span { display: block; height: 100%; width: 0; background: var(--gt-gold); transition: width 0.3s; }
.gt-save { white-space: nowrap; }
.gt-clear { color: var(--gt-muted) !important; font-size: 0.85rem; }
.gt-error {
    max-width: 760px; margin: 10px auto 0; padding: 10px 14px; border-radius: 12px; background: rgba(150, 40, 30, 0.85); color: #fff;
}
.gt-error[hidden] { display: none; }
.gt-after { max-width: 760px; margin: 22px auto 0; font-size: 0.92rem; color: var(--gt-ink); }
.gt-after h2 { font-size: 1.1rem; color: var(--gt-gold); }
.gt-after ol { padding-left: 1.2rem; }
.gt-after-note { color: var(--gt-muted); }
.gt-after a { color: var(--gt-gold); }

/* Окно человека */
.gt-editor { position: fixed; inset: 0; z-index: 1095; display: flex; align-items: center; justify-content: center; padding: 16px; }
.gt-editor[hidden] { display: none; }
.gt-editor-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.6); }
.gt-editor-box {
    position: relative; width: min(460px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 16px 18px 18px;
    border-radius: 18px; background: #142211; color: #f3e7c6; border: 1px solid rgba(232, 194, 82, 0.5); box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}
.gt-editor-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.gt-editor-head h2 { font-size: 1.25rem; color: #e8c252; margin: 0; }
.gt-editor-x { width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #c9bc95; font-size: 1.1rem; }
.gt-editor-x:hover { background: rgba(232, 194, 82, 0.15); }
.gt-editor-hint { font-size: 0.86rem; color: #e8c252; background: rgba(232, 194, 82, 0.1); border-radius: 10px; padding: 6px 10px; }
.gt-editor-photo { display: flex; align-items: center; gap: 14px; margin: 6px 0 12px; }
.gt-photo-big {
    width: 84px; height: 84px; border-radius: 50%; border: 2px dashed #e8c252; display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: #e8c252; font-size: 1.6rem; flex: none; background: rgba(232, 194, 82, 0.08);
}
.gt-photo-big img { width: 100%; height: 100%; object-fit: cover; }
.gt-gender { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; border: 0; padding: 0; }
.gt-gender[hidden] { display: none; }
.gt-gender legend { float: left; width: auto; margin: 0 6px 0 0; }
.gt-gender label { display: inline-flex; gap: 6px; align-items: center; cursor: pointer; }
.gt-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.gt-fields label { display: flex; flex-direction: column; gap: 3px; font-size: 0.82rem; color: #c9bc95; }
.gt-fields label[hidden] { display: none; }
.gt-fields input {
    height: 42px; border-radius: 10px; border: 1px solid rgba(232, 194, 82, 0.4); background: rgba(0, 0, 0, 0.3); color: #f3e7c6;
    padding: 0 10px; font-size: 1rem;
}
.gt-fields input:focus { outline: none; border-color: #e8c252; box-shadow: 0 0 0 3px rgba(232, 194, 82, 0.2); }
.gt-small { font-size: 0.78rem; color: #c9bc95; margin: 6px 0 0; }
.gt-editor-error { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(150, 40, 30, 0.85); color: #fff; font-size: 0.88rem; }
.gt-editor-error[hidden] { display: none; }
.gt-editor-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.gt-saving { position: fixed; inset: 0; z-index: 1100; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, 0.6); color: #f3e7c6; font-size: 1.2rem; }
.gt-saving[hidden] { display: none; }

@media (max-width: 768px) {
    .gt-page { padding: 16px 10px 18px; border-radius: 18px; margin-left: -4px; margin-right: -4px; }
    .gt-board { gap: 30px; }
    .gt-row { gap: 8px; }
    .gt-row-grand { gap: 10px; flex-wrap: nowrap; }
    .gt-pair { gap: 6px; }
    .gt-frame { width: calc((100vw - 64px) / 4); min-height: 112px; padding: 6px 3px; border-radius: 14px; }
    .gt-row-parents .gt-frame, .gt-row-me .gt-frame, .gt-row-kids .gt-frame { width: 118px; min-height: 132px; }
    .gt-row-grand .gt-photo { width: 46px; height: 46px; font-size: 1rem; }
    .gt-row-grand .gt-role { font-size: 0.58rem; }
    .gt-row-grand .gt-name { font-size: 0.72rem; }
    .gt-row-grand .gt-years { font-size: 0.66rem; }
    .gt-photo { width: 60px; height: 60px; }
    .gt-bar { bottom: 6px; padding: 10px 12px; gap: 8px; }
    .gt-save { width: 100%; }
    .gt-fields { grid-template-columns: 1fr; }
    .gt-editor { align-items: flex-end; padding: 0; }
    .gt-editor-box { width: 100%; border-radius: 18px 18px 0 0; max-height: 92vh; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
}
