.textract-wrap {
    font-family: 'Gowun Dodum', sans-serif;
    width: 100%;
    max-width: 1400px;
    background-color: #859a85;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    gap: 16px;
    min-height: 100vh;
    box-sizing: border-box;
}

.textract-card,
.textract-list-card {
    background: #fff;
    border: 1px solid #e8ebf2;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.05);
}

.textract-title {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.25;
    color: #1f2937;
}

.textract-desc {
    margin: 0 0 14px;
    color: #4b5563;
    font-size: 15px;
}

.textract-tabs {
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
    
}

.textract-tab {
    border: 1px solid #d1d5db;
    background: #f7f7f9;
    color: #374151;
    border-radius: 20px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.textract-tab.active {
    background: #4c5a64;
    color: #fff;
    border-color: #4c5a64;
}

.textract-tab-panel {
    display: none;
}

.textract-tab-panel.active {
    display: block;
}

.textract-input-group {
    display: grid;
    gap: 10px;
}

.textract-input-label {
    color: #374151;
    font-size: 14px;
    font-weight: 700;
}

.textract-input {
    width: 100%;
    border: 1px solid #d1d5db;
    border-radius: 25px;
    padding: 12px 14px;
    font-size: 14px;
    background: #fbf9f7;
    box-sizing: border-box;
}

.textract-file-input-proxy {
    cursor: pointer;
}

.textract-file-input-proxy.dragover {
    border-color: #324a9e;
    background: #eef2ff;
    box-shadow: 0 0 0 3px rgba(50, 74, 158, 0.12);
}

.textract-hidden-file-input {
    display: none;
}

.textract-input::placeholder {
    color: #a8b0b7;
}

.textract-action-row {
    display: flex;
    justify-content: flex-end;
}

.textract-file-action-row {
    justify-content: flex-end;
    gap: 8px;
}

.textract-file-action-row .textract-btn {
    min-width: 124px;
}

.textract-file-action-row #textract-file-manual-btn {
    background: #324a9e;
}

.textract-file-action-row #textract-file-manual-btn:hover {
    background: #2a3f86;
}

.textract-btn {
    border: 0;
    border-radius: 20px;
    background: #d36c4f;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    padding: 10px 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.textract-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.textract-status {
    min-height: 18px;
    font-size: 13px;
    color: #4b5563;
}

.textract-progress {
    display: none;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}

.textract-progress.show {
    display: block;
}

.textract-progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #d36c4f 0%, #f09a78 100%);
    transition: width 0.25s ease;
}

.textract-status.error {
    color: #b91c1c;
}

.textract-status.success {
    color: #065f46;
}

.textract-under-construction {
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #6b7280;
    background: #fafafa;
}

.textract-box-title {
    margin: 0 0 12px;
    font-size: 18px;
    color: #1f2937;
}

.textract-link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, auto));
    gap: 8px;
}

.textract-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    min-height: 24px;
    background: #5189bc;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 12px;
    padding: 4px 8px;
    text-align: center;
    transition: all 0.2s ease;
}

.textract-link-btn:hover {
    background: #0e5496;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.textract-list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.textract-list-title {
    margin: 0;
    font-size: 20px;
    color: #111827;
    flex: 1;
    min-width: 0;
}

.textract-list-limit-hint {
    font-size: 12px;
    color: #6b7280;
}

.textract-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 10px;
}

.textract-list-empty {
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    padding: 14px;
    text-align: center;
    color: #6b7280;
    background: #fafafa;
}

.textract-item {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fbf9f7;
    padding: 12px;
    display: grid;
    gap: 8px;
}

.textract-item-top {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
}

.textract-check {
    width: 16px;
    height: 16px;
    margin: 2px 0 0;
    cursor: pointer;
    accent-color: #d36c4f;
}

.textract-item-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    word-break: break-word;
}

.textract-item-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.textract-item-source-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    display: block;
}

.textract-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: #6b7280;
}

.textract-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.textract-inline-link,
.textract-inline-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 12px;
    text-decoration: none;
}

.textract-inline-link {
    background: #e8eef6;
    color: #334155;
}

.textract-inline-btn {
    background: #647893;
    color: #fff;
}

.textract-pagination {
    margin-top: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.textract-page-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 8px;
    min-width: 36px;
    height: 34px;
    cursor: pointer;
    font-weight: 700;
}

.textract-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.textract-page-info {
    min-width: 72px;
    text-align: center;
    font-size: 13px;
    color: #334155;
    font-weight: 700;
}

.txm-modal {
    position: fixed;
    inset: 0;
    z-index: 1800;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.txm-modal.open {
    display: flex;
}

.txm-modal-content {
    width: min(95vw, 1400px);
    height: min(92vh, 920px);
    background: #fff;
    border: 1px solid #dce3eb;
    border-radius: 12px;
    display: grid;
    grid-template-rows: auto 1fr;
    overflow: hidden;
}

.txm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e6ebf1;
    padding: 12px 14px;
}

.txm-title {
    margin: 0;
    font-size: 18px;
    color: #253140;
}

.txm-close-btn {
    border: 0;
    background: transparent;
    color: #394959;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

.txm-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 250px;
    gap: 16px;
    overflow: hidden;
    padding: 12px;
    box-sizing: border-box;
}

.txm-pages {
    overflow: auto;
    padding-right: 6px;
}

.txm-page-card {
    border: 1px solid #e5ebf1;
    border-radius: 12px;
    background: #fff;
    margin-bottom: 14px;
    padding: 10px;
}

.txm-page-head {
    text-align: center;
    margin-bottom: 10px;
    color: #46525f;
    font-size: 13px;
    font-weight: 700;
}

.txm-page-overlay-wrap {
    position: relative;
    width: 90%;
    margin: 0 auto;
    border: 1px solid #dce3eb;
    border-radius: 8px;
    overflow: hidden;
    background: #f8fafc;
    user-select: none;
}

.txm-page-image {
    display: block;
    width: 100%;
    height: auto;
}

.txm-overlay-layer {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.txm-overlay-box {
    position: absolute;
    border: 1.5px solid transparent;
    background: transparent;
    pointer-events: none;
    cursor: pointer;
    transition: border-color 0.12s ease, background-color 0.12s ease;
}

.mode-select .txm-overlay-box {
    pointer-events: none;
    z-index: 1;
}

.mode-select .txm-overlay-box.kind-text {
    pointer-events: auto;
    border-color: rgba(0, 0, 0, 0.1);
    z-index: 2;
}

.mode-select .txm-overlay-box.kind-image,
.mode-select .txm-overlay-box.kind-vector {
    border-color: rgba(107, 114, 128, 0.18);
    background: rgba(148, 163, 184, 0.08);
}

.mode-select .txm-overlay-box.kind-text:hover {
    border-color: #5f7ea3;
    background: rgba(95, 126, 163, 0.12);
    z-index: 3;
}

.txm-overlay-box.selected {
    border-color: #1f5ea6 !important;
    background: rgba(31, 94, 166, 0.2) !important;
    z-index: 3;
}

.txm-overlay-box.captured {
    border-color: #f3d27a;
    background: rgba(255, 235, 181, 0.45);
    z-index: 1;
}

.txm-overlay-order {
    position: absolute;
    top: -17px;
    left: 0;
    background: #1f5ea6;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 6px;
    display: none;
    white-space: nowrap;
}

.txm-overlay-box.selected .txm-overlay-order {
    display: inline-block;
}

.txm-right-panel {
    position: sticky;
    top: 0;
    border: 1px solid #e5ebf1;
    border-radius: 12px;
    padding: 12px;
    background: #fff;
    overflow: auto;
    max-height: 100%;
}

.txm-tool-btn {
    width: 100%;
    border-radius: 10px;
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    margin-bottom: 8px;
    border: 1px solid #567091;
    background: #5f7ea3;
    color: #fff;
    cursor: pointer;
}

.txm-tool-btn.active {
    background: #fff;
    color: #5f7ea3;
    border-color: #567091;
}

.txm-tool-actions {
    width: 100%;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.txm-mini-btn {
    flex: 1 1 0;
    border-radius: 8px;
    padding: 0.34rem 0.4rem;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.1;
    cursor: pointer;
}

.txm-clear-btn {
    border: 1px solid #dc3545;
    color: #dc3545;
    background: #fff;
}

.txm-close-mini-btn {
    border: 1px solid #6c757d;
    color: #6c757d;
    background: #fff;
}

.txm-save-btn {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #a44200;
    background: #a44200;
    color: #fff;
    font-weight: 700;
    padding: 9px 10px;
    cursor: pointer;
    margin-bottom: 10px;
}

.txm-capture-head {
    margin: 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.txm-capture-label {
    font-size: 14px;
    font-weight: 700;
    color: #111;
}

.txm-select-all-wrap {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.txm-select-all-text {
    font-size: 12px;
    color: #111;
    font-weight: 600;
}

.txm-select-all-checkbox {
    width: 13px;
    height: 13px;
    accent-color: #4c5a64;
    cursor: pointer;
}

.txm-save-btn:disabled,
.txm-mini-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.txm-capture-list {
    display: grid;
    gap: 8px;
    padding-bottom: 50px;
}

.txm-capture-item {
    border: 1px solid #d9e1e8;
    border-radius: 8px;
    padding: 8px;
    background: #fafcfe;
}

.txm-capture-item.is-picked {
    background: #f8f7f2;
    border-color: #e2d9c9;
}

.txm-capture-top {
    font-size: 12px;
    font-weight: 700;
    color: #37444f;
    margin-bottom: 6px;
}

.txm-capture-preview {
    font-size: 12px;
    color: #45535f;
    margin-bottom: 8px;
    line-height: 1.45;
    word-break: break-word;
}

.txm-capture-actions {
    display: flex;
    gap: 6px;
}

.txm-capture-btn {
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid #4c5a64;
    background: #4c5a64;
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.txm-capture-btn .material-icons-outlined {
    font-size: 15px;
    line-height: 1;
}

.txm-capture-delete-btn {
    font-size: 12px;
    font-weight: 700;
    border-radius: 8px;
    padding: 6px 8px;
    border: 1px solid #dc3545;
    background: #fff;
    color: #dc3545;
    cursor: pointer;
}

.txm-empty {
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    color: #6b7280;
    background: #fafafa;
    font-size: 12px;
}

.txv-wrap {
    font-family: 'Gowun Dodum', sans-serif;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 32px 20px 48px;
    box-sizing: border-box;
}

.txv-card {
    background: #fff;
    border: 1px solid #e8ebf2;
    border-radius: 14px;
    padding: 20px;
    box-shadow: 0 6px 20px rgba(16, 24, 40, 0.05);
}

.txv-title {
    margin: 0 0 8px;
    color: #111827;
    font-size: 26px;
    line-height: 1.3;
    word-break: break-word;
}

.txv-head-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.txv-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.txv-meta {
    color: #6b7280;
    font-size: 12px;
}

.txv-source-link {
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.txv-pagebar {
    margin-top: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    width: 100%;
}

.txv-pagebar-controls {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.txv-page-btn {
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    color: #334155;
    border-radius: 7px;
    min-width: 30px;
    height: 28px;
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    line-height: 1;
}

.txv-page-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.txv-page-info {
    min-width: 80px;
    text-align: center;
    font-size: 13px;
    color: #334155;
    font-weight: 700;
}

.txv-page-numbers {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
}

.txv-page-num-btn {
    min-width: 28px;
    padding: 0 6px;
}

.txv-page-num-btn.active {
    background: #4c5a64;
    color: #fff;
    border-color: #4c5a64;
}

.txv-pagebar-top {
    margin-bottom: 4px;
}

.txv-close-btn {
    margin-left: auto;
    white-space: nowrap;
}

.txv-blocks {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.txv-block {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fbf9f7;
    padding: 12px;
}

.txv-block-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-bottom: 8px;
}

.txv-copy-btn {
    border: 1px solid #d1d5db;
    background: #fff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 700;
    color: #374151;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.txv-copy-icon {
    width: 14px;
    height: 14px;
    display: block;
}

.txv-copy-msg {
    min-width: 110px;
    font-size: 11px;
    color: #065f46;
    text-align: right;
}

.txv-block-heading {
    margin: 0 0 8px;
    color: #1f2937;
    font-size: 18px;
}

.txv-block-body {
    color: #111827;
    font-size: 14px;
    line-height: 1.7;
    word-break: break-word;
}

.txv-page-piece-sep {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed #e5e7eb;
}

@media (min-width: 767.9px) {

    .textract-wrap {
        width: 90%
    }
}


@media (max-width: 768px) {
    .textract-wrap {
        padding: 24px 12px;
    }

    .textract-card,
    .textract-list-card {
        padding: 16px;
    }

    .textract-title {
        font-size: 24px;
    }

   
    .txv-wrap {
        padding: 20px 12px 32px;
    }

    .txv-card {
        padding: 16px;
    }

    .txv-title {
        font-size: 22px;
    }

    .txv-block-tools {
        justify-content: space-between;
        flex-wrap: wrap;
    }

    .txv-pagebar {
        align-items: stretch;
    }

    .txv-pagebar-controls {
        width: 100%;
        justify-content: center;
    }

    .txv-close-btn {
        margin-left: auto;
    }

    .txm-modal {
        padding: 10px;
    }

    .txm-body {
        grid-template-columns: 1fr;
    }

    .txm-right-panel {
        max-height: 42vh;
    }
}
