/* ==========================================================================
   PRO LEVEL - i18n layer
   1. Premium language switcher (light theme, matches platform design tokens)
   2. Global RTL support (Arabic)
   3. Locale typography (Arabic / CJK)
   Loaded last so it can win over the theme without !important spam.
   ========================================================================== */

:root {
    --pl-lang-surface: #ffffff;
    --pl-lang-surface-soft: #f2f5f7;
    --pl-lang-surface-strong: #e9eef1;
    --pl-lang-ink: #0f1720;
    --pl-lang-text: #243244;
    --pl-lang-muted: #607084;
    --pl-lang-border: #dce4e9;
    --pl-lang-border-strong: #c9d4dc;
    --pl-lang-lime: #b7ff00;
    --pl-lang-lime-2: #d9ff63;
    --pl-lang-lime-dark: #527900;
    --pl-lang-lime-soft: rgba(183, 255, 0, .16);
    --pl-lang-radius: 16px;
    --pl-lang-radius-sm: 12px;
    --pl-lang-shadow: 0 30px 90px rgba(12, 20, 32, .16), 0 8px 24px rgba(12, 20, 32, .08);
    --pl-lang-focus: 0 0 0 4px rgba(156, 255, 0, .28);
    --pl-lang-ease: cubic-bezier(.16, 1, .3, 1);
}

/* --------------------------------------------------------------------------
   1. Switcher shell
   -------------------------------------------------------------------------- */

.pl-lang {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
    max-width: 100%;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* Trigger: white glass pill with monogram chip -------------------------- */

.pl-lang-trigger {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 40px;
    padding: 5px 12px 5px 5px;
    border: 1px solid var(--pl-lang-border);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff, #f7fafb);
    color: var(--pl-lang-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .01em;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(12, 20, 32, .06);
    transition: border-color 180ms var(--pl-lang-ease),
                box-shadow 180ms var(--pl-lang-ease),
                transform 180ms var(--pl-lang-ease);
}

.pl-lang-trigger:hover {
    border-color: var(--pl-lang-border-strong);
    box-shadow: 0 6px 18px rgba(12, 20, 32, .10);
    transform: translateY(-1px);
}

.pl-lang-trigger:focus-visible {
    outline: none;
    box-shadow: var(--pl-lang-focus);
    border-color: var(--pl-lang-lime);
}

.pl-lang.is-open .pl-lang-trigger {
    border-color: var(--pl-lang-lime);
    box-shadow: var(--pl-lang-focus);
}

/* Monogram chip: replaces emoji flags, renders identically everywhere --- */

.pl-lang-flag {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: linear-gradient(140deg, var(--pl-lang-lime), var(--pl-lang-lime-2));
    color: #16240a;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: inset 0 0 0 1px rgba(12, 20, 32, .08);
    user-select: none;
}

.pl-lang-trigger-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.12;
    text-align: start;
}

.pl-lang-name { font-size: 13px; font-weight: 800; color: var(--pl-lang-ink); }

.pl-lang-code {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--pl-lang-muted);
}

.pl-lang-chevron {
    width: 15px;
    height: 15px;
    color: var(--pl-lang-muted);
    transition: transform 220ms var(--pl-lang-ease), color 180ms;
}

.pl-lang.is-open .pl-lang-chevron { transform: rotate(180deg); color: var(--pl-lang-ink); }

/* --------------------------------------------------------------------------
   2. Panel: elevated light card
   -------------------------------------------------------------------------- */

.pl-lang-panel {
    box-sizing: border-box;
    position: absolute;
    top: calc(100% + 10px);
    inset-inline-end: 0;
    z-index: 460;
    width: min(860px, calc(100vw - 32px));
    max-height: min(680px, 82vh);
    display: flex;
    flex-direction: column;
    border: 1px solid var(--pl-lang-border);
    border-radius: var(--pl-lang-radius);
    background: rgba(255, 255, 255, .96);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    backdrop-filter: blur(20px) saturate(1.4);
    box-shadow: var(--pl-lang-shadow);
    overflow: hidden;
    opacity: 0;
    transform: translateY(-6px) scale(.97);
    transform-origin: top right;
    transition: opacity 200ms var(--pl-lang-ease), transform 240ms var(--pl-lang-ease);
    pointer-events: none;
}

.pl-lang-panel::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--pl-lang-lime), var(--pl-lang-lime-2) 55%, transparent);
    opacity: .9;
    pointer-events: none;
}

.pl-lang.is-open .pl-lang-panel {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.pl-lang-panel[hidden] { display: none; }

.pl-lang-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px 10px;
}

.pl-lang-panel-title {
    display: block;
    margin-top: 3px;
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -.025em;
    color: var(--pl-lang-ink);
}

.pl-lang-panel-kicker {
    display: block;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--pl-lang-lime-dark);
}

.pl-lang-close {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: 1px solid var(--pl-lang-border);
    border-radius: 999px;
    background: var(--pl-lang-surface);
    color: var(--pl-lang-muted);
    cursor: pointer;
    transition: color 150ms, border-color 150ms, background 150ms;
}

.pl-lang-close:hover { color: var(--pl-lang-ink); border-color: var(--pl-lang-border-strong); }
.pl-lang-close svg { width: 14px; height: 14px; }

/* Fast access ------------------------------------------------------------ */

.pl-lang-quick {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 6px;
    padding: 4px 22px 12px;
}

.pl-lang-quick-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    border: 1px solid var(--pl-lang-border);
    border-radius: 10px;
    background: var(--pl-lang-surface-soft);
    color: var(--pl-lang-ink);
    font-size: 11px;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 150ms, background 150ms, transform 150ms var(--pl-lang-ease);
}

.pl-lang-quick-link span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 23px;
    height: 23px;
    border-radius: 999px;
    background: #fff;
    font-size: 8px;
    letter-spacing: .04em;
    box-shadow: inset 0 0 0 1px var(--pl-lang-border);
}

.pl-lang-quick-link:hover,
.pl-lang-quick-link:focus-visible,
.pl-lang-quick-link.is-active {
    outline: none;
    border-color: var(--pl-lang-lime);
    background: var(--pl-lang-lime-soft);
    transform: translateY(-1px);
}

/* Search ---------------------------------------------------------------- */

.pl-lang-search { position: relative; padding: 4px 22px 12px; }

.pl-lang-search-icon {
    position: absolute;
    top: 50%;
    inset-inline-start: 35px;
    width: 15px;
    height: 15px;
    transform: translateY(calc(-50% - 3px));
    color: var(--pl-lang-muted);
    pointer-events: none;
}

.pl-lang-search-input {
    box-sizing: border-box;
    display: block;
    width: 100%;
    min-height: 40px;
    padding: 8px 12px;
    padding-inline-start: 38px;
    border: 1px solid var(--pl-lang-border);
    border-radius: var(--pl-lang-radius-sm);
    background: var(--pl-lang-surface-soft);
    color: var(--pl-lang-ink);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: normal;
    text-indent: 0;
    writing-mode: horizontal-tb;
    transition: border-color 160ms, box-shadow 160ms, background 160ms;
}

.pl-lang-search-input::placeholder { color: var(--pl-lang-muted); font-weight: 500; }

.pl-lang-search-input:focus {
    outline: none;
    background: #ffffff;
    border-color: var(--pl-lang-lime);
    box-shadow: var(--pl-lang-focus);
}

/* Option list ----------------------------------------------------------- */

.pl-lang-list {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    align-content: start;
    gap: 5px;
    margin: 0;
    padding: 2px 16px 14px;
    list-style: none;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--pl-lang-border-strong) transparent;
}

.pl-lang-list::-webkit-scrollbar { width: 8px; }
.pl-lang-list::-webkit-scrollbar-thumb { background: var(--pl-lang-border-strong); border-radius: 999px; border: 2px solid #fff; }

.pl-lang-item { border-radius: var(--pl-lang-radius-sm); }
.pl-lang-item[hidden] { display: none; }

.pl-lang-link {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 6px 8px;
    border-radius: var(--pl-lang-radius-sm);
    border: 1px solid transparent;
    color: var(--pl-lang-text);
    text-decoration: none;
    transition: background 140ms var(--pl-lang-ease), border-color 140ms, transform 140ms var(--pl-lang-ease);
}

.pl-lang-item:hover .pl-lang-link,
.pl-lang-item.is-focused .pl-lang-link {
    background: var(--pl-lang-surface-soft);
    border-color: var(--pl-lang-border);
    transform: translateX(2px);
}

.pl-lang.is-rtl .pl-lang-item:hover .pl-lang-link,
.pl-lang.is-rtl .pl-lang-item.is-focused .pl-lang-link { transform: translateX(-2px); }

.pl-lang-item-flag {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    border-radius: 999px;
    background: var(--pl-lang-surface-strong);
    color: var(--pl-lang-ink);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .04em;
    box-shadow: inset 0 0 0 1px rgba(12, 20, 32, .06);
    transition: background 140ms, color 140ms;
}

.pl-lang-item-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }

.pl-lang-item-native {
    font-size: 12.5px;
    font-weight: 800;
    color: var(--pl-lang-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pl-lang-item-english { font-size: 10.5px; font-weight: 600; color: var(--pl-lang-muted); }

.pl-lang-item-code {
    margin-inline-start: auto;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .08em;
    color: var(--pl-lang-muted);
    text-transform: uppercase;
}

.pl-lang-item-check { width: 16px; height: 16px; color: var(--pl-lang-lime-dark); opacity: 0; transform: scale(.6); transition: opacity 160ms, transform 200ms var(--pl-lang-ease); }

/* Active locale --------------------------------------------------------- */

.pl-lang-item.is-active .pl-lang-link {
    background: var(--pl-lang-lime-soft);
    border-color: color-mix(in srgb, var(--pl-lang-lime) 45%, var(--pl-lang-border));
}

.pl-lang-item.is-active .pl-lang-item-flag {
    background: linear-gradient(140deg, var(--pl-lang-lime), var(--pl-lang-lime-2));
    color: #16240a;
}

.pl-lang-item.is-active .pl-lang-item-native { color: var(--pl-lang-ink); }
.pl-lang-item.is-active .pl-lang-item-code { color: var(--pl-lang-lime-dark); }
.pl-lang-item.is-active .pl-lang-item-check { opacity: 1; transform: scale(1); }

/* Empty + footer -------------------------------------------------------- */

.pl-lang-empty {
    margin: 0;
    padding: 18px 16px 22px;
    font-size: 13px;
    font-weight: 600;
    color: var(--pl-lang-muted);
    text-align: center;
}

.pl-lang-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 9px 16px 12px;
    border-top: 1px solid var(--pl-lang-border);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--pl-lang-muted);
    background: var(--pl-lang-surface-soft);
}

.pl-lang-foot strong {
    flex: 0 0 auto;
    color: var(--pl-lang-ink);
}

/* Loading state while the localized page is being fetched --------------- */

.pl-lang.is-switching .pl-lang-trigger { opacity: .6; pointer-events: none; }
.pl-lang.is-switching .pl-lang-chevron { animation: pl-lang-spin .7s linear infinite; }
@keyframes pl-lang-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
    .pl-lang-panel, .pl-lang-trigger, .pl-lang-chevron, .pl-lang-link, .pl-lang-item-check { transition: none; }
}

/* --------------------------------------------------------------------------
   3. Variants
   -------------------------------------------------------------------------- */

/* Header: compact pill next to nav buttons */
.pl-lang--header { margin-inline-start: 4px; }

/* Dashboard sidebar: full width row */
.pl-lang--dashboard { width: 100%; }
.pl-lang--dashboard .pl-lang-trigger { width: 100%; justify-content: flex-start; border-radius: 12px; }
.pl-lang--dashboard .pl-lang-chevron { margin-inline-start: auto; }
.pl-lang--dashboard .pl-lang-panel {
    inset-inline-start: 0;
    inset-inline-end: auto;
    width: min(860px, calc(100vw - 32px));
    transform-origin: top left;
}

/* Footer (light surface, same treatment, slightly muted) */
.pl-lang--footer .pl-lang-trigger { background: var(--pl-lang-surface); }
.pl-lang--footer .pl-lang-panel {
    position: fixed;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(900px, calc(100vw - 40px));
    max-height: min(720px, calc(100vh - 48px));
    transform: translate(-50%, -46%) scale(.97);
    transform-origin: center;
    border-color: rgba(156, 255, 0, .45);
    background: linear-gradient(145deg, rgba(15, 26, 38, .985), rgba(9, 18, 28, .99));
    color: #f7fafc;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .58);
}
.pl-lang--footer.is-open .pl-lang-panel { transform: translate(-50%, -50%) scale(1); }

/*
 * Footer panels are portaled directly under <body> while open. This prevents
 * transformed footer/theme ancestors from turning position:fixed into a
 * container-relative box that can stretch beyond the viewport.
 */
.pl-lang-panel--footer-portal {
    position: fixed;
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    z-index: 1200;
    width: min(900px, calc(100vw - 40px));
    max-width: calc(100vw - 40px);
    max-height: min(720px, calc(100dvh - 48px));
    transform: translate(-50%, -46%) scale(.97);
    transform-origin: center;
    border-color: rgba(156, 255, 0, .45);
    background: linear-gradient(145deg, rgba(15, 26, 38, .99), rgba(9, 18, 28, .995));
    color: #f7fafc;
    box-shadow: 0 40px 120px rgba(0, 0, 0, .58);
}

.pl-lang-panel--footer-portal.is-open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}

/* The footer panel is portaled under <body>; repeat its contrast rules here. */
.pl-lang-panel--footer-portal .pl-lang-panel-title,
.pl-lang-panel--footer-portal .pl-lang-item-native,
.pl-lang-panel--footer-portal .pl-lang-foot strong,
.pl-lang-panel--footer-portal .pl-lang-quick-link {
    color: #f7fafc !important;
}

.pl-lang-panel--footer-portal .pl-lang-panel-kicker {
    color: #b9ff45 !important;
}

.pl-lang-panel--footer-portal .pl-lang-close,
.pl-lang-panel--footer-portal .pl-lang-quick-link,
.pl-lang-panel--footer-portal .pl-lang-link {
    border-color: rgba(255, 255, 255, .16);
    color: #eef4f8 !important;
    background: rgba(255, 255, 255, .075);
}

.pl-lang-panel--footer-portal .pl-lang-search-input {
    border-color: rgba(168, 242, 45, .48);
    color: #122630 !important;
    background: #f9fcfd !important;
    box-shadow: 0 0 0 4px rgba(168, 242, 45, .12);
}

.pl-lang-panel--footer-portal .pl-lang-search-input::placeholder {
    color: #60717e !important;
    opacity: 1;
}

.pl-lang-panel--footer-portal .pl-lang-search-icon {
    color: #60717e !important;
}

.pl-lang-panel--footer-portal .pl-lang-item-english,
.pl-lang-panel--footer-portal .pl-lang-item-code,
.pl-lang-panel--footer-portal .pl-lang-foot {
    color: #bdc9d3 !important;
}

.pl-lang-panel--footer-portal .pl-lang-item-native {
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
}

.pl-lang-panel--footer-portal .pl-lang-item-code {
    flex: 0 0 48px;
    overflow-wrap: anywhere;
}

.pl-lang-panel--footer-portal .pl-lang-item:hover .pl-lang-link,
.pl-lang-panel--footer-portal .pl-lang-item.is-focused .pl-lang-link,
.pl-lang-panel--footer-portal .pl-lang-quick-link:hover,
.pl-lang-panel--footer-portal .pl-lang-quick-link:focus-visible {
    border-color: rgba(168, 242, 45, .62);
    background: rgba(168, 242, 45, .13);
}

.pl-lang-panel--footer-portal .pl-lang-item.is-active .pl-lang-link,
.pl-lang-panel--footer-portal .pl-lang-quick-link.is-active {
    border-color: #9cff00;
    color: #fff !important;
    background: linear-gradient(135deg, rgba(115, 178, 20, .30), rgba(168, 242, 45, .12));
}

.pl-lang-panel--footer-portal .pl-lang-item.is-active .pl-lang-item-native {
    color: #fff !important;
}

.pl-lang-panel--footer-portal .pl-lang-item.is-active .pl-lang-item-code,
.pl-lang-panel--footer-portal .pl-lang-item.is-active .pl-lang-item-check {
    color: #b9ff45 !important;
}

.pl-lang-panel--footer-portal .pl-lang-foot {
    border-color: rgba(255,255,255,.12);
    background: rgba(0,0,0,.22);
}

.pl-lang--footer .pl-lang-panel-title,
.pl-lang--footer .pl-lang-item-native,
.pl-lang--footer .pl-lang-foot strong { color: #f7fafc; }
.pl-lang--footer .pl-lang-panel-kicker { color: #b9ff45; }
.pl-lang--footer .pl-lang-close,
.pl-lang--footer .pl-lang-search-input,
.pl-lang--footer .pl-lang-quick-link,
.pl-lang--footer .pl-lang-link {
    border-color: rgba(255, 255, 255, .13);
    background: rgba(255, 255, 255, .07);
    color: #eef4f8;
}
.pl-lang--footer .pl-lang-search-input::placeholder,
.pl-lang--footer .pl-lang-item-english,
.pl-lang--footer .pl-lang-item-code,
.pl-lang--footer .pl-lang-foot { color: #aebbc8; }
.pl-lang--footer .pl-lang-search-input:focus {
    background: rgba(255,255,255,.1);
    color: #fff;
}
.pl-lang--footer .pl-lang-item:hover .pl-lang-link,
.pl-lang--footer .pl-lang-item.is-focused .pl-lang-link,
.pl-lang--footer .pl-lang-quick-link:hover,
.pl-lang--footer .pl-lang-quick-link:focus-visible {
    background: rgba(156, 255, 0, .12);
    border-color: rgba(156, 255, 0, .55);
}
.pl-lang--footer .pl-lang-item.is-active .pl-lang-link {
    background: rgba(156, 255, 0, .16);
    border-color: #9cff00;
}
.pl-lang--footer .pl-lang-foot {
    border-color: rgba(255,255,255,.1);
    background: rgba(0,0,0,.18);
}

/* Mobile nav drawer */
.pl-lang--mobile { width: 100%; }
.pl-lang--mobile .pl-lang-trigger { width: 100%; justify-content: flex-start; border-radius: 14px; min-height: 48px; }
.pl-lang--mobile .pl-lang-chevron { margin-inline-start: auto; }

/* --------------------------------------------------------------------------
   4. Mobile: bottom sheet
   -------------------------------------------------------------------------- */

@media (max-width: 720px) {
    .pl-lang-panel {
        position: fixed;
        inset: auto 0 0 0;
        width: 100%;
        max-width: 100%;
        max-height: 84vh;
        border-radius: 22px 22px 0 0;
        border-inline: none;
        border-bottom: none;
        transform: translateY(16px);
        transform-origin: bottom center;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        box-shadow: 0 -24px 80px rgba(12, 20, 32, .28);
    }

    .pl-lang-panel::after {
        content: "";
        position: absolute;
        top: 7px;
        left: 50%;
        width: 42px;
        height: 4px;
        transform: translateX(-50%);
        border-radius: 999px;
        background: var(--pl-lang-border-strong);
    }

    .pl-lang.is-open .pl-lang-panel { transform: translateY(0); }
    .pl-lang-close { display: inline-flex; }
    .pl-lang-quick {
        display: flex;
        overflow-x: auto;
        padding-inline: 16px;
        scrollbar-width: none;
    }

    .pl-lang--footer .pl-lang-panel {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 88vh;
        transform: translateY(18px);
        transform-origin: bottom center;
        border-radius: 24px 24px 0 0;
    }
    .pl-lang--footer.is-open .pl-lang-panel { transform: translateY(0); }
    .pl-lang-panel--footer-portal,
    .pl-lang-panel--footer-portal.is-open {
        top: auto;
        right: 8px;
        bottom: max(8px, env(safe-area-inset-bottom, 8px));
        left: 8px;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 16px);
        transform: translateY(0);
        transform-origin: bottom center;
        border: 1px solid rgba(156, 255, 0, .35);
        border-radius: 22px;
    }
    .pl-lang-quick::-webkit-scrollbar { display: none; }
    .pl-lang-quick-link { flex: 0 0 auto; min-width: 100px; }
    .pl-lang-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-height: 50vh;
        padding-inline: 10px;
    }
    .pl-lang-panel-head { padding: 18px 16px 10px; }
    .pl-lang-search { padding-inline: 16px; }
    .pl-lang-search-icon { inset-inline-start: 29px; }
    .pl-lang-link { padding: 8px; }
    .pl-lang-item-native { font-size: 12.5px; }
    .pl-lang-item-code, .pl-lang-item-check { display: none; }
    .pl-lang-foot { padding-inline: 16px; }
}

@media (min-width: 721px) and (max-width: 980px) {
    .pl-lang-quick { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .pl-lang-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* --------------------------------------------------------------------------
   5. Global RTL support (Arabic)
   -------------------------------------------------------------------------- */

html[dir="rtl"] body { direction: rtl; }
html[dir="rtl"] .site-nav,
html[dir="rtl"] .site-header,
html[dir="rtl"] .dash-nav,
html[dir="rtl"] .dash-topbar { direction: rtl; }
html[dir="rtl"] th, html[dir="rtl"] td { text-align: right; }
html[dir="rtl"] input, html[dir="rtl"] select, html[dir="rtl"] textarea { text-align: right; }
html[dir="rtl"] .pl-lang-panel { transform-origin: top left; }
html[dir="rtl"] .breadcrumbs, html[dir="rtl"] .pagination { direction: rtl; }

/* --------------------------------------------------------------------------
   6. Locale typography
   -------------------------------------------------------------------------- */

html[lang="ar"] body {
    font-family: "Segoe UI", Tahoma, "Noto Sans Arabic", "Noto Kufi Arabic", Arial, sans-serif;
    letter-spacing: 0;
}

html[lang="zh-Hans"] body,
html[lang="ja-JP"] body {
    font-family: "Segoe UI", "PingFang SC", "Hiragino Sans", "Microsoft YaHei", "Yu Gothic UI", Meiryo, sans-serif;
    letter-spacing: 0;
}

html[lang="ar"] .pl-lang-item-native,
html[lang="zh-Hans"] .pl-lang-item-native,
html[lang="ja-JP"] .pl-lang-item-native { letter-spacing: 0; }

/* --------------------------------------------------------------------------
   7. RTL bidi isolation
   Untranslated (English) fallback strings inside an RTL page keep their own
   left-to-right direction and punctuation position, instead of rendering
   mirrored. Arabic text keeps full RTL. Applies per text element.
   -------------------------------------------------------------------------- */

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3,
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6,
html[dir="rtl"] p, html[dir="rtl"] li, html[dir="rtl"] dt, html[dir="rtl"] dd,
html[dir="rtl"] label, html[dir="rtl"] figcaption, html[dir="rtl"] blockquote,
html[dir="rtl"] th, html[dir="rtl"] td,
html[dir="rtl"] a, html[dir="rtl"] button, html[dir="rtl"] summary,
html[dir="rtl"] span:not(.pl-lang-flag):not(.pl-lang-item-flag) {
    unicode-bidi: plaintext;
}

html[dir="rtl"] input, html[dir="rtl"] textarea { unicode-bidi: plaintext; }

html[lang="he-IL"] body {
    font-family: "Segoe UI", "Noto Sans Hebrew", "Arial Hebrew", Tahoma, Arial, sans-serif;
    letter-spacing: 0;
}

/* --------------------------------------------------------------------------
   8. Premium enterprise footer
   -------------------------------------------------------------------------- */

.pl-public-shell .site-footer.enterprise-footer {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(250px, 1.35fr) repeat(4, minmax(145px, 1fr)) !important;
    gap: clamp(26px, 3vw, 52px) !important;
    margin-top: 5rem !important;
    padding: clamp(48px, 6vw, 82px) max(24px, calc((100vw - 1320px) / 2)) 28px !important;
    border-top: 1px solid rgba(156, 255, 0, .25) !important;
    background:
        radial-gradient(circle at 10% 0%, rgba(156, 255, 0, .09), transparent 28%),
        linear-gradient(145deg, #0b121c, #111d2a 62%, #0b131c) !important;
    color: #f7fafc !important;
    overflow: visible;
}

.pl-public-shell .site-footer.enterprise-footer::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, transparent, #9cff00 28%, #d7ff70 50%, #9cff00 72%, transparent);
    opacity: .8;
}

.pl-public-shell .enterprise-footer .footer-brand {
    min-width: 0;
}

.pl-public-shell .enterprise-footer .footer-brand-mark {
    display: inline-flex;
    padding: 8px 12px;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 15px;
    background: rgba(255,255,255,.96);
}

.pl-public-shell .enterprise-footer .footer-brand img {
    width: 156px !important;
    height: 62px !important;
    object-fit: contain !important;
}

.pl-public-shell .enterprise-footer .footer-brand-statement {
    max-width: 32ch;
    margin: 22px 0 !important;
    color: #c4ced9 !important;
    font-size: 14px;
    line-height: 1.65;
}

.pl-public-shell .enterprise-footer nav {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
    min-width: 0;
}

.pl-public-shell .enterprise-footer h3 {
    margin: 0 0 9px !important;
    color: #fff !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.pl-public-shell .enterprise-footer nav > a {
    position: relative;
    color: #aebbc8 !important;
    font-size: 13px;
    font-weight: 650 !important;
    line-height: 1.4;
    text-decoration: none;
    transition: color 150ms, transform 150ms;
}

.pl-public-shell .enterprise-footer nav > a:hover,
.pl-public-shell .enterprise-footer nav > a:focus-visible {
    outline: none;
    color: #d9ff7b !important;
    transform: translateX(3px);
}

html[dir="rtl"] .pl-public-shell .enterprise-footer nav > a:hover,
html[dir="rtl"] .pl-public-shell .enterprise-footer nav > a:focus-visible {
    transform: translateX(-3px);
}

.pl-public-shell .enterprise-footer .footer-language {
    display: grid;
    gap: 8px;
    max-width: 245px;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 16px;
    background: rgba(255,255,255,.055);
}

.pl-public-shell .enterprise-footer .footer-language > span {
    color: #fff;
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.pl-public-shell .enterprise-footer .footer-language > button {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: #b8c4ce;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.pl-public-shell .enterprise-footer .footer-social {
    grid-column: 2 / -1;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.pl-public-shell .enterprise-footer .footer-social h3 {
    width: 100%;
}

.pl-public-shell .enterprise-footer .footer-social a {
    padding: 7px 11px;
    border: 1px solid rgba(255,255,255,.13);
    border-radius: 999px;
}

.pl-public-shell .enterprise-footer .footer-legal-line {
    grid-column: 1 / -1;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding-top: 22px;
    border-top: 1px solid rgba(255,255,255,.1);
}

.pl-public-shell .enterprise-footer .footer-legal-line p {
    margin: 0 !important;
    color: #7f8d9a !important;
    font-size: 11px;
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .pl-public-shell .site-footer.enterprise-footer {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
    .pl-public-shell .enterprise-footer .footer-brand { grid-column: 1 / -1; }
    .pl-public-shell .enterprise-footer .footer-brand-statement { max-width: 62ch; }
    .pl-public-shell .enterprise-footer .footer-social { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
    .pl-public-shell .site-footer.enterprise-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 32px 22px !important;
    }
    .pl-public-shell .enterprise-footer .footer-brand,
    .pl-public-shell .enterprise-footer .footer-social,
    .pl-public-shell .enterprise-footer .footer-legal-line { grid-column: 1 / -1; }
    .pl-public-shell .enterprise-footer .footer-legal-line { flex-direction: column; }
}

@media (max-width: 460px) {
    .pl-public-shell .site-footer.enterprise-footer {
        grid-template-columns: 1fr !important;
    }
    .pl-public-shell .enterprise-footer nav,
    .pl-public-shell .enterprise-footer .footer-brand,
    .pl-public-shell .enterprise-footer .footer-social,
    .pl-public-shell .enterprise-footer .footer-legal-line { grid-column: 1; }
}

/* ==========================================================================
   Final readability guardrails: Legal, Demo and Customer Support
   Loaded last so dark premium surfaces always keep accessible contrast.
   ========================================================================== */

/* Legal documents: comfortable reading scale, regardless of global section CSS. */
.pl-public-shell .legal-page .legal-title-block h1 {
    max-width: 18ch;
    font-size: clamp(34px, 4.8vw, 62px) !important;
    line-height: 1.04 !important;
    overflow-wrap: anywhere;
}

.pl-public-shell .legal-document-card {
    color: #17212e;
    font-size: 16px;
}

.pl-public-shell .legal-document-card .content,
.pl-public-shell .legal-document-card section.section {
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0;
    padding: 0;
    background: transparent;
    box-shadow: none;
}

.pl-public-shell .legal-document-card section.section {
    margin-bottom: 0;
    padding-bottom: 20px;
}

.pl-public-shell .legal-document-card section.section + section.section {
    padding-top: 20px;
    border-top: 1px solid #e4ebee;
}

.pl-public-shell .legal-document-card h1 {
    margin: 0 0 22px;
    color: #101827 !important;
    font-size: clamp(28px, 3vw, 40px) !important;
    line-height: 1.12 !important;
}

.pl-public-shell .legal-document-card h2 {
    margin: 0 0 10px !important;
    color: #101827 !important;
    font-size: clamp(21px, 2vw, 28px) !important;
    line-height: 1.25 !important;
    letter-spacing: -.02em !important;
    overflow-wrap: anywhere;
}

.pl-public-shell .legal-document-card h3 {
    margin: 20px 0 10px !important;
    color: #17212e !important;
    font-size: clamp(18px, 1.5vw, 22px) !important;
    line-height: 1.3 !important;
}

.pl-public-shell .legal-document-card p,
.pl-public-shell .legal-document-card li {
    color: #344254 !important;
    font-size: clamp(15px, 1.15vw, 17px) !important;
    line-height: 1.62 !important;
}

.pl-public-shell .legal-document-card p {
    margin: 0 0 11px !important;
}

.pl-public-shell .legal-document-card ul,
.pl-public-shell .legal-document-card ol {
    display: grid;
    gap: 6px;
    margin: 8px 0 12px;
    padding-inline-start: 24px;
}

.pl-public-shell .legal-document-card table {
    margin: 10px 0 14px;
}

.pl-public-shell .legal-company-card {
    padding: 18px;
    border: 1px solid rgba(168, 242, 45, .42) !important;
    border-radius: 18px;
    color: #eaf3f4 !important;
    background:
        radial-gradient(circle at 100% 0, rgba(168, 242, 45, .17), transparent 38%),
        linear-gradient(145deg, #07191e, #0e2b31) !important;
    box-shadow: 0 16px 38px rgba(4, 27, 32, .16);
}

.pl-public-shell .legal-company-card > span {
    display: block;
    margin-bottom: 6px;
    color: #b8ff46;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.pl-public-shell .legal-company-card strong {
    display: block;
    color: #fff !important;
    font-size: 17px;
}

.pl-public-shell .legal-company-card p {
    margin: 9px 0 0;
    color: #d7e4e6 !important;
    font-size: 13px;
    line-height: 1.65;
}

/* Demo: explicit foreground colors for every dark premium panel. */
.pl-public-shell .demo-workspace-page .demo-workspace-head h1,
.pl-public-shell .demo-workspace-page .demo-workspace-head h2,
.pl-public-shell .demo-workspace-page .demo-workspace-head strong,
.pl-public-shell .demo-activity h2,
.pl-public-shell .demo-confidence h3 {
    color: #f8fbfc !important;
}

.pl-public-shell .demo-workspace-page .demo-workspace-head p,
.pl-public-shell .demo-activity p,
.pl-public-shell .demo-activity .demo-timeline span,
.pl-public-shell .demo-confidence p {
    color: #c5d4d8 !important;
}

.pl-public-shell .demo-workspace-page .demo-workspace-head {
    padding: clamp(28px, 4vw, 48px) !important;
}

.pl-public-shell .demo-workspace-page .demo-workspace-head h1 {
    font-size: clamp(38px, 5vw, 72px) !important;
    line-height: 1.02 !important;
}

.pl-public-shell .demo-confidence article {
    color: #dce8ea !important;
}

.pl-public-shell .demo-confidence h3 {
    font-size: clamp(18px, 1.8vw, 23px);
    line-height: 1.3;
}

.pl-public-shell .demo-premium .demo-entry-hero {
    color: #fff !important;
    background:
        radial-gradient(circle at 88% 5%, rgba(168, 242, 45, .19), transparent 29%),
        linear-gradient(135deg, #061216 0%, #0b2329 62%, #102f35 100%) !important;
}

.pl-public-shell .demo-premium .demo-entry-hero h1 {
    color: #fff !important;
    font-size: clamp(42px, 6vw, 78px) !important;
    line-height: 1 !important;
}

.pl-public-shell .demo-premium .demo-entry-hero p {
    color: #c8d8dc !important;
}

.pl-public-shell .demo-premium .demo-entry-hero .demo-lead,
.pl-public-shell .demo-premium .demo-trust-row span {
    color: #f3f8f9 !important;
}

.pl-public-shell .demo-premium .demo-trust-row span {
    border-color: rgba(255, 255, 255, .24) !important;
    background: rgba(255, 255, 255, .08);
}

.pl-public-shell .demo-premium .demo-live-card {
    color: #e8f1f3 !important;
    border-color: rgba(255, 255, 255, .18) !important;
    background: rgba(255, 255, 255, .085) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,.1) !important;
}

.pl-public-shell .demo-premium .demo-live-card > span {
    color: #b8ff46 !important;
}

.pl-public-shell .demo-premium .demo-live-card > strong {
    color: #fff !important;
}

.pl-public-shell .demo-premium .demo-live-card > p,
.pl-public-shell .demo-premium .demo-live-card small {
    color: #c7d7da !important;
}

.pl-public-shell .demo-premium .demo-live-card b {
    color: #a8f22d !important;
}

.pl-public-shell .demo-entry-page .section-head h2,
.pl-public-shell .demo-workspace-page .section-head h2,
.pl-public-shell .demo-actions-panel .section-head h2 {
    font-size: clamp(28px, 3.6vw, 48px) !important;
    line-height: 1.08 !important;
    letter-spacing: -.035em !important;
    overflow-wrap: anywhere;
}

.pl-public-shell .demo-role-card h3,
.pl-public-shell .demo-tools-grid h2,
.pl-public-shell .demo-operations-grid h2,
.pl-public-shell .demo-passport-card h2 {
    color: #14212b !important;
    font-size: clamp(20px, 1.8vw, 27px) !important;
    line-height: 1.25 !important;
}

.pl-public-shell .demo-role-card p,
.pl-public-shell .demo-role-card li,
.pl-public-shell .demo-tools-grid p,
.pl-public-shell .demo-operations-grid p,
.pl-public-shell .demo-passport-card p,
.pl-public-shell .demo-actions-panel p {
    color: #52656d !important;
}

.pl-public-shell .demo-metrics article {
    color: #15222c;
    background: #fff;
}

.pl-public-shell .demo-metrics article span,
.pl-public-shell .demo-metrics article p {
    color: #596c74 !important;
}

.pl-public-shell .demo-metrics article strong {
    color: #14212b !important;
}

.pl-public-shell .demo-data-badge span {
    color: #b8ff46 !important;
}

.pl-public-shell .demo-data-badge strong {
    color: #fff !important;
}

.pl-public-shell .demo-data-badge small {
    color: #c6d5d8 !important;
}

.pl-public-shell .demo-mode-bar,
.pl-public-shell .demo-mode-bar span,
.pl-public-shell .demo-mode-bar a,
.pl-public-shell .demo-mode-bar button {
    color: #edf6f7;
}

.pl-public-shell .demo-mode-bar strong,
.pl-public-shell .demo-mode-bar [data-demo-timer] {
    color: #b7ff36 !important;
}

.pl-public-shell .demo-board,
.pl-public-shell .demo-passport-card,
.pl-public-shell .demo-actions-panel,
.pl-public-shell .demo-tools-grid article,
.pl-public-shell .demo-operations-grid article {
    color: #17242d;
    background: #fff;
}

.pl-public-shell .demo-legal-notice,
.pl-public-shell .demo-legal-notice p {
    color: #4f626a !important;
}

/* Support: force premium hero readability and a predictable search layout. */
.pl-public-shell .support-premium .support-hero h1 {
    color: #f8fbfc !important;
    font-size: clamp(40px, 5.4vw, 72px) !important;
    line-height: 1.02 !important;
    text-wrap: balance;
}

.pl-public-shell .support-premium .support-hero > div > p,
.pl-public-shell .support-premium .support-hero aside p {
    color: #c9d7da !important;
}

.pl-public-shell .support-premium .support-hero aside strong {
    color: #fff !important;
}

.pl-public-shell .support-premium .support-search {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas: "input button";
    align-items: stretch;
}

.pl-public-shell .support-premium .support-search input {
    grid-area: input;
    width: 100%;
    min-width: 0;
    color: #13292f !important;
    background: #fff !important;
}

.pl-public-shell .support-premium .support-search .btn {
    grid-area: button;
    width: auto;
    white-space: nowrap;
}

.pl-public-shell .support-premium .support-search .sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Premium dark-surface system: consistent contrast and restrained lime accents. */
.pl-public-shell :is(
    .contact-premium .contact-hero,
    .support-premium .support-hero,
    .support-premium .support-service-band,
    .premium-guide .guide-hero,
    .premium-guide .documentation-hero,
    .premium-guide .guide-cta,
    .premium-guide .guide-trust
) {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(168, 242, 45, .16);
    background:
        radial-gradient(circle at 92% 4%, rgba(168, 242, 45, .16), transparent 30%),
        linear-gradient(135deg, #061418 0%, #0a2228 68%, #12352d 100%) !important;
    box-shadow: 0 26px 72px rgba(3, 24, 29, .17);
}

.pl-public-shell :is(
    .contact-premium .contact-hero,
    .support-premium .support-hero,
    .support-premium .support-service-band,
    .premium-guide .guide-hero,
    .premium-guide .documentation-hero,
    .premium-guide .guide-cta,
    .premium-guide .guide-trust
)::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #98f000, rgba(168, 242, 45, .45), transparent 72%);
}

.pl-public-shell :is(
    .contact-premium .contact-hero,
    .support-premium .support-hero,
    .support-premium .support-service-band,
    .premium-guide .guide-hero,
    .premium-guide .documentation-hero,
    .premium-guide .guide-cta,
    .premium-guide .guide-trust
) :is(h1, h2, h3, strong) {
    color: #f8fbfc !important;
}

.pl-public-shell :is(
    .contact-premium .contact-hero,
    .support-premium .support-hero,
    .support-premium .support-service-band,
    .premium-guide .guide-hero,
    .premium-guide .documentation-hero,
    .premium-guide .guide-cta,
    .premium-guide .guide-trust
) p {
    color: #c7d7da !important;
}

.pl-public-shell :is(
    .contact-premium .contact-hero,
    .support-premium .support-hero,
    .support-premium .support-service-band,
    .premium-guide .guide-hero,
    .premium-guide .documentation-hero,
    .premium-guide .guide-cta,
    .premium-guide .guide-trust
) .eyebrow {
    color: #a8f22d !important;
}

.pl-public-shell .contact-premium .contact-hero h1 {
    max-width: 13ch;
    font-size: clamp(40px, 5.2vw, 70px) !important;
    line-height: 1.01 !important;
}

.pl-public-shell .contact-premium .contact-assurance-card {
    border-color: rgba(168, 242, 45, .24);
    background: linear-gradient(145deg, rgba(255,255,255,.11), rgba(168,242,45,.055));
}

.pl-public-shell .contact-premium .contact-assurance-card > span {
    color: #b8ff46 !important;
}

.pl-public-shell .contact-premium .contact-assurance-card li {
    color: #d9e6e8 !important;
}

.pl-public-shell .support-premium .support-service-band {
    isolation: isolate;
}

.pl-public-shell .support-premium .support-service-band h2 {
    max-width: 16ch;
    color: #fff !important;
    font-size: clamp(29px, 3.4vw, 46px) !important;
    line-height: 1.08 !important;
}

.pl-public-shell .support-premium .support-service-band p {
    color: #c7d7da !important;
}

.pl-public-shell .support-premium .support-service-band .btn.ghost,
.pl-public-shell .contact-premium .contact-hero .btn.ghost {
    border-color: rgba(255,255,255,.34);
    color: #101820 !important;
    background: #fff !important;
}

.pl-public-shell :is(
    .support-quick-grid a,
    .support-category-grid article,
    .contact-path-grid a,
    .contact-business-grid article,
    .guide-step-grid article,
    .guide-role-map a
) {
    position: relative;
    overflow: hidden;
}

.pl-public-shell :is(
    .support-quick-grid a,
    .support-category-grid article,
    .contact-path-grid a,
    .contact-business-grid article,
    .guide-step-grid article,
    .guide-role-map a
)::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #98f000, rgba(168, 242, 45, .38), transparent 74%);
}

@media (max-width: 760px) {
    .pl-public-shell .legal-document-card {
        padding: 22px 18px;
    }
    .pl-public-shell .legal-document-card h2 {
        font-size: clamp(20px, 6vw, 25px) !important;
    }
    .pl-public-shell .demo-workspace-page .demo-workspace-head {
        padding: 26px 20px !important;
    }
    .pl-public-shell .demo-entry-page .section-head h2,
    .pl-public-shell .demo-workspace-page .section-head h2,
    .pl-public-shell .demo-actions-panel .section-head h2 {
        font-size: clamp(27px, 8vw, 38px) !important;
    }
    .pl-public-shell .support-premium .support-search {
        grid-template-columns: 1fr !important;
        grid-template-areas: "input" "button";
    }
    .pl-public-shell .support-premium .support-search .btn {
        width: 100%;
    }
    .pl-public-shell .contact-premium .contact-hero h1 {
        font-size: clamp(38px, 11vw, 56px) !important;
    }
    .pl-public-shell .support-premium .support-service-band {
        padding: 30px 22px;
    }
}
