#pantaila-txikia-oharra {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: #111;
    color: #fff;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    text-align: center;
    padding: 40px;
}
#pantaila-txikia-oharra .material-symbols-outlined {
    font-size: 48px;
    opacity: 0.5;
}
#pantaila-txikia-oharra p {
    font-size: 16px;
    line-height: 1.6;
    margin: 0;
    opacity: 0.85;
}
#pantaila-txikia-oharra a {
    color: #32c795;
}
@media (max-width: 1024px) {
    #pantaila-txikia-oharra {
        display: flex;
    }
}
#grafika h1 {
    font-size: 18px;
    margin-bottom: 0px;
    line-height: inherit;
    letter-spacing: 0;
    margin-right: 30px;
    font-weight: 700;
}
#grafika h2 {
    font-family: 'Quicksand';
    font-size: 14px;
}
nav {
    height: 47px;
    box-sizing: border-box;
    padding: 0 15px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    position: relative;
    z-index: 1;
    background: #fff;
}
nav > ul {
    display: flex;
    flex-direction: row;
    align-items: center;
}
main {
    display: block;
    position: fixed;
    top: 47px;
    left: 0px;
    width: 100vw;
    height: calc(100vh - 47px);
    overflow: hidden;
}
main.zoom-aktibo {
    overflow-x: auto;
    overflow-y: auto;
}
#loader {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
    width: 100vw;
    height: 100vh;
    display: none;
    flex-direction: row;
    justify-content: center;
    align-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.7);
}
#loader.active {
    display: flex;
}
#loader img {
    display: block;
}
#bg-image {
    display: block;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: calc(100vh);
    max-height: calc(100vh);
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.2)), url('');
    /*background-image: url('../img/grafikak/652a7b430dfe51a2cbbac05d_0021524.png');*/
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: grayscale(80%);
}
#bg-image:after {
    content: '';
    display: block;
    position: fixed;
    top: 0px;
    left: 0px;
    width: 100%;
    height: calc(100vh);
    max-height: calc(100vh);
    overflow: hidden;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0.8));
}
#denbora {
    position: fixed;
    top: 47px;
    left: 0px;
    width: 50px;
    height: calc(100vh - 47px);
    /*background: linear-gradient(180deg, rgba(76,226,176,1) 0%, rgba(51,130,113,1) 100%);*/
    border-right: 3px solid #000;
    z-index: 10;
    overflow: visible;
    background-color: #fff;;
}
#denbora.zoom-aktibo {
    overflow: visible;
}
#denbora .urtea {
    position: absolute;
    left: 0px;
    z-index: 0;
    display: block;
    width: 100%;
    font-weight: bold;
    letter-spacing: 1px;
    font-size: 11px;
    line-height: 11px;
}
#denbora .urtea:after {
    content: '';
    position: absolute;
    width: 10px;
    height: 3px;
    background-color: #000;
    top: 0px;
    right: 0px;
}

.eskala-etena {
    position: absolute;
    left: 0;
    width: 100%;
    height: 10px;
    transform: translateY(-5px);
    background: repeating-linear-gradient(
        90deg,
        rgba(76, 226, 176, 0.4) 0px, rgba(51, 130, 113, 0.4) 4px,
        transparent 4px, transparent 8px
    );
    z-index: 0;
}
.eskala-etena::before,
.eskala-etena::after {
    content: '';
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(85deg, rgba(76, 226, 176, 1) 0%, rgba(51, 130, 113, 1) 100%);
}
.eskala-etena::before { top: 0; }
.eskala-etena::after  { bottom: 0; }

#atlasa .inner .urtea-lerro-horiz {
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.07);
    z-index: 0;
    pointer-events: none;
}

#atlasa .inner .eskala-corte-lerro-horiz {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(85deg, rgba(76, 226, 176, 0.5) 0%, rgba(51, 130, 113, 0.5) 100%);
    z-index: 0;
    pointer-events: none;
}

.eskala-corte-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 8px;
    background: #f8f8f8;
    border-radius: 4px;
    margin-bottom: 4px;
    font-size: 13px;
}
.eskala-corte-urtea {
    color: #aaa;
    font-size: 11px;
}
.eskala-corte-hutsa {
    font-size: 12px;
    color: #aaa;
    margin: 0 0 4px;
}

.fasea-denbora {
    position: absolute;
    opacity: 0.7;
    z-index: 1;
    overflow: hidden;
}
.fasea-blokea {
    position: absolute;
    z-index: 1;
    width: 15px;
    overflow: hidden;
    cursor: pointer;
}
.fasea-blokea-izena {
    position: absolute;
    top: 4px;
    left: 0px;
    font-size: 11px;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}
.fasea-denbora span {
    position: absolute;
    top: 5px;
    left: 2px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
}
.fasea-denbora .aukerak {
    position: absolute;
    z-index: 2;
    display: none;
}
body.editatu-aktibo .fasea-denbora:hover .aukerak {
    display: block;
}
#info {
    display: none;
    position: fixed;
    top: 47px;
    right: 0;
    width: 90vw;
    height: calc(100vh - 47px);
    background: #fff;
    z-index: 150;
    border-left: 3px solid #32c795;
    flex-direction: column;
    overflow: hidden;
    box-shadow: -4px 0 24px rgba(0,0,0,0.18);
}
#info.aktibo {
    display: flex;
}
/* Info superpuesto — main no se encoge */
body.info-aktibo main {
    /* overlay, no se redimensiona */
}

/* == INFO: BI ZUTABE == */
#info-body {
    display: flex;
    flex: 1;
    overflow: hidden;
}
#info-edukia {
    flex: 3;
    display: flex;
    flex-direction: row;
    overflow: hidden;
    border-right: 1px solid #e0e0e0;
}
#info-edukia-kolumna {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    min-width: 0;
}
#info-alboko {
    flex: 1;
    min-width: 200px;
    max-width: 320px;
    overflow-y: auto;
    background: #fafafa;
    display: flex;
    flex-direction: column;
}
.info-alboko-bloke {
    padding: 14px 14px 12px;
    border-bottom: 1px solid #ebebeb;
}
#info-alboko-aukerak {
    margin-top: auto;
    position: sticky;
    bottom: 0;
    background: #fafafa;
    border-top: 1px solid #ebebeb;
    border-bottom: none;
}
.info-alboko-titulua {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #aaa;
    margin: 0 0 10px;
}
.info-alboko-elementu-item {
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: #333;
    cursor: pointer;
    border-left: 3px solid transparent;
    margin-bottom: 4px;
    transition: background 0.12s, border-color 0.12s;
}
.info-alboko-elementu-item:hover { background: #eef9f5; border-left-color: #32c795; }
.info-alboko-elementu-item.aktibo { background: #e8f5f1; border-left-color: #32c795; }
.info-alboko-elementu-item .item-fila { display: flex; align-items: center; gap: 6px; }
.info-alboko-elementu-item .item-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.info-alboko-elementu-item .item-izena { font-weight: 600; line-height: 1.3; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info-alboko-elementu-item .item-data { font-size: 10px; color: #999; flex-shrink: 0; white-space: nowrap; }
.info-alboko-loading, .info-alboko-empty { font-size: 11px; color: #bbb; margin: 0; font-style: italic; }
.info-mapa-lotura { font-size: 11px; color: #27ae60; margin: 4px 0 2px; }
.zut-bilduma-item { display: flex; align-items: center; gap: 7px; }
.zut-bilduma-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }

#info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid #dce1e7;
    background: #fff;
    flex-shrink: 0;
}
#info-header h3 { margin: 0; font-size: 13px; font-weight: 600; flex: 1; color: #333; }
#info-itxi {
    cursor: pointer;
    font-size: 18px;
    background: none;
    border: none;
    color: #888;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
#info-itxi:hover { color: #e74c3c; }

/* Zona superior: detalle del elemento */
/* Breadcrumb */
#info-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1px;
    padding: 8px 16px 4px;
    min-height: 0;
    flex-shrink: 0;
}
#info-breadcrumb:empty {
    padding: 0;
}
.bc-sep {
    color: #ccc;
    font-size: 11px;
    padding: 0 3px;
    flex-shrink: 0;
}
.bc-item {
    font-size: 11px;
    color: #1a9e72;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}
.bc-item:hover {
    text-decoration: underline;
}
.bc-aktibo {
    color: #555;
    font-weight: 600;
    cursor: default;
}
.bc-aktibo:hover {
    text-decoration: none;
}

#info-detailea {
    padding: 8px 16px 12px;
    border-bottom: 1px solid #e0e0e0;
    overflow: visible;
    /* Detaileak geratzen den toki guztia hartzen du (garrantzitsuena da); notek goi-muga dute */
    flex: 0 0 auto;
    flex-shrink: 0;
    min-height: auto;
    border-bottom: 0;
    padding-bottom: 0;
}
#info-detailea p {
    font-size: 12px;
    line-height: 1.55;
    color: #666;
    margin: 4px 0 0;
}
#info-detailea p + p {
    margin-top: 9px;
}
/* Tipo-chip: dot + label + optional date — unified across all element types */
.info-tipo-fila {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.info-tipo-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
}
.info-tipo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.info-tipo-data {
    font-size: 11px;
    color: #999;
    font-weight: 600;
    margin-left: auto;
}

/* Elementuaren irudia + kreditua (info panela) */
.info-irudia {
    margin: 0 0 10px;
}
.info-irudia img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    margin: 0 auto;
    border-radius: 6px;
    object-fit: contain;
}
.info-irudia figcaption {
    margin-top: 4px;
    font-size: 10px;
    line-height: 1.3;
    color: #999;
    text-align: center;
}
.info-irudia figcaption a {
    color: inherit;
    text-decoration: underline;
}

/* Zona inferior: notas */
#info-notak {
    /* Edukiaren tamaina hartzen du, baina gehienez altueraren %35: gainerakoa goiko detailerako */
    flex: 0 0 auto;
    max-height: none;
    min-height: auto;
    display: flex;
    flex-direction: column;
    overflow: visible;
    padding: 0 16px 16px;
}
#info-notak-zerrenda {
    flex: 0 0 auto;
    min-height: 0;
    overflow: visible;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding-bottom: 0;
}
/* Nota = apartado de la ficha: título + texto con el mismo estilo que la descripción (sin tarjeta) */
.info-nota-item {
    background: none;
    border: 0;
    padding: 0;
    margin-top: 16px;
}
.info-nota-item h4 {
    font-size: 14px;
    font-weight: 700;
    margin: 0;
    color: #222;
}
.nota-izenburu-ezkutua { display: none; }
body.editatu-aktibo .nota-izenburu-ezkutua { display: block; }
.nota-edit-btn { display: none; }
body.editatu-aktibo .nota-edit-btn { display: inline-block; }
.info-nota-item .info-nota-item-content, .info-nota-item .info-nota-item-content p { font-size: 12px; line-height: 1.55; color: #666; }
.info-nota-item .info-nota-item-content p { margin: 4px 0 0; }
.info-nota-item .info-nota-item-content p + p { margin-top: 9px; }
.info-nota-item .info-nota-item-content h3, .info-nota-item .info-nota-item-content h4 { font-size: 13px; color: #222; margin: 10px 0 2px; }
.info-nota-item p {
    font-size: 11px;
    color: #666;
    margin: 0;
}
.info-nota-item .nota-biblio {
    margin-top: 6px;
}
.info-nota-item .nota-biblio-tag {
    font-size: 10px;
    padding: 2px 6px;
    background: #e8f5f1;
    border-radius: 3px;
    color: #1a9e72;
}
#info-nota-berria-btn {
    flex-shrink: 0;
    margin-top: 8px;
    align-self: flex-end;
}
#info-nota-form {
    flex-shrink: 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 10px;
    overflow-y: auto;
    max-height: 55%;
}
/* Nota-forma irekita dagoenean, notek toki guztia behar dute (max-height kendu) */
#info-notak.forma-aktibo { flex: 1 1 auto; max-height: none; }
#info-notak.forma-aktibo #info-notak-zerrenda { display: none; }
#info-notak.forma-aktibo #info-nota-berria-btn { display: none !important; }
#info-notak.forma-aktibo #info-nota-form { flex: 1; max-height: none; }
.button-cancel {
    background: #f0f0f0;
    color: #666;
}
.button-cancel:hover { background: #fdecea; color: #e74c3c; }

/* == ERLAZIO CASCADE FORM == */
#erlazio-sel-info { font-size: 10px; color: #32c795; font-weight: 600; padding: 3px 6px; background: #e8f5f1; border-radius: 3px; margin-bottom: 6px; display: none; }
.erlazio-item {
    padding: 5px 8px;
    border-radius: 4px;
    font-size: 11px;
    color: #333;
    border-left: 3px solid #ddd;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fafafa;
}
.erlazio-item .item-mota-badge { font-size: 9px; font-weight: 700; text-transform: uppercase; padding: 1px 5px; border-radius: 3px; background: #e0e0e0; color: #666; flex-shrink: 0; }
.erlazio-item .item-izena { flex: 1; font-weight: 600; }
.erlazio-item .erlazio-kendu-btn { cursor: pointer; color: #ccc; font-size: 12px; flex-shrink: 0; background: none; border: none; padding: 0 2px; line-height: 1; }
.erlazio-item .erlazio-kendu-btn:hover { color: #e74c3c; }
.erlazio-item[onclick]:hover { background: #eef9f5; }

#atlasa, #zuhahitza, #mapa {
    position: absolute;
    top: 0px;
    left: 0px;
    min-height: 100%;
    z-index: 1;
}
#atlasa {
    overflow: visible;
    width: 100%;
}
#atlasa.active, #zuhahitza.active, #mapa.active {
    z-index: 2;
}
#atlasa #zutabeak {
    position: fixed;
    left: 50px;
    bottom: 14px;
    z-index: 100;
    display: flex;
    min-height: 31px;
}
#hasiera-gida {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}
#hasiera-gida-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: rgba(255,255,255,0.92);
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 40px 48px;
    max-width: 420px;
    pointer-events: all;
    box-shadow: 0 4px 24px rgba(0,0,0,0.07);
}
#hasiera-gida-body h3 {
    font-size: 18px;
    color: #2c3e50;
    margin: 0 0 10px;
}
#hasiera-gida-body p {
    font-size: 13px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 0 0 20px;
}
.solo-erlatiboa { display: none; }
#atlasa.erlatiboa .solo-erlatiboa { display: list-item; }
#atlasa.erlatiboa {
    left: 0px;
}
#atlasa.erlatiboa #zutabeak {
    left: 0px;
}
#atlasa .inner {
    position: absolute;
    left: 0px;
    top: 0px;
    width: 100%;
    height: calc(100% - 31px - 14px);
    display: flex;
    align-items: stretch;
}
#atlasa.lvl-0 .inner {
    min-height: calc(100% - 31px - 14px);
}
#atlasa .inner > .inner-zutabea {
    border-right: 1px dotted #000;
    width: 100%;
    min-height: 100%;
    padding: 3px 15px;
    position: relative;
}
#atlasa.lvl-0 .inner > .inner-zutabea .block-bilduma {
    width: 100%;
    max-width: 800px;
    margin: auto;
    padding: 3px;
}
#atlasa.absolutua  .inner > .inner-zutabea .block-bilduma {
    position: absolute;
    z-index: 12;
}
#atlasa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua {
    padding-left: 22px;
}
body.editatu-aktibo #atlasa.absolutua .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua:hover .aukerak {
    display: flex !important;
    left: 0px;
    top: 0px;
}
#atlasa.lvl-0 .inner > .inner-zutabea .block-bilduma {
    width: calc(100% - 30px);
}
#atlasa .inner > .inner-zutabea .block-bilduma .inner-bilduma {
    background-color: #fff;
    padding: 0;
}
#atlasa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua {
    /*background-color: #fff;*/
    /*padding: 10px 10px;*/
    display: flex;
    justify-content: space-between;
    align-items: center;
}
#atlasa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua ul {
    display: flex;
}
body.editatu-aktibo #atlasa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua:hover .aukerak {
    display: flex !important;
    position: absolute;
    left: 0px;
    top: 0px;
    right: 10px;
    z-index: 10;
}
#atlasa.lvl-0 .inner > .inner-zutabea .block-bilduma h2 {
    font-size: 10px;
    font-weight: bold;
}
#atlasa .inner > .inner-zutabea .block-bilduma h2 {
    font-size: 9px;
    font-weight: bold;
    margin-bottom: 0px;
}
#atlasa.erlatiboa .inner > .inner-zutabea .block-bilduma .info-nota  {
    padding: 0px;
}
#atlasa.erlatiboa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua {
    padding-left: 0px;
    position: relative;
}
#atlasa.erlatiboa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua h2 {
    position: relative;
    z-index: 2;
}
#atlasa.erlatiboa .inner > .inner-zutabea .block-bilduma .inner-bilduma .inner-titulua .azpimarra {
    position: absolute;
    bottom: -2px;
    left: -2px;
    width: 45px;
    height: 5px;
    z-index: 1;
}
#atlasa .inner > .inner-zutabea .block-bilduma .info-nota  {
    /*background-color: #fff;*/
    padding: 8px;
    margin-bottom: 15px;
}
#atlasa .inner > .inner-zutabea .block-bilduma .info-nota p  {
    margin-top: 0px;
}
#atlasa .inner > .inner-zutabea .lerroa {
    position: absolute;
    width: 15px;
    background-color: #000;
}
#atlasa.absolutua .inner > .inner-zutabea .block-bilduma .inner-bilduma {
    background-color: transparent;
}
#atlasa.absolutua .inner > .inner-zutabea .puntua-blokea {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
    padding-left: 22px;
}
#atlasa.absolutua .inner > .inner-zutabea .puntua-blokea .azpimarra {
    position: absolute;
    display: block;
    width: 45px;
    height: 2px;
    flex-shrink: 0;
    opacity: 0.8;
    bottom: 3px;
}
#atlasa.absolutua .inner > .inner-zutabea .puntua-blokea .puntua-izena {
    font-size: 9px;
    font-weight: bold;
    white-space: nowrap;
    position: relative;
}

body.puntua-letra-handia #atlasa.absolutua .inner > .inner-zutabea .puntua-blokea .puntua-izena {
    font-size: 12px;
}
body.puntua-letra-handia .fasea-blokea-izena {
    font-size: 12px;
}
body.puntua-letra-handia #atlasa.erlatiboa .inner > .inner-zutabea .block-bilduma h2 {
    font-size: 12px;
}
#atlasa.absolutua.lvl-0 .inner > .inner-zutabea .block-bilduma {
    transform-origin: bottom left;
    /*transform: rotate(90deg);
    top: 15px;*/
    z-index: 2;
    padding: 0px;
    width: auto;
}
#atlasa.absolutua .inner > .inner-zutabea .block-bilduma h2 {
    /*text-shadow: 1px 1px 0px rgba(0,0,0,0.4);*/
    word-wrap: break-word;
}
#atlasa.absolutua.lvl-0 .inner > .inner-zutabea .lerroa {
    width: 20px;
    z-index: 1;
}
#atlasa #zutabeak > div {
    position: relative;
    text-align: center;
    background: linear-gradient(135deg, rgb(76 162 226) 0%, rgb(51 60 130) 100%);
    padding: 8px 0px;
    width: 100%;
    font-weight: 600;
    border-right: 1px solid #fff;
    color: #fff;
}

/* ── Nabigazioa: ikuspegiak | zoom | editazioa | ekintza orokorrak ── */
.nav-tresnak { gap: 14px; }
.nav-tresnak > li { list-style: none; }
.nav-taldea { display: flex; align-items: center; gap: 2px; }
.nav-zoom { margin-left: auto; margin-right: 14px; list-style: none; }
.nav-zoom li { list-style: none; }
.nav-zoom a:hover { background: #ecf0f1; }
.nav-zoom a,
.nav-tresnak a {
    display: flex; align-items: center; gap: 6px;
    height: 28px; padding: 0 9px; border-radius: 14px;
    font-family: 'Quicksand'; font-size: 13px; font-weight: 600;
    color: #2c3e50; text-decoration: none; white-space: nowrap;
    transition: background 0.2s, color 0.2s;
}
.nav-zoom a .material-symbols-outlined,
.nav-tresnak a .material-symbols-outlined { font-size: 18px; }
.nav-tresnak a:hover { background: #ecf0f1; }
.nav-tresnak a.active,
.nav-tresnak a.active:hover {
    background: linear-gradient(85deg, rgba(76,226,176,1) 0%, rgba(51,130,113,1) 100%);
    color: #fff;
}
/* Ikuspegiak: pestaina taldea */
.nav-bistak { background: #f3f5f6; border-radius: 16px; padding: 2px; }
.nav-bistak a { padding: 0 13px; }
.nav-bistak a:hover { background: #e3e8ea; }
/* Zoom: grafikan soilik */
body.mapa-aktibo .nav-zoom,
body.zuhaitza-aktibo .nav-zoom,
body.biblio-aktibo .nav-zoom { display: none; }
/* Editazio modua + tresnak */
.nav-modua a.active { box-shadow: 0 0 0 2px rgba(51,130,113,0.25); }
.nav-edit { display: none; background: #eefaf6; border: 1px solid #b9e8d8; border-radius: 16px; padding: 2px 6px 2px 10px; }
body.editatu-aktibo .nav-edit { display: flex; }
.nav-etiketa { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: #338271; margin-right: 6px; }
.nav-bereizlea { display: block; width: 1px; height: 18px; background: #b9e8d8; margin: 0 4px; }
/* Ekintza orokorrak */
.nav-globala { padding-left: 14px; border-left: 1px solid #dde2e4; }
.nav-gehiago { position: relative; }
.nav-gehiago-menua {
    display: none; position: absolute; right: 0; top: 34px; min-width: 170px;
    background: #fff; border-radius: 8px; padding: 4px; z-index: 50;
    box-shadow: 0 4px 14px rgba(0,0,0,0.25); flex-direction: column;
}
.nav-gehiago-menua.zabalik { display: flex; }
.nav-gehiago-menua a { border-radius: 6px; }
/* Laguntza: aktibatu/desaktibatu etengailua */
.nav-tresnak #btn-laguntza { gap: 8px; }
.nav-tresnak #btn-laguntza.active,
.nav-tresnak #btn-laguntza.active:hover { background: transparent; color: inherit; }
.nav-tresnak #btn-laguntza:hover { background: #ecf0f1; }
.nav-switch {
    margin-left: auto; position: relative; flex-shrink: 0;
    width: 30px; height: 16px; border-radius: 8px; background: #c5ccd0;
    transition: background 0.2s;
}
.nav-switch::after {
    content: ''; position: absolute; top: 2px; left: 2px;
    width: 12px; height: 12px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.3); transition: left 0.2s;
}
#btn-laguntza.active .nav-switch { background: #338271; }
#btn-laguntza.active .nav-switch::after { left: 16px; }
.nav-tresnak a.nav-edit-globala { display: none; }
body.editatu-aktibo .nav-tresnak a.nav-edit-globala { display: flex; }

/* Hanburgesa menua (≤1024px): aukerak eskuineko zutabe batean */
#btn-hamburguesa { display: none; }
@media (max-width: 1024px) {
    #btn-hamburguesa {
        display: flex; align-items: center; justify-content: center;
        width: 34px; height: 34px; border: 0; border-radius: 50%;
        background: transparent; cursor: pointer; color: #2c3e50;
        position: relative; z-index: 61;
    }
    #btn-hamburguesa:hover, body.nav-zabalik #btn-hamburguesa { background: #ecf0f1; }
    body.nav-zabalik nav { box-shadow: 0 1px 0 #dde2e4; }
    nav > ul:first-child { min-width: 0; overflow: hidden; }
    nav > .nav-zoom { margin-right: 4px; flex-direction: row; align-items: center; }
    #label-deskribapena { display: none; }
    .nav-tresnak {
        display: none; position: fixed; top: 47px; right: 0; z-index: 60;
        width: 250px; height: calc(100vh - 47px); overflow-y: auto;
        flex-direction: column; align-items: stretch; gap: 6px;
        padding: 10px; background: #fff; border-left: 1px solid #dde2e4;
        box-shadow: -6px 0 14px rgba(0,0,0,0.12);
    }
    body.nav-zabalik .nav-tresnak { display: flex; }
    .nav-tresnak > li { display: block; }
    .nav-taldea { flex-direction: column; align-items: stretch; gap: 2px; }
    .nav-tresnak a { height: 36px; padding: 0 12px; border-radius: 8px; font-size: 14px; }
    .nav-tresnak a .material-symbols-outlined { font-size: 20px; }
    .nav-tresnak a.nav-ikonoa::after { content: attr(title); }
    .nav-bistak { padding: 4px; border-radius: 10px; }
    .nav-bistak a { padding: 0 12px; }
    .nav-edit { border-radius: 10px; padding: 6px; }
    .nav-tresnak > li.nav-edit { display: none; }
    body.editatu-aktibo .nav-tresnak > li.nav-edit { display: flex; }
    .nav-etiketa { margin: 0 0 4px 6px; }
    .nav-bereizlea { width: auto; height: 1px; margin: 4px 0; }
    .nav-globala { padding-left: 0; border-left: 0; border-top: 1px solid #dde2e4; padding-top: 8px; }
    .nav-gehiago > #btn-gehiago { display: none; }
    .nav-gehiago-menua {
        display: flex; position: static; min-width: 0; padding: 0;
        box-shadow: none; background: transparent;
    }
}


.aukerak a {
    background-color: #fff;
    border-radius: 50%;
    margin-left: 3px;
    width: 30px;
    height: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 1px 3px 3px rgba(0,0,0,0.6);
    position: relative;
    top: 0px;
    left: 0px;
    transition: 0.3s all ease-out;
}
.aukerak a:hover,
.aukerak a.active {
    text-decoration: none;
    background: linear-gradient(85deg, rgba(76,226,176,1) 0%, rgba(51,130,113,1) 100%);;
    color: #fff;
    left: 3px;
    top: 3px;
    box-shadow: 0px 0px 0px;
}
#zutabeak > .block-izena .aukerak {
    position: absolute;
    top: 0px;
    left: 0;
    right: 0;
    margin: auto;
    opacity: 0;
    display: none;
    justify-content: center;
    transition: 0.3s all ease-out;
}
body.editatu-aktibo #zutabeak > .block-izena:hover .aukerak {
    display: flex;
    top: -15px;
    opacity: 1;
}
/* Zoom > 1: inner-titulua vertical */
.inner-bilduma.bilduma-vertical {
    overflow: visible;
    position: relative;
}
.inner-titulua.vertical {
    display: block !important;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    /*height: 100%;*/
    justify-content: flex-start;
    overflow: visible;
    padding: 4px 0px;
    padding-left: 2px !important;
    z-index: 1;
    position: relative;
}
.inner-titulua.vertical h2 {
    font-size: 11px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}
.inner-titulua.vertical .aukerak {
    writing-mode: horizontal-tb;
}

/* Cursor pointer on clickable elements when not in edit mode */
body:not(.editatu-aktibo) #zutabeak .block-izena > span { cursor: pointer; }
body:not(.editatu-aktibo) .block-bilduma .inner-titulua { cursor: pointer; }
body:not(.editatu-aktibo) .puntua-blokea .puntua-izena { cursor: pointer; }
body:not(.editatu-aktibo) .fasea-denbora > span { cursor: pointer; }
#atlasa.erlatiboa .puntua {
    margin-left: 15px;
}
#atlasa.erlatiboa .puntua .inner-titulua {
    position: relative;
}
#atlasa.erlatiboa .puntua .inner-titulua h2 {
    position: relative;
    z-index: 2;
}
#atlasa.erlatiboa .puntua .inner-titulua .azpimarra {
    position: absolute !important;
    bottom: -1px !important;
    left: -1px !important;
    width: 35px !important;
    height: 3px !important;
    z-index: 1 !important;
}
/* == FANCYBOX DRAWER DERECHO == */

/* El slide alinea el contenido a la derecha */
.fancybox-slide--html {
    padding: 0 !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: flex-start !important;
}

/* El panel en sí: drawer desde la derecha, auto-height */
.fancybox-slide--html .fancybox-content {
    width: 420px !important;
    max-width: 90vw;
    height: 100vh !important;
    min-height: 200px;
    max-height: 100vh !important;
    background: #fff;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    border-left: 3px solid #32c795;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: -4px 0 20px rgba(0,0,0,0.12);
}

/* Botón de cierre de fancybox */
.fancybox-slide--html .fancybox-close-small {
    top: 8px;
    right: 8px;
}

/* Contenido interior del drawer — flex column so buttons always stick to bottom */
.fancy-body {
    padding: 20px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    flex-direction: column;
}
/* Atzealde ilunik ez (beste paneletan bezala) */
.fancybox-bg { opacity: 0 !important; background: transparent !important; }
.fancybox-slide--html .fancybox-content.fancy-body { padding: 20px !important; }
.fancybox-slide--html .fancybox-content.fancy-body > form,
.fancybox-slide--html .fancybox-content.fancy-body > .group-input:last-of-type { flex: 1; }
/* Botoiak beti behean */
.fancybox-slide--html .fancy-body .forma-botoiak { margin-top: auto; }
.fancybox-slide--html .fancy-body form > .forma-botoiak { position: sticky; bottom: -20px; background: #fff; padding-bottom: 20px; margin-bottom: -20px; }
/* Modal barruan soilik ikusgai (fancybox-ek .fancybox-slide-ra mugitzen du) */
.fancybox-slide .fancy-body { display: flex !important; }

/* ══ FORMA SISTEMA BATERATUA ═══════════════════════════════════════════
   Fancybox modalak (.fancy-body form) eta panel/sidebar inline formak (.forma-inline)
   osagai berberak erabiltzen dituzte:
   .forma-titulua · .group-input (+ .check) · .forma-errenkada · .forma-azpibloke
   .forma-botoiak · .button-mini · .sidebar-goiburua                          */

.fancy-body form { display: flex; flex-direction: column; }

/* Titulua */
.fancy-body form h2,
.forma-titulua {
    font-size: 14px;
    font-weight: 700;
    color: #333;
    margin: 0 0 16px;
    padding: 0;
    border: none;
    display: flex;
    align-items: center;
    gap: 9px;
    text-transform: none;
    letter-spacing: 0;
}
.fancy-body form h2 .material-symbols-outlined,
.forma-titulua .material-symbols-outlined {
    /* Goiko menuko ikonoen tamaina eta kolorea (borobilik gabe) */
    font-size: 24px;
    color: #32c795;
    flex-shrink: 0;
}

/* Eremua (label + sarrera) */
.fancy-body form .group-input,
.forma-inline .group-input {
    display: block;
    width: 100%;
    margin-top: 0;
    margin-bottom: 12px;
    position: relative;
}
.fancy-body form .group-input label,
.forma-inline .group-input label,
.forma-inline > label.forma-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 5px;
}
.fancy-body form .group-input input:not([type="checkbox"]),
.fancy-body form .group-input select,
.fancy-body form .group-input textarea,
.forma-inline .group-input input:not([type="checkbox"]),
.forma-inline .group-input select,
.forma-inline .group-input textarea,
.forma-inline .zuhaitz-input,
.forma-inline .zuhaitz-select,
.forma-inline .erlazio-sel,
.forma-inline .biblio-buscador input,
.forma-inline .forma-errenkada input:not([type="checkbox"]),
.forma-inline .forma-errenkada select,
.zuhaitz-input,
.zuhaitz-select,
.erlazio-sel {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 7px 10px;
    font-size: 13px;
    font-family: inherit;
    background: #fff;
    color: #333;
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: auto;
    outline: none;
}
.fancy-body form .group-input input:not([type="checkbox"]):focus,
.fancy-body form .group-input select:focus,
.fancy-body form .group-input textarea:focus,
.forma-inline .group-input input:not([type="checkbox"]):focus,
.forma-inline .group-input select:focus,
.forma-inline .group-input textarea:focus,
.forma-inline .zuhaitz-input:focus,
.forma-inline .zuhaitz-select:focus,
.forma-inline .erlazio-sel:focus,
.forma-inline .biblio-buscador input:focus,
.forma-inline .forma-errenkada input:not([type="checkbox"]):focus,
.zuhaitz-input:focus,
.zuhaitz-select:focus,
.erlazio-sel:focus {
    border-color: #32c795;
    outline: none;
    box-shadow: 0 0 0 2px rgba(50,199,149,0.1);
}
.fancy-body form .group-input input.error:not([type="checkbox"]),
.fancy-body form .group-input select.error,
.fancy-body form .group-input textarea.error,
.forma-inline .group-input input.error:not([type="checkbox"]),
.forma-inline .group-input select.error,
.forma-inline .group-input textarea.error {
    border-color: #e74c3c;
}
.fancy-body form .group-input textarea,
.forma-inline .group-input textarea {
    resize: vertical;
    min-height: 64px;
}
.fancy-body form .group-input input[type="color"],
.forma-inline .group-input input[type="color"],
.forma-inline .forma-errenkada input[type="color"] {
    padding: 2px 4px;
    height: 34px;
    cursor: pointer;
}
.forma-inline select:disabled, .erlazio-sel:disabled { background: #f5f5f5; color: #bbb; cursor: not-allowed; }

/* Checkbox lerroak */
.fancy-body form .group-input.check,
.forma-inline .group-input.check {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
.fancy-body form .group-input.check input,
.forma-inline .group-input.check input {
    width: auto;
    margin: 0;
    flex-shrink: 0;
}
.fancy-body form .group-input.check label,
.forma-inline .group-input.check label {
    display: inline;
    font-size: 13px;
    text-transform: none;
    letter-spacing: 0;
    color: #555;
    font-weight: 400;
    margin: 0;
}

/* Sarrera bat baino gehiago lerro berean (urtea hasi/amaiera, kolorea + izena...) */
.forma-errenkada {
    display: flex;
    gap: 6px;
    align-items: flex-end;
    margin-bottom: 12px;
}
.forma-errenkada > .group-input { flex: 1; min-width: 0; margin-bottom: 0; }
.forma-errenkada > .group-input.finkoa { flex: 0 0 auto; width: auto; }
.forma-errenkada > button { flex-shrink: 0; }
.forma-errenkada.forma-errenkada-sarrerak { align-items: center; }
.forma-errenkada.forma-errenkada-sarrerak > input { flex: 1; }

/* Sarrera berean urtea + hilabetea / data modua */
.forma-inline .mapa-data-input { gap: 4px; }
.forma-inline .mapa-data-input input { padding-left: 6px; padding-right: 6px; }
.forma-inline .mapa-data-input input { flex: 1; min-width: 0; }

/* Azpi-bloke (forma barruko forma txikia: sortu berria, etab.) */
.forma-azpibloke {
    background: #f5f9f7;
    border: 1px solid #d4ede5;
    border-radius: 6px;
    padding: 10px;
    margin-bottom: 12px;
}
.forma-azpibloke > .forma-label,
.forma-azpibloke > label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #888;
    margin-bottom: 6px;
}
.forma-azpibloke .group-input:last-of-type { margin-bottom: 8px; }
.forma-azpibloke .forma-botoiak { margin-top: 8px; padding-top: 0; border-top: none; }

/* Botoiak: beti Gorde (zabaldu) · Ezabatu (ikonoa, aukerakoa) · Utzi */
.fancy-body .button {
    font-family: inherit;
    margin: 0;
}
.forma-botoiak {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #eef0f3;
    display: flex;
    gap: 4px;
}
.forma-botoiak .button { margin: 0; font-family: inherit; }
.forma-botoiak .button:not(.button-cancel):not(.forma-ikonoa) { flex: 1; }
.forma-botoiak .button-cancel,
.forma-botoiak .forma-ikonoa { flex: 0 0 auto; }
/* Botoi nagusiak (Gorde / Sortu / Inportatu...) beti betea */
.fancy-body .button:not(.button-cancel),
.forma-inline .button:not(.button-cancel):not(.button-mini):not(.forma-ikonoa) {
    background: #32c795;
    color: #fff;
    border-color: #32c795;
}
.fancy-body .button:not(.button-cancel):hover,
.forma-inline .button:not(.button-cancel):not(.button-mini):not(.forma-ikonoa):hover {
    background: #28b386;
    border-color: #28b386;
}
.forma-inline .button-cancel,
.forma-botoiak .button.button-cancel,
.forma-botoiak .button.forma-ikonoa { background: #f0f0f0; color: #666; border-color: #f0f0f0; }
.forma-inline .button-cancel:hover,
.forma-botoiak .button.button-cancel:hover { background: #fdecea; color: #e74c3c; border-color: #fdecea; }
.forma-botoiak .button.forma-ikonoa:hover { background: #e4e7ea; color: #333; border-color: #e4e7ea; }

/* "+" / editatu botoi txikiak sidebar goiburuetan */
.button.button-small.button-mini, .button-mini {
    padding: 2px 8px;
    min-width: 26px;
    font-size: 12px;
    line-height: 1.4;
    margin: 0;
    flex-shrink: 0;
}
body.biblio-aktibo #info-nota-berria-btn { display: none !important; }
.sidebar-goiburua {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 4px;
}
.sidebar-goiburua > .mapa-label,
.sidebar-goiburua > .zuhaitz-label,
.sidebar-goiburua > span { margin: 0; }
.sidebar-goiburua-botoiak { display: flex; gap: 4px; align-items: center; }

/* Scrollbar estiluak */
main::-webkit-scrollbar {
    height: 14px;
    width: 14px;
}

main::-webkit-scrollbar-track {
    background: #1a1a2e;
    border-radius: 0px;
}

main::-webkit-scrollbar-thumb {
    background: #32c795;
    border-radius: 6px;
    border: 3px solid #1a1a2e;
}

main::-webkit-scrollbar-thumb:hover {
    background: #50e0aa;
    border: 2px solid #1a1a2e;
}

main::-webkit-scrollbar-corner {
    background: #1a1a2e;
}

/* == BIBLIOGRAFIA == */
.biblio-buscador {
    position: relative;
    margin-bottom: 6px;
}
.biblio-buscador input {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    background: #fff;
    color: #333;
}
.biblio-buscador input:focus { border-color: #32c795; }
.biblio-emaitzak {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,.1);
    z-index: 500;
    max-height: 200px;
    overflow-y: auto;
}
.biblio-emaitza-item {
    padding: 6px 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
    color: #333;
}
.biblio-emaitza-item:hover { background: #f5f5f5; }
.biblio-emaitza-hutsa { padding: 8px 10px; font-size: 12px; color: #aaa; }
.biblio-emaitza-sortu { padding: 6px 10px; font-size: 12px; color: #1a9e72; cursor: pointer; border-top: 1px solid #e8f5f1; font-weight: 600; }
.biblio-emaitza-sortu:hover { background: #f0faf6; }
.biblio-izenburua { flex: 1; color: #333; }
.biblio-egilea { color: #aaa; font-size: 11px; }
.biblio-mota-badge {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 5px;
    border-radius: 3px;
    background: #e8e8e8;
    color: #666;
    flex-shrink: 0;
}
.biblio-mota-liburua   { background: #dceefb; color: #1a6a9e; }
.biblio-mota-artikulua { background: #d4f0e2; color: #1a6b3a; }
.biblio-mota-aldizkaria { background: #e8f4d4; color: #4a6b1a; }
.biblio-mota-web       { background: #ede8fb; color: #5a3a9e; }
.biblio-mota-wikipedia { background: #fdf3d4; color: #7a6000; }
.biblio-mota-dokumentala { background: #fde8e8; color: #9e1a1a; }
.biblio-mota-podcast   { background: #fdeede; color: #9e4a1a; }

.biblio-hautatuak, .estekak-zerrenda {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 6px;
    overflow: hidden;
}
.biblio-ref-item {
    display: flex;
    background: #f5f7f6;
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    min-width: 0;
    box-sizing: border-box;
    width: 100%;
}
.biblio-ref-item:hover { background: #eaeff8; }
.biblio-ref-item-top {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-width: 0;
}
.biblio-ref-zitazioa {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    color: #555;
    line-height: 1.4;
}
.biblio-ref-zitazioa em { font-style: italic; }
.biblio-ref-item-acciones {
    display: flex;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}
.biblio-ref-izenburua { display: none; }
.biblio-ref-egilea { display: none; }
.biblio-kendu-btn {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 13px;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
}
.biblio-kendu-btn:hover { opacity: .7; }
.biblio-ref-orrialdeak,
#info-nota-form .biblio-ref-orrialdeak {
    width: 100px !important;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 11px;
    padding: 2px 5px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    color: #555;
    text-align: center;
    box-sizing: border-box;
}
.biblio-ref-orrialdeak:focus,
#info-nota-form .biblio-ref-orrialdeak:focus { border-color: #2ecc71; outline: none; }
.button-small {
    font-size: 11px;
    padding: 3px 8px;
    margin-top: 0;
}
.button.button-small:not(.button-cancel) {
    background: #32c795;
    color: #fff;
}
.button.button-small:not(.button-cancel):hover {
    background: #28b386;
    border-color: #28b386;
}
.button-icon {
    padding: 0px 1px;
    height: 28px;
}
.esteka-item a { flex: 1; color: #32c795; font-size: 12px; }
.estekak-gehitu {
    display: flex;
    gap: 6px;
    align-items: center;
}
.estekak-gehitu input { flex: 1; }

/* == BIBLIOGRAFIA PANEL (#info) == */
#biblio-panel { padding: 2px 0 12px; }

/* Tresna-barra */
.biblio-panel-toolbar { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.biblio-panel-bilaketa-input { flex: 1; padding: 7px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; font-family: inherit; outline: none; background: #fff; direction: ltr; text-align: left; }
.biblio-panel-bilaketa-input:focus { border-color: #32c795; box-shadow: 0 0 0 2px rgba(50,199,149,.15); }

/* Edit-mode-only elements */
.biblio-panel-edit-only { display: none !important; }
body.editatu-aktibo .biblio-panel-edit-only { display: inline-flex !important; }

/* == ELEMENTUAK SEKZIOA (bibliography fancybox) == */
#biblio-elementuak-zerrenda { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; }
.biblio-elementuak-sep { border-top: 1px solid #eee; margin: 14px 0 10px; }
.biblio-elementuak-label { font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 6px; }
.biblio-elementu-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; border-bottom: 1px solid #f5f5f5; font-size: 12px; }
.biblio-elementu-item-izena { flex: 1; color: #333; }
.biblio-elementu-item-pp { color: #999; font-size: 11px; white-space: nowrap; }
.biblio-elementu-hutsa { font-size: 11px; color: #bbb; margin: 2px 0 6px; }
.biblio-elementu-bilaketa { width: 100%; padding: 7px 10px; border: 1px solid #ddd; border-radius: 4px; font-size: 13px; font-family: inherit; outline: none; box-sizing: border-box; }
.biblio-elementu-bilaketa:focus { border-color: #32c795; }
.biblio-elementu-emaitzak { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid #ddd; border-radius: 4px; box-shadow: 0 4px 12px rgba(0,0,0,0.1); z-index: 20; max-height: 160px; overflow-y: auto; }
.biblio-elementu-aukera { padding: 6px 10px; font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.biblio-elementu-aukera:hover { background: #f5f5f5; }
.biblio-elementu-aukera-hutsa { padding: 6px 10px; font-size: 12px; color: #aaa; }
.biblio-elementu-orrialde-form { margin-top: 6px; }
.biblio-elementu-orrialde-form input[type="text"] { flex: 1; padding: 4px 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 12px; outline: none; min-width: 0; }
.biblio-elementu-orrialde-izena { font-size: 12px; color: #555; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.biblio-iradokizun-tit { font-size: 10px; color: #aaa; margin: 6px 0 3px; }
.biblio-iradokizun-chip { display: inline-block; background: #f0f8f5; border: 1px solid #c8e8df; border-radius: 10px; padding: 2px 8px; font-size: 11px; cursor: pointer; margin: 2px; }
.biblio-iradokizun-chip:hover { background: #d4f0e8; }

/* Estatistikak */
.biblio-panel-stats { font-size: 11px; color: #999; margin-bottom: 8px; padding: 0 2px; }
.biblio-panel-stats-sep { color: #ccc; }
.biblio-panel-stats-erabilia { color: #32c795; font-weight: 600; }

/* Mota iragazki txipak */
.biblio-panel-filter-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 12px; }
.biblio-panel-chip { padding: 3px 9px; border-radius: 12px; font-size: 10px; cursor: pointer; background: #f0f0f0; color: #555; border: 1px solid transparent; transition: background .12s, color .12s; white-space: nowrap; user-select: none; }
.biblio-panel-chip:hover { background: #e0e0e0; }
.biblio-panel-chip.aktibo { background: #32c795; color: #fff; }

/* Zerrenda */
.biblio-panel-lista { display: flex; flex-direction: column; gap: 6px; }
.biblio-panel-loading, .biblio-panel-hutsa { color: #aaa; font-size: 12px; text-align: center; padding: 24px 0; }
.biblio-panel-section-sep { font-size: 10px; color: #aaa; text-transform: uppercase; letter-spacing: 1px; padding: 10px 2px 4px; border-top: 1px solid #eee; margin-top: 4px; }

/* Item */
.biblio-panel-item { border-left: 3px solid #ddd; padding: 8px 10px; background: #f9fbfa; border-radius: 0 5px 5px 0; }
.biblio-panel-item-erabilia { border-left-color: #32c795; background: #f0faf6; }
.biblio-panel-item-top { display: flex; align-items: flex-start; gap: 4px; }
.biblio-panel-item-main { flex: 1; min-width: 0; }
.biblio-panel-item-header { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; flex-wrap: wrap; }
.biblio-panel-erabilia-dot { color: #32c795; font-size: 8px; line-height: 1; }
.biblio-panel-item-actions { flex-shrink: 0; padding-top: 2px; }
.biblio-panel-izenburua { font-size: 13px; font-weight: 700; color: #222; margin-bottom: 2px; }
.biblio-panel-meta { font-size: 11px; color: #666; margin-bottom: 2px; }
.biblio-panel-url a { font-size: 11px; color: #1a9e72; word-break: break-all; text-decoration: none; }
.biblio-panel-url a:hover { text-decoration: underline; }
.biblio-panel-deskribapena { font-size: 11px; color: #777; font-style: italic; margin-top: 4px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* Erreferentziak grafikan */
.biblio-panel-erreferentziak { margin-top: 7px; padding-top: 7px; border-top: 1px solid #c8ead8; }
.biblio-panel-erref-tit { font-size: 10px; color: #32c795; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 5px; }
.biblio-panel-erref-toggle { display: inline-flex; align-items: center; margin-left: auto; padding: 0 2px 0 0; height: 14px; line-height: 1; border: 0; background: none; color: #32c795; font-size: 10px; font-weight: 700; cursor: pointer; }
.biblio-panel-erref-toggle .material-symbols-outlined { font-size: 14px; transition: transform .15s; }
.biblio-panel-erref-toggle.irekita .material-symbols-outlined { transform: rotate(90deg); }
.biblio-panel-erref-item { font-size: 11px; padding: 2px 0; }
.biblio-panel-nota-izena { color: #444; font-weight: 500; }
.biblio-panel-orrialdeak { color: #1a9e72; font-size: 10px; margin-left: 3px; }
.biblio-panel-aipamena { color: #666; font-style: italic; font-size: 10px; margin: 2px 0 0 8px; }

/* == BIBLIO INLINE FORM (350px panel eskuinera #info-edukia barnean) == */
#biblio-form-inline {
    width: 350px;
    flex-shrink: 0;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    border-left: 1px solid #e0e0e0;
}
#biblio-form-inline[style*="none"] { display: none; }
#biblio-form-inline > .forma-botoiak:last-child { margin-top: auto; }
/* Firefox */
main {
    scrollbar-width: auto;
    scrollbar-color: #32c795 #1a1a2e;
}

/* =====================================================
   ZUHAITZ GENEALOGIKOA
   ===================================================== */

#zuhaitza {
    position: fixed;
    top: 47px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 47px);
    background: #f9f9f9;
    z-index: 50;
    display: none;
    flex-direction: row;
    overflow: hidden;
}
#zuhaitza.aktibo {
    display: flex;
}
#zuhaitza-itxi {
    position: absolute;
    top: 0px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #bbb;
    z-index: 60;
    line-height: 1;
    padding: 4px 6px;
}
#zuhaitza-itxi:hover { color: #e74c3c; }

#zuhaitza-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

/* Canvas: arbolaren area nagusia */
#zuhaitza-canvas {
    flex: 1;
    overflow: auto;
    padding: 20px;
    background: #fff;
    min-width: 0;
    min-height: 0;
}

/* Sidebar: kontrol eta editore area */
#zuhaitz-sidebar {
    width: 350px;
    flex-shrink: 0;
    border-left: 1px solid #eee;
    background: #fff;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 20px;
}
/* Zuhaitz sidebar-eko bilaketa-emaitzak: flow estatikoa (overflow-y:auto-ak ez moztu) */
#zuhaitz-def-bilaketa-emaitzak {
    position: static;
    margin-top: 2px;
    width: 100%;
    box-sizing: border-box;
}

/* ── Sidebar bateratuak (mapa + zuhaitza) ────── */
.zuhaitz-kontrol-bloke, .mapa-kontrol-bloke {
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
}
.zuhaitz-label, .mapa-label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #aaa;
    margin-bottom: 5px;
}
#zuhaitza-urtea-input {
    width: 100%;
    padding: 6px 8px;
    font-size: 13px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Sidebar edukia */
#zuhaitz-sidebar-edukia {
    flex: 1;
    overflow-y: auto;
}
.zuhaitz-info-pertsona h3 {
    font-size: 14px;
    margin: 0 0 3px;
}
.zuhaitz-data {
    font-size: 11px;
    color: #999;
    margin: 0 0 10px;
}
.zuhaitz-info-pertsona {
    margin-bottom: 10px;
}
.zuhaitz-urtea-bloke {
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    padding: 10px 0;
    margin-bottom: 10px;
}
.zuhaitz-urtea-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 0;
}
.zuhaitz-urtea-input {
    flex: 1;
    min-width: 0;
}
.zuhaitz-urtea-sep {
    font-size: 12px;
    color: #bbb;
    flex-shrink: 0;
}
.zuhaitz-erlazioak-bloke {
    margin-top: 4px;
}
.bilatu-urtea {
    font-size: 10px;
    color: #bbb;
    margin-left: 4px;
}

/* Pertsonaia hautatzeko bilaketa-blokea */
.zuhaitz-hautaketa-bloke {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 12px;
}

/* Sidebar zerrenda itemak (erlazioak + eremuak + guneak) */
.zuhaitz-erlazio-item, .mapa-eremua-item, .mapa-gunea-item {
    display: flex;
    align-items: center;
    font-size: 11px;
    color: #444;
    padding: 3px 6px;
    background: #f4f6fb;
    border-radius: 3px;
    margin-bottom: 2px;
    gap: 4px;
}
.zuhaitz-erlazio-item:hover, .mapa-eremua-item:hover, .mapa-gunea-item:hover { background: #eaeff8; }
.zuhaitz-erlazio-item { justify-content: space-between; }
.mapa-eremua-item, .mapa-gunea-item { flex-wrap: wrap; }
.zuhaitz-erlazio-item.zuhaitz-erlazio-editatzen {
    background: #ddeaff;
    border-left: 3px solid #3a7bd5;
}
.erlazio-mota-label {
    font-size: 10px;
    font-weight: 700;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    white-space: nowrap;
    margin-right: 4px;
}
.erlazio-izena { flex: 1; color: #333; }
.zuhaitz-kendu-btn, .sidebar-item-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
    flex-shrink: 0;
}
.zuhaitz-kendu-btn:hover, .sidebar-item-btn:hover { color: #922b21; }
.zuhaitz-edit-btn, .sidebar-item-btn-edit { color: #3a7bd5; font-size: 11px; }
.zuhaitz-edit-btn:hover, .sidebar-item-btn-edit:hover { color: #2471a3; }

/* Erlazio editatzeko fila */
.zuhaitz-erlazio-editatzen {
    background: #f8f8f8;
    border-radius: 4px;
    padding: 4px 6px;
    gap: 4px;
    flex-wrap: wrap;
}
.zuhaitz-erlazio-edit-select {
    flex: 1;
    min-width: 0;
    font-size: 11px;
    padding: 3px 5px;
}

/* Erlazio berria gehitu formularioa */
.zuhaitz-erlazio-berria { margin-top: 4px; }
.zuhaitz-bilatu-wrapper {
    position: relative;
}
#zuhaitz-bilatu-emaitzak {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 4px 4px;
    z-index: 200;
    max-height: 160px;
    overflow-y: auto;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.bilatu-item {
    padding: 7px 10px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}
.bilatu-item:hover { background: #f5f5f5; }
.bilatu-item-empty { color: #aaa; cursor: default; font-style: italic; }

.zuhaitz-empty {
    font-size: 11px;
    color: #bbb;
    font-style: italic;
    margin: 8px 0 0;
}

/* Pertsona nodoak canvas-ean */
.zuhaitz-pertsona {
    position: absolute;
    width: 130px;
    height: 60px;
    padding: 8px 10px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.15s, transform 0.1s;
    box-sizing: border-box;
    z-index: 1;
    overflow: hidden;
}
.zuhaitz-pertsona:hover {
    box-shadow: 0 3px 10px rgba(0,0,0,0.14);
    transform: translateY(-1px);
}
.zuhaitz-pertsona.hautatuta {
    box-shadow: 0 3px 10px rgba(50,199,149,0.35);
    background: #edfaf4;
}
.zuhaitz-pertsona.erlazio-hover {
    box-shadow: 0 0 0 3px #5f9ea0, 0 3px 10px rgba(0,0,0,0.12);
    transform: translateY(-1px);
    z-index: 5;
}
.zuhaitz-pertsona .p-izena {
    font-weight: 700;
    font-size: 12px;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zuhaitz-pertsona .p-deskribapena {
    font-size: 9px;
    color: #888;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 1px;
}
.zuhaitz-pertsona-izena-nagusia {
    font-size: 13px;
    font-weight: 600;
    color: #222;
}
.zuhaitz-deskribapena-sidebar {
    font-size: 12px;
    color: #555;
    margin-top: 4px;
    line-height: 1.4;
}
.zuhaitz-pertsona-urtea-sidebar {
    font-size: 11px;
    color: #aaa;
    margin-top: 2px;
}
/* MOTA BADGE — kolore automatikoa, nodo txikiaren behealdean */
.zuhaitz-pertsona.zuhaitz-motaduna {
    border-width: 2px;
    padding-bottom: 14px;
}
.zuhaitz-mota-badge {
    position: absolute;
    bottom: 0;
    left: -1px;
    right: -1px;
    font-size: 8px;
    color: #fff;
    padding: 1px 4px;
    text-align: center;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    border-radius: 0 0 3px 3px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}
.zuhaitz-mota-preview {
    display: inline-block;
    font-size: 10px;
    color: #fff;
    padding: 2px 10px;
    border-radius: 10px;
    margin-top: 4px;
    font-weight: 600;
    letter-spacing: 0.3px;
}
.zuhaitz-mota-bloke {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #333;
}
/* ── Blokeak ─────────────────────────────────────── */
.info-publikoa {
}
.zuhaitz-bloke {
    position: relative;
    padding: 10px 0;
    border-top: 1px solid #f0f0f0;
}
.zuhaitz-bloke:first-child { border-top: none; }
.zuhaitz-bloke .zuhaitz-mota-badge {
    position: relative;
    display:inline-block;
    margin-top:4px;
}
/* ── Tab nabigatzailea ───────────────────────────── */
.zuhaitz-gehitu-bloke { padding-bottom: 4px; }
.zuhaitz-gehitu-tabs {
    display: flex;
    gap: 3px;
    margin-bottom: 8px;
}
.zuhaitz-tab-btn {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #444;
    color: #888;
    font-size: 10px;
    padding: 4px 2px;
    border-radius: 4px;
    cursor: pointer;
    text-align: center;
    line-height: 1.3;
}
.zuhaitz-tab-btn:hover { border-color: #666; color: #bbb; }
.zuhaitz-tab-btn.aktibo {
    background: #333;
    border-color: #888;
    color: #fff;
}

/* ── Berria sortu form ───────────────────────────── */
.zuhaitz-berria-form { display: flex; flex-direction: column; gap: 4px; }
.z-btn-full { width: 100%; margin-top: 2px; }

/* ── Motak kudeatu ───────────────────────────────── */
.zuhaitz-motak-bloke { border-radius: 4px; padding: 4px 0 !important; margin-top: 4px; }
.zuhaitz-motak-edukia { margin-top: 6px; }
.zuhaitz-motak-zerrenda { margin-bottom: 6px; }
.zuhaitz-mota-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 0;
    border-bottom: 1px solid #eee;
}
.zuhaitz-mota-item:last-child { border-bottom: none; }
.zuhaitz-mota-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}
.zuhaitz-mota-izen {
    flex: 1;
    font-size: 11px;
    color: #444;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.zuhaitz-mota-berria-form { margin-top: 6px; }
.zuhaitz-kolorea-input {
    width: 32px;
    height: 28px;
    padding: 1px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── Iturria hautatua (source selected display) ─── */
.zuhaitz-sel-persona {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 5px 8px;
    margin-top: 6px;
    flex-wrap: wrap;
}
.zuhaitz-sel-izena {
    font-size: 12px;
    font-weight: 600;
    color: #222;
}
.zuhaitz-sel-urtea {
    font-size: 11px;
    color: #999;
}

/* ── Picker hautatua (selected target / 2nd parent) ─ */
.zuhaitz-picker-sel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #edf7f2;
    border: 1px solid #b2dfc9;
    border-radius: 5px;
    padding: 5px 8px;
    margin-top: 4px;
    font-size: 12px;
    color: #1a6640;
}
.zuhaitz-picker-sel span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Picker container (each picker in erlazio form) ─ */
.zuhaitz-picker-bloke {
    margin-top: 8px;
}

/* ── Label txikia (sub-section label) ───────────── */
.zuhaitz-label.zuhaitz-label-sm {
    font-size: 9px;
    letter-spacing: 0.3px;
    color: #bbb;
    margin-bottom: 3px;
}

/* ── Berria sortu — izena display ─────────────────── */
.zuhaitz-berria-izena-display {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 4px 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Bilatu-item ekintza (API bilatu + sortu berria) */
.bilatu-item-action {
    color: #3d8b64;
    font-style: italic;
    border-top: 1px solid #eee;
}

/* =====================================================
   MAPA INTERAKTIBOA
   ===================================================== */

#mapa {
    position: fixed;
    top: 47px;
    left: 0;
    width: 100vw;
    height: calc(100vh - 47px);
    background: #f9f9f9;
    z-index: 50;
    display: none;
    flex-direction: row;
    overflow: hidden;
}
#mapa { min-height: 0; }
#mapa.aktibo {
    display: flex;
}

#mapa-itxi {
    position: absolute;
    top: 0px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #bbb;
    z-index: 60;
    line-height: 1;
    padding: 4px 6px;
}
#mapa-itxi:hover { color: #e74c3c; }

#mapa-body {
    display: flex;
    flex-direction: row;
    width: 100%;
    height: 100%;
}

#mapa-kontainerra {
    flex: 1;
    height: 100%;
    z-index: 1;
}

#mapa-sidebar {
    width: 350px;
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    border-left: 1px solid #e0e0e0;
    background: #fff;
    z-index: 2;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.mapa-kontrol-bloke:last-child {
    border-bottom: none;
}

#mapa-urtea-input {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    box-sizing: border-box;
}

.mapa-info-txt {
    font-size: 11px;
    color: #aaa;
    margin: 4px 0;
    line-height: 1.4;
}

/* Búsqueda de puntua para geolocalizar */

.mapa-puntua-emaitzak {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 160px;
    overflow-y: auto;
    margin-bottom: 4px;
}

.mapa-puntua-item {
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    border-bottom: 1px solid #f5f5f5;
}
.mapa-puntua-item:last-child { border-bottom: none; }
.mapa-puntua-item:hover { background: #f0f8ff; }

/* Formulario de eremua */

.mapa-eremua-form-row input[type="range"] {
    flex: 1;
}
#mapa-eremua-opakutasuna-val {
    font-size: 11px;
    width: 28px;
    text-align: right;
    color: #666;
}


/* Polygon list in eremua form */
.mapa-poligon-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #444;
    padding: 3px 6px;
    background: #f4f6fb;
    border-radius: 3px;
    margin-bottom: 2px;
}
.mapa-poligon-kendu-btn {
    background: none;
    border: none;
    color: #c0392b;
    font-size: 14px;
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}
.mapa-poligon-kendu-btn:hover { color: #922b21; }

/* Eremua zerrenda */
.mapa-eremua-color {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 2px;
    flex-shrink: 0;
}

/* Override Leaflet z-index inside #mapa */
#mapa .leaflet-top,
#mapa .leaflet-bottom {
    z-index: 10;
}

/* Cursor crosshair cuando se está colocando un pin */
#mapa-kontainerra.kokatu-modua {
    cursor: crosshair !important;
}
#mapa-kontainerra.kokatu-modua .leaflet-container {
    cursor: crosshair !important;
}

/* =====================================================
   MAPA — ADD PANEL (añadir marcador)
   ===================================================== */

/* Botón "Kokatu mapan" activo */
#mapa-add-btn.aktibo {
    background: #2ecc71;
    color: #fff;
    border-color: #27ae60;
}

/* Panel de añadir marcador */

#mapa-add-coords-txt {
    font-size: 11px;
    color: #3498db;
    font-weight: 600;
    margin-bottom: 8px;
}

/* Separadores de sección dentro del add-panel */
.mapa-add-section-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #bbb;
    margin: 8px 0 4px;
}
.mapa-add-section-label:first-child {
    margin-top: 0;
}

/* Input de búsqueda API */

/* Formulario de gunea libre */



/* Guneak zerrenda */
.mapa-gunea-color {
    display: inline-block;
    width: 10px;
    height: 10px;
    transform: rotate(45deg);
    flex-shrink: 0;
    border: 1px solid rgba(0,0,0,0.15);
}
.mapa-gunea-izena {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mapa-gunea-urtea {
    color: #aaa;
    font-size: 10px;
}
.bilatu-item-action:hover { background: #edf7f2; }

/* Ikono picker */
.mapa-ikono-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    max-height: 120px;
    overflow-y: auto;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 4px;
    background: #fafafa;
}
.mapa-ikono-item {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid transparent;
    flex-shrink: 0;
}
.mapa-ikono-item:hover { background: #e8f5e9; border-color: #a5d6a7; }
.mapa-ikono-item.aktibo { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.mapa-ikono-item.aktibo .material-symbols-outlined { color: #fff; }
.mapa-ikono-item .material-symbols-outlined { font-size: 18px; }

/* Erlazio picker */
.mapa-erlazio-emaitzak {
    position: absolute;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-height: 160px;
    overflow-y: auto;
    z-index: 9999;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.mapa-erlazio-item {
    padding: 5px 8px;
    font-size: 11px;
    cursor: pointer;
}
.mapa-erlazio-item:hover { background: #f0f9f4; }
.mapa-erlazio-hautatuak {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.mapa-erlazio-tag {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    border-radius: 12px;
    padding: 2px 6px;
    font-size: 10px;
    color: #2e7d32;
}
.mapa-erlazio-tag button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    font-size: 10px;
    color: #888;
    line-height: 1;
}

/* Data input toggle */
.mapa-data-input {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
    min-width: 0;
}
.mapa-data-input input {
    min-width: 0;
    flex: 2;
}
.mapa-data-input input[id$="-hil"],
.mapa-data-input input[id$="-mm"],
.mapa-data-input input[id$="-dd"] { flex: 1; }
.mapa-data-toggle {
    background: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 3px;
    height: 34px;
    width: 34px;
    cursor: pointer;
    color: #aaa;
    flex-shrink: 0;
    line-height: 1;
    transition: color 0.1s, border-color 0.1s;
}
.mapa-data-toggle:hover { color: #3498db; border-color: #3498db; }
.mapa-data-toggle.aktibo  { color: #3498db; border-color: #3498db; background: #eaf3fb; }
.mapa-data-toggle .material-symbols-outlined { font-size: 13px; display: block; }

/* MAPA — urtea lista (display soilik) */
.mapa-urtea-lista {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: 260px;
    overflow-y: auto;
}
.mapa-urtea-item {
    font-size: 11px;
    color: #444;
    padding: 4px 8px;
    cursor: pointer;
    user-select: none;
    border-left: 3px solid #ddd;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
    line-height: 1.3;
}
.mapa-urtea-item:hover {
    background: #eef3fc;
    border-left-color: #7a9fd4;
    color: #2c5282;
}
.mapa-urtea-item.aktibo {
    background: #ddeaff;
    border-left-color: #3a7bd5;
    color: #1a4fa0;
    font-weight: 600;
}


/* ============================================
   MINI-TIMELINE (info panel bilduma)
   ============================================ */
.mini-timeline h2 {
    font-size: 15px;
    margin: 0 0 4px;
}
.mini-deskr {
    font-size: 12px;
    color: #888;
    margin: 0 0 12px;
}

/* Contenedor principal: flex horizontal */
.mini-denbora-wrap {
    position: relative;
    display: flex;
    gap: 0;
    overflow: hidden;
    border-left: 1px solid #333;
    margin-top: 10px;
}

/* Eje Y — marcas de año */
.mini-eje-y {
    position: relative;
    width: 52px;
    flex-shrink: 0;
    border-right: 1px solid #3a3a3a;
}
.mini-urtea-marka {
    position: absolute;
    right: 6px;
    font-size: 10px;
    color: #666;
    transform: translateY(-50%);
    white-space: nowrap;
    line-height: 1;
}
.mini-urtea-marka::before {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    width: 4px;
    height: 1px;
    background: #3a3a3a;
}

/* Fases — grafika nagusiaren antzera, zutabe absolutuetan */
.mini-faseak-col {
    position: relative;
    flex-shrink: 0;
    border-right: 1px solid #2a2a2a;
}
.mini-fasea-bloke {
    position: absolute;
    overflow: hidden;
    opacity: 0.75;
    border-top: 2px solid;
    border-bottom: 2px solid;
}
.mini-fasea-izena {
    position: absolute;
    top: 4px;
    left: 2px;
    font-size: 10px;
    font-weight: bold;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    white-space: nowrap;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.45);
    overflow: hidden;
    max-height: calc(100% - 4px);
}

/* Puntuak — columna principal */
.mini-puntuak-col {
    position: relative;
    flex: 1;
    min-width: 0;
}
.mini-puntua-bloke {
    position: absolute;
    left: 8px;
    right: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    transform: translateY(-50%);
    cursor: pointer;
    padding: 2px 0;
    transition: opacity 0.15s;
}
.mini-puntua-bloke:hover .mini-puntua-izena {
    color: #000;
}
.mini-puntua-marra {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.mini-puntua-izena {
    font-size: 11px;
    color: #bbb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    line-height: 1.3;
}
.mini-puntua-urtea {
    font-size: 9px;
    color: #555;
    flex-shrink: 0;
    white-space: nowrap;
}

/* Sin rango de años: lista simple */
.mini-lista {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}
.mini-lista li {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 12px;
    color: #bbb;
    border-bottom: 1px solid #222;
    cursor: pointer;
    transition: color 0.15s;
}
.mini-lista li:hover { color: #fff; }
.mini-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Timeline modua: zutabea finkatu, elementuak-ek scroll propioa */
#info-alboko.bilduma-tl-aktibo {
    overflow-y: hidden;
}
#info-alboko.bilduma-tl-aktibo #info-bilduma-bloke {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
#info-bilduma-elementuak.tl-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Tabs bilduma (timeline / lista) */
#info-bilduma-tabs {
    display: flex;
    gap: 4px;
    margin: 6px 0 8px;
}

/* == RICH TEXT EDITOR == */
#nota-editor-toolbar {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 4px 6px;
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    flex-wrap: wrap;
}
#nota-editor-toolbar button {
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 2px 6px;
    cursor: pointer;
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    min-width: 24px;
}
#nota-editor-toolbar button:hover {
    background: #e0e0e0;
    border-color: #ccc;
}
.editor-sep {
    width: 1px;
    height: 16px;
    background: #ccc;
    margin: 0 3px;
    display: inline-block;
}
#nota-editor {
    min-height: 100px;
    max-height: 280px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 0 0 4px 4px;
    padding: 8px;
    font-size: 12px;
    line-height: 1.6;
    color: #333;
    background: #fff;
    outline: none;
    margin-bottom: 8px;
    word-break: break-word;
}
#nota-editor:empty:before {
    content: attr(data-placeholder);
    color: #aaa;
    pointer-events: none;
}
#nota-editor table {
    border-collapse: collapse;
    width: 100%;
    margin: 4px 0;
    font-size: 11px;
}
#nota-editor table td, #nota-editor table th {
    border: 1px solid #ccc;
    padding: 3px 6px;
    min-width: 40px;
}
#nota-editor table th { background: #f5f5f5; font-weight: 600; }
#nota-editor img { max-width: 100%; height: auto; border-radius: 3px; margin: 4px 0; }
#nota-editor ul, #nota-editor ol { padding-left: 20px; margin: 4px 0; }
#nota-editor ul { list-style-type: circle; }
#nota-editor ol { list-style-type: decimal; }
#nota-editor h2 { font-size: 14px; font-weight: 700; margin: 10px 0 2px; color: #222; line-height: 1.3; }
#nota-editor h3 { font-size: 12px; font-weight: 700; margin: 8px 0 2px; color: #555; text-transform: uppercase; letter-spacing: 0.4px; line-height: 1.3; }
#nota-editor-toolbar button.aktibo { background: #e0ecf8; border-color: #90b8e0; color: #1a6ab0; }
/* Nota item content */
.info-nota-item-content { font-size: 11px; color: #444; margin: 4px 0 0; }
.info-nota-item-content img { max-width: 100%; height: auto; border-radius: 3px; margin: 4px 0; }
.info-nota-item-content table { border-collapse: collapse; width: 100%; font-size: 11px; }
.info-nota-item-content table td, .info-nota-item-content table th { border: 1px solid #ccc; padding: 2px 5px; }
.info-nota-item-content ul, .info-nota-item-content ol { padding-left: 16px; margin: 2px 0; }
.info-nota-item-content ul { list-style-type: circle; }
.info-nota-item-content ol { list-style-type: decimal; }
.info-nota-item-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
}
.nota-item-edit-btns {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}
.nota-item-edit-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #888;
    padding: 0 3px;
    line-height: 1;
}
.nota-item-edit-btn:hover { color: #333; }
.nota-item-kendu-btn:hover { color: #e74c3c; }
.nota-hdr-left { display: flex; align-items: center; gap: 5px; flex: 1; min-width: 0; }
.nota-hdr-left h4 { margin: 0; }
.nota-item-edit-btns a:hover { color: #333; }
.nota-item-kendu-lnk:hover { color: #e74c3c !important; }
/* Content preview / expand */
.nota-gehiago-btn { font-size: 10px; color: #1a9e72; text-decoration: none; white-space: nowrap; }
.nota-gehiago-btn:hover { text-decoration: underline; }
/* Tags */
.nota-tagak { margin-top: 5px; display: flex; flex-wrap: wrap; gap: 3px; }
.nota-tag-chip { font-size: 10px; padding: 1px 5px; background: #eef2ff; border-radius: 3px; color: #5c6bc0; }
/* Bibliography items */
.nota-biblio-entry { font-size: 10px; padding: 4px 0; border-bottom: 1px solid #e8f5f1; }
.nota-biblio-entry:last-child { border-bottom: none; }
.nota-biblio-item { display: flex; align-items: flex-start; gap: 5px; }
.nota-biblio-zitazioa { flex: 1; min-width: 0; color: #333; line-height: 1.4; }
.nota-biblio-zitazioa em { font-style: italic; }
.nota-biblio-link { color: #1a9e72; text-decoration: none; }
.nota-biblio-link:hover { text-decoration: underline; }
.biblio-ref-url { font-size: 10px; color: #3a7bd5; text-decoration: none; word-break: break-all; }
.biblio-ref-url:hover { text-decoration: underline; }
.nota-biblio-orr { color: #888; font-style: italic; white-space: nowrap; flex-shrink: 0; font-size: 9px; margin-top: 2px; }
.nota-biblio-aipamena { color: #666; font-style: italic; margin-top: 3px; padding-left: 8px; border-left: 2px solid #c8e6da; }
/* External links */
.nota-estekak { margin-top: 5px; display: flex; flex-direction: column; gap: 2px; }
.nota-esteka-lnk { font-size: 10px; color: #4a7cb5; text-decoration: none; }
.nota-esteka-lnk:hover { text-decoration: underline; }

/* == MODALS (confirm/move) == */
#kendu-modal-overlay, #mugitu-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999990;
}
#kendu-modal, #mugitu-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 999991;
    background: #fff;
    border-radius: 8px;
    padding: 24px 28px;
    min-width: 300px;
    max-width: 480px;
    width: 90%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
}
#kendu-modal h3, #mugitu-modal h3 {
    margin: 0 0 10px;
    font-size: 15px;
    color: #222;
}
#kendu-modal p { font-size: 12px; color: #666; margin-bottom: 16px; }
.kendu-modal-btns {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}
#kendu-modal-btn-bai { background: #e74c3c; color: #fff; }
#kendu-modal-btn-bai:hover { background: #c0392b; }

/* ESPORTATU MENU */
#esportatu-menu {
    position: fixed;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    z-index: 10000;
    padding: 6px 0;
    min-width: 180px;
}
#esportatu-menu button {
    display: block;
    width: 100%;
    padding: 10px 16px;
    background: none;
    border: none;
    text-align: left;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
#esportatu-menu button:hover {
    background: #f5f5f5;
}
#esportatu-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
}

/* BAIMENAK MODAL */
#baimenak-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    border-radius: 8px;
    padding: 24px;
    z-index: 10000;
    width: 340px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
}
#baimenak-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9999;
}
#baimenak-modal h3 {
    margin: 0 0 14px 0;
    font-size: 15px;
}
#baimenak-modal input, #baimenak-modal select {
    border: none;
    border-bottom: 2px solid #32c795;
    padding: 4px 6px;
    font-size: 13px;
    box-sizing: border-box;
}
.baimena-lerro {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 12px;
}
.baimena-izena { flex: 1; }
.baimena-rol {
    font-size: 10px;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.baimena-kendu-btn {
    background: none;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    font-size: 13px;
    padding: 0 4px;
}
.baimena-kendu-btn:hover { opacity: 1; }

/* Lotura erlazionatua — zerrenda itemetan */
.mapa-erlazio-lotura {
    display: block;
    width: 100%;
    font-size: 10px;
    color: #27ae60;
    padding: 1px 0 1px 18px;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mapa-erlazio-lotura:hover { text-decoration: underline; }

/* MapaDef select */
.mapa-def-select {
    width: 100%;
    font-size: 11px;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
}
.mapa-def-select:focus { outline: none; border-color: #27ae60; }

/* MapaDef erlazio tag mota badge */
.mapa-erlazio-mota-badge {
    display: inline-block;
    font-size: 9px;
    font-weight: 700;
    background: #ecf0f1;
    color: #666;
    border-radius: 3px;
    padding: 0 3px;
    margin-right: 2px;
}

body.mapa-aktibo .nagusia-editatu,
body.zuhaitza-aktibo .nagusia-editatu,
body.mapa-aktibo #btn-zoom-in,
body.mapa-aktibo #btn-zoom-out,
body.zuhaitza-aktibo #btn-zoom-in,
body.zuhaitza-aktibo #btn-zoom-out {
    display: none !important;
}

@media print {
    nav, #info, #zuhaitza, #mapa, .opt-edit, #loader, #kendu-modal, #kendu-modal-overlay, #mugitu-modal, #mugitu-modal-overlay, #baimenak-modal, #baimenak-modal-overlay, #esportatu-menu, #esportatu-overlay {
        display: none !important;
    }
    #atlasa {
        position: static !important;
        overflow: visible !important;
    }
    body { background: white; }
}
/* ── PDF Konfiguragailua ──────────────────────────────────────────────────── */

#pdf-modal-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 3000;
}
body.pdf-modal-aktibo #pdf-modal-overlay { display: block; }

#pdf-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, 96vw);
    max-height: 90vh;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    z-index: 3001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Barruko kutxa (goiburua + gorputza + oina): zutabe flexiblea. Gabe, oina ("Sortu" botoia) modalaren mugatik kanpo
   geratzen da eta moztu egiten da pantaila baxuetan (mugikorra, horizontala). */
#pdf-modal-box {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    max-height: 90vh;
    overflow: hidden;
}
#pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid #eee;
    background: var(--secondary, #2c3e50);
    color: #fff;
}
#pdf-modal-header h2 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.pdf-itxi-btn {
    background: none; border: none;
    color: rgba(255,255,255,0.7);
    font-size: 18px; cursor: pointer; padding: 0 4px;
    line-height: 1;
}
.pdf-itxi-btn:hover { color: #fff; }

#pdf-modal-body {
    overflow-y: auto;
    padding: 16px 20px;
    flex: 1;
    min-height: 0;
}

.pdf-section {
    margin-bottom: 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
}
.pdf-section:last-child { border-bottom: none; margin-bottom: 0; }

.pdf-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #aaa;
    margin-bottom: 10px;
}

.pdf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #333;
}
.pdf-row label { min-width: 90px; color: #555; font-size: 12px; }

.pdf-check-label {
    display: flex; align-items: center; gap: 8px;
    cursor: pointer; font-size: 13px; color: #333;
    min-width: unset !important;
}
.pdf-check-label input[type=checkbox] { cursor: pointer; }

.pdf-select {
    flex: 1; padding: 5px 8px;
    border: 1px solid #ddd; border-radius: 5px;
    font-size: 12px; color: #333; background: #fafafa;
}
.pdf-select:focus { outline: none; border-color: var(--primary,#3498db); }

.pdf-hint {
    font-size: 10px; color: #aaa; margin-left: 4px;
}

/* Cover style previews */
.pdf-azal-estioak {
    display: flex; gap: 12px; margin-top: 10px;
}
.pdf-azal-estilo {
    flex: 1; cursor: pointer;
    border: 2px solid #e0e0e0; border-radius: 7px;
    overflow: hidden;
    transition: border-color 0.15s;
    text-align: center;
}
.pdf-azal-estilo:hover { border-color: #aaa; }
.pdf-azal-estilo.pdf-azal-aktibo { border-color: var(--primary,#3498db); }
.pdf-azal-estilo span {
    display: block; font-size: 11px; color: #666;
    padding: 5px 0 6px;
}

.pdf-azal-preview {
    height: 90px; position: relative;
    display: flex; flex-direction: column;
    overflow: hidden;
}

/* Style 1 preview — colorful */
.pdf-azal-preview-1 { background: #ecf0f1; }
.pdf-azal-preview-1 .paz-header {
    height: 55px; background: var(--secondary,#2c3e50);
}
.pdf-azal-preview-1 .paz-title {
    position: absolute; top: 12px; left: 10px;
    color: #fff; font-size: 11px; font-weight: bold;
}
.pdf-azal-preview-1 .paz-meta {
    position: absolute; bottom: 8px; left: 10px;
    color: #666; font-size: 9px;
}

/* Style 2 preview — minimal */
.pdf-azal-preview-2 {
    background: #fff;
    align-items: center; justify-content: center; gap: 4px;
    padding: 8px 0;
}
.pdf-azal-preview-2 .paz-line-top {
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px; background: var(--secondary,#2c3e50);
}
.pdf-azal-preview-2 .paz-title-c {
    font-size: 13px; font-weight: bold; color: #1a1a2e;
    margin-top: 12px;
}
.pdf-azal-preview-2 .paz-rule {
    width: 40px; height: 2px;
    background: var(--secondary,#2c3e50);
}
.pdf-azal-preview-2 .paz-meta-c {
    font-size: 9px; color: #888;
}

/* Footer */
#pdf-modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}

/* Progress */
#pdf-progress {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: #666;
    margin-bottom: 10px;
}
.pdf-spinner {
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid #ddd;
    border-top-color: var(--primary,#3498db);
    border-radius: 50%;
    animation: pdf-spin 0.7s linear infinite;
}
@keyframes pdf-spin { to { transform: rotate(360deg); } }


/* Sidebar-eko formak: zerrenda blokeen bereizlerik ez, tituluak lehen lerroan */
.forma-inline.mapa-kontrol-bloke,
.forma-inline.zuhaitz-kontrol-bloke {
    border-bottom: none;
    padding: 4px 0 0;
}
.sidebar-goiburua > label { margin: 0; }
.forma-azpibloke > .forma-label { display: block; }
.zuhaitz-picker-bloke { margin-top: 0; margin-bottom: 12px; }


/* Checkbox pertsonalizatuak (nabigatzailearenak ordez) */
.fancy-body input[type="checkbox"],
.forma-inline input[type="checkbox"],
.pdf-check-label input[type="checkbox"],
.mugitu-check {
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: #fff center / 12px no-repeat;
    cursor: pointer;
    transition: background-color .12s, border-color .12s, box-shadow .12s;
}
.fancy-body input[type="checkbox"]:hover,
.forma-inline input[type="checkbox"]:hover,
.pdf-check-label input[type="checkbox"]:hover,
.mugitu-check:hover { border-color: #32c795; }
.fancy-body input[type="checkbox"]:focus-visible,
.forma-inline input[type="checkbox"]:focus-visible,
.pdf-check-label input[type="checkbox"]:focus-visible,
.mugitu-check:focus-visible { outline: none; box-shadow: 0 0 0 2px rgba(50,199,149,0.25); }
.fancy-body input[type="checkbox"]:checked,
.forma-inline input[type="checkbox"]:checked,
.pdf-check-label input[type="checkbox"]:checked,
.mugitu-check:checked {
    background-color: #32c795;
    border-color: #32c795;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.4 2.4 4.6-5' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
.fancy-body input[type="checkbox"]:disabled,
.forma-inline input[type="checkbox"]:disabled { opacity: .5; cursor: not-allowed; }

/* Sidebar formak modalaren berdinak: altuera osoa, botoiak behean */
#mapa-sidebar > .forma-inline.mapa-kontrol-bloke,
#zuhaitz-sidebar > .forma-inline.zuhaitz-kontrol-bloke {
    flex: 1;
    flex-direction: column;
    min-height: 0;
}
#mapa-sidebar > .forma-inline.mapa-kontrol-bloke[style*="display: block"],
#mapa-sidebar > .forma-inline.mapa-kontrol-bloke:not([style*="none"]),
#zuhaitz-sidebar > .forma-inline.zuhaitz-kontrol-bloke:not([style*="none"]) { display: flex; }
#mapa-sidebar > .forma-inline > .forma-botoiak:last-child,
#zuhaitz-sidebar > .forma-inline > .forma-botoiak:last-child { margin-top: auto; }

/* =====================================================
   RESPONSIVE ≤768px — blokeak zutabetan (bata bestearen azpian)
   ===================================================== */
@media (max-width: 768px) {
    /* Info panela: pantaila osoa, edukia + alboko blokeak zutabean */
    #info { width: 100vw; border-left: 0; }
    #info-body { flex-direction: column; overflow-y: auto; }
    #info-edukia {
        flex: none;
        flex-direction: column;
        overflow: visible;
        border-right: 0;
    }
    #info-edukia-kolumna { flex: none; overflow: visible; }
    #info-alboko {
        flex: none;
        width: 100%;
        min-width: 0;
        max-width: none;
        overflow-y: visible;
        border-top: 1px solid #e0e0e0;
    }
    #info-alboko-aukerak { position: static; }

    /* Zuhaitza eta mapa: kanbasa gainean, sidebar azpian */
    #zuhaitza-body,
    #mapa-body { flex-direction: column; overflow-y: auto; }
    #zuhaitza-canvas { flex: none; height: 60%; min-height: 260px; }
    #mapa-kontainerra { flex: none; width: 100%; height: 60%; min-height: 260px; }
    #zuhaitz-sidebar,
    #mapa-sidebar {
        width: 100%;
        height: auto;
        flex-shrink: 0;
        border-left: 0;
        border-top: 1px solid #e0e0e0;
        overflow-y: visible;
        padding: 14px;
        box-sizing: border-box;
    }

    /* Formak: eremu anitzeko errenkadak zutabean */
    .forma-errenkada { flex-wrap: wrap; }
    .forma-errenkada > .group-input { flex: 1 1 100%; }
    .forma-errenkada > .group-input.finkoa { flex: 1 1 100%; width: 100%; }

    /* Fancybox drawer: pantaila osoa */
    .fancybox-slide--html .fancybox-content { width: 100vw !important; max-width: 100vw; border-left: 0; }

    /* Hasiera gida */
    #hasiera-gida-body { padding: 24px 20px; margin: 0 16px; }
}

/* =====================================================
   RESPONSIVE ≤768px — edizioa (atlas, formak, sidebar-ak)
   ===================================================== */
@media (max-width: 768px) {
    /* Nabigazioa: izenburua laburtu, menua pantaila osoan */
    #grafika h1 { font-size: 15px; margin-right: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
    nav { padding: 0 10px; }
    .nav-tresnak { width: 100vw; max-width: 100vw; border-left: 0; padding-bottom: 80px; }

    /* Zutabeen barra: zabalera osoa, horizontalki scrollagarria */
    #atlasa #zutabeak,
    #atlasa.erlatiboa #zutabeak {
        left: 50px;
        right: 0;
        overflow-x: auto;
        overflow-y: visible;
        -webkit-overflow-scrolling: touch;
    }
    #atlasa #zutabeak > div { min-width: 110px; flex: 1 0 auto; padding: 8px 12px; white-space: nowrap; }
    #atlasa.erlatiboa #zutabeak { left: 0; }

    /* Atlasaren edukia: bilduma blokeen tartea eta letra handiagoa */
    #atlasa .inner > .inner-zutabea { padding: 3px 8px; min-width: 240px; }
    #atlasa.lvl-0 .inner > .inner-zutabea .block-bilduma { width: 100%; }
    #atlasa .inner > .inner-zutabea .block-bilduma h2 { font-size: 11px; }
    #atlasa.lvl-0 .inner > .inner-zutabea .block-bilduma h2 { font-size: 12px; }

    /* Edizio aukerak (hover menua): ukitzeko tamaina */
    .aukerak a { width: 36px; height: 36px; }
    body.editatu-aktibo #zutabeak > .block-izena:hover .aukerak { top: -22px; }

    /* Formak: sarrerak 16px (iOS-ek zoom egin ez dezan) eta ukitzeko altuera */
    .fancy-body form .group-input input:not([type="checkbox"]):not([type="color"]),
    .fancy-body form .group-input select,
    .fancy-body form .group-input textarea,
    #mapa-sidebar input:not([type="checkbox"]):not([type="color"]):not([type="range"]),
    #mapa-sidebar select,
    #mapa-sidebar textarea,
    #zuhaitz-sidebar input:not([type="checkbox"]):not([type="color"]):not([type="range"]),
    #zuhaitz-sidebar select,
    #zuhaitz-sidebar textarea,
    #mapa-urtea-input,
    #zuhaitza-urtea-input { font-size: 16px; min-height: 40px; box-sizing: border-box; }

    /* Botoiak: sidebar eta formetan hatz-tamaina */
    .button.button-small { min-height: 38px; }
    .forma-botoiak { flex-wrap: wrap; }
    .sidebar-item-btn,
    .zuhaitz-kendu-btn,
    .zuhaitz-edit-btn { min-width: 36px; min-height: 36px; font-size: 18px; }

    /* Info panela: goiburua eta itxi botoia erosoago */
    #info-itxi { font-size: 24px; padding: 6px 10px; }
    #zuhaitza-itxi,
    #mapa-itxi { font-size: 24px; padding: 6px 10px; }
}

/* Alboko barra: bildumaren izena zerrendaren goiburuan */
.info-alboko-bilduma { display: flex; align-items: center; gap: 7px; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 1px solid #ebebeb; }
.info-alboko-bilduma .item-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.info-alboko-bilduma-izena { font-size: 13px; font-weight: 700; color: #2c3e50; line-height: 1.3; }

/* Barne-estekak: testuan elementu batera lotura */
a.barne-esteka { color: #1a6ab0; text-decoration: none; border-bottom: 1px dashed #1a6ab0; cursor: pointer; }
a.barne-esteka:hover { background: #e0ecf8; }
#info-atzera { max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; flex-shrink: 1; }
#editor-esteka-kutxa { margin: 6px 0; }
#editor-esteka-emaitzak { max-height: 160px; overflow-y: auto; }
