/* 🖼️ Εικόνες σε επεξεργαστή κειμένου (js/imagetool.js): συλλογή, μπάρα εικόνας, περίγραμμα με λαβές μεγέθους */
.it-gallery { position: absolute; top: 100%; right: 0; z-index: 40; margin-top: 4px; width: min(600px, 92vw); max-height: min(430px, 62vh); display: flex; flex-direction: column;
  background: #fff; border: 2px solid #ffd54f; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.22); overflow: hidden; }
.it-gal-head { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #fff8e1; border-bottom: 2px solid #ffe082; font-size: 15px; }
.it-gal-head b { flex: 1; }
.it-own { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; padding: 5px 12px; border-radius: 10px; background: #e3f2fd; border: 2px solid #90caf9; color: #1565c0; cursor: pointer; }
.it-own:hover { background: #bbdefb; }
.it-own input { display: none; }
.it-gal-x { border: 0; background: none; font-size: 18px; cursor: pointer; color: #78909c; }
.it-gal-body { overflow: auto; padding: 6px 10px 10px; }
.it-gal-lbl { font-weight: 700; font-size: 14px; color: #546e7a; margin: 6px 0 4px; }
.it-gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px; }
.it-pic { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px; border: 2px solid #eceff1; border-radius: 10px; background: #fff; cursor: pointer; font-family: inherit; font-size: 12px; color: #455a64; }
.it-pic img { width: 64px; height: 64px; object-fit: contain; }
.it-pic:hover { border-color: #ff9800; transform: scale(1.05); }
.it-pic span { line-height: 1.15; text-align: center; }

/* Μπάρα εικόνας: εμφανίζεται μόνο όταν είναι επιλεγμένη μια εικόνα (όπως η μπάρα πίνακα) */
.it-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; background: #f3e5f5; border: 2px solid #ce93d8; border-radius: 12px; padding: 5px 10px; }
.it-bar.hidden, .it-bar .hidden { display: none; }
.it-bar-title { font-weight: 700; color: #6a1b9a; }
.it-bar-group { display: flex; align-items: center; gap: 3px; padding-right: 8px; border-right: 2px solid #e1bee7; }
.it-bar-lbl { font-size: 12px; color: #7b1fa2; margin-right: 2px; }
.it-bar .it-op small { font-size: 11px; margin-left: 3px; }
.it-bar .it-op.on { background: #e1bee7; border-color: #8e24aa; }
.it-bar-tip { font-size: 12px; color: #7b1fa2; }

/* Η επιλεγμένη εικόνα: περίγραμμα (πάνω από τη σελίδα, position: fixed) με 4 λαβές */
.it-frame { position: fixed; z-index: 35; pointer-events: none; outline: 2px solid #8e24aa; outline-offset: 1px; }
.it-frame.hidden { display: none; }
.it-h { position: absolute; width: 14px; height: 14px; background: #fff; border: 2px solid #8e24aa; border-radius: 3px; pointer-events: auto; }
.it-h[data-h="nw"] { left: -9px; top: -9px; cursor: nwse-resize; } .it-h[data-h="se"] { right: -9px; bottom: -9px; cursor: nwse-resize; }
.it-h[data-h="ne"] { right: -9px; top: -9px; cursor: nesw-resize; } .it-h[data-h="sw"] { left: -9px; bottom: -9px; cursor: nesw-resize; }
.it-h.flash { animation: tf-flash .5s 5; }
/* Πλάτος της εικόνας ως ποσοστό της σελίδας (κάτω από το περίγραμμα· πιο έντονο όσο σέρνεις) */
.it-size { position: absolute; left: 50%; top: 100%; transform: translate(-50%, 8px); white-space: nowrap; background: #6a1b9a; color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 8px; opacity: .85; }
.it-frame.dragging .it-size { opacity: 1; font-size: 14px; background: #8e24aa; }

/* Εικόνες μέσα στο κείμενο: κλικ για επιλογή· οι αιωρούμενες (κείμενο γύρω) δεν «βγαίνουν» από τη σελίδα */
.tf-editor img, .wr-editor img { max-width: 100%; cursor: pointer; border-radius: 6px; }
.tf-editor img::selection, .wr-editor img::selection { background: transparent; }   /* η επιλεγμένη εικόνα δείχνεται με το μωβ περίγραμμα, όχι βαμμένη */
.tf-editor::after, .wr-editor::after { content: ''; display: block; clear: both; }
.it-pic.flash { animation: tf-flash .5s 5; }
@media print { .it-bar, .it-gallery, .it-frame { display: none !important; } }
