﻿
:root {
    --toolbar-size: 64px;
    --padding: 3px;
    --bordersize: 1px;
    --lightbordercolor: #ccc;
    --darkbordercolor: #d7d7d7;
    --linkaccentcolor: #4177be;
    --conflict-shadow-color: rgba(255, 68, 68, 0.2);
    --checkbox-size: 16px;
    --grey: #888;
    --disabledcolor: #888;
    --warning-color: #9a6e00;
    --mobile-ui-width: 1024;
    --mobile-ui-narrow: 600;
    --mobile-ui-critical: 390;
}

[data-theme="light"] {
    --logo: url(/images/logo-dark.svg);
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-color: #3e98cf;
    --border-color: #cccccc;
    --offset-bg: #f0f0f0;
    --cell-bg: #ffffff;
    --cell-hover: #dbdbdb;
    --cell-active: #ffd595;
    --cell-active-secondary: #ffecb3;
    --scrollbar-color: #959595;
    --scrollbar-hover: #a8a8a8;
    --accent-color: #0087b8;
    --header-bg: #f0f0f0;
    --empty-row-bg: #fafafa;
    --loading-color: #888888;
    --modified-color: #f00000;
    --modified-dark: #f57c00;
    --modified-color-bg: transparent;
    --saved-color: #4caf50;
    --conflict-color: #ff5722;
    --selected-bg: #c7eaf7;
    --selected-bg-active: #aae0f3;
    --insert-mode-color: #ff5722;
    --overwrite-mode-color: #4caf50;
    --pane-border: #ff5722;
    --input-bg: #fefefe;
    --odd-column-bg: #f9f9f9;
    --even-column-bg: #ffffff;
    --cross-highlight-bg: #f0f7ff;
    --tab-bg: #f0f0f0;
    --tab-active-bg: #ffffff;
    --ribboncolor: #e1e1e1;
    --lightbgcolor: #f5f5f5;
    --darkbgcolor: #f0f0f0;
    --maintoolbarbgcolor: #f1fefe;
    --maintoolbaraccentcolor: #d9f1f2;
    --whitebg: #fff;
    --approx-color: #007bc5;
    --conflict-shadow-size: 2px;
    --datainspector-color: #0091c9;
    --popover-bg: #ffffff;
    --popover-border: #596b69;
    --popover-shadow: rgba(0, 0, 0, 0.4);
    --checkbox-border: #888;
    --checkbox-bg: #fff;
    --checkbox-checked: #0087b8;
}

[data-theme="dark"] {
    --logo: url(/images/logo-light.svg);
    --bg-color: #1e1e1e;
    --text-color: #ffffff;
    --link-color: #67a5cb;
    --border-color: #444444;
    --offset-bg: #2d2d2d;
    --cell-bg: #1e1e1e;
    --cell-hover: #5c5c5c;
    --cell-active: #a9851f;
    --cell-active-secondary: #5d4a0f;
    --scrollbar-color: #555555;
    --scrollbar-hover: #666666;
    --header-bg: #2d2d2d;
    --accent-color: #0087b8;
    --empty-row-bg: #252525;
    --loading-color: #aaaaaa;
    --modified-color: #ff2b00;
    --modified-dark: #ff6f00;
    --modified-color-bg: transparent;
    --saved-color: #388e3c;
    --conflict-color: #d84315;
    --selected-bg: #0c4075;
    --selected-bg-active: #124f91;
    --insert-mode-color: #d84315;
    --overwrite-mode-color: #388e3c;
    --pane-border: #ff5722;
    --input-bg: #2d2d2d;
    --odd-column-bg: #252525;
    --even-column-bg: #2d2d2d;
    --cross-highlight-bg: #1a2b3c;
    --tab-bg: #2d2d2d;
    --tab-active-bg: #1e1e1e;
    --ribboncolor: #333333;
    --lightbgcolor: #2d2d2d;
    --darkbgcolor: #252525;
    --maintoolbarbgcolor: #252525;
    --maintoolbaraccentcolor: #333333;
    --whitebg: #1e1e1e;
    --approx-color: #5abaf5;
    --conflict-shadow-size: 3px;
    --datainspector-color: #008db7;
    --popover-bg: #2d2d2d;
    --popover-border: #4a4e4e;
    --popover-shadow: rgba(0, 0, 0, 0.5);
    --checkbox-border: #aaa;
    --checkbox-bg: #1e1e1e;
    --checkbox-checked: #176fa6
}

[data-theme="bw"] {
    --logo: url(/images/logo-dark.svg);
    --bg-color: #ffffff;
    --text-color: #000000;
    --link-color: #000000;
    --border-color: #ccc;
    --offset-bg: #f0f0f0;
    --cell-bg: #ffffff;
    --cell-hover: #e8e8e8;
    --cell-active: #c0c0c0;
    --cell-active-secondary: #e0e0e0;
    --scrollbar-color: #888888;
    --scrollbar-hover: #444444;
    --header-bg: #e8e8e8;
    --accent-color: #326f85;
    --empty-row-bg: #fafafa;
    --loading-color: #666666;
    --modified-color: red;
    --modified-dark: #ff6f00;
    --modified-color-bg: #a8a8a8;
    --saved-color: #666666;
    --conflict-color: #000000;
    --selected-bg: #dbdbdb;
    --selected-bg-active: #c2c2c2;
    --insert-mode-color: #000000;
    --overwrite-mode-color: #555555;
    --pane-border: #ff5722;
    --input-bg: #ffffff;
    --odd-column-bg: #f5f5f5;
    --even-column-bg: #ffffff;
    --cross-highlight-bg: #ececec;
    --tab-bg: #e8e8e8;
    --tab-active-bg: #ffffff;
    --ribboncolor: #cccccc;
    --lightbgcolor: #f5f5f5;
    --darkbgcolor: #e8e8e8;
    --maintoolbarbgcolor: #f0f0f0;
    --maintoolbaraccentcolor: #e0e0e0;
    --whitebg: #ffffff;
    --approx-color: #333333;
    --conflict-shadow-size: 2px;
    --datainspector-color: #888;
    --popover-bg: #ffffff;
    --popover-border: #000000;
    --popover-shadow: rgba(0, 0, 0, 0.5);
    --checkbox-border: #000000;
    --checkbox-bg: #ffffff;
    --checkbox-checked: #888;
}

/* Any element using the Popover API gets theme-correct text color automatically --
   no per-dialog class needed. */
[popover] {
    color: var(--text-color);
}

[data-theme="dark"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
    background: var(--bg-color);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 4px;
}

    [data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-hover);
    }

[data-theme="bw"] button,
[data-theme="bw"] button > span,
[data-theme="bw"] .he-context-menu-icon,
[data-theme="bw"] .history-type,
[data-theme="bw"] .tab-with-icon span,
[data-theme="bw"] .he-doc-tab-with-icon span,
[data-theme="bw"] .he-doc-tabs > label,
[data-theme="bw"] #hhdProducts > span {
    filter: grayscale(80%);
}

[data-theme="bw"] ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

[data-theme="bw"] ::-webkit-scrollbar-track {
    background: var(--bg-color);
}

[data-theme="bw"] ::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 0;
}

    [data-theme="bw"] ::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-hover);
    }

[data-theme="dark"] input[type="number"] {
    color-scheme: dark;
}

[data-theme="light"] input[type="number"],
[data-theme="bw"] input[type="number"] {
    color-scheme: light;
}

li:has(#recentItems) {
    position: relative;

    div {
        #recentItems {
            content: " ";
            color: transparent;
            position: absolute;
            bottom: 0;
            right: 0;
            width: 24px;
            height: 24px;
            background-image: url(/images/recentitems.svg);
            background-size: 18px;
            background-repeat: no-repeat;
            background-position: center;
            background-color: transparent;
            border: none;
            transition: all 0.3s;

            &:hover {
                background-size: 24px;
                cursor: pointer;
            }

            &:active {
                cursor: pointer;
                bottom: 1px;
            }
        }
    }
}

#loadFileBtn:has(#recentItems:hover) {
    background-color: var(--maintoolbarbgcolor) !important;

    span {
        background-size: calc(0.34375*var(--toolbar-size)) !important;
    }
}

.bookmark-add {
    background-image: url(/images/memoadd.svg);
}

.bookmark-clear {
    background-image: url(/images/memoclear.svg);
}

#he-di-hilighting {
    background-image: url(/images/dinsp_hilight.svg);
}

#he-di-endianness, #he-cs-endianness {
    background-image: url(/images/viewle.svg);

    &.pressed-button {
        background-image: url(/images/viewbe.svg);
    }
}

#he-di-enableediting {
    background-image: url(/images/editcell.svg);
}

#he-di-display-hex, #he-cs-display-hex, #he-statistics-display-hex {
    background-image: url(/images/svhexmode.svg);
}

#he-di-colors {
    background-image: url(/images/dinsp_changecolors.svg);
}

#he-di-settings {
    background-image: url(/images/selectitems.svg);
}

#he-di-add-new-type {
    background-image: url(/images/dinsp_addrule.svg);
}

#he-bc-copyall, #he-di-copyall {
    background-image: url(/images/editcopy.svg);
}

#he-bc-clear {
    background-image: url(/images/clear.svg);
}

#he-bc-leadingzero {
    background-image: url(/images/preservezero.svg);
}

#he-de-openfolder {
    background-image: url(/images/de-showinexplorer.svg);
}

#he-de-openfile {
    background-image: url(/images/de-openfile.svg);
}

#he-de-streamdata {
    background-image: url(/images/de-selectfiledata.svg);
}

#he-de-copyto {
    background-image: url(/images/de-copyfile.svg);
}

#he-de-copyvolume {
    background-image: url(/images/de-copyvolume.svg);
}

#he-de-editvolumes {
    background-image: url(/images/de-customvolume.svg);
}

#he-find-main {
    background-image: url(/images/editfind.svg);
}

#he-find-previous {
    background-image: url(/images/editfindprev.svg);
}

#he-find-next {
    background-image: url(/images/editfindnext.svg);
}

#he-history-details {
    background-image: url(/images/historydetails.svg);
}

#he-history-group {
    background-image: url(/images/historygroup.svg);
}

#he-history-branches {
    background-image: url(/images/historyautobranch.svg);
}

#he-history-rename {
    background-image: url(/images/rename.svg);
}

#he-history-load {
    background-image: url(/images/historyload.svg);
}

#he-history-save {
    background-image: url(/images/historysave.svg);
}

#he-history-patch {
    background-image: url(/images/historycreatepatch.svg);
}

#he-sel-selectall {
    background-image: url(/images/selectall.svg);
}

#he-sel-selectnone {
    background-image: url(/images/selectnone.svg);
}

#he-sel-invertselection {
    background-image: url(/images/selectinvert.svg);
}

#he-sel-selectrange {
    background-image: url(/images/selectrange.svg);
}

#he-sel-selectmodified {
    background-image: url(/images/selectmodified.svg);
}

#he-sel-gapselection {
    background-image: url(/images/cmd.selection.gap.svg);
}

#he-pc-addnewrule {
    background-image: url(/images/pcadd.svg);
}

#he-pc-clear {
    background-image: url(/images/pcclear.svg);
}

#he-pc-enable {
    background-image: url(/images/pconoff.svg);
}

#he-cs-refresh {
    background-image: url(/images/viewrefresh.svg);
}

#he-cs-copy {
    background-image: url(/images/checkcopy.svg);
}

#he-cs-copyall {
    background-image: url(/images/checkcopyall.svg);
}

#he-cs-displayresult {
    background-image: url(/images/checkdisplayresult.svg);
}

#he-cs-add {
    background-image: url(/images/checkadd.svg);
}

#he-cs-reset {
    background-image: url(/images/checkreset.svg);
}

#he-cs-selectitems {
    background-image: url(/images/selectitems.svg);
}

#he-cs-parameters {
    background-image: url(/images/checkparameters.svg);
}

#he-fif-find {
    background-image: url(/images/editfindinfiles.svg);
}

#he-fif-stop {
    background-image: url(/images/fif_stop.svg);
}

#he-fif-open {
    background-image: url(/images/fif_open.svg);
}

#he-fif-bgmode {
    background-image: url(/images/fif_background.svg);
}

#he-fif-export {
    background-image: url(/images/fif_export.svg);
}

#he-bm-new {
    background-image: url(/images/bookmarknew.svg);
}

#he-bm-toggle {
    background-image: url(/images/bookmarktoggle.svg);
}

#he-bm-selectiontobm {
    background-image: url(/images/bookmarkfromsel.svg);
}

#he-bm-bmtoselection {
    background-image: url(/images/bookmarktosel.svg);
}

#he-bm-load {
    background-image: url(/images/bookmarkload.svg);
}

#he-bm-save {
    background-image: url(/images/bookmarksave.svg);
}

#he-ntfs-streamscreate {
    background-image: url(/images/streamcreate.svg);
}

#he-ntfs-streamsopen {
    background-image: url(/images/streamopen.svg);
}

#he-ntfs-streamsopenparent {
    background-image: url(/images/streamup.svg);
}

#he-ntfs-streamsrename {
    background-image: url(/images/streamrename.svg);
}

#he-ntfs-streamsfind {
    background-image: url(/images/streamlocate.svg);
}

#he-processesopen {
    background-image: url(/images/fileopenprocess.svg);
}

#he-processesopensnap {
    background-image: url(/images/process.opensnapshot.svg);
}

#he-processesrefresh {
    background-image: url(/images/viewrefresh.svg);
}

#he-processesshowall {
    background-image: url(/images/process.all.svg);
}

#he-an-addannotation {
    background-image: url(/images/annoadd.svg);
}

#he-an-removeannotation {
    background-image: url(/images/annoremove.svg);
}

#he-an-annotateselection {
    background-image: url(/images/annoselection.svg);
}

#he-an-annotatecursor {
    background-image: url(/images/annocursor.svg);
}

#he-an-clearannotations {
    background-image: url(/images/annoclear.svg);
}

#he-fc-comparefiles {
    background-image: url(/images/fccompare.svg);
}

#he-fc-displayhex {
    background-image: url(/images/svhexmode.svg);
}

#he-fc-previousblock {
    background-image: url(/images/fcprevious.svg);
}

#he-fc-nextblock {
    background-image: url(/images/fcnext.svg);
}

#he-fc-configurefilter {
    background-image: url(/images/fcfilter.svg);
}

#he-fc-enabledisablefiltering {
    background-image: url(/images/fcfilterswitcher.svg);
}

#he-fc-clearresults {
    background-image: url(/images/cmd.diff.clear.svg);
}

#he-macros-recording {
    background-image: url(/images/macrostartrecording.svg);
}

#he-macros-play {
    background-image: url(/images/macrorun.svg);
}

#he-macros-edit {
    background-image: url(/images/macroedit.svg);
}

#he-macros-duplicate {
    background-image: url(/images/cmd.macro.duplicate.svg);
}

#he-macros-import {
    background-image: url(/images/macroimport.svg);
}

#he-macros-export {
    background-image: url(/images/macroexport.svg);
}

#he-structureviewer-library {
    background-image: url(/images/svlibrary.svg);
}

#he-structureviewer-hex {
    background-image: url(/images/svhexmode.svg);
}

#he-structureviewer-save {
    background-image: url(/images/svsave.svg);
}

#he-structureviewer-associations {
    background-image: url(/images/associations.svg);
}

#he-structureviewer-tooltips {
    background-image: url(/images/svshowtooltip.svg);
}

#he-statistics-refresh {
    background-image: url(/images/viewrefresh.svg);
}

#he-statistics-table {
    background-image: url(/images/stattable.svg);
}

#he-statistics-cumulative {
    background-image: url(/images/statcumulative.svg);
}

#he-statistics-logarithmic {
    background-image: url(/images/statlogarithmic.svg);
}

#he-statistics-colors {
    background-image: url(/images/dinsp_changecolors.svg);
}

#he-statistics-peak {
    background-image: url(/images/stathidemax.svg);
}

.he-stat-scroll-container {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 0;
}

.he-stat-split {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: row;
    overflow: hidden;
}

.he-stat-main {
    flex: 2;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    justify-content: center;
}

    .he-stat-main.narrow {
        flex: 1;
    }

.he-stat-side {
    flex: 1;
    overflow: auto;
    display: flex;
    flex-direction: column;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
    min-width: 0;
    min-height: 0;
}

.he-stat-main-scroll {
    flex: 1;
    min-height: 0;
    overflow: auto;
    contain: paint;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

.he-stat-empty {
    padding: 20px;
    color: var(--loading-color);
    text-align: center;
    font-style: italic;
}

.he-stat-computing-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
}

    .he-stat-computing-wrap .he-cs-params-progress {
        margin-right: 0;
        min-width: 160px;
    }

.he-stat-histogram-wrap {
    padding: 2px;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.he-stat-histogram-svg {
    width: 100%;
    height: 100%;
    display: block;
}

    .he-stat-histogram-svg .he-stat-overlay {
        cursor: crosshair;
    }

.he-stat-cursor-wrap {
    padding: 10px 12px;
}

.he-stat-cursor-title {
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 11px;
    letter-spacing: 0.05em;
    color: var(--loading-color);
}

.he-stat-cursor-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .he-stat-cursor-table td {
        padding: 3px 4px;
    }

        .he-stat-cursor-table td:first-child {
            color: var(--loading-color);
            white-space: nowrap;
            padding-right: 8px;
        }

        .he-stat-cursor-table td:last-child {
            font-weight: bold;
            font-variant-numeric: tabular-nums;
        }

.he-stat-freq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

    .he-stat-freq-table th {
        position: sticky;
        top: 0;
        background: var(--header-bg);
        padding: 4px 8px;
        text-align: left;
        border-bottom: 1px solid var(--border-color);
        font-weight: bold;
        z-index: 1;
        cursor: pointer;
        user-select: none;
    }

        .he-stat-freq-table th:hover {
            background: var(--cell-hover);
        }

.he-stat-sort-arrow {
    color: var(--accent-color);
}

.he-stat-freq-table td {
    padding: 2px 8px;
}

.he-stat-freq-table tr:nth-child(even) td {
    background: var(--odd-column-bg);
}

.he-stat-freq-table tr:hover td {
    background: var(--cell-hover);
}

.he-stat-desc-wrap {
    padding: 8px 12px;
    font-size: 13px;
}

.he-stat-desc-section:not(:first-child) {
    margin-top: 10px;
}

.he-stat-desc-section-title {
    text-align: center;
    font-weight: bold;
    color: var(--loading-color);
    margin: 0 0 4px 0;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.he-stat-desc-table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

    .he-stat-desc-table td {
        padding: 2px 4px;
        font-size: 13px;
    }

        .he-stat-desc-table td:first-child {
            color: var(--loading-color);
            padding-right: 8px;
            white-space: nowrap;
        }

        .he-stat-desc-table td:last-child {
            font-weight: bold;
            text-align: right;
            font-variant-numeric: tabular-nums;
        }

body {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s ease;
    height: 100vh;
    overflow: hidden;
}

input, select, button, textarea {
    border-radius: 3px;
    accent-color: var(--accent-color);
}

.hidden {
    display: none;
}

ul, li {
    padding: 0;
    margin: 0;
}

a {
    color: var(--link-color);
}

input[type="checkbox"], input[type="radio"] {
    position: relative;
    top: -1px;

    &:disabled {
        cursor: default !important;
    }
}

button:disabled {
    opacity: 0.3;
    cursor: default;
    -webkit-filter: grayscale(100%);
    -moz-filter: grayscale(100%);
    -ms-filter: grayscale(100%);
    -o-filter: grayscale(100%);
    filter: gray;
}

.std-he-button {
    position: relative;
    border: 0;
    padding: 0;
    background-color: transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s;

    &.pressed-button {
        background-color: rgb(140 140 140 / 35%);
        border: calc(2*var(--bordersize)) solid var(--lightbgcolor);
    }
}

    .std-he-button:active {
        top: 1px;
    }

.main-grid {
    list-style-type: none;
    display: grid;
    grid-template-columns: var(--he-sb01-w, 25%) var(--he-bb-col2-fr, 1fr) var(--he-bb-col3-fr, 1fr) var(--he-sb02-w, 24%);
    grid-template-rows: auto 1fr var(--he-bb-h, 25%) auto;
    gap: var(--bordersize);
    position: fixed;
    inset: 0;
}

    .main-grid li {
        list-style-type: none;
        padding: 0;
        margin: 0;
    }

.tab-panel-close-btn, .he-doc-tabs-panel-close-btn {
    --size: calc(0.1875*var(--toolbar-size));
}

.tab-panel-close-btn, .he-di-popover-close, #closeBookmarkPopover {
    width: var(--size);
    height: var(--size);
    flex-shrink: 0;
    background-image: url(/images/x.svg);
    background-position: center;
    background-repeat: no-repeat;
    align-self: center;

    &:hover {
        background-size: calc(0.3*var(--toolbar-size));
    }
}

.he-doc-tabs-panel-close-btn {
    width: calc(var(--size) + 2*var(--padding));
    height: auto;
    right: 1px;
    background-image: url(/images/x.svg);
    background-position: center;
    background-repeat: no-repeat;
    align-self: stretch;
    background-size: var(--size);

    &:hover {
        background-size: calc(1.2*var(--size)) !important;
    }
}

.h-toolbar {
    grid-column: 1 / span 4;
    grid-row: 1;
    background-color: var(--maintoolbarbgcolor);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

.main-window {
    grid-column: 2 / span 2;
    grid-row: 2;
    overflow: hidden;
    position: relative;
}

.tabset, .he-doc-panels {
    border: var(--bordersize) solid var(--border-color);
}

.tabset {
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-01, .sidebar-02, .tabframe, .bottombar-01, .bottombar-02 {
    display: flex;
    flex-direction: column;
    overflow-y: hidden;
}

.sidebar-01, .sidebar-02, .bottombar-01, .bottombar-02 {
    position: relative;
}

.he-panel-resize {
    position: absolute;
    z-index: 10;
    background: transparent;
    transition: background 0.15s, opacity 0.15s;
}

    .he-panel-resize:hover, .he-panel-resize.he-panel-resizing {
        background: var(--link-color);
        opacity: 0.4;
    }

.he-panel-resize-right {
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    cursor: ew-resize;
}

.he-panel-resize-left {
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    cursor: ew-resize;
}

.he-panel-resize-top {
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    cursor: ns-resize;
}

.sidebar-01 > div, .sidebar-02 > div, .bottombar-01 > div, .bottombar-02 > div {
}

.sidebar-01, .sidebar-02 {
    grid-row: 2;
}

.sidebar-01 {
    grid-column: 1;
}

.sidebar-02 {
    grid-column: 4;
}

.bottombar-01, .bottombar-02 {
    grid-row: 3;
    border-top: 1px solid var(--border-color);
}

.bottombar-01 {
    grid-column: 1 / span 2;
    border-right: 1px solid var(--border-color);
}

.bottombar-02 {
    grid-column: 3 / span 2;
}

.footer {
    grid-column: 1 / span 4;
    grid-row: 4;
    padding: 0 calc(1.2*var(--padding));
    background: var(--header-bg);
    border-top: 1px solid var(--border-color);
}

#cursorInfo {
    min-width: 180px;
}

.tabs {
    white-space: nowrap;
    display: flex;
    align-items: center;
}

    .tabs > input[type="radio"], .he-doc-tabs > input[type="radio"] {
        position: absolute;
        left: -200vw;
    }

    .tabs > label, .he-doc-tabs > label {
        font-size: 0.875rem;
        position: relative;
        display: inline-block;
        border: var(--bordersize) solid transparent;
        cursor: pointer;
    }

    .tabs > label {
        display: flex;
        border-top: 0;
        overflow-x: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
    }

        .tabs > label span {
            width: 100%;
            display: inline-block;
            height: calc(0.3125*var(--toolbar-size));
            white-space: nowrap;
            overflow-x: hidden;
            text-overflow: ellipsis;
        }

    .tabs > label {
        padding: calc(1.3333*var(--padding)) calc(2*var(--padding));
        top: calc(-1*var(--bordersize));
    }

        .tabs > label[for='tab1'] {
            margin-left: calc(1.33*var(--padding));
        }

        .tabs > label:hover,
        .tabs > label:has(+ input:focus),
        .tabs > label:has(+ input:checked) {
            color: var(--linkaccentcolor);
        }

        .tabs > label:has(+ input:checked) {
            border-color: var(--border-color);
            border-top: var(--bordersize) solid var(--tab-active-bg);
            margin-bottom: calc(0.6666*var(--padding));
            border-radius: 0 0 var(--padding) var(--padding);
            background-color: var(--tab-active-bg);
        }

.tabset .tab-panel {
    display: none;
}

    .tabset .tab-panel h4 {
        margin: 0;
        font-size: inherit;
        font-weight: inherit;
    }

.he-doc-panels-panel {
    display: none;
    flex-direction: row;
    justify-content: space-between;
    counter-increment: count;
    position: absolute;
    inset: 0;
}

.tabframe:has(.tabs > input:nth-child(2):checked) .tab-panels > .tab-panel:nth-child(1),
.tabframe:has(.tabs > input:nth-child(4):checked) .tab-panels > .tab-panel:nth-child(2),
.tabframe:has(.tabs > input:nth-child(6):checked) .tab-panels > .tab-panel:nth-child(3),
.tabframe:has(.tabs > input:nth-child(8):checked) .tab-panels > .tab-panel:nth-child(4),
.tabframe:has(.tabs > input:nth-child(10):checked) .tab-panels > .tab-panel:nth-child(5),
.tabframe:has(.tabs > input:nth-child(12):checked) .tab-panels > .tab-panel:nth-child(6) {
    display: flex;
}

.he-editor:has(.he-doc-tabs > input:nth-child(2):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(1),
.he-editor:has(.he-doc-tabs > input:nth-child(4):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(2),
.he-editor:has(.he-doc-tabs > input:nth-child(6):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(3),
.he-editor:has(.he-doc-tabs > input:nth-child(8):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(4),
.he-editor:has(.he-doc-tabs > input:nth-child(10):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(5),
.he-editor:has(.he-doc-tabs > input:nth-child(12):checked) .he-doc-panels > .he-doc-panels-panel:nth-child(6) {
    display: flex;
}

.he-editor {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding-bottom: calc(0.6666*var(--padding) + var(--bordersize));
}

.he-doc-panels {
    position: relative;
    flex-grow: 1;
    flex-shrink: 1;
    padding: 0 calc(1.333*var(--padding));
    overflow: auto;
    counter-reset: count;
}

.tabs-ribbon, .he-tools-header {
    background-color: var(--ribboncolor);
    font-size: 0.8125rem;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.tabs-ribbon {
    --size: calc(0.3438*var(--toolbar-size));
    height: var(--size);
    min-height: var(--size);
    line-height: var(--size);
    padding: 0 calc(1.2*var(--padding));
    overflow-x: hidden;
}

    .tabs-ribbon > h4, .he-tools-header > h4 {
        flex: 1 1 auto;
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
    }

.tabs-toolbar {
    --size: calc(0.5*var(--toolbar-size));
    height: var(--size);
    min-height: var(--size);
    display: flex;
    flex-direction: row;
    justify-content: start;
    background-color: var(--lightbgcolor);
    overflow: hidden;
}

    .tabs-toolbar button, .goto-bookmarks-footer button, .tabs-toolbar-overflow-menu button {
        --size: calc(0.5*var(--toolbar-size));
        width: var(--size);
        height: var(--size);
        margin: 0 calc(0.6666*var(--padding));
        background-position: center;
        background-repeat: no-repeat;
        background-size: calc(0.34375*var(--toolbar-size));
        transition: background-size 0.2s ease;

        &:hover {
            background-size: calc(0.37*var(--toolbar-size));
        }
    }

.tabs-toolbar-overflow {
    display: none;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
}

    .tabs-toolbar-overflow.show {
        display: flex;
    }

.tabs-toolbar-overflow-btn {
    --size: calc(0.5*var(--toolbar-size));
    width: var(--size) !important;
    height: var(--size) !important;
    margin: 0 calc(0.6666*var(--padding)) !important;
    position: relative;
}

    .tabs-toolbar-overflow-btn::after {
        content: "";
        position: absolute;
        left: 50%;
        top: 50%;
        width: calc(0.09375*var(--toolbar-size));
        height: calc(0.09375*var(--toolbar-size));
        border-right: 2px solid var(--accent-color);
        border-bottom: 2px solid var(--accent-color);
        transform: translate(-50%, -70%) rotate(45deg);
    }

.tabs-toolbar-overflow-menu {
    position: fixed;
    inset: unset;
    margin: 0;
    padding: calc(0.6666*var(--padding)) 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--lightbgcolor);
    box-shadow: 0 4px 14px var(--popover-shadow);
    list-style: none;
    max-height: 80vh;
    overflow-y: auto;
    flex-direction: column;
    gap: calc(0.6666*var(--padding));
}

    .tabs-toolbar-overflow-menu:popover-open {
        display: flex;
    }

    .tabs-toolbar-overflow-menu > li {
        display: flex;
        justify-content: center;
    }

.he-toolbar-select {
    height: calc(0.5*var(--toolbar-size) - 6px);
    margin: 3px 4px;
    padding: 0 4px;
    font-size: 0.8rem;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    cursor: pointer;
    max-width: 132px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tab-with-icon span, .he-doc-tab-with-icon span {
    background-position: left center;
    background-repeat: no-repeat;
    background-size: 20px;
}

.tab-with-icon span {
    padding-left: calc(0.40625*var(--toolbar-size));
}

.he-doc-tab-with-icon span {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0;
    position: relative;
    margin: 0 calc(2*var(--padding)) 0 calc(2*var(--padding) + 0.3125*var(--toolbar-size));
    white-space: nowrap;
}

.he-doc-tabs {
    --size: calc(0.3438*var(--toolbar-size) + 2*var(--bordersize));
    height: var(--size);
    min-height: var(--size);
    line-height: var(--size);
    font-size: 0.875rem;
    padding: 0 calc(1.333*var(--padding));
    display: flex;
    flex-direction: row;
    position: relative;
    top: 1px;
    overflow: hidden;
}

    .he-doc-tabs > label {
        border-bottom: 0;
        margin-top: calc(-1*var(--bordersize));
        flex-shrink: 0;
    }

    .he-doc-tabs > label {
        bottom: calc(-1*var(--bordersize));
        margin-right: var(--padding);
        display: flex;
        padding-right: 0;
        background-size: calc(0.25*var(--toolbar-size));
        background-image: url(/images/filenew.svg);
        background-position: calc(2*var(--padding)) calc(3*var(--bordersize));
        background-repeat: no-repeat;
    }

        .he-doc-tabs > label:has(+ input:checked) {
            border-color: var(--border-color);
            border-bottom: var(--bordersize) solid var(--offset-bg);
            border-radius: var(--padding) var(--padding) 0 0;
            background-color: var(--offset-bg);
            z-index: 2;
            position: relative;
            top: var(--bordersize);
        }

.tabs-section-content {
    flex-grow: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.extfeature-ok {
    padding: 3px 8px;
    min-width: 50px;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
}

    .extfeature-ok:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

#fileInfo {
    display: flex;
    align-items: center;
    margin-left: auto;
    padding: 0 10px;
}

.theme-toggle {
    padding: 5px 10px;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 3px;
    margin-left: 10px;
}

.hex-viewer-container {
    background: var(--bg-color);
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
    overflow-x: auto;
    overflow-y: hidden;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    outline: none;
}

.hex-viewer {
    display: inline-block;
    min-width: 100%;
    min-height: 100%;
    position: relative;
}

.header-row {
    display: flex;
    white-space: nowrap;
    height: 20px;
    line-height: 20px;
    background: var(--header-bg);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid var(--border-color);
    cursor: default;
}

.offset-header {
    background: var(--offset-bg);
    padding: 0 10px 0 2px;
    border-right: 1px solid var(--border-color);
    min-width: 80px;
    text-align: center;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: end;
    position: relative;
}

.goto-input {
    color: var(--text-color);
    font-family: 'Courier New', monospace;
    font-size: 14px;
    width: 80px;
    text-align: right;
    outline: none;
    padding: 0;
    box-sizing: border-box;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    position: relative;
    right: -7px;
    padding: 1px 6px 1px 1px;
}

.hex-header, .text-header {
    display: flex;
    user-select: none;
    position: relative;
}

.pane-indicator {
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.hex-header .pane-indicator.active {
    background-color: var(--pane-border);
}

.text-header .pane-indicator.active {
    background-color: var(--pane-border);
}

.hex-index-cell, .text-index-cell {
    text-align: center;
    margin: 0 1px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.hex-index-cell, .hex-cell {
    width: 20px;
}

.text-index-cell, .text-cell {
    width: 5px;
}

.hex-cell.odd {
    background-color: var(--odd-column-bg);
}

.hex-cell.even {
    background-color: var(--even-column-bg);
}

.text-cell {
    background-color: var(--cell-bg);
}

.hex-index-cell:hover, .text-index-cell:hover, .offset-column.current-position, .hex-index-cell.current-position, .text-index-cell.current-position {
    background: var(--cell-hover);
}

.text-header {
    margin-left: 20px;
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
}

.hex-row {
    display: flex;
    white-space: nowrap;
    height: 20px;
    line-height: 20px;
    background: var(--cell-bg);
    position: relative;
    cursor: default;
}

.offset-column {
    background: var(--offset-bg);
    padding: 0 10px 0 2px;
    border-right: 1px solid var(--border-color);
    min-width: 80px;
    text-align: right;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    cursor: pointer;
}

    .offset-column:hover, .hex-cell:hover, .text-cell:hover {
        background: var(--cell-hover);
    }

.hex-area {
    display: flex;
}

.hex-cell, .text-cell {
    text-align: center;
    border: 1px solid transparent;
    margin: 0;
    padding: 0 1px;
    cursor: default;
    background: var(--cell-bg);
    transition: background-color 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    position: relative;
}

    .hex-cell.active, .text-cell.active {
        background: var(--cell-active) !important;
        border-color: var(--border-color) !important;
    }

    .hex-cell.active-secondary, .text-cell.active-secondary {
        background: var(--cell-active-secondary) !important;
        border-color: var(--border-color) !important;
    }

    .hex-cell.cross-highlight, .text-cell.cross-highlight {
        background-color: var(--cross-highlight-bg) !important;
    }

    .hex-cell.loading, .text-cell.loading {
        color: var(--loading-color);
        font-style: italic;
    }

    .hex-cell.modified, .text-cell.modified {
        color: var(--modified-color);
    }

[data-theme="bw"] .hex-cell.modified, [data-theme="bw"] .text-cell.modified {
    color: var(--modified-color);
}

.hex-cell.conflict, .text-cell.conflict {
    background: var(--conflict-color);
    color: white;
}

.hex-cell.selected, .text-cell.selected {
    background-color: var(--selected-bg);
}

.hex-cell.gap-cell, .text-cell.gap-cell {
    color: var(--gap-cell-color, #9baab8);
    opacity: 0.5;
}

[data-theme="dark"] .hex-cell.gap-cell, [data-theme="dark"] .text-cell.gap-cell {
    color: var(--gap-cell-color, #556677);
    opacity: 0.9;
}

.hex-cell.modified.gap-cell, .text-cell.modified.gap-cell {
    color: var(--modified-color);
    opacity: 1;
}

.text-area {
    display: flex;
    margin-left: 20px;
    border-left: 1px solid var(--border-color);
    padding-left: 10px;
}

.text-cell {
    font-family: 'Courier New', monospace;
}

.custom-scrollbar {
    position: absolute;
    right: 0;
    top: 20px;
    width: 13px;
    background: var(--bg-color);
    border-left: 1px solid var(--border-color);
}

.custom-scrollbar-track {
    position: absolute;
    top: 17px;
    left: 0;
    right: 0;
    bottom: 17px;
    background: var(--bg-color);
    overflow: hidden;
}

.custom-scrollbar-thumb {
    position: absolute;
    left: 2px;
    right: 2px;
    background: var(--scrollbar-color);
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.15s;
    min-height: 17px;
    top: 0;
    touch-action: none;
}

    .custom-scrollbar-thumb:hover {
        background: var(--scrollbar-hover);
    }

.scrollbar-arrow {
    position: absolute;
    left: 0;
    right: 0;
    height: 17px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
    border: none;
    z-index: 5;
}

    .scrollbar-arrow.top {
        top: 0;
    }

    .scrollbar-arrow.bottom {
        bottom: 0;
    }

    .scrollbar-arrow::after {
        content: '';
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
    }

    .scrollbar-arrow.top::after {
        border-bottom: 6px solid var(--scrollbar-color);
    }

    .scrollbar-arrow.bottom::after {
        border-top: 6px solid var(--scrollbar-color);
    }

.bottom-filler {
    background: var(--empty-row-bg);
    border-top: 1px solid var(--border-color);
}

.he-has-hscroll .header-row,
.he-has-hscroll .hex-row,
.he-has-hscroll .bottom-filler {
    padding-right: 13px;
}

.status-bar {
    padding: 5px 10px;
    font-size: 12px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: center;
}

    .status-bar > span {
        min-width: 0;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

.edit-indicator {
    color: var(--modified-dark);
    font-weight: bold;
    cursor: pointer;
}

.saved-indicator {
    color: var(--saved-color);
}

@keyframes fade-in {
    0% {
        opacity: 0.0;
    }

    33% {
        opacity: 0;
    }

    66% {
        opacity: 0;
    }

    90% {
        opacity: 0.9;
    }

    100% {
        opacity: 1;
    }
}

.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}


.progress-bar {
    width: 300px;
    height: 20px;
    background: #333;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}

.progress-fill {
    height: 100%;
    background: #4caf50;
    transition: width 0.1s ease;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}

.progress-cancel-hint {
    margin-top: 8px;
    font-size: 13px;
    color: #bbb;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}

.progress-nag {
    text-align: center;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}

.progress-nag-description {
    max-width: 350px;
    animation-name: fade-in;
    animation-duration: 0.5s;
    animation-timing-function: ease-in;
}

    .progress-nag-description a {
        font-size: 16px;
        font-weight: bold;
        animation-name: fade-in;
        animation-duration: 0.5s;
        animation-timing-function: ease-in;
    }

.insert-dialog, .fill-dialog, .about-dialog, .size-dialog, .settings-dialog, .find-dialog, .export-url-dialog, .export-snippet-dialog, .export-hexrecord-dialog {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 450px;
}

    .insert-dialog h3, .fill-dialog h3, .nag-screen h3, .about-dialog h3, .size-dialog h3, .settings-dialog h3, .find-dialog h3, .export-url-dialog h3, .export-snippet-dialog h3, .export-hexrecord-dialog h3 {
        margin-top: 0;
        margin-bottom: 15px;
    }

    .insert-dialog textarea, .fill-dialog textarea {
        width: 100%;
        height: 100px;
        font-family: 'Courier New', monospace;
        background: var(--cell-bg);
        color: var(--text-color);
        border: 1px solid var(--border-color);
        padding: 5px;
        box-sizing: border-box;
        resize: vertical;
    }

.insert-dialog-buttons, .fill-dialog-buttons, .nag-screen-buttons, .about-dialog-buttons, .size-dialog-buttons, .progress-nag-buttons, .settings-dialog-buttons, .find-dialog-buttons, .export-url-dialog-buttons, .export-snippet-dialog-buttons, .export-hexrecord-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 25px;
}

.progress-nag-buttons {
    justify-content: center;
    gap: 0;
}

    .insert-dialog-buttons button, .fill-dialog-buttons button, .nag-screen-buttons button, .about-dialog-buttons button, .size-dialog-buttons button, .progress-nag-buttons button, .settings-dialog-buttons button, .find-dialog-buttons button, .export-url-dialog-buttons button, .export-snippet-dialog-buttons button, .export-hexrecord-dialog-buttons button, .export-panel-buttons button {
        padding: 5px 10px;
        background: var(--cell-bg);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        cursor: pointer;
        border-radius: 3px;

        &:disabled {
            cursor: default;
        }
    }

        .insert-dialog-buttons button:not(:disabled):hover, .fill-dialog-buttons button:not(:disabled):hover, .nag-screen-buttons button:not(:disabled):hover, .about-dialog-buttons button:hover, .size-dialog-buttons button:not(:disabled):hover, .settings-dialog-buttons button:not(:disabled):hover, .find-dialog-buttons button:not(:disabled):hover, .export-url-dialog-buttons button:not(:disabled):hover, .export-snippet-dialog-buttons button:not(:disabled):hover, .export-hexrecord-dialog-buttons button:not(:disabled):hover, .export-panel-buttons button:not(:disabled):hover {
            background: var(--cell-hover);
        }

.select-locked {
    border: 0 !important;
    appearance: none;
}

.he-dlg-dim::backdrop {
    background: rgba(0, 0, 0, 0.5);
}

.export-hexrecord-dialog {
    min-width: 600px;
}

.export-overflow-note {
    margin-top: 6px;
    font-size: 12px;
    color: var(--modified-color);
}


.export-hexrecord-output {
    width: 100%;
    height: 300px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    padding: 5px;
    box-sizing: border-box;
    resize: vertical;
    white-space: pre;
    word-break: normal;
    overflow-x: auto;
    margin-top: 10px;
    margin-bottom: 0;
}

.input-row {
    display: flex;
    margin-bottom: 10px;
}

.export-url-dialog .input-row {
    margin-bottom: 16px;

    &.export-url-url-row, &.export-url-link-row {
        margin-bottom: 6px;
    }
}

.input-row-col {
    flex-direction: column;
}

    .input-row-col .input-label {
        width: auto;
        padding-top: 0;
        margin-bottom: 4px;
    }

.input-label {
    width: 130px;
    font-weight: bold;
    align-self: center;
}

.export-snippet-dialog :not(.input-row-col) .input-label,
.export-hexrecord-dialog .input-label {
    width: 170px;
}

.input-field {
    flex: 1;
}

.preview-section {
    margin-top: 15px;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
}

.preview-row {
    display: flex;
    margin-bottom: 5px;
}

.preview-label {
    font-weight: bold;
}

.preview-value {
    flex: 1;
    font-family: 'Courier New', monospace;
    word-break: break-word;
}

.radio-group {
    margin: 10px 0;
}

.radio-option {
    margin: 5px 0;
}

.settings-option {
    margin: 15px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-label {
    font-weight: bold;
}

.settings-control {
    display: flex;
    gap: 10px;
}

.settings-toggle {
    padding: 5px 15px;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 3px;
    min-width: 60px;
}

    .settings-toggle.active {
        background: var(--saved-color);
        color: white;
    }

    .settings-toggle:not(.active):hover {
        background: var(--cell-hover);
    }

.nag-screen {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    min-width: 300px;
    max-width: 500px;
}

    .nag-screen h3 {
        margin-top: 0;
        margin-bottom: 15px;
        color: var(--modified-color);
    }

    .nag-screen p {
        margin: 10px 0;
        line-height: 1.4;
    }

.nag-screen-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
}

    .nag-screen-buttons button {
        padding: 8px 16px;
        background: var(--cell-bg);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        cursor: pointer;
        border-radius: 3px;
        min-width: 80px;
    }

        .nag-screen-buttons button:hover {
            background: var(--cell-hover);
        }

        .nag-screen-buttons button.primary {
            background: var(--saved-color);
            color: white;
        }

            .nag-screen-buttons button.primary:hover {
                background: var(--overwrite-mode-color);
            }

.about-content {
    white-space: pre-line;
    line-height: 1.5;
    margin: 15px 0;
}

.size-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.size-input {
    box-sizing: border-box;
    flex: 1;
    padding: 5px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
}

.export-url-dialog .size-input {
    padding: 5px 14px;
}

.size-unit {
    width: 80px;
    padding: 5px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
}

.settings-select {
    padding: 5px 10px;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    border-radius: 3px;
    min-width: 100px;
    font-family: inherit;
    box-sizing: border-box;
}

.export-url-dialog .settings-select,
.export-hexrecord-dialog .settings-select {
    width: 100%;
}

.find-input-row {
    display: flex;
    margin-bottom: 10px;
    align-items: center;
}

.find-combo {
    flex: 1;
    padding: 5px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: inherit;
}

    .find-combo:disabled {
        opacity: 0.3;
    }

    .find-combo > option:disabled {
        color: var(--border-color);
    }

.find-input {
    flex: 2;
    padding: 5px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-family: 'Courier New', monospace;
}

.find-input, .find-combo {
    height: calc(0.28125*var(--toolbar-size));
    box-sizing: content-box;
}


.find-options-btn {
    padding: 5px 10px;
    background: var(--cell-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    cursor: pointer;
    border-radius: 3px;
    white-space: nowrap;
}

.find-options-btn, .find-options-input {
    margin-left: 10px;
}

    .find-options-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
    }

.find-options-menu {
    position: fixed;
    inset: auto;
    margin: 0;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    padding: 0;
    min-width: 150px;
}

.find-options-menu-item {
    padding: 5px 15px;
    cursor: pointer;
    white-space: nowrap;
}

    .find-options-menu-item:hover {
        background: var(--cell-hover);
    }

.he-context-menu {
    inset: unset;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    min-width: 210px;
    box-shadow: 0 4px 14px var(--popover-shadow);
    user-select: none;
    overflow: visible;
}

.he-context-menu-item {
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 14px 7px 8px;
    cursor: pointer;
    white-space: nowrap;
    color: var(--text-color);
}

.he-context-menu-item-disabled {
    opacity: 0.38;
    cursor: default;
}

.he-context-menu-separator {
    height: 1px;
    background: var(--border-color);
    margin: 3px 0;
}

.he-context-menu-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    display: inline-block;
    opacity: 0.85;
}

.export-url-dialog {
    width: 520px;
    max-width: calc(100vw - 32px);
}

.export-snippet-dialog {
    width: 620px;
    max-width: calc(100vw - 32px);

    .size-input {
        width: 100%;
    }
}

    .export-snippet-dialog .input-row {
        margin-bottom: 16px;
    }

    .export-snippet-dialog .input-row-col {
        margin-top: 20px;
    }

    .export-snippet-dialog .settings-select {
        width: 100%;
    }

    .export-snippet-dialog .size-input {
        padding: 5px 14px;
    }

    .export-snippet-dialog .export-url-textarea {
        white-space: pre;
        word-break: normal;
        overflow-x: auto;
    }

.export-url-url-row {
    margin-top: 28px;
}

.export-url-link-row {
    margin-bottom: 0;
}

#euFileName {
    width: 100%;
    box-sizing: border-box;
}

#he-drop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 1.6rem;
    font-weight: 600;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    letter-spacing: 0.02em;
}

.export-url-textarea {
    width: 100%;
    height: 150px;
    padding: 5px;
    background: var(--cell-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    font-size: 11px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    box-sizing: border-box;
    word-break: break-all;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

    .export-url-textarea::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }

    .export-url-textarea::-webkit-scrollbar-track {
        background: var(--bg-color);
    }

    .export-url-textarea::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-color);
        border-radius: 4px;
    }

        .export-url-textarea::-webkit-scrollbar-thumb:hover {
            background-color: var(--scrollbar-hover);
        }

.export-url-test-link {
    font-size: 12px;
    color: var(--link-color);
    text-decoration: underline;
    cursor: pointer;
}

    .export-url-test-link.disabled {
        visibility: hidden;
    }


.find-radio-group {
    margin: 10px 0;
    display: flex;
    gap: 20px;
}

.find-checkbox {
    margin: 10px 0;
    display: flex;
    align-items: center;
}

    .find-checkbox input {
        margin-right: 8px;
    }

.find-results-table {
    width: 100%;
    align-self: flex-start;
    border-collapse: collapse;
    min-width: min-content;
}

    .find-results-table th,
    .find-results-table td {
        padding: 2px 4px;
        border: 1px solid var(--border-color);
        text-align: left;
        font-family: 'Courier New', monospace;
        white-space: nowrap;
    }

        .find-results-table th:last-child,
        .find-results-table td:last-child {
            border-left: 0 !important;
        }

        .find-results-table th:first-child,
        .find-results-table td:first-child {
            border-right: 0 !important;
        }

        .find-results-table th:not(:first-child):not(:last-child),
        .find-results-table td:not(:first-child):not(:last-child) {
            border-left: 0 !important;
            border-right: 0 !important;
        }

        .find-results-table th:last-child,
        .find-results-table td:last-child {
            border-left: 0 !important;
        }


    .find-results-table th {
        background-color: var(--header-bg);
        font-weight: bold;
    }

    .find-results-table tr:hover {
        background-color: var(--cell-hover);
        cursor: pointer;
    }

    .find-results-table tr.selected, .find-results-table tr.hovered, .he-context-menu-item:hover:not(.he-context-menu-item-disabled), .he-tools-item:hover {
        background-color: var(--selected-bg);
    }

.notification-window {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    max-width: 350px;
}

.notification-content {
    text-align: center;
    margin-bottom: 15px;
}

.notification-buttons {
    display: flex;
    justify-content: center;
}

    .notification-buttons button {
        padding: 8px 16px;
        background: var(--cell-bg);
        border: 1px solid var(--border-color);
        color: var(--text-color);
        cursor: pointer;
        border-radius: 3px;
        min-width: 80px;
    }

        .notification-buttons button:hover {
            background: var(--cell-hover);
        }

.tabs-section-content-wrapper {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.tabs-section-content-scroll-container {
    height: 100%;
    overflow: auto;
    flex-grow: 1;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
    position: relative;
    background: var(--bg-color);
}

#History .tabs-section-content-scroll-container {
    outline: none;
}

.export-panel-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px !important;
}

.export-panel-label {
    margin: 0 0 15px 0;
    font-weight: bold;
}

.export-panel-radio {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 2px 0;
    white-space: nowrap;

    > input[type=radio] {
        margin: 0;
    }
}


.export-panel-buttons {
    margin-top: 20px;
}

.tabs-section-content-scroll-container::-webkit-scrollbar {
    width: 12px;
}

.tabs-section-content-scroll-container::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.tabs-section-content-scroll-container::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 6px;
    border: 3px solid var(--bg-color);
}

    .tabs-section-content-scroll-container::-webkit-scrollbar-thumb:hover {
        background-color: var(--scrollbar-hover);
    }

.tab-panels {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

    .tab-panels .tab-panel {
        height: 100%;
        display: none;
        flex-direction: column;
    }

.tab-panel {
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

@keyframes ribbon-attention {
    0%, 32%, 68%, 100% {
        background-color: var(--ribboncolor);
    }

    16%, 50%, 94% {
        background-color: var(--accent-color);
    }
}

.ribbon-attention {
    animation: ribbon-attention 1.2s ease-in-out;
}

.tabs-section-content-aux {
    padding: 0 calc(1.2*var(--padding));
    border-top: var(--bordersize) solid var(--border-color);
    background: var(--bg-color);

    &:has(#bitEditor) {
        padding: 0;
    }
}

#auxInfo {
    display: flex;
    flex-direction: row;
}

#findAlignment {
    max-width: 50px;
}

.extfeature {
    display: grid;
    text-wrap: balance;
    font-size: 13px;

    &:has(.extfeature-banner) {
        place-items: center;
    }
}

.extfeature-banner {
    background-color: var(--whitebg);
    height: 100%;
    display: flex;
    align-items: center;
}

.tabs-section-content-wrapper .extfeature-banner {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 0;
    z-index: 9999;
}

.extfeature:has(> .extfeature-banner) > :not(.extfeature-banner) {
    display: none;
}

.tabs-section-content-wrapper:has(.extfeature-banner) > .tabs-section-content-aux {
    display: none;
}

.extfeature-banner-content {
    max-width: 530px;
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

@media (max-height: 500px) {
    .extfeature-banner-content {
        align-self: flex-start;
    }
}

@media (max-height: 950px) {
    .bottombar-01, .bottombar-02 {
        .extfeature-banner-content {
            align-self: flex-start;
        }
    }
}

.extfeature-banner-content a {
    white-space: nowrap;
    font-weight: 500;
}

.extfeature-banner-content > p {
    margin: 6px 10px;
}

.find-dialog-buttons:has(+ .replace-section[style*="display: none"]) #findCancelBtn,
.find-dialog-buttons:has(+ .replace-section[style*="display:none"]) #findCancelBtn {
    display: inline-block !important;
}

.find-dialog-buttons:has(+ .replace-section:not([style*="display: none"])) #findCancelBtn,
.find-dialog-buttons:has(+ .replace-section:not([style*="display:none"])) #findCancelBtn {
    display: none;
}

.find-dialog-buttons:has(+ .replace-section[style*="display: none"]),
.find-dialog-buttons:has(+ .replace-section[style*="display:none"]) {
    padding-bottom: 0 !important;
}

.find-dialog-buttons:has(+ .replace-section:not([style*="display: none"])),
.find-dialog-buttons:has(+ .replace-section:not([style*="display:none"])) {
    padding-bottom: 20px;
}

.he-main-toolbar {
    display: flex;
    flex-wrap: nowrap;
    overflow-y: hidden;
    overflow-x: auto;
    scrollbar-width: thin;

    &:has(span[data-translated]) {
        gap: 8px;
    }

    > li {
        padding: 0;
        align-self: center;
        box-sizing: border-box;
        background-color: var(--maintoolbarbgcolor);
        display: flex;

        > button {
            position: relative;
            height: var(--toolbar-size);
            min-width: calc(1.1*var(--toolbar-size));
            padding: 0;
            border: 0;
            cursor: pointer;
            font-family: inherit;
            background-color: var(--maintoolbarbgcolor);
            color: var(--text-color);
            transition: all 0.3s;

            > span:not(#recentItems) {
                display: flex;
                align-items: end;
                justify-content: center;
                font-size: 12px;
                height: calc(0.64*var(--toolbar-size));
                background-position: top center;
                background-repeat: no-repeat;
                background-size: calc(0.34375*var(--toolbar-size));
                transition: background-size 0.2s ease;
                white-space: nowrap;

                &[data-translated] {
                    word-spacing: -4px;
                }
            }

            &:not(:disabled):not(#hhdProducts):not(#hhdLogo):hover > span:not(#recentItems) {
                background-size: calc(0.38*var(--toolbar-size));
            }

            &:active {
                top: 1px;
            }
        }

        > #hhdLogo {
            > span {
                width: 89px !important;
                height: 37px !important;
                background-size: 89px 37px !important;
                padding: 0 6px !important;
            }
        }

        &:has(#hhdProducts) {
            width: 64px;
        }

        > #hhdProducts {
            min-width: unset;
            width: 36px;
            display: flex;
            justify-content: center;
            align-items: center;

            > span {
                width: 22px !important;
                height: 22px !important;
                background-position: center !important;
            }
        }

        > button:hover {
            background-color: var(--maintoolbaraccentcolor);
        }

        > button:disabled {
            background-color: transparent;
            cursor: not-allowed;
        }

        > button.overwrite-mode {
            color: var(--overwrite-mode-color);
        }

        > button.insert-mode {
            color: var(--insert-mode-color);
        }
    }
}


li.spacer {
    margin-left: auto;
    min-width: calc(1.2*var(--toolbar-size));

    > button {
        margin-left: auto;
    }
}

#hhdProducts > span {
    background-image: url(/images/hhd-browse-p.svg);
    transition: transform 0.05s linear;
}

#hhdProducts:hover > span, .spacer:has(:popover-open) span {
    transform: rotate(90deg);
}

#hhdLogo > span {
    background-image: var(--logo);
}

#hhdProductsMenu {
    inset: unset;
    top: var(--toolbar-size) !important;
    right: 0;
    border-radius: 8px;
    border-color: transparent;
    background-color: var(--bg-color);
    box-shadow: 0 2px 15px 0 var(--scrollbar-hover);
    padding: 5px 0;

    a {
        display: block;
        text-decoration: none;
        padding: 5px 8px;
        margin: 0 2px;

        &:hover {
            color: var(--bg-color);
            background-color: var(--link-color);
        }
    }
}

.selection-cell:hover, .he-cs-row.he-cs-selected td.he-cs-cell-focused {
    background-color: var(--selected-bg-active);
}

.history-list {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
    font-family: 'Consolas', 'Monaco', monospace;
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1px 0;
    gap: 1px;
}

.history-item {
    display: flex;
    width: 100%;
    margin-right: auto;
    min-height: 24px;
    line-height: 24px;
    cursor: pointer;
    gap: 0 6px;
    white-space: nowrap;
    word-spacing: -2px;
}

    .current-item:not(.history-tail), .history-item:not(.history-tail):hover {
        filter: brightness(1) grayscale(0);
        opacity: 1;
        background-color: var(--selected-bg);
    }

    .history-item.history-group:hover .history-tail {
        filter: brightness(1.5) grayscale(100%);
        opacity: 0.5;

        &:hover {
            filter: brightness(1) grayscale(0);
            opacity: 1;
            background-color: var(--selected-bg);
        }
    }

    .history-item.current-item.expanded,
    .history-item.history-group.expanded {
        &:hover {
            filter: brightness(1) grayscale(0);
            opacity: 1;
            background-color: unset;
        }
    }

.history-tail:not(.history-group-item), .current-item .history-tail {
    filter: brightness(1.5) grayscale(100%);
    opacity: 0.5;

    &:hover {
        filter: brightness(1) grayscale(0);
        opacity: 1;
        background-color: var(--selected-bg);
    }
}

.history-details {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.history-type {
    padding-left: 30px;
    margin-left: 6px;
    background-position: left center;
    background-repeat: no-repeat;
    background-size: 18px;
}

.history-name {
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-group-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.history-group-toggle {
    width: 16px;
    text-align: center;
    margin-left: 7px;
    margin-right: 2px;
    font-size: 10px;
    color: #4a90e2;
}

.history-group-items {
    margin-left: 40px;
    border-left: 1px dashed var(--border-color);
}

.history-group-item {
    box-sizing: border-box;
    padding: 2px 0 2px 8px;
    display: flex;
    width: 100%;
}

.history-group-header {
    padding-right: 0;
    box-sizing: border-box;
}

.history-group.expanded {
    flex-direction: column;
}

.history-rename-button {
    visibility: hidden;
    margin-left: auto;
    margin-right: 4px;
    padding: 2px 6px;
    font-size: 11px;
    line-height: 18px;
    cursor: pointer;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
    border-radius: 5px;
    background-image: url(/images/editcell.svg);
    background-position: center;
    background-repeat: no-repeat;
    background-size: 10px;
    transition: background-size 0.2s ease;
    transform: scaleX(-1);
    color: transparent;
    width: 22px;
    height: 22px;

    &:hover {
        background-size: 11px;
    }
}

.history-item:not(:has(.history-group-header)):hover .history-rename-button,
.history-group-header:hover .history-rename-button,
.history-group-item:hover .history-rename-button {
    visibility: visible;
}

.history-rename-input {
    border: 1px solid var(--selected-bg);
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 2px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: inherit;
    width: 100%;
    min-width: 80px;
    box-sizing: border-box;
    margin-left: 2px;
}

.history-type-container {
    display: flex;
    align-items: center;
}

.history-group-items.items-collapsed {
    display: none;
}

.history-item.item-renamed {
    color: var(--modified-color);

    .history-item:not(.item-renamed) {
        color: var(--text-color);
    }
}

.base-converter, .data-inspector, .export-panel-form, #bitEditor {
    padding: 8px;
    box-sizing: border-box;
}

.converter-grid {
    display: table;
    padding: 0;
    margin: 0;
}

#BaseConverter .converter-row {
    height: 40px;
}

.converter-row {
    display: table-row;
    height: 36px;
}

    .converter-row input:not([type="checkbox"]) {
        padding: 5px 8px;
        border-radius: 3px;
        font-family: 'Courier New', monospace;
        font-size: 13px;
        flex: 1;
        box-sizing: border-box;
        min-width: 128px;
        width: 100%;
        height: 28px;
        text-overflow: ellipsis;
        overflow: hidden !important;
        white-space: nowrap;
        background: var(--input-bg);
        border: 1px solid var(--border-color);
        color: var(--text-color);
    }

    .converter-row input:focus {
        outline: none;
        border-color: var(--accent-color);
    }

    .converter-row label {
        font-size: 13px;
        color: var(--text-color, #333);
        word-spacing: -5px;
        white-space: nowrap;
        display: table-cell;
        padding-right: 8px;
        vertical-align: middle;
    }

.converter-input-container {
    position: relative;
    width: 100%;
    display: table-cell;
    vertical-align: middle;
}

    .converter-input-container > button {
        display: none;
    }

@media (hover: hover) and (pointer: fine) {
    .converter-input-container:hover {
        > button {
            display: block;
        }

        input:not([type="checkbox"]) {
            padding-right: 50px !important;
        }
    }

    .converter-input-container:has(input.readonly):hover > .converter-clear-button {
        display: none;
    }

    .converter-input-container:has(input.empty):hover > button {
        display: none;
    }
}

.converter-copy-button,
.converter-clear-button {
    all: unset;
    cursor: pointer;
    width: 24px;
    height: 24px;
    opacity: 0.9;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    transition: all 0.2s ease;
    padding: 0;
    margin: 0;
    z-index: 2;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 16px;
}

.converter-clear-button {
    right: 26px;
    background-image: url(/images/clear.svg);
}

.converter-copy-button {
    right: 4px;
    background-image: url(/images/copy.svg);
}

.converter-clear-button:hover, .converter-clear-button:active {
    opacity: 1;
    background-image: url(/images/clear.svg);
    background-size: 18px;
}

.converter-copy-button:hover, .converter-copy-button:active {
    opacity: 1;
    background-image: url(/images/copy.svg);
    background-size: 20px;
}

.converter-copy-button:disabled,
.converter-clear-button:disabled {
    display: none !important;
}

.invalid-input {
    border-color: var(--conflict-color) !important;
}

.converter-row input:focus.invalid-input {
    border-color: var(--conflict-color) !important;
    box-shadow: 0 0 0 var(--conflict-shadow-size) var(--conflict-shadow-color) !important;
}

.approximate-value {
    color: var(--approx-color) !important;
}

.data-inspector .converter-input-container input.readonly {
    background-color: var(--odd-column-bg);
    border-color: var(--border-color);
    color: var(--loading-color);
    cursor: default;
}

.hex-cell.data-inspector-highlight,
.text-cell.data-inspector-highlight {
    background-color: var(--datainspector-color) !important;
    color: #fff !important;
}

    .hex-cell.data-inspector-highlight.active,
    .text-cell.data-inspector-highlight.active {
        background-color: var(--datainspector-color) !important;
        border: 1px solid var(--datainspector-color) !important;
        ;
        color: white !important;
    }

.data-inspector .converter-row[data-visible="false"] {
    display: none;
}

.data-inspector .converter-row {
    transition: opacity 0.15s ease, display 0.15s ease;
}

.he-popover {
    border: 4px solid var(--popover-border);
    border-radius: 8px;
    background: var(--popover-bg);
    box-shadow: 0 8px 20px var(--popover-shadow);
    padding: 0;
    margin: auto;
}

    .he-popover::backdrop {
        background: rgba(0, 0, 0, 0.4);
    }

:is(.he-popover, .notification-window, .insert-dialog, .fill-dialog, .about-dialog, .size-dialog, .settings-dialog, .find-dialog, .export-url-dialog, .export-snippet-dialog, .export-hexrecord-dialog, .nag-screen)
:is(input:not([type=checkbox]):not([type=radio]), select, textarea, button):focus {
    outline: none;
    border-color: var(--accent-color);
}

:is(.he-popover, .insert-dialog, .fill-dialog, .about-dialog, .size-dialog, .settings-dialog, .find-dialog, .export-url-dialog, .export-snippet-dialog, .export-hexrecord-dialog)
:is(input.he-invalid:not([type=checkbox]), input.he-invalid:focus:not([type=checkbox])) {
    border-color: var(--modified-color);
}

#he-external-change-popover {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    max-width: 480px;

    .he-di-types-list {
        padding: 0;

        > p {
            margin: 8px 0;

            &:last-child {
                margin: 8px 0 16px 0;
            }
        }

        .he-ext-change-warning {
            margin: 4px 0 8px 0;
            color: var(--modified-color);
        }
    }

    .he-di-popover-footer {
        justify-content: flex-end;

        .he-ext-change-btn-row {
            display: flex;
            gap: 8px;
        }
    }
}

.he-offscreen-textarea {
    position: fixed;
    left: -999999px;
    top: -999999px;
}

.he-label-disabled {
    color: var(--grey);
}

.he-di-popover-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);

    h3 {
        margin: 0;
    }
}

.he-di-popover-close {
    color: transparent !important;
    background-color: transparent !important;
    font-size: 20px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    border-radius: 4px;
    border: 0;
    background-size: 16px;
}

    .he-di-popover-close:hover {
        background-color: transparent !important;
        background-size: 22px;
    }

.he-di-popover-content {
    padding: 16px;
    max-height: 400px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

.he-di-types-list li {
    display: flex;
    align-items: flex-start;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background 0.1s ease;

    > label {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 10px;
        cursor: pointer !important;
    }
}

    .he-di-types-list li:hover {
        background: var(--cell-hover);
    }

.he-si-group-header {
    padding: 6px 8px 2px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--accent-color);
    pointer-events: none;
    user-select: none;

    &:not(:first-child) {
        margin-top: 12px;
    }
}

    .he-si-group-header:hover {
        background: none !important;
    }

.he-di-types-list input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    width: var(--checkbox-size);
    height: var(--checkbox-size);
    cursor: pointer;
}

.he-di-type-name {
    font-weight: 600;
    font-size: 0.95rem;
    width: 148px;
}

.he-di-type-desc {
    font-size: 0.8rem;
    opacity: 0.8;
    margin-top: 2px;
    margin-left: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 460px;
}

.he-di-popover-footer {
    display: flex;
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
    background: var(--header-bg);
    border-radius: 0 0 8px 8px;

    > div {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
    }
}

.he-di-popover-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-color);
    background: var(--cell-bg);
    color: var(--text-color);
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

    .he-di-popover-btn:hover {
        background: var(--cell-hover);
    }

    .he-di-popover-btn.primary {
        background: var(--accent-color);
        color: white;
        border-color: var(--accent-color);
    }

        .he-di-popover-btn.primary:hover {
            filter: brightness(1.1);
        }

.he-di-select-all {
    font-size: 16px;
    display: flex;
    align-items: center;

    strong {
        position: relative;
        top: 1px;
    }
}

    .he-di-select-all label {
        display: flex;
        align-items: center;
        gap: 8px;
        cursor: pointer;
    }

.he-di-popover-content::-webkit-scrollbar {
    width: 10px;
}

.he-di-popover-content::-webkit-scrollbar-track {
    background: var(--bg-color);
}

.he-di-popover-content::-webkit-scrollbar-thumb {
    background-color: var(--scrollbar-color);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}

.he-controls-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 28px;
    padding: 16px 20px;
    max-height: 66vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

    .he-controls-content::-webkit-scrollbar {
        width: 10px;
    }

    .he-controls-content::-webkit-scrollbar-track {
        background: var(--bg-color);
    }

    .he-controls-content::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-color);
        border-radius: 5px;
        border: 2px solid var(--bg-color);
    }

.he-controls-col {
    min-width: 0;
}

.he-controls-section {
    margin-bottom: 24px;
}

    .he-controls-section:last-child {
        margin-bottom: 0;
    }

.he-controls-section-title {
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent-color);
    margin-bottom: 1px;
    padding-bottom: 4px;
}

.he-controls-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 2px 0;
    font-size: 0.84rem;
    line-height: 1.5;
}

.he-controls-keys {
    flex-shrink: 0;
    width: 280px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px;
}

.he-controls-desc {
    opacity: 0.85;
    min-width: 0;
}

kbd.he-kbd {
    display: inline-block;
    padding: 0 5px;
    font-family: ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;
    font-size: 0.78rem;
    border: 1px solid var(--border-color);
    border-bottom-width: 2px;
    border-radius: 3px;
    background: var(--cell-bg);
    color: var(--text-color);
    white-space: nowrap;
    line-height: 1.65;
    vertical-align: middle;
}

.he-controls-or {
    font-size: 0.75rem;
    opacity: 0.6;
    margin: 0 1px;
}

.he-help-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 20px;
    max-height: 75vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
}

    .he-help-content::-webkit-scrollbar {
        width: 10px;
    }

    .he-help-content::-webkit-scrollbar-track {
        background: var(--bg-color);
    }

    .he-help-content::-webkit-scrollbar-thumb {
        background-color: var(--scrollbar-color);
        border-radius: 5px;
        border: 2px solid var(--bg-color);
    }

.he-help-card {
    padding: 10px 13px;
    max-width: 700px;
}

.he-help-card-title {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: var(--accent-color);
    margin-bottom: 5px;
    padding-bottom: 4px;
}

.he-help-card-body {
    font-size: 0.82rem;
    line-height: 1.58;
    opacity: 0.9;
}



#recentItemsPopover {
    border: 4px solid var(--popover-border);
    border-radius: 8px;
    background: var(--popover-bg);
    box-shadow: 0 8px 20px var(--popover-shadow);
    padding: 0;
    margin: 0;
    inset: unset;
    top: calc(var(--toolbar-size) + 2px);
    margin: 0 10px;
}

    #recentItemsPopover::backdrop {
        background: rgba(0, 0, 0, 0.4);
    }

    #recentItemsPopover .he-di-popover-header,
    .he-di-popover-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 12px 16px;
        border-bottom: 1px solid var(--border-color);
    }

        #recentItemsPopover .he-di-popover-header h3,
        .he-di-popover-header h3 {
            margin: 0;
            font-size: 1rem;
            font-weight: 600;
        }

    #recentItemsPopover .he-di-type-name {
        font-weight: 600;
        font-size: 0.95rem;
        flex: 1;
    }

    #recentItemsPopover .he-di-type-desc {
        font-size: 0.8rem;
        opacity: 0.8;
        color: var(--loading-color);
    }

    #recentItemsPopover .he-di-popover-footer,
    .he-di-popover-footer {
        display: flex;
        justify-content: flex-end;
        padding: 12px 16px;
        border-top: 1px solid var(--border-color);
        background: var(--header-bg);
        border-radius: 0 0 8px 8px;
    }

    #recentItemsPopover .he-di-popover-btn,
    .he-di-popover-btn {
        padding: 6px 16px;
        border: 1px solid var(--border-color);
        background: var(--cell-bg);
        color: var(--text-color);
        border-radius: 4px;
        cursor: pointer;
        font-size: 0.9rem;
        transition: background 0.2s;
    }

        #recentItemsPopover .he-di-popover-btn:hover,
        .he-di-popover-btn:hover {
            background: var(--cell-hover);
            border: 1px solid var(--border-color);
        }



.recent-files-table {
    display: table;
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    line-height: 1.4;
}

.recent-files-thead {
    display: table-header-group;
}

.recent-files-th {
    user-select: none;
    color: var(--scrollbar-hover);
}

.recent-files-tbody {
    display: table-row-group;
    background-color: var(--popover-bg);

    .recent-files-tr {
        &:focus {
            background-color: var(--selected-bg);
            cursor: pointer;
            filter: brightness(0.98);
        }

        &:hover {
            background-color: var(--selected-bg);
            cursor: pointer;
            filter: brightness(1.04);
        }
    }
}

.recent-files-tr {
    display: table-row;
    width: 100%;
    transition: background-color 0.15s ease;
    box-sizing: border-box;
}

.recent-files-td, .recent-files-th {
    display: table-cell;
    padding: 8px 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    &:first-child {
        border-radius: 5px 0 0 5px;
    }

    &:last-child {
        border-radius: 0 5px 5px 0;
    }
}

.recent-files-empty {
    padding: 24px;
    text-align: center;
    color: var(--loading-color);
    font-style: italic;
}

.recent-files-th:nth-child(1),
.recent-files-td:nth-child(1) {
    width: 140px;
}

.recent-files-th:nth-child(2),
.recent-files-td:nth-child(2) {
    width: 120px;
}

.recent-files-th:nth-child(3),
.recent-files-td:nth-child(3) {
    width: 190px;
}

.recent-files-th:nth-child(4),
.recent-files-td:nth-child(4) {
    width: 50px;
    text-align: justify;
}

.recent-files-th:nth-child(5),
.recent-files-td:nth-child(5) {
    width: 70px;
    text-align: justify;
}

.recent-files-th:nth-child(6),
.recent-files-td:nth-child(6) {
    width: 70px;
    text-align: justify;
}

.recent-files-th:nth-child(7),
.recent-files-td:nth-child(7) {
    width: 70px;
    text-align: justify;
}

.recent-files-th:nth-child(8),
.recent-files-td:nth-child(8) {
    width: 120px;
    text-align: justify;
}

.recent-files-th:nth-child(9),
.recent-files-td:nth-child(9) {
    width: 120px;
    text-align: justify;
}

.file-name-cell {
    font-weight: 500;
}

.path-cell, .date-cell {
    font-size: 12px;
}

.hex-preview-cell,
.text-preview-cell {
    font-family: 'Courier New', monospace;
    font-size: 12px;
}

.number-cell {
    text-align: right;
    font-family: 'Courier New', monospace;
}

.history-cell {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

#bitEditor {
    input[type="checkbox"] {
        --ch-size: 16px;
        margin: 0;
        width: var(--ch-size);
        height: var(--ch-size);
        cursor: pointer;

        &:nth-child(4) {
            margin-right: 6%;
        }
    }

    .be-bitsall {
        display: flex;
        flex-direction: row;
        flex-wrap: nowrap;
        justify-content: space-between;
    }
}

#goto-bookmarks {
    background: var(--cell-bg);
    border: 1px solid var(--popover-border);
    border-radius: 5px;
    box-shadow: 0 4px 12px var(--popover-shadow);
    font-family: monospace;
    padding: 0;
}

.bookmark-relative-container {
    position: relative;
}

#goto-bookmarks .bookmark-item {
    cursor: pointer;
    padding: 2px 13px;
    box-sizing: border-box;
    text-align: left;

    &.compressed-padding {
        padding: 2px 3px 2px 13px;
    }

    &.wide9 {
        width: 88px;
        padding: 2px 3px 2px 13px;

        &.compressed-padding {
            width: 78px;
            padding: 2px 3px 2px 6px;
        }
    }
}

    #goto-bookmarks .bookmark-item:hover {
        background-color: var(--selected-bg);
    }

#goto-bookmarks .bookmark-empty {
    min-width: 88px;
    text-align: center;
    padding: 2px 13px;
    box-sizing: border-box;
    cursor: default;
}

#goto-bookmarks .bookmark-add,
#goto-bookmarks .bookmark-clear {
    padding: 4px 8px;
    cursor: pointer;
    background-position: center;
}

    #goto-bookmarks .bookmark-add:hover,
    #goto-bookmarks .bookmark-clear:hover {
        background-color: var(--ribboncolor);
    }

#closeBookmarkPopover {
    --size: 12px;
    width: var(--size);
    height: var(--size);
    font-size: var(--size);
    display: block;
    text-align: right;
    color: transparent !important;
    background-color: transparent !important;
    border: none;
    padding: 0;
    cursor: pointer;

    &:hover {
        background-size: 18px;
    }
}

.goto-bookmarks-header, .goto-bookmarks-footer {
    padding: 4px 13px;
    background: var(--header-bg);
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: default;
}

.goto-bookmarks-header {
    border-radius: 5px 5px 0 0;
}

.goto-bookmark-list-container {
    scrollbar-width: thin;
}

    .goto-bookmark-list-container.scrollable {
        scrollbar-gutter: stable;
        overflow-y: auto;
    }

.goto-bookmarks-footer {
    border-radius: 0 0 5px 5px;
}

.he-cs-grid-wrap {
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-color) var(--bg-color);
    outline: none;
}

.he-cs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .8rem;
    table-layout: fixed;
}

    .he-cs-table th, .he-cs-table td {
        padding: 4px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        vertical-align: middle;
    }

        .he-cs-table th:not(:last-child), .he-cs-table td:not(:last-child) {
            border-right: 1px solid var(--border-color);
        }

    .he-cs-table thead th {
        position: sticky;
        top: 0;
        z-index: 1;
        background: var(--bg-color);
        border-top: 1px solid var(--border-color);
        font-weight: 600;
        text-align: left;
        user-select: none;
    }

.he-cs-col-chk {
    width: 24px;
    text-align: center !important;

    input[type="checkbox"] {
        cursor: pointer;
    }
}

td.he-cs-col-name, td.he-cs-col-val {
    cursor: pointer;
}

.he-cs-col-name {
    width: 18%;
}

.he-cs-col-val {
    width: 35%;
    position: relative;

    > .converter-copy-button {
        display: none;
    }

    &:not(th) {
        font-family: monospace;
        font-size: .76rem;
    }
}

.he-cs-params-body {
    input[type="checkbox"], input[type="radio"] {
        top: 0 !important;
    }

    .he-checkbox-row-label {
        white-space: nowrap;
    }
}

@media (hover: hover) and (pointer: fine) {
    td.he-cs-col-val:hover {
        padding-right: 30px;

        > .converter-copy-button {
            display: block;
        }
    }
}

.he-cs-group-hdr td {
    background: var(--bg-color);
    color: var(--grey);
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .05em;
    padding: 3px 0;
    text-transform: capitalize;
    text-align: center;
}

    .he-cs-group-hdr td span {
        display: flex;
        align-items: center;
        text-align: center;
        gap: 10px;
        background: var(--bg-color);
    }

        .he-cs-group-hdr td span::before, .he-cs-group-hdr td span::after {
            content: "";
            flex: 1;
            height: 1px;
            background: var(--tab-bg);
        }

.he-cs-row {
    cursor: default;
}

    .he-cs-row:hover td {
        background: color-mix(in srgb,var(--selected-bg) 35%,transparent);
    }

    .he-cs-row.he-cs-selected td {
        background: var(--selected-bg);
    }

.he-cs-val-pending {
    color: var(--grey);
    font-style: italic;
}

.he-cs-val-error {
    color: var(--modified-color);
    font-size: .73rem;
}

.he-cs-col-resize-handle {
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    cursor: col-resize;
    z-index: 3;
    user-select: none;
}

    .he-cs-col-resize-handle:hover, .he-cs-col-resize-handle.he-cs-col-resizing {
        background: var(--link-color);
        opacity: .45;
    }

.he-cs-params-text {
    color: var(--grey);
    font-size: .74rem;
    cursor: pointer;
}

    .he-cs-params-text:hover {
        text-decoration: underline;
    }

#he-cs-params-dialog {
    min-width: 420px;
    max-width: 520px;
    position: fixed;
    left: 50%;
    right: auto;
    top: 50%;
    transform: translate(-50%,-50%);
    margin: 0;
}

.he-cs-params-body {
    padding: 16px 20px;
}

.he-cs-params-sep {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 10px 0;
}

.he-cs-hmac-key-col {
    flex: 2 1 0;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

    .he-cs-hmac-key-col .find-input {
        flex: none;
        box-sizing: content-box;
    }

.he-cs-params-hmac-warn {
    font-size: .74rem;
    color: var(--warning-color);
    line-height: 1.4;
    padding-top: 4px;
    overflow-wrap: break-word;
    max-width: 326px;
}

.he-checkbox-row-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding-top: 5px;
}

    .he-checkbox-row-label input[type="checkbox"] {
        margin: 0;
        flex-shrink: 0;
        width: var(--checkbox-size);
        height: var(--checkbox-size);
        cursor: pointer;
    }

#he-cs-params-dialog .input-row:has(:disabled) {
    opacity: 0.3;
    cursor: default;
    filter: grayscale(100%);
}

#he-cs-params-dialog .find-combo:disabled {
    opacity: 1;
}

.he-cs-params-progress {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    margin-right: auto;
    min-width: 140px;
}

    .he-cs-params-progress.active {
        display: flex;
    }

.he-cs-params-progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.he-cs-params-progress-fill {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0%;
    background: var(--accent-color);
    border-radius: 2px;
    transition: width 0.15s ease;
}

    .he-cs-params-progress-fill.indeterminate {
        width: 35% !important;
        left: -35%;
        transition: none;
        animation: he-cs-progress-indeterminate 1.1s ease-in-out infinite;
    }

@keyframes he-cs-progress-indeterminate {
    0% {
        left: -35%;
    }

    100% {
        left: 100%;
    }
}

html[dir="rtl"] .he-cs-params-progress-fill {
    left: auto;
    right: 0;
}

    html[dir="rtl"] .he-cs-params-progress-fill.indeterminate {
        right: -35%;
        left: auto;
        animation-name: he-cs-progress-indeterminate-rtl;
    }

@keyframes he-cs-progress-indeterminate-rtl {
    0% {
        right: -35%;
    }

    100% {
        right: 100%;
    }
}

.he-cs-params-progress-label {
    font-size: 0.75rem;
    color: var(--grey);
    white-space: nowrap;
}

.goto-bookmarks-footer > div {
    --goto-bookmarks-btn-size: 24px;
    display: flex;
    padding: 0;
    margin: 0;
    width: var(--goto-bookmarks-btn-size);
    height: var(--goto-bookmarks-btn-size);

    > button {
        padding: 0;
        margin: 0;
        width: var(--goto-bookmarks-btn-size);
        height: var(--goto-bookmarks-btn-size);
        border-radius: 0;

        &:hover {
            background-color: transparent !important;
            background-size: 28px;
        }
    }
}

.he-tools-menu {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: var(--bg-color);
}

    .he-tools-menu:popover-open {
        display: flex;
        flex-direction: column;
    }

.he-tools-list {
    flex: 1 1 auto;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-y: auto;
}

.he-tools-item {
    display: flex;
    align-items: center;
    gap: calc(4*var(--padding));
    padding: calc(4*var(--padding)) calc(5*var(--padding));
    cursor: pointer;
}

.he-tools-item-icon {
    flex: 0 0 auto;
    width: calc(0.375*var(--toolbar-size));
    height: calc(0.375*var(--toolbar-size));
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.he-panel-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 1000;
    display: flex !important;
}

    .he-panel-fullscreen .tabs {
        display: none;
    }

#menuBtn {
    display: none;
}

/* mobile-ui-width */
@media (max-width: 1024px) {
    .text-area, .text-header {
        margin-left: 5px;
        padding-left: 5px;
    }

    .he-stat-split {
        flex-direction: column;
    }

    .he-stat-main {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* mobile-ui-narrow */
@media (max-width: 600px) {
    #menuBtn {
        display: revert;
    }

    #saveFileBtn, #insertFileBtn {
        display: none;
    }

    .main-grid {
        grid-template-columns: 0 1fr 1fr 0 !important;
        grid-template-rows: auto 1fr 0 auto !important;
    }

    .sidebar-01:not(.he-panel-fullscreen), .sidebar-02:not(.he-panel-fullscreen),
    .bottombar-01:not(.he-panel-fullscreen), .bottombar-02:not(.he-panel-fullscreen) {
        display: none !important;
    }

    .he-tools-header, .tabs-ribbon {
        flex: 0 0 auto;
        height: calc(0.75*var(--toolbar-size));
        min-height: calc(0.75*var(--toolbar-size));
        line-height: normal;
        align-items: center;
        padding: 0 calc(5*var(--padding));
        overflow-x: revert;
        border-bottom: var(--bordersize) solid var(--border-color);
    }

    .he-checkbox-row-label {
        font-size: .72rem;
    }

    .offset-column:hover, .hex-cell:hover, .text-cell:hover,
    .hex-index-cell:hover, .text-index-cell:hover {
        background: transparent;
    }

    .insert-dialog, .fill-dialog, .about-dialog, .size-dialog, .settings-dialog,
    .find-dialog, .export-url-dialog, .export-snippet-dialog, .export-hexrecord-dialog,
    #he-cs-params-dialog, #he-external-change-popover, .he-popover {
        min-width: 0;
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: calc(100dvh - 16px);
        box-sizing: border-box;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .he-di-popover-content, .he-controls-content, .he-help-content {
        max-height: none;
    }

    .he-popover:popover-open {
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .he-popover > .he-di-popover-header,
    .he-popover > .he-di-popover-footer {
        flex: 0 0 auto;
    }

    .he-popover > .he-di-popover-content,
    .he-popover > .he-controls-content,
    .he-popover > .he-help-content {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }

    .he-controls-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }

    .he-controls-keys {
        width: auto;
    }

    .he-help-card {
        max-width: none;
    }

    .he-di-types-list li > label {
        flex-wrap: wrap;
        align-items: center;
    }

    .he-di-type-name {
        width: auto;
        flex-shrink: 0;
    }

    .he-di-type-desc {
        flex-basis: 100%;
        max-width: none;
        white-space: normal;
        padding-left: 26px;
    }

    .he-di-popover-footer > div {
        flex-direction: column;
        gap: 10px;
    }

        .he-di-popover-footer > div > div:last-child {
            display: flex;
            justify-content: flex-end;
            gap: 8px;
        }

    #he-cs-params-dialog .input-row {
        flex-direction: column;
        gap: 4px;
    }

    #he-cs-params-dialog .input-label {
        width: auto;
        padding-top: 0;
    }

    #he-cs-params-dialog .find-dialog-buttons {
        flex-wrap: wrap;
        row-gap: 8px;
    }

    #he-cs-params-dialog .he-cs-params-progress {
        min-width: 0;
        flex-basis: 100%;
        margin-right: 0;
    }

    #recentItemsPopover,
    .he-context-menu, .find-options-menu,
    .tabs-toolbar-overflow-menu,
    #hhdProductsMenu, #goto-bookmarks {
        max-width: calc(100vw - 16px);
        box-sizing: border-box;
    }
}

/* ---- Right-to-left (Arabic, Hebrew, Persian, Urdu, Dhivehi) ---- */
[dir="rtl"] .main-window {
    direction: ltr;
}

[dir="rtl"] .hex-area, [dir="rtl"] .text-area,
[dir="rtl"] .offset-column, [dir="rtl"] .he-editor {
    direction: ltr;
}

[dir="rtl"] .he-cs-table, [dir="rtl"] .converter-input-container input,
[dir="rtl"] .he-di-value {
    direction: ltr;
}
