﻿/* Encode / decode HTML entities. Needs /assets/css/modern-tool-cards.css (tokens + .cat-website accent). */
.he, .he *, .he *::before, .he *::after { box-sizing: border-box; }
.he-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
.he-panel { display: flex; flex-direction: column; min-width: 0; background: var(--tc-bg); border: 1px solid var(--tc-border); border-radius: 20px; box-shadow: var(--tc-shadow); overflow: hidden; }
.he-panel__head { display: flex; align-items: center; gap: .6rem; padding: .9rem 1.25rem; background: var(--tc-surface); border-bottom: 1px solid var(--tc-border); }
.he-panel__head h3 { margin: 0; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--tc-muted); }
.he-panel__head h3 label { margin: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; }
.he-panel__head > i { color: var(--accent); font-size: 1.1rem; }
.he-stats { margin-left: auto; font-size: .78rem; font-weight: 600; color: var(--tc-muted); text-align: right; }
.he-text { flex: 1 1 auto; width: 100%; min-height: 16rem; padding: 1.1rem 1.25rem; resize: vertical; font: .88rem/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; color: var(--tc-text); background: var(--tc-bg); border: 0; border-radius: 0; }
.he-text:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.he-text[readonly] { background: var(--tc-surface); }

.he-bar { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; }
.he-select { display: grid; gap: .3rem; margin: 0; font-size: .78rem; font-weight: 700; color: var(--tc-muted); }
.he-select select { min-width: 17rem; max-width: 100%; height: 2.8rem; padding: 0 .8rem; font: inherit; font-size: .9rem; font-weight: 500; color: var(--tc-text); background: var(--tc-bg); border: 1px solid var(--tc-border); border-radius: 12px; }
.he-select select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.he-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.he-btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; height: 2.8rem; padding: 0 1.1rem; font-size: .92rem; font-weight: 600; color: var(--tc-text); background: var(--tc-bg); border: 1px solid var(--tc-border); border-radius: 12px; cursor: pointer; transition: border-color .15s, color .15s; }
.he-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.he-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.he-btn--primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.he-btn--primary:hover:not(:disabled) { color: #fff; filter: brightness(1.08); }
.he-btn--danger:hover:not(:disabled) { color: #dc2626; border-color: #dc2626; }
.he-btn:disabled { opacity: .7; cursor: default; }
.he-note { margin: 1rem 0 0; padding: .75rem 1rem; font-size: .78rem; color: var(--tc-muted); background: var(--tc-surface); border: 1px solid var(--tc-border); border-radius: 12px; }
.he-note i { margin-right: .3rem; color: var(--accent); }
@media (max-width: 760px) { .he-grid { grid-template-columns: minmax(0, 1fr); } .he-text { min-height: 11rem; } .he-select select { min-width: 0; width: 100%; } .he-select { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .he-btn { transition: none; } }