.fr-tool-container {
    max-width: 800px;
    margin: 20px auto 40px;
    padding: 20px 40px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.fr-title {
    text-align: center;
    margin-bottom: 15px;
    margin-top: 0;
    font-size: 24px;
    color: #333;
}

.fr-label {
    display: block;
    margin-bottom: 5px;
    font-size: 17px;
    font-weight: 500;
    color: #444;
}

.fr-editable {
    width: 100%;
    height: 200px;
    font-size: 16px;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    background: #fff;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    box-sizing: border-box;
    resize: vertical;
    overflow: auto;
}

.fr-editable:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.8px rgba(0, 123, 255, .25);
    background-color: #fff;
}

.fr-editable:empty::before {
    content: 'Enter or paste your text here...';
    color: #999;
    pointer-events: none;
    /* Prevents the placeholder from being clickable */
    display: block;
    /* Ensures it behaves correctly */
}

.fr-options {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.fr-field {
    flex: 1;
}

.fr-input {
    width: 100%;
    font-size: 16px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box;
}

.fr-editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.fr-nav-controls {
    display: flex;
    align-items: center;
    gap: 1px;
    visibility: hidden;
    /* Hide by default */
}

#fr-match-count {
    font-size: 15px;
    color: #555;
    user-select: none;
}

.fr-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: transform 0.1s ease;
}

.fr-nav-btn:hover:not(:disabled),
.fr-nav-btn:focus-visible:not(:disabled) {
    background-color: transparent;
}

.fr-nav-btn:focus {
    background-color: transparent;
}

.fr-nav-btn:active:not(:disabled) {
    transform: scale(0.9);
}

/* --- Override Theme Styles for Inputs --- */
.fr-tool-container input[type="text"].fr-input,
.fr-tool-container input[type="text"].fr-input:hover,
.fr-tool-container input[type="text"].fr-input:active,
.fr-tool-container input[type="text"].fr-input:focus {
    background-color: #fff;
    border-radius: 5px;
    outline: none;
    box-shadow: none;
    border: 1px solid #ccc;
}

.fr-tool-container input[type="text"].fr-input:focus {
    border-color: #80bdff;
    box-shadow: 0 0 0 0.8px rgba(0, 123, 255, .25);
}

/* --- End Override --- */

.fr-nav-btn svg {
    width: 22px;
    height: 22px;
    fill: #555;
}

.fr-nav-btn:disabled {
    cursor: not-allowed;
}

.fr-nav-btn:disabled svg {
    fill: #bbb;
}


.fr-error-msg {
    color: #d93025;
    font-size: 14px;
    margin-top: 5px;
}

.fr-error-msg:not(:empty) {
    min-height: 1em;
    /* Reserve space only when there is a message */
}

.fr-options-container {
    margin-bottom: 15px;
}

.fr-options-toggle-btn {
    display: none;
    /* Hidden by default, shown on mobile */
    width: 100%;
    padding: 10px;
    font-size: 16px;
    text-align: left;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
}

.fr-arrow-icon {
    width: 20px;
    height: 20px;
    transition: transform 0.3s ease;
}

.fr-options-toggle-btn[aria-expanded="true"] .fr-arrow-icon {
    transform: rotate(180deg);
}

.fr-checkboxes {
    margin-bottom: 15px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.fr-checkboxes label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px;
}

.fr-checkboxes input[type="checkbox"] {
    width: 15px;
    height: 15px;
    margin: 0 6px 0 0;
    /* Reset all margins and set right margin */
    flex-shrink: 0;
    /* Prevent checkbox from shrinking */
}

.fr-buttons {
    text-align: center;
    margin-bottom: 0;
}

.fr-btn {
    padding: 8px 12px;
    margin: 3px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    border-radius: 5px;
    background: #1371d6;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s, transform 0.1s ease;
}

.fr-btn:hover,
.fr-btn:focus {
    background: #1371d6;
    /* Keep background color consistent */
    outline: none;
    /* Remove focus outline */
    box-shadow: none;
    /* Remove any theme-added shadow */
}

.fr-btn:active {
    transform: scale(0.97);
    /* Add zoom-in effect on click */
}

.fr-btn:disabled {
    background-color: #f0f0f0;
    color: #4c4c4c;
    cursor: not-allowed;
}

.fr-btn:disabled:hover {
    background-color: #f0f0f0;
    color: #4c4c4c;
    box-shadow: none;
    transform: none;
}

.fr-spinner,
.fr-download-text {
    vertical-align: middle;
}

.fr-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: fr-spin 1s ease-in-out infinite;
}

.fr-download-text {
    margin-left: 8px;
}

@keyframes fr-spin {
    to {
        transform: rotate(360deg);
    }
}

.fr-highlight {
    background: yellow;
    color: black;
}

.fr-highlight-current {
    background: #ffab70;
    color: black;
}

.faq-list {
    margin-top: 1rem;
}

.faq-list dt {
    font-weight: 500;
    font-size: 1.1em;
}

.faq-list dd {
    margin-left: 0;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    padding-left: 1rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed #ddd;
}

.fr-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.fr-info-table {
    width: 80%;
    border-collapse: collapse;
    min-width: 600px;
    /* Ensure table has a minimum width to scroll */
}

.fr-info-table th,
.fr-info-table td {
    border: 1px solid #ccc;
    padding: 8px;
    text-align: left;
    vertical-align: middle;
}

.fr-info-table .fr-table-center {
    text-align: center;
}

@media (max-width: 700px) {
    .fr-tool-container {
        margin: 0 0 40px 0;
        padding: 20px 0;
        border-radius: 0;
        box-shadow: none;
        border-top: 1px solid #e0e0e0;
        border-bottom: 1px solid #e0e0e0;
    }

    .fr-options-toggle-btn {
        display: flex;
        color: #444;
    }

    .fr-options-toggle-btn:focus,
    .fr-options-toggle-btn:hover,
    .fr-options-toggle-btn:active {
        background-color: #f7f7f7;
        color: #444;
        outline: none;
        box-shadow: none;
    }

    .fr-checkboxes {
        display: block;
        /* Stack checkboxes vertically */
        max-height: 0;
        overflow: hidden;
        padding: 0 10px;
        margin: 0;
        border: none;
        transition: max-height 0.3s ease-out, padding 0.3s ease-out;
    }

    .fr-checkboxes.open {
        max-height: 500px;
        /* Large enough to show all options */
        padding: 15px 10px 0 10px;
        border: 1px solid #ddd;
        border-top: none;
        border-radius: 0 0 5px 5px;
    }

    .fr-checkboxes label {
        margin-bottom: 12px;
    }

    .fr-options {
        flex-direction: column;
        gap: 10px;
    }

    .fr-btn {
        margin: 5px;
    }

    .fr-checkboxes input[type="checkbox"] {
        width: 17px;
        height: 17px;
    }

    .fr-input {
        padding: 10px 8px;
    }

    .fr-info-table {
        width: 100%;
    }
    
    .fr-buttons {
        margin-bottom: 10px;
    }
}