.hj-morph { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; padding: 7px 12px; border-radius: 999px; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); font-size: .8rem; font-weight: 600; }
.hj-morph .from { opacity: .75; text-decoration: line-through; text-decoration-color: rgba(255,255,255,.5); }
.hj-morph .arrow { color: var(--hj-cyan); animation: hj-nudge 1.6s ease-in-out infinite; }
.hj-morph .to { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: linear-gradient(135deg, #22c55e, #16a34a); color: #fff; }
.hj-drop { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center;
            padding: 34px 18px 28px; border-radius: 20px; cursor: pointer; outline: none;
            border: 2px dashed rgba(13,110,253,.45);
            background: linear-gradient(135deg, rgba(13,110,253,.06), rgba(124,58,237,.07));
            transition: border-color .2s, background .2s, transform .2s; }
.hj-drop:hover, .hj-drop:focus-visible { border-color: var(--hj-blue); background: linear-gradient(135deg, rgba(13,110,253,.11), rgba(124,58,237,.11)); }
.hj-drop:focus-visible { box-shadow: 0 0 0 4px rgba(13,110,253,.25); }
.hj-drop.over { border-style: solid; border-color: var(--hj-violet); transform: scale(1.01); background: linear-gradient(135deg, rgba(13,110,253,.16), rgba(124,58,237,.16)); }
.hj-drop-ico { width: 64px; height: 64px; border-radius: 20px; display: grid; place-items: center; font-size: 1.7rem; color: #fff; margin-bottom: 6px;
            background: linear-gradient(135deg, var(--hj-blue), var(--hj-violet)); box-shadow: 0 12px 26px rgba(13,110,253,.35); }
.hj-drop-t { font-size: 1.15rem; font-weight: 700; margin: 0; }
.hj-drop-s { font-size: .86rem; color: var(--text-muted); margin: 0; }
.hj-file-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); }
.hj-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 16px; padding: 12px 14px; border-radius: 16px; background: var(--bg-soft); border: 1px solid var(--line); }
.hj-opt-l { font-size: .78rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); margin-right: 8px; }
.hj-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(100,116,139,.15); }
.hj-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hj-seg label { margin: 0; padding: 6px 16px; border-radius: 9px; font-size: .88rem; font-weight: 600; cursor: pointer; color: var(--text-muted); transition: all .15s; }
.hj-seg input:checked + label { background: #fff; color: var(--hj-blue); box-shadow: 0 2px 8px rgba(0,0,0,.12); }
body.dark-theme .hj-seg input:checked + label { background: #334155; color: #93c5fd; }
.hj-seg input:focus-visible + label { outline: 2px solid var(--hj-blue); outline-offset: 1px; }
.hj-q { display: inline-flex; align-items: center; gap: 10px; flex: 1; min-width: 200px; }
.hj-q input[type=range] { flex: 1; accent-color: var(--hj-blue); min-width: 100px; }
.hj-q output { min-width: 34px; font-weight: 700; font-size: .9rem; text-align: right; }
.hj-q[hidden] { display: none; }
.hj-bar { display: none; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.hj-bar.on { display: flex; }
.hj-sum { font-size: .9rem; font-weight: 600; margin: 0; }
.hj-sum small { color: var(--text-muted); font-weight: 500; }
.hj-bar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.hj-alert { display: none; margin-top: 12px; padding: 10px 14px; border-radius: 12px; font-size: .86rem; background: rgba(245,158,11,.14); border: 1px solid rgba(245,158,11,.4); color: #92400e; }
body.dark-theme .hj-alert { color: #fcd34d; }
.hj-alert.on { display: block; }


/* ---------------- shared tool rules ---------------- */
.hj-btn.ok { background: linear-gradient(135deg, #047857, #10b981); box-shadow: 0 10px 22px rgba(5,150,105,.28); }
.hj-btn.ok:hover { box-shadow: 0 14px 28px rgba(5,150,105,.4); }
.hj-btn[disabled] { opacity: .55; cursor: default; transform: none; }
.hj-opts [hidden] { display: none !important; }
@keyframes hj-nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(4px); } }



/* ---------------- FileXL Graphical Abstract and Figure Editor ---------------- */
.hj-tool.ga-tool { width: min(1360px, calc(100vw - 40px)); max-width: none; padding: 10px; position: relative; left: 50%; transform: translateX(-50%); }
.ga-tool [hidden] { display: none !important; }
.ga-app { --ga-sel: #2563eb; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--bg-card, #fff); color: var(--text-main); font-size: .86rem; }
.ga-app * { box-sizing: border-box; }
.ga-loading { padding: 60px 20px; text-align: center; color: var(--text-muted); }
.ga-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 8px 10px; border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.ga-grp { display: flex; align-items: center; gap: 4px; }
.ga-right-grp { margin-left: auto; }
.ga-sel label { display: flex; align-items: center; gap: 6px; font-size: .74rem; font-weight: 600; color: var(--text-muted); margin: 0; }
.ga-sel select, .ga-app select, .ga-app input[type=number], .ga-app input[type=text], .ga-app input[type=search], .ga-app textarea { height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-card, #fff); color: var(--text-main); font-size: .82rem; max-width: 100%; }
.ga-app textarea { height: auto; padding: 8px; width: 100%; resize: vertical; font-family: inherit; }
.ga-sel select { max-width: 230px; }
.ga-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 9px; background: var(--bg-card, #fff); color: var(--text-main); font-size: .8rem; font-weight: 600; cursor: pointer; line-height: 1; }
.ga-btn:hover:not([disabled]) { border-color: var(--hj-blue, #0d6efd); }
.ga-btn:focus-visible, .ga-tab:focus-visible, .ga-tile:focus-visible, .ga-card:focus-visible, .ga-tb:focus-visible, .ga-chip:focus-visible, .ga-stage:focus-visible { outline: 2px solid var(--hj-blue, #0d6efd); outline-offset: 1px; }
.ga-btn[disabled] { opacity: .4; cursor: default; }
.ga-btn.on { background: rgba(13,110,253,.12); border-color: var(--hj-blue, #0d6efd); color: var(--hj-blue, #0d6efd); }
.ga-btn.ga-primary { background: linear-gradient(135deg, var(--hj-blue, #0d6efd), var(--hj-violet, #7c3aed)); color: #fff; border: 0; padding: 0 16px; }
.ga-btn.ga-danger { color: #b91c1c; }
.ga-btn.ga-wide { width: 100%; margin-top: 6px; }
.ga-zl { min-width: 46px; text-align: center; font-weight: 700; font-size: .78rem; }
.ga-main { display: grid; grid-template-columns: 280px minmax(0, 1fr) 280px; height: min(84vh, 800px); min-height: 560px; }
.ga-left, .ga-right { display: flex; flex-direction: column; min-height: 0; overflow: auto; background: var(--bg-card, #fff); }
.ga-left { border-right: 1px solid var(--line); }
.ga-right { border-left: 1px solid var(--line); padding-bottom: 20px; }
.ga-tabs { display: flex; position: sticky; top: 0; z-index: 2; background: var(--bg-soft); border-bottom: 1px solid var(--line); }
.ga-tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 2px 7px; border: 0; background: transparent; color: var(--text-muted); font-size: .66rem; font-weight: 700; cursor: pointer; border-bottom: 2px solid transparent; }
.ga-tab.on { color: var(--hj-blue, #0d6efd); border-bottom-color: var(--hj-blue, #0d6efd); background: var(--bg-card, #fff); }
.ga-panel { padding: 10px; flex: 1; }
.ga-help { margin: 6px 0 8px; font-size: .76rem; line-height: 1.45; color: var(--text-muted); }
.ga-app h3 { margin: 0 0 8px; font-size: .95rem; }
.ga-app h4 { margin: 14px 0 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--text-muted); }
.ga-chips, .ga-lay { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 10px; }
.ga-chip { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--bg-card, #fff); color: var(--text-main); font-size: .74rem; font-weight: 600; cursor: pointer; }
.ga-chip.on { background: var(--hj-blue, #0d6efd); color: #fff; border-color: transparent; }
.ga-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ga-card { display: flex; flex-direction: column; gap: 4px; padding: 6px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-card, #fff); color: var(--text-main); cursor: pointer; }
.ga-card:hover { border-color: var(--hj-blue, #0d6efd); box-shadow: 0 6px 16px rgba(13,110,253,.14); }
.ga-card b { font-size: .72rem; line-height: 1.25; } .ga-card small { font-size: .66rem; color: var(--text-muted); }
.ga-th { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #fff; line-height: 0; }
.ga-th svg { width: 100%; height: auto; display: block; }
.ga-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ga-tiles.ga-small { grid-template-columns: repeat(5, 1fr); }
.ga-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px; padding: 5px 2px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card, #fff); color: var(--text-main); cursor: pointer; }
.ga-tile:hover { border-color: var(--hj-blue, #0d6efd); background: rgba(13,110,253,.06); }
.ga-tile > span { display: flex; align-items: center; justify-content: center; width: 100%; line-height: 0; }
.ga-tile svg { max-width: 100%; height: auto; }
.ga-tile small { font-size: .6rem; color: var(--text-muted); line-height: 1.1; text-align: center; }
.ga-small .ga-tile { min-height: 42px; }
.ga-aa { font-size: 1.4rem; font-weight: 800; line-height: 1; } .ga-aa.s { font-weight: 500; font-size: 1.1rem; } .ga-aa.xs { font-weight: 400; font-size: .8rem; color: var(--text-muted); }
.ga-pill { display: inline-block; padding: 3px 9px; border-radius: 99px; background: var(--hj-blue, #0d6efd); color: #fff; font-size: .62rem; font-weight: 700; line-height: 1.2; }
.ga-badge { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--hj-blue, #0d6efd); color: #fff; font-weight: 800; font-size: .82rem; line-height: 1; }
.ga-search { width: 100%; }
.ga-drop { margin-top: 8px; padding: 14px 8px; text-align: center; border: 2px dashed var(--line); border-radius: 12px; color: var(--text-muted); font-size: .78rem; cursor: pointer; }
.ga-drop.on { border-color: var(--hj-blue, #0d6efd); background: rgba(13,110,253,.07); }
.ga-tray { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ga-tr { position: relative; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; cursor: pointer; background: #f3f4f6; }
.ga-tr img { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.ga-x { position: absolute; top: 2px; right: 2px; width: 22px; height: 22px; border-radius: 50%; border: 0; background: rgba(0,0,0,.6); color: #fff; font-size: .9rem; line-height: 1; cursor: pointer; }
.ga-layers { list-style: none; margin: 0; padding: 0; }
.ga-layers li { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border: 1px solid transparent; border-radius: 8px; cursor: pointer; }
.ga-layers li:hover { background: var(--bg-soft); } .ga-layers li.on { background: rgba(13,110,253,.1); border-color: rgba(13,110,253,.4); }
.ga-lt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .78rem; }
.ga-layers button { border: 1px solid var(--line); background: var(--bg-card, #fff); color: var(--text-muted); border-radius: 6px; font-size: .62rem; padding: 2px 6px; cursor: pointer; }
.ga-layers button.on { color: #b45309; border-color: #f59e0b; }
.ga-center { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ga-stage { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #dfe6ee; outline: none; touch-action: none; cursor: default; }
body.dark-theme .ga-stage { background: #0b1220; }
.ga-stage.ga-over { box-shadow: inset 0 0 0 3px var(--hj-blue, #0d6efd); }
.ga-stage.ga-draw { cursor: crosshair; } .ga-stage.ga-hand, .ga-stage.ga-space { cursor: grab; } .ga-stage.ga-panning { cursor: grabbing; }
.ga-svg { display: block; width: 100%; height: 100%; user-select: none; -webkit-user-select: none; touch-action: none; }
.ga-h { cursor: pointer; } .ga-h-nw, .ga-h-se { cursor: nwse-resize; } .ga-h-ne, .ga-h-sw { cursor: nesw-resize; } .ga-h-n, .ga-h-s { cursor: ns-resize; } .ga-h-e, .ga-h-w { cursor: ew-resize; } .ga-h-rot { cursor: grab; }
.ga-te { position: absolute; margin: 0; border: 2px dashed var(--ga-sel); background: transparent; resize: none; overflow: hidden; outline: none; box-sizing: border-box; z-index: 3; white-space: pre-wrap; border-radius: 4px; }
.ga-tools { position: absolute; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 12px; background: var(--bg-card, #fff); border: 1px solid var(--line); box-shadow: 0 6px 16px rgba(0,0,0,.12); z-index: 2; }
.ga-tb { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--text-main); cursor: pointer; }
.ga-tb.on { background: var(--hj-blue, #0d6efd); color: #fff; }
.ga-toast { position: absolute; left: 50%; bottom: 44px; transform: translateX(-50%); max-width: 90%; padding: 9px 14px; border-radius: 10px; background: #0f172a; color: #fff; font-size: .8rem; z-index: 4; box-shadow: 0 10px 24px rgba(0,0,0,.3); }
.ga-restore { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 7px 10px; background: rgba(13,110,253,.1); border-bottom: 1px solid rgba(13,110,253,.3); font-size: .8rem; }
.ga-restore span { flex: 1; }
.ga-bar { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; padding: 6px 10px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: .74rem; color: var(--text-muted); min-height: 32px; }
.ga-note { flex: 1; min-width: 160px; } .ga-warn { color: #b45309; font-weight: 700; }
.ga-sec { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.ga-sec h3 { margin: 0 0 6px; }
.ga-sec input[type=text] { width: 100%; }
.ga-row { display: grid; grid-template-columns: 74px 1fr; align-items: center; gap: 6px; margin: 6px 0; }
.ga-row > label { margin: 0; font-size: .74rem; color: var(--text-muted); font-weight: 600; }
.ga-row select { width: 100%; }
.ga-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ga-mini { display: flex; flex-direction: column; gap: 2px; margin: 0; font-size: .68rem; font-weight: 600; color: var(--text-muted); }
.ga-mini input, .ga-mini select { width: 100%; }
.ga-btns { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0; }
.ga-btns .ga-btn { height: 30px; padding: 0 8px; font-size: .74rem; }
.ga-chk { display: flex; align-items: center; gap: 6px; margin: 6px 0; font-size: .78rem; font-weight: 500; cursor: pointer; }
.ga-rng { display: flex; align-items: center; gap: 6px; } .ga-rng input { flex: 1; min-width: 0; accent-color: var(--hj-blue, #0d6efd); } .ga-rng output { min-width: 30px; text-align: right; font-size: .72rem; font-weight: 700; }
.ga-sw { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.ga-sw button { width: 22px; height: 22px; border-radius: 6px; border: 1px solid rgba(100,116,139,.55); cursor: pointer; padding: 0; line-height: 1; }
.ga-sw button.on { outline: 2px solid var(--ga-sel); outline-offset: 1px; }
.ga-sw .ga-sw-none { background: repeating-linear-gradient(45deg, #fff 0 4px, #fca5a5 4px 5px); color: #b91c1c; font-size: .8rem; }
.ga-sw input[type=color] { width: 26px; height: 24px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: none; }
.ga-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 16px; background: rgba(15,23,42,.55); overflow: auto; }
.ga-dlg { width: min(560px, 100%); max-height: 94vh; overflow: auto; padding: 16px 18px; border-radius: 16px; background: var(--bg-card, #fff); color: var(--text-main); box-shadow: 0 24px 60px rgba(0,0,0,.4); }
.ga-dh { display: flex; align-items: center; justify-content: space-between; } .ga-dh h3 { margin: 0; font-size: 1.05rem; }
.ga-fmts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 6px; margin: 10px 0; }
.ga-fmt { display: flex; flex-direction: column; text-align: left; gap: 2px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-card, #fff); color: var(--text-main); cursor: pointer; }
.ga-fmt.on { border-color: var(--hj-blue, #0d6efd); background: rgba(13,110,253,.08); box-shadow: 0 0 0 1px var(--hj-blue, #0d6efd); }
.ga-fmt small { font-size: .66rem; color: var(--text-muted); }
.ga-checks { margin: 8px 0; padding: 0; list-style: none; } .ga-checks li { padding: 7px 10px; margin: 4px 0; border-radius: 9px; font-size: .78rem; background: rgba(245,158,11,.13); border: 1px solid rgba(245,158,11,.4); } .ga-checks li.info { background: rgba(13,110,253,.08); border-color: rgba(13,110,253,.3); }
.ga-ok { margin: 8px 0; padding: 7px 10px; border-radius: 9px; background: rgba(16,185,129,.12); color: #047857; font-size: .8rem; font-weight: 600; }
.ga-msg { min-height: 1.2em; margin: 8px 0 0; font-size: .8rem; color: var(--text-muted); }
.ga-tp { margin: 10px 0; padding: 14px; border-radius: 10px; background: #fff; border: 1px solid var(--line); text-align: center; overflow: auto; }
.ga-tp img { display: inline-block; max-width: 100%; }

/* rating, ad, credit (same look as the other tools) */
.ga-rate { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px 14px; margin: 14px 0 0; font-size: .86rem; color: var(--text-muted); }
.ga-rate b { color: var(--text-main); }
.ga-rate .hj-btn { padding: 6px 14px; font-size: .82rem; }
.ga-adsec { margin: 22px 0 4px; } .ga-adsec[hidden] { display: none; }
.ga-ad { max-width: 746px; margin: 0 auto; padding: 6px 0 8px; text-align: center; border-radius: 14px; background: var(--bg-card); border: 1px solid var(--line); }
@media (min-width: 576px) { .ga-ad { padding: 6px 8px 8px; } }
.ga-ad-label { display: block; margin: 0 0 4px; font-size: 10px; line-height: 1.2; letter-spacing: 1px; text-transform: uppercase; color: var(--text-muted); opacity: .8; }
.ga-ad .adsbygoogle { display: inline-block; width: 320px; height: 100px; max-width: 100%; }
@media (min-width: 800px) { .ga-ad .adsbygoogle { width: 728px; height: 90px; } }
.ga-credit { margin: 6px 0 0; text-align: center; font-size: .72rem; line-height: 1.5; color: var(--text-muted); }
.ga-credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* tablets and phones: the page first, then the tools */
@media (max-width: 1100px) { .ga-main { grid-template-columns: 250px minmax(0, 1fr) 250px; } }
@media (max-width: 899px) {
    .hj-tool.ga-tool { padding: 8px; border-radius: 22px; }
    .ga-main { display: flex; flex-direction: column; height: auto; min-height: 0; }
    .ga-center { order: 1; height: 62vh; min-height: 340px; }
    .ga-left { order: 2; border-right: 0; border-top: 1px solid var(--line); max-height: 440px; }
    .ga-right { order: 3; border-left: 0; border-top: 1px solid var(--line); }
    .ga-tab span { font-size: .6rem; }
    .ga-tools { flex-direction: row; left: 8px; top: 8px; }
    .ga-tb { width: 40px; height: 40px; }
    .ga-sel { flex-wrap: wrap; width: 100%; }
    .ga-sel label { flex: 1 1 140px; min-width: 0; }
    .ga-sel select { max-width: 100%; min-width: 0; flex: 1; width: 100%; }
    .ga-right-grp { margin-left: 0; }
    .ga-adsec { margin-left: -16px; margin-right: -16px; } .ga-ad { border-radius: 0; border-left: 0; border-right: 0; }
}
@media (prefers-reduced-motion: reduce) { .ga-app * { transition: none !important; } }
