/* ============================================================
   Constructor de árboles familiares — estilos propios de la página.
   Hereda tokens y tipografías de ../styles.css
   ============================================================ */

.tool {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 20rem;
    gap: clamp(1.25rem, 3vw, 2rem);
    align-items: start;
}

@media (max-width: 56rem) {
    .tool { grid-template-columns: 1fr; }
}

/* ---------- Lienzo ---------- */

.tool__stage {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: .85rem;
    padding: 1rem;
    box-shadow: var(--shadow);
    min-height: 26rem;
    display: flex;
}

.tool__stage svg {
    display: block;
    width: 100%;
    height: auto;
    max-height: 34rem;
    margin: auto;
}

.tool__stage .node { cursor: pointer; }
.tool__stage .node:focus { outline: none; }
.tool__stage .node:hover > :nth-child(1) { opacity: .75; }

/* ---------- Panel ---------- */

.tool__panel {
    background: var(--paper-raised);
    border: 1px solid var(--rule);
    border-radius: .85rem;
    padding: 1.35rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: sticky;
    top: 5rem;
}

@media (max-width: 56rem) {
    .tool__panel { position: static; }
}

.group__title {
    font-size: .7rem;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--ink-muted);
    margin: 0 0 .7rem;
}

.group__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .45rem;
}

.group__row { display: flex; gap: .45rem; }

/* ---------- Botones del panel ---------- */

.tbtn {
    font-family: inherit;
    font-size: .85rem;
    font-weight: 500;
    padding: .55rem .6rem;
    border-radius: .45rem;
    border: 1px solid var(--rule-strong);
    background: transparent;
    color: var(--ink);
    cursor: pointer;
    text-align: center;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.tbtn:hover:not(:disabled) { background: var(--paper-sunken); border-color: var(--ink-muted); }

.tbtn:disabled {
    opacity: .36;
    cursor: not-allowed;
}

.tbtn.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.tbtn--danger:hover:not(:disabled) {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-wash);
}

.tbtn--wide { flex: 1; }

.field {
    width: 100%;
    font-family: inherit;
    font-size: .9rem;
    padding: .55rem .7rem;
    border-radius: .45rem;
    border: 1px solid var(--rule-strong);
    background: var(--paper);
    color: var(--ink);
}

.field:focus { border-color: var(--accent); outline: none; }

.hint {
    font-size: .78rem;
    color: var(--ink-muted);
    margin: .6rem 0 0;
    line-height: 1.5;
}

.status {
    font-size: .8rem;
    color: var(--accent);
    min-height: 1.2em;
    margin: 0;
}

/* ---------- Aviso de privacidad ---------- */

.privacy {
    display: flex;
    gap: .85rem;
    align-items: flex-start;
    background: var(--accent-wash);
    border-radius: .7rem;
    padding: 1rem 1.15rem;
    font-size: .9rem;
    color: var(--ink-soft);
    max-width: var(--measure);
    margin-bottom: 2.5rem;
}

.privacy svg {
    width: 1.15rem;
    height: 1.15rem;
    flex-shrink: 0;
    margin-top: .15rem;
    color: var(--accent);
}

.privacy strong { color: var(--ink); font-weight: 600; }

/* ---------- Leyenda ---------- */

.tool__legend {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem 1.35rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--rule);
    list-style: none;
    font-size: .8rem;
    color: var(--ink-muted);
    padding-inline-start: 0;
}

.tool__legend li { display: flex; align-items: center; gap: .4rem; }
.tool__legend svg { width: 16px; height: 16px; flex-shrink: 0; }
