:root {
    --c-line: #EAEAEA;
    --c-text: #000000;
    --c-muted: #9DA9B5;
    --c-btn: #F1F2F7;
    --c-btn-hover: #E3E7ED;
    --c-statement-text: #1A1A2E;
    --c-statement-navy: #1A3C6E;
    --c-statement-navy-line: #12306A;
    --c-statement-rule: #CCD6E8;
    --c-statement-cell-line: #DDE3EF;
    --c-statement-total: #E8F0FB;
    --c-statement-label: #333333;
    --c-statement-value: #555555;
    --c-statement-note: #F8F9FD;
    --c-statement-dots: #E8EAF0;
    --c-statement-row-alt: #FAFBFD;
    --c-statement-total-line: #B9C7DF;
    --c-statement-negative: #B42318;
    --c-statement-row-hover: #F3F6FC;
    --c-statement-total-hover: #DCE7F8;
    --c-statement-focus: rgba(26, 60, 110, 0.25);
    --c-btn-active: #E9EAEB;
    --ease: all ease-in .15s;
}

h2,
h2 *,
h3,
h3 * {
    font-weight: bold;
}

h2,
h2 * {
    font-size: 1.4em;
}

h3,
h3 * {
    font-size: 1.2rem;
}

.tool {
    box-shadow: 0px 20px 20px -12px #0000000A, 0px 1px 2px 1px #0000000A;
}

.left-preview-inner,
.convert-btn,
.result-text-download-all div button,
.status-wrapper,
:is(.file-download-btn, .file-preview-btn, .file-copy-btn) {
    display: flex;
    align-items: center;
    justify-content: center;
}

.result-waiting,
.result-waiting .header,
.result-waiting .img-title-text,
.parent-response-div,
.result-waiting-card,
.result-waiting-card .card-row,
.status-wrapper,
.action_wrapper,
.table-container {
    min-width: 0;
    max-width: 100%;
}

.js-single-img-preview .img-preview-name,
.result-waiting .img-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tool-section {
    background-color: var(--color-skyblue);
}

.tool-area {
    display: flex;
    width: 100%;
    gap: 16px;
    min-width: 0;
    overflow: visible;
}

.drag-n-drop-text {
    font-weight: 500;
    line-height: 28px;
    gap: 4px;
}

.upload-section {
    border-color: #EADDF8;
}

.drag-n-drop-text small {
    line-height: 20px;
}

.drop-file-text {
    display: none;
    color: #9DA2B5;
    font-weight: 500;
    font-size: 18px;
    line-height: 28px;
    text-align: center;
}

.flex-basis-50-per {
    flex-basis: 50% !important;
}

.after-img-upload {
    flex-basis: 50%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.after-img-upload .images-clear {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.cloudflare_container {
    position: absolute;
    right: 0;
    bottom: 35px;
}

.selected-img-preview {
    padding: 0 6px 0 0;
    overflow: auto;
    height: auto;
    min-height: 294px;
    max-height: 294px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.selected-img-preview::-webkit-scrollbar {
    background: transparent;
}

.selected-img-preview::-webkit-scrollbar-thumb {
    background: var(--c-line);
}

.js-single-img-preview {
    box-shadow: inset 0 0 0 1px var(--c-line);
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.js-single-img-preview:hover {
    background: #f5f7fb49;
}

.js-single-img-preview .left-preview {
    display: flex;
    align-items: center;
    gap: 16px;
}

.left-preview-inner .preview-thumb {
    width: 64px;
    height: 64px;
    border-radius: 6px;
    object-fit: cover;
    border: 0.5px solid #eaeaea;
}

.left-preview-inner .preview-icon {
    object-fit: contain;
    padding: 12px;
}

.detail-preview {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.js-single-img-preview .img-preview-name {
    font-size: var(--font-size-small);
    font-weight: 400;
    line-height: 24px;
    color: var(--c-text);
    max-width: 20ch;
}

.js-single-img-preview .img-preview-size {
    font-size: var(--font-size-x-small);
    font-weight: 400;
    line-height: 20px;
    color: var(--c-muted);
    position: relative;
}

.right-preview {
    margin: auto 0;
}

.right-preview,
.right-preview * {
    font-size: 14px;
}

.right-preview .delete-action,
.right-preview .cropper-btn {
    cursor: pointer;
    height: 36px;
    width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.15s ease-in-out;
}

.right-preview .delete-action:hover,
.right-preview .cropper-btn:hover {
    background-color: #F4F5F5;
}

.right-preview .delete-action:hover img,
.right-preview .cropper-btn:hover img {
    filter: invert(1);
}

.convert-btn {
    padding: 8px 24px;
    gap: 8px;
    border-radius: 8px;
    background: var(--c-text);
    color: #fff;
    font-weight: 400;
    font-size: 16px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--ease);
}

.convert-btn:hover {
    background: #262626;
}

.result-waiting {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-basis: 100%;
}

.result-text-download-all {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.result-text-download-all div {
    display: flex;
    gap: 8px;
}

.result-text-download-all div button {
    padding: 6px 12px;
    gap: 6px;
    border: none;
    border-radius: 6px;
    transition: var(--ease);
}

.result-text-download-all div button span {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
    text-align: center;
    color: var(--c-text);
}

.result-text-download-all div button:first-child {
    background: var(--c-btn);
}

.result-text-download-all div button:first-child:hover {
    background: var(--c-btn-hover);
}

.parent-response-div {
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.result-waiting .result-waiting-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: inset 0 0 0 1px var(--c-line);
    border-radius: 12px;
    position: relative;
    transition: all 0.3s;
    overflow: clip;
    width: 100%;
    min-height: 68px;
}

.result-waiting-card .card-row {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 12px;
    min-height: 68px;
}

.result-waiting .img-title-text {
    display: flex;
    align-items: center;
    flex: 1;
}

.result-waiting .img-title {
    display: flex;
    flex-direction: row;
    align-items: center;
    position: sticky;
    top: 0;
    gap: 12px;
    min-height: 36px;
}

.result-waiting .img-title span {
    display: block;
    font-size: 14px;
    line-height: 20px;
    max-width: 12ch;
}

.status-wrapper,
.action_wrapper {
    flex: 1;
}

.action_wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}

.finshed__span {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: max-content;
    padding: 2px 8px;
    border-radius: 5px;
    background: #F1F6FF;
    color: #017BFF;
    font-size: 12px;
    font-weight: 400;
    line-height: 18px;
    text-align: center;
}

.result-waiting .img-title img.result-thumbnail {
    height: 36px;
    width: 36px;
    object-fit: cover;
    box-shadow: inset 0 0 0 1px #EAEAEA;
}

.remove_card_icon {
    color: #606060;
    font-size: 18px;
    height: auto;
    cursor: pointer;
}

.remove_card_icon:hover,
.result-waiting .img-title img.result-thumbnail.js-image-to-show:hover {
    opacity: 0.7;
}

.remove_card_icon:active {
    opacity: 0.5;
}

.result-waiting-card .text_not_found {
    position: static;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 52px 12px;
    gap: 12px;
    border-top: 1px solid var(--c-line);
}

.text_not_found div b {
    font-size: 18px;
    line-height: 28px;
    color: #000000;
    font-weight: 500;
}

.text_not_found div p {
    font-size: 14px;
    line-height: 20px;
    color: #888A92;
}

:is(.file-download-btn, .file-preview-btn, .file-copy-btn) {
    padding: 8px 16px;
    border-radius: 8px;
    background: #ffffff;
    color: var(--c-text);
    text-align: center;
    cursor: pointer;
    border: 1px solid #EAEAEB;
    transition: var(--ease);
}

:is(.file-download-btn, .file-preview-btn, .file-copy-btn):hover {
    background: #F4F5F5;
}

:is(.file-download-btn, .file-preview-btn, .file-copy-btn):active,
.file-download-parent.menu-open .file-download-btn {
    background: var(--c-btn-active);
}

:is(.file-download-btn, .file-preview-btn, .file-copy-btn):focus-visible {
    outline: 2px solid var(--c-statement-focus);
    outline-offset: 2px;
}

:is(.file-download-btn, .file-preview-btn, .file-copy-btn) span {
    font-size: 14px;
    line-height: 20px;
    font-weight: 400;
}

.btn-icon {
    display: none;
}

.table-container {
    display: none;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.table-container.table-active {
    display: block;
    border-top: 1px solid var(--c-line);
}

.table-container::-webkit-scrollbar {
    background: transparent;
    height: 3px;
    width: 3px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #EAEAEA;
}

.html-result {
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: var(--c-statement-text);
    word-break: break-word;
    overflow-x: auto;
    outline: none;
    padding: 16px;
}

.html-result ::selection {
    background-color: var(--c-statement-rule);
    color: var(--c-statement-text);
}

.html-result * {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

.html-result :is(h1, h2, h3, h4, h5, h6) {
    line-height: 1.3;
}

.html-result :is(small, sub, sup) {
    font-size: 11px;
}

.html-result :is(sub, sup) {
    line-height: 0;
}

.html-result :is(code, kbd, samp, pre) {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
}

.html-result h1 {
    margin: 0 0 4px;
    padding: 12px 0 4px;
    border-bottom: 2px solid var(--c-statement-navy);
    font-size: 18px;
    font-weight: 700;
    color: var(--c-statement-navy);
}

.html-result :is(h2, h3) {
    margin: 16px 0 6px;
    padding: 6px 0;
    border-bottom: 1px solid var(--c-statement-rule);
    font-size: 15px;
    font-weight: 700;
    color: var(--c-statement-navy);
}

.html-result h3 {
    font-size: 14px;
}

.html-result :is(h4, h5, h6) {
    margin: 12px 0 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--c-statement-navy);
}

.html-result> :first-child {
    margin-top: 0;
}

.html-result p {
    margin: 6px 0;
    padding: 6px 10px;
    border-left: 3px solid var(--c-statement-rule);
    border-radius: 0 4px 4px 0;
    background-color: var(--c-statement-note);
    font-size: 12px;
    color: var(--c-statement-value);
}

.html-result p:has(> :is(strong, b):first-child) {
    margin: 0;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid var(--c-statement-dots);
    border-radius: 0;
    background: transparent;
    font-size: 13px;
    line-height: 20px;
    color: var(--c-statement-value);
}

.html-result p:has(> :is(strong, b):first-child ~ :is(strong, b)) {
    padding: 0;
    border-bottom: none;
    background: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, var(--c-statement-dots) 23px, var(--c-statement-dots) 24px);
    line-height: 24px;
}

.html-result p:has(> :is(strong, b):first-child)> :is(strong, b) {
    display: inline-block;
    min-width: 200px;
    margin-right: 8px;
    font-weight: 600;
    color: var(--c-statement-label);
}

.html-result :is(b, strong) {
    font-weight: 600;
}

.html-result :is(ul, ol, blockquote, pre) {
    margin: 0 0 12px;
}

.html-result :is(ul, ol) {
    padding-left: 18px;
}

.html-result :is(a, u, ins, s, strike, del) {
    text-decoration: revert;
}

.html-result [data-statement-scroll],
.html-result table {
    margin: 16px 0;
}

.html-result [data-statement-scroll] {
    overflow-x: auto;
}

.html-result [data-statement-scroll]::-webkit-scrollbar {
    height: 4px;
}

.html-result [data-statement-scroll]::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: var(--c-statement-rule);
}

.html-result [data-statement-scroll]>table {
    margin: 0;
}

.html-result table {
    width: 100%;
    min-width: 400px;
    border-collapse: collapse;
    border-spacing: 0;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.html-result table:has(th) {
    min-width: 560px;
}

.html-result p:has(> :is(strong, b):first-child)+ :is(h2, h3) {
    margin-top: 24px;
}

.html-result :is(h1, h2, h3, h4, h5, h6)+ :is(table, [data-statement-scroll]) {
    margin-top: 22px;
}

.html-result caption {
    caption-side: top;
    padding: 0 0 6px;
    text-align: left;
    font-weight: 700;
    color: var(--c-statement-navy);
}

.html-result th {
    padding: 8px 10px;
    border: 1px solid var(--c-statement-navy-line);
    background-color: var(--c-statement-navy);
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    text-align: left;
    white-space: nowrap;
}

.html-result td {
    padding: 6px 10px;
    border: 1px solid var(--c-statement-cell-line);
    text-align: left;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: normal;
}

.html-result :where(table:has(th) tbody tr:nth-child(even):not(:has(> td:first-child > :is(strong, b))))>td:not([colspan]) {
    background-color: var(--c-statement-row-alt);
}

.html-result :is(th, td)[data-cell="amount"] {
    text-align: right;
    white-space: nowrap;
}

.html-result td[data-cell="date"] {
    white-space: nowrap;
}

.html-result td[data-negative] {
    color: var(--c-statement-negative);
}

.html-result td[colspan] {
    background-color: var(--c-statement-navy);
    color: #ffffff;
    font-weight: 600;
}

.html-result tfoot td,
.html-result tr:has(> td:first-child > :is(strong, b)) td {
    border-top: 2px solid var(--c-statement-total-line);
    background-color: var(--c-statement-total);
    color: var(--c-statement-text);
    font-weight: 700;
}

.html-result :is(tfoot, tr:has(> td:first-child > :is(strong, b))) :is(strong, b) {
    font-weight: 700;
}

.html-result [contenteditable] {
    cursor: text;
    outline: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

.html-result a {
    color: var(--c-statement-navy);
    transition: color 0.15s ease;
}

.html-result a:hover {
    color: var(--c-statement-navy-line);
    text-decoration-thickness: 2px;
}

@media (hover: hover) {
    .html-result [contenteditable]:not(:focus):hover {
        background-color: var(--c-statement-row-hover);
    }

    .html-result tr:has(> td:first-child > :is(strong, b))>td[contenteditable]:not(:focus):hover,
    .html-result tfoot td[contenteditable]:not(:focus):hover {
        background-color: var(--c-statement-total-hover);
    }

    .html-result th[contenteditable]:not(:focus):hover,
    .html-result tr:not(:has(> td:first-child > :is(strong, b)))>td[colspan][contenteditable]:not(:focus):hover {
        background-color: var(--c-statement-navy-line);
    }
}

.html-result th[contenteditable]:not(:focus):active,
.html-result tr:not(:has(> td:first-child > :is(strong, b)))>td[colspan][contenteditable]:not(:focus):active {
    background-color: var(--c-statement-navy-line);
}

.html-result [contenteditable]:focus {
    box-shadow: inset 0 0 0 1px var(--c-statement-focus);
}

.html-result th[contenteditable]:focus,
.html-result tr:not(:has(> td:first-child > :is(strong, b)))>td[colspan][contenteditable]:focus {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6);
}

.html-result hr {
    height: 0;
    margin: 16px 0;
    border: none;
    border-top: 1px solid var(--c-statement-rule);
}

.html-result> :last-child {
    margin-bottom: 0;
}

.download-toggle-arrow {
    transition: transform 0.15s ease;
}

.download-parent.menu-open .download-toggle-arrow {
    transform: rotate(180deg);
}

.download_all_menu {
    position: absolute;
    right: 0;
    top: 36px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    background-color: #ffffff;
    gap: 4px;
    padding: 4px;
    border: 0.5px solid #EAEAEB;
    box-shadow: 0px 2px 4px -2px #0000000F, 0px 4px 8px -2px #0000001A;
    min-width: max-content;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transform-origin: top;
    pointer-events: none;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
}

.download-parent.menu-open .download_all_menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.download_all_menu button {
    padding: 6px 10px !important;
    border: none !important;
    border-radius: 6px !important;
    display: flex !important;
    justify-content: start !important;
    align-items: center !important;
    gap: 6px !important;
    background-color: #ffffff;
    font-size: 12px;
    line-height: 16px;
    color: #000000;
    width: 100% !important;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
}

.download_all_menu button:hover {
    background-color: #F4F5F5;
}

.download_all_menu button:active {
    background-color: var(--c-btn-active);
}

.download_all_menu button:focus-visible {
    outline: 2px solid var(--c-statement-focus);
    outline-offset: -2px;
}

.file-download-parent {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-download-parent .file-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.result-waiting .result-waiting-card:has(.menu-open) {
    overflow: visible;
}

.imagetotext-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 5px;
    overflow: hidden;
    border-radius: 0 0 5px 5px;
    background: var(--color-EAEAEA);
}

.imagetotext-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg,
            #fff0 2.85%,
            rgb(169 149 253/0.909375) 53.25%,
            #a28cff 100%);
    border-radius: 3px;
    animation: progress 2s linear infinite;
}

.file-preview-btn {
    min-width: 82.5px;
}

@keyframes progress {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

@media (width <=1200px) {
    .after-img-upload .images-clear {
        gap: 10px;
    }
}

@media (width <=768px) {
    .tool-area {
        flex-direction: column;
    }

    .result-waiting-card .text_not_found {
        justify-content: start;
        padding: 24px 12px;
    }

    .finshed__span {
        display: none;
    }

    .result-waiting-card .status-wrapper {
        display: none;
    }

    .result-waiting .img-title-text,
    .action_wrapper {
        flex: unset;
    }

    .btn-label {
        display: none;
    }

    .btn-icon {
        display: inline-block;
        vertical-align: middle;
    }

    :is(.file-download-btn, .file-preview-btn, .file-copy-btn) {
        padding: 8px;
        line-height: 0;
        border: none;
    }

    .file-preview-btn {
        min-width: unset;
    }

    .file-download-parent .file-download-btn {
        gap: 2px;
    }

    .download_all_menu {
        min-width: 150px;
    }

    .download_all_menu button img {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .html-result {
        padding: 12px;
    }

    .html-result p:has(> :is(strong, b):first-child)> :is(strong, b) {
        min-width: 140px;
    }
}

@media (width <=600px) {
    .result-text-download-all div button {
        padding: 6px;
    }

    .result-text-download-all div button span {
        display: none;
    }

    .selected-img-preview {
        min-height: auto;
    }
}