:root {
    --jat-font-scale: 1;
    --jat-panel-bg: #ffffff;
    --jat-panel-text: #151515;
    --jat-border: #d9d9d9;
    --jat-accent: #111111;
    --jat-accent-text: #ffffff;
    --jat-focus: #005fcc;
    --jat-shadow: 0 18px 45px rgba(0, 0, 0, 0.2);
}

.jat-shortcode-wrap,
.jat-shortcode-wrap * {
    box-sizing: border-box;
}

.jat-shortcode-wrap {
    position: relative;
    display: inline-block;
    font-size: 16px;
    line-height: 1.4;
    text-align: left;
    z-index: 9998;
}

.jat-launcher,
.jat-close,
.jat-control,
.jat-reset {
    font: inherit;
}

.jat-launcher {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    min-height: 44px;
    padding: 0.7rem 1rem;
    border: 2px solid var(--jat-accent);
    border-radius: 6px;
    background: var(--jat-accent);
    color: var(--jat-accent-text);
    cursor: pointer;
}

.jat-launcher:hover {
    filter: brightness(1.08);
}


/* Plain text launcher. It remains a semantic button because it opens a dialog,
   but is visually presented like a normal text link. */
.jat-shortcode-wrap .jat-launcher--link,
.jat-shortcode-wrap .jat-launcher--link:hover,
.jat-shortcode-wrap .jat-launcher--link:focus,
.jat-shortcode-wrap .jat-launcher--link:active {
    display: inline;
    min-height: 0;
    padding: 0;
    border: 0 !important;
    border-radius: 0;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    filter: none;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.16em;
}

.jat-shortcode-wrap .jat-launcher--link:hover {
    text-decoration-thickness: 2px;
}

/* When trigger_id is supplied the external Elementor/theme element is used
   instead. If the target ID cannot be found, JavaScript removes this class and
   the normal launcher becomes visible as a fallback. */
.jat-launcher--external {
    display: none !important;
}

.jat-launcher__icon {
    display: inline-grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border: 2px solid currentColor;
    border-radius: 50%;
    font-weight: 700;
    line-height: 1;
}

.jat-launcher:focus-visible,
.jat-close:focus-visible,
.jat-control:focus-visible,
.jat-reset:focus-visible {
    outline: 3px solid var(--jat-focus);
    outline-offset: 3px;
}

.jat-panel {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: min(390px, calc(100vw - 32px));
    max-height: min(680px, calc(100vh - 32px));
    overflow: auto;
    border: 1px solid var(--jat-border);
    border-radius: 10px;
    background: var(--jat-panel-bg);
    color: var(--jat-panel-text);
    box-shadow: var(--jat-shadow);
}

.jat-panel[hidden] {
    display: none !important;
}


.jat-panel.jat-panel--external {
    position: fixed;
    z-index: 2147483642;
    margin: 0;
}

.jat-panel__header {
    position: sticky;
    top: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1rem 0.9rem;
    border-bottom: 1px solid var(--jat-border);
    background: var(--jat-panel-bg);
}

.jat-panel__title,
.jat-control-group__title {
    margin: 0;
    color: inherit;
    font-family: inherit;
    text-transform: none;
    letter-spacing: normal;
}

.jat-panel__title {
    font-size: 1.15rem;
    line-height: 1.3;
}

.jat-control-group__title {
    margin-bottom: 0.6rem;
    font-size: 0.95rem;
}

.jat-shortcode-wrap .jat-close,
.jat-shortcode-wrap .jat-close:hover,
.jat-shortcode-wrap .jat-close:focus,
.jat-shortcode-wrap .jat-close:active {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0 !important;
    border: 1px solid var(--jat-border) !important;
    border-radius: 50% !important;
    background: #ffffff !important;
    color: #111111 !important;
    cursor: pointer;
    box-shadow: none !important;
    filter: none !important;
    -webkit-appearance: none;
    appearance: none;
}

/* Draw the close icon instead of relying on a text glyph. This prevents
   theme/Elementor button typography rules from hiding the icon. */
.jat-close > span {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.jat-close::before,
.jat-close::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: #111111 !important;
    pointer-events: none;
    transform-origin: center;
}

.jat-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.jat-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.jat-panel__body {
    padding: 1rem;
}

.jat-control-group {
    margin-bottom: 1rem;
}

.jat-stepper {
    display: grid;
    grid-template-columns: 1fr minmax(72px, auto) 1fr;
    gap: 0.5rem;
    align-items: center;
}

.jat-stepper__value {
    text-align: center;
    font-weight: 700;
}

.jat-control-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.jat-shortcode-wrap .jat-control {
    min-height: 48px;
    padding: 0.75rem;
    border: 1px solid var(--jat-border) !important;
    border-radius: 6px;
    background: #ffffff !important;
    color: #151515 !important;
    cursor: pointer;
    font-weight: 600;
    box-shadow: none !important;
    -webkit-appearance: none;
    appearance: none;
}

.jat-control--toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 0.35rem;
    min-height: 82px;
    text-align: left;
}

.jat-shortcode-wrap .jat-control:hover,
.jat-shortcode-wrap .jat-control:focus,
.jat-shortcode-wrap .jat-control:focus-visible,
.jat-shortcode-wrap .jat-control:active {
    border-color: #777777 !important;
    background: #ffffff !important;
    color: #151515 !important;
}

/* Toggle controls use a persistent filled state when enabled. The higher
   specificity and !important values prevent theme/Elementor button styles
   from turning focused or selected controls white. */
.jat-shortcode-wrap .jat-control--toggle.is-active,
.jat-shortcode-wrap .jat-control--toggle[aria-pressed="true"],
.jat-shortcode-wrap .jat-control--toggle.is-active:hover,
.jat-shortcode-wrap .jat-control--toggle[aria-pressed="true"]:hover,
.jat-shortcode-wrap .jat-control--toggle.is-active:focus,
.jat-shortcode-wrap .jat-control--toggle[aria-pressed="true"]:focus,
.jat-shortcode-wrap .jat-control--toggle.is-active:focus-visible,
.jat-shortcode-wrap .jat-control--toggle[aria-pressed="true"]:focus-visible,
.jat-shortcode-wrap .jat-control--toggle.is-active:active,
.jat-shortcode-wrap .jat-control--toggle[aria-pressed="true"]:active {
    border-color: var(--jat-accent) !important;
    background: var(--jat-accent) !important;
    color: var(--jat-accent-text) !important;
}

.jat-control__icon {
    font-size: 1.2rem;
    line-height: 1;
}

.jat-reset {
    width: 100%;
    min-height: 44px;
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border: 1px solid var(--jat-border);
    border-radius: 6px;
    background: #f4f4f4;
    color: #151515;
    cursor: pointer;
    font-weight: 600;
}

/* Text resizing is applied by JavaScript to rendered text-bearing elements.
   This works with themes and page builders that use fixed px font sizes. */

html.jat-readable-font body,
html.jat-readable-font body *:not(code):not(pre):not(kbd):not(samp) {
    font-family: Verdana, Arial, sans-serif !important;
}

html.jat-text-spacing body *:not(script):not(style):not(svg):not(path) {
    letter-spacing: 0.08em !important;
    word-spacing: 0.16em !important;
    line-height: 1.7 !important;
}

html.jat-highlight-links a:not(.jat-launcher) {
    text-decoration: underline !important;
    text-decoration-thickness: 3px !important;
    text-underline-offset: 0.2em !important;
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

html.jat-highlight-headings h1,
html.jat-highlight-headings h2,
html.jat-highlight-headings h3,
html.jat-highlight-headings h4,
html.jat-highlight-headings h5,
html.jat-highlight-headings h6 {
    outline: 3px solid currentColor !important;
    outline-offset: 4px !important;
}

html.jat-bold-text body :is(p, li, dd, dt, blockquote, figcaption, label, legend, td, th, summary, a, button, input, textarea, select) {
    font-weight: 700 !important;
}

html.jat-greyscale body {
    filter: grayscale(1) !important;
}

/* Enhanced contrast keeps the site's design and colour relationships intact rather
   than forcing every section to black. It increases rendered contrast, removes
   low-contrast text effects and makes interactive controls easier to identify. */
html.jat-contrast body {
    filter: contrast(1.35) saturate(1.05) !important;
}

html.jat-contrast body :is(p, li, dd, dt, blockquote, h1, h2, h3, h4, h5, h6, label, legend, td, th) {
    text-shadow: none !important;
}

html.jat-contrast body a:not(.jat-launcher) {
    text-decoration-line: underline !important;
    text-decoration-thickness: max(2px, 0.12em) !important;
    text-underline-offset: 0.15em !important;
}

html.jat-contrast body :is(button, input, select, textarea, [role="button"]) {
    outline: 2px solid currentColor !important;
    outline-offset: 2px !important;
}

/* Do not apply the page contrast filter a second time inside the toolkit UI. */
html.jat-contrast .jat-shortcode-wrap {
    filter: contrast(0.74075) saturate(0.9524) !important;
}

html.jat-pause-motion *,
html.jat-pause-motion *::before,
html.jat-pause-motion *::after {
    animation-delay: -0.0001s !important;
    animation-duration: 0.0001s !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.0001s !important;
}

html.jat-large-cursor body,
html.jat-large-cursor body * {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='44' viewBox='0 0 36 44'%3E%3Cpath d='M3 2v31l8-7 6 15 7-3-6-14h11L3 2z' fill='white' stroke='black' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 3 2, auto !important;
}

html.jat-large-cursor a,
html.jat-large-cursor button,
html.jat-large-cursor [role="button"],
html.jat-large-cursor input[type="button"],
html.jat-large-cursor input[type="submit"],
html.jat-large-cursor label,
html.jat-large-cursor select {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='44' viewBox='0 0 38 44'%3E%3Cpath d='M12 3v18l-4-5-5 4 11 16c2 3 5 5 9 5h2c6 0 10-5 10-11V18c0-3-4-4-6-2-1-4-6-4-8-1-2-3-6-2-7 1V3c0-4-6-4-6 0z' fill='white' stroke='black' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") 12 3, pointer !important;
}

.jat-reading-ruler {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 2147483644;
    width: 100%;
    height: 36px;
    border-top: 3px solid #111111;
    border-bottom: 3px solid #111111;
    background: rgba(255, 255, 0, 0.18);
    pointer-events: none;
    will-change: transform;
}

.jat-screen-mask {
    position: fixed;
    left: 0;
    z-index: 2147483643;
    width: 100%;
    background: rgba(0, 0, 0, 0.72);
    pointer-events: none;
}

.jat-screen-mask--top {
    top: 0;
}

.jat-screen-mask--bottom {
    bottom: 0;
}

@media (max-width: 600px) {
    .jat-panel {
        position: fixed;
        top: 16px;
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
        max-height: none;
    }

    .jat-control-grid {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .jat-shortcode-wrap *,
    .jat-shortcode-wrap *::before,
    .jat-shortcode-wrap *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
    }
}
