/* Base styles for the accessibility widget */
#kjc-accessibility-widget {
    position: fixed;
    top: 7%;
    right: -405px;
    z-index: 99999;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    transition: right 0.3s ease-in-out;
    height: 90vh; /* Added: sets popup height to 75% of viewport */
    overflow-y: auto; /* Added: allows scrolling if content exceeds height */
}
#kjc-accessibility-widget.is-open {
    right: 30px;
}

/* Hide the original toggle button */
#kjc-accessibility-toggle {
    display: none !important;
}

#kjc-accessibility-panel {
    padding: 20px;
    width: 400px;
}

#kjc-accessibility-panel h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 16px;
    margin-bottom: 10px;
}

/* Labels with enforced font colour and bold */
.kjc-setting label {
    display: block;
    margin-bottom: 5px;
    font-size: 14px;
    font-weight: bold;
    color: #154734 !important;
}

/* Sections spacing */
.kjc-setting {
    margin-bottom: 15px;
}

/* Buttons styling */
.kjc-setting button,
.kjc-setting select {
    width: 100%;
    padding: 5px;
    margin-bottom: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    color: #154734;
}

/* Font Awesome or SVG icons inside buttons */
.kjc-setting button i,
.kjc-setting button svg {
    color: #154734;
    fill: #154734;
}

/* Hover state */
.kjc-setting button:hover,
.kjc-setting select:hover {
    background-color: #efefef;
}

/* Active state */
.kjc-setting button.is-active {
    background-color: rgba(221, 203, 164, 0.3);
    color: #154734;
    border-color: #ddcba4;
    font-weight: bold;
}
.kjc-setting button.is-active i,
.kjc-setting button.is-active svg {
    color: #154734;
    fill: #154734;
}

/* Font size buttons */
.kjc-font-size-btn {
    width: 48%;
    display: inline-block;
    padding: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #154734;
    margin-bottom: 5px;
}
.kjc-font-size-btn:first-of-type {
    margin-right: 2%;
}

/* Close button with icon styling */
.kjc-close-button {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 25px;
    color: #154734;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

/* Font size levels */
.kjc-text-level-1 p, .kjc-text-level-1 li, .kjc-text-level-1 {
    font-size: 1.1em !important;
}
.kjc-text-level-2 p, .kjc-text-level-2 li, .kjc-text-level-2 {
    font-size: 1.2em !important;
}
.kjc-text-level-3 p, .kjc-text-level-3 li, .kjc-text-level-3 {
    font-size: 1.3em !important;
}
.kjc-text-level--1 p, .kjc-text-level--1 li, .kjc-text-level--1 {
    font-size: 0.9em !important;
}
.kjc-text-level--2 p, .kjc-text-level--2 li, .kjc-text-level--2 {
    font-size: 0.8em !important;
}
.kjc-text-level--3 p, .kjc-text-level--3 li, .kjc-text-level--3 {
    font-size: 0.7em !important;
}

/* Content adjustments */
body.kjc-bigger-line-height p, body.kjc-bigger-line-height li {
    line-height: 1.8;
}

body.kjc-readable-font {
    font-family: serif !important;
}

body.kjc-text-align-justify {
    text-align: justify;
}

body.kjc-hide-images img {
    display: none !important;
}

/* Reading guide mask */
#kjc-reading-guide {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.1);
    pointer-events: none;
    z-index: 99998;
    display: none;
}

/* Accessibility Settings heading and icon */
#kjc-accessibility-panel h4 {
    margin-top: 0;
    color: #154734;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
    font-size: 16pt;
    margin-bottom: 10px;
    font-weight: bold;
    letter-spacing: 0em;
}

#kjc-accessibility-panel h4 i {
    color: #154734;
}

/* Close button icon in red */
.kjc-close-button i {
    color: #154734;
    font-size: 18px;
}
.kjc-close-button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #154734;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}
