.orientation-lock {
    display: none;
}
@media screen and (orientation: landscape) and (pointer: coarse) {
    body > :not(.orientation-lock) {
        visibility: hidden !important;
    }

    .orientation-lock {
        position: fixed;
        z-index: 2147483647;
        inset: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 24px;
        background: var(--ColorPrimary, #E5183F);
        color: var(--ColorOnPrimary, #FFFFFF);
        font-size: 1.25rem;
        font-weight: 600;
        text-align: center;
        visibility: visible;
    }
}

html {
    background: var(--ColorSurfaceBase);
}

body {
    --app-header-background: var(--ColorPrimary);
    --app-header-foreground: var(--ColorOnPrimary);
    box-sizing: border-box;
    min-height: 100vh;
    min-height: 100dvh;
    background: linear-gradient(
        to bottom,
        var(--app-header-background) 0,
        var(--app-header-background) env(safe-area-inset-top, 0px),
        var(--ColorSurfaceBase) env(safe-area-inset-top, 0px)
    ) fixed;
    padding-top: calc(72px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px) + 20px);
}

body[data-app-color="surface"] {
    --app-header-background: var(--ColorSurfaceRaised);
    --app-header-foreground: var(--ColorTextSecondary);
}

body[data-app-color="secondary"] {
    --app-header-background: var(--ColorSecondary);
    --app-header-foreground: var(--ColorOnSecondary);
}

.container {
    box-sizing: border-box;
    width: 100%;
    max-width: 768px;
    margin-inline: auto;
}

@scope (.bottom-navigation) {
    :scope {
        position: fixed;
        z-index: 1050;
        inset: auto 0 0;
        padding-bottom: env(safe-area-inset-bottom, 0px);
        border-top: 1px solid var(--ColorDivider, #E4E9ED);
        background: var(--ColorSurfaceRaised, #FFFFFF);
        font-family: var(--FontDefault, sans-serif);
    }

    .items {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        height: 72px;
        padding-inline: max(8px, env(safe-area-inset-left, 0px)) max(8px, env(safe-area-inset-right, 0px));
    }

    .item, .item:hover {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        min-width: 0;
        padding: 4px;
        border: 0;
        background: transparent;
        color: var(--ColorTextSecondary, #4A5A68);
        font: inherit;
        text-decoration: none;
        cursor: pointer;
    }

    .item:last-child {
        grid-column: 4;
    }

    .icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px;
        height: 32px;
        border-radius: var(--BorderradiusPill, 56px);
        font-size: 20px;
    }

    .icon svg {
        display: block;
        width: 20px;
        height: 20px;
        fill: currentColor;
    }

    .label {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 0.75rem;
        font-weight: 600;
    }

    .item.active, .item.active:hover {
        color: var(--ColorPrimary);
    }

    .item.active .icon {
        background: var(--ColorPrimaryTintStrong, color-mix(in srgb, var(--ColorPrimary) 14%, transparent));
    }

    .item:focus-visible {
        outline: 2px solid var(--ColorFocus, #0B57D0);
        outline-offset: -2px;
    }
}

@keyframes navigation-offcanvas-enter {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.navigation-overlay {
    position: fixed;
    z-index: 1030;
    inset: 0 0 calc(72px + env(safe-area-inset-bottom, 0px));
    background: var(--ColorOverlayScrim, rgb(21 33 43 / 58%));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}

.navigation-offcanvas[open]:not(.closing) + .navigation-overlay {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.25s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
    .navigation-overlay, .navigation-offcanvas[open]:not(.closing) + .navigation-overlay {
        transition: none;
    }
}

@keyframes navigation-offcanvas-exit {
    from { transform: translateX(0); }
    to { transform: translateX(100%); }
}

@scope (.navigation-offcanvas) {
    :scope {
        position: fixed;
        z-index: 1040;
        inset: 0 0 auto auto;
        box-sizing: border-box;
        width: min(100%, 440px);
        max-width: 100%;
        height: calc(100vh - 72px - env(safe-area-inset-bottom, 0px));
        height: calc(100dvh - 72px - env(safe-area-inset-bottom, 0px));
        max-height: calc(100% - 72px - env(safe-area-inset-bottom, 0px));
        margin: 0;
        padding: env(safe-area-inset-top, 0px) 0 0;
        border: 0;
        background: linear-gradient(
            to bottom,
            var(--app-header-background) 0,
            var(--app-header-background) env(safe-area-inset-top, 0px),
            var(--ColorSurfaceBase) env(safe-area-inset-top, 0px)
        );
        color: var(--ColorTextPrimary);
        font-family: var(--FontDefault, sans-serif);
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior: contain;
    }

    :scope[open] {
        animation: navigation-offcanvas-enter 0.25s ease-out;
    }

    :scope[open].closing {
        animation: navigation-offcanvas-exit 0.25s ease-in forwards;
    }

    :scope::backdrop {
        background: var(--ColorOverlayScrim, rgb(21 33 43 / 58%));
    }

    .heading {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--app-header-background);
        color: var(--app-header-foreground);
    }

    .title {
        margin: 0;
        color: inherit;
        font: inherit;
        font-size: 1.25rem;
        font-weight: 600;
    }

    .chatbot {
        width: 48px;
        height: 48px;
        border: 1px solid currentColor;
        border-radius: 50%;
        background: transparent;
        color: inherit;
        font-size: 20px;
        cursor: pointer;
    }

    .chatbot:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: 2px;
    }

    .content {
        padding: 16px;
    }

    .link-block {
        margin: 0;
        padding: 0;
        overflow: hidden;
        border: 1px solid var(--ColorBorderDefault, #D8DFE5);
        border-radius: var(--BorderradiusOuter, 12px);
        background: var(--ColorSurfaceRaised, #FFFFFF);
        list-style: none;
    }

    .link-block + .link-block {
        margin-top: 16px;
    }

    .personal > details + details, .favorites-list > li {
        border-top: 1px solid var(--ColorDivider, #E4E9ED);
    }

    summary.link {
        list-style: none;
        cursor: pointer;
    }

    summary.link::-webkit-details-marker {
        display: none;
    }

    details[open] > summary .chevron {
        transform: rotate(90deg);
    }

    details[open] > summary .link-label, .link[aria-current="page"] .link-label {
        text-decoration: underline;
    }

    .favorites-list {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .favorites-list .link, .favorites-list .link:hover {
        padding-left: 28px;
    }

    .panel-message {
        margin: 0;
        padding: 12px;
        color: var(--ColorTextSecondary);
    }

    .theme-setting {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 12px;
        min-height: 56px;
        padding: 8px 12px;
        border-top: 1px solid var(--ColorDivider, #E4E9ED);
    }

    .theme-label {
        color: var(--ColorTextPrimary);
        font-size: 0.9375rem;
    }

    .light-label {
        font-weight: 600;
    }

    .theme-setting:has(input:checked) .light-label {
        font-weight: 400;
    }

    .theme-setting:has(input:checked) .dark-label {
        font-weight: 600;
    }

    .theme-switch {
        position: relative;
        display: inline-flex;
        flex: none;
        align-items: center;
        width: 52px;
        height: 32px;
        cursor: pointer;
    }

    .theme-switch input {
        position: absolute;
        width: 1px;
        height: 1px;
        opacity: 0;
    }

    .track {
        box-sizing: border-box;
        width: 100%;
        height: 100%;
        border-radius: 999px;
        background: var(--ColorBorderStrong, #7C8A96);
        transition: background-color 0.2s ease;
    }

    .track::after {
        content: '';
        display: block;
        width: 24px;
        height: 24px;
        margin: 4px;
        border-radius: 50%;
        background: #FFFFFF;
        transition: transform 0.2s ease;
    }

    .theme-switch input:checked + .track {
        background: var(--ColorPrimary);
    }

    .theme-switch input:checked + .track::after {
        transform: translateX(20px);
    }

    .theme-switch input:focus-visible + .track {
        outline: 2px solid var(--ColorFocus, #0B57D0);
        outline-offset: 3px;
    }

    @media (prefers-reduced-motion: reduce) {
        .track, .track::after {
            transition: none;
        }
    }

    .link-block > li + li {
        border-top: 1px solid var(--ColorDivider, #E4E9ED);
    }

    .link, .link:hover {
        display: flex;
        align-items: center;
        gap: 16px;
        min-height: 56px;
        padding: 10px 12px;
        box-sizing: border-box;
        color: var(--ColorTextPrimary);
        text-decoration: none;
    }

    .link:focus-visible {
        outline: 2px solid var(--ColorFocus, #0B57D0);
        outline-offset: -2px;
    }

    .link-icon {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        background: var(--ColorPrimaryTintStrong, color-mix(in srgb, var(--ColorPrimary) 14%, transparent));
        color: var(--ColorPrimary);
        font-size: 20px;
    }

    .link-icon svg {
        display: block;
        width: 24px;
        height: 24px;
        fill: currentColor;
    }

    .link-label {
        flex: 1;
        min-width: 0;
        font-size: 1rem;
        font-weight: 600;
    }

    .chevron {
        flex: none;
        font-size: 12px;
    }

    .search {
        position: relative;
        margin: 16px 16px 0;
    }

    .search-icon {
        position: absolute;
        z-index: 1;
        left: 18px;
        top: 50%;
        transform: translateY(-50%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--ColorPrimary);
        font-size: 20px;
        pointer-events: none;
    }

    .input {
        box-sizing: border-box;
        width: 100%;
        min-width: 0;
        min-height: 52px;
        padding: 12px 12px 12px 52px;
        border: 2px solid var(--ColorPrimary);
        border-radius: var(--BorderradiusInner, 8px);
        background: var(--ColorSurfaceRaised, #FFFFFF);
        color: var(--ColorTextPrimary);
        font: inherit;
        font-size: 16px;
    }

    .input::placeholder {
        color: var(--ColorTextSecondary);
        opacity: 1;
    }

    .search:focus-within .search-icon {
        color: var(--ColorFocus, #0B57D0);
    }

    .input:focus {
        border-color: var(--ColorFocus, #0B57D0);
        outline: 2px solid var(--ColorFocus, #0B57D0);
        outline-offset: -3px;
    }

    @media (prefers-reduced-motion: reduce) {
        :scope[open], :scope[open].closing {
            animation: none;
        }
    }
}

@keyframes chatbot-sheet-enter {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@scope (.chatbot-sheet) {
    :scope {
        position: fixed;
        inset: auto 0 0;
        box-sizing: border-box;
        max-width: 400px;
        max-height: calc(100dvh - env(safe-area-inset-top, 0px));
        margin: 0 auto;
        padding: 0 0 env(safe-area-inset-bottom, 0px);
        overflow: hidden;
        border: 0;
        border-radius: var(--BorderradiusOuter, 12px) var(--BorderradiusOuter, 12px) 0 0;
        background: var(--ColorSurfaceRaised, #FFFFFF);
        color: var(--ColorTextPrimary, #15212B);
        font-family: var(--FontDefault, sans-serif);
    }

    :scope[open] {
        display: flex;
        flex-direction: column;
        animation: chatbot-sheet-enter 0.25s ease-out;
    }

    :scope::backdrop {
        background: var(--ColorOverlayScrim, rgb(21 33 43 / 58%));
    }

    .error {
        margin: 12px 20px;
        color: var(--ColorTextError, #7A1212);
    }

    eo-chatbot-widget {
        display: block;
        flex: 1;
        min-height: 0;
    }

    @media (prefers-reduced-motion: reduce) {
        :scope[open] {
            animation: none;
        }
    }
}

@scope (.push-toast) {
    :scope {
        position: fixed;
        z-index: 1200;
        left: 50%;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        display: flex;
        align-items: center;
        gap: 12px;
        width: min(440px, calc(100% - 32px));
        min-height: 48px;
        padding: 4px 8px 4px 16px;
        border-radius: var(--BorderradiusInner, 8px);
        background: var(--ColorTextPrimary);
        color: var(--ColorOnPrimary);
        font-family: var(--FontDefault, sans-serif);
        font-size: 0.875rem;
        line-height: 1.4;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transform: translate(-50%, calc(100% + 24px));
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s linear 0.2s;
    }

    :scope.visible {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        transform: translate(-50%, 0);
        transition: transform 0.2s ease, opacity 0.2s ease, visibility 0s;
    }

    .message {
        flex: 1;
        min-width: 0;
    }

    .close {
        display: flex;
        flex: none;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: transparent;
        color: inherit;
        font-size: 18px;
        cursor: pointer;
    }

    .close:focus-visible {
        outline: 2px solid currentColor;
        outline-offset: -2px;
    }

    @media (prefers-reduced-motion: reduce) {
        :scope, :scope.visible {
            transition: none;
        }
    }
}

@scope (.pwa-install-hint) {
    :scope {
        position: fixed;
        z-index: 1100;
        left: 50%;
        bottom: calc(88px + env(safe-area-inset-bottom, 0px));
        box-sizing: border-box;
        width: min(440px, calc(100% - 32px));
        max-height: calc(100dvh - 32px);
        overflow-y: auto;
        transform: translateX(-50%);
        padding: 24px;
        border: 1px solid var(--ColorBorderDefault, #D8DFE5);
        border-radius: var(--BorderradiusOuter, 12px);
        background: var(--ColorSurfaceRaised, #FFFFFF);
        box-shadow: 0 12px 40px rgb(21 33 43 / 20%);
        color: var(--ColorTextPrimary, #15212B);
    }

    :scope[hidden], .install[hidden], .instructions[hidden] {
        display: none;
    }

    .close {
        position: absolute;
        top: 12px;
        right: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 0;
        border-radius: 50%;
        background: var(--ColorSurfaceBase, #F3F5F7);
        color: var(--ColorTextSecondary, #4A5A68);
        font-size: 18px;
        line-height: 1;
        cursor: pointer;
        transition: background-color 0.2s ease, color 0.2s ease;
    }

    .close:hover {
        background: var(--ColorBorderDefault, #D8DFE5);
        color: var(--ColorTextPrimary, #15212B);
    }

    .icon {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        margin-bottom: 16px;
        border-radius: var(--BorderradiusInner, 8px);
        background: var(--ColorPrimary, #E5183F);
        color: var(--ColorOnPrimary, #FFFFFF);
        font-size: 20px;
    }

    .title {
        margin: 0 48px 8px 0;
        color: var(--ColorTextPrimary, #15212B);
        font-size: 1.25rem;
        font-weight: 700;
        line-height: 1.3;
    }

    .description, .instructions {
        margin: 0 0 16px;
        color: var(--ColorTextSecondary, #4A5A68);
        font-size: 0.9375rem;
        line-height: 1.5;
    }

    .instructions:last-child {
        margin-bottom: 0;
    }

    .install {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        min-height: 48px;
        padding: 12px 20px;
        border: 0;
        border-radius: var(--BorderradiusPill, 56px);
        background: var(--ColorPrimary, #E5183F);
        color: var(--ColorOnPrimary, #FFFFFF);
        font: inherit;
        font-weight: 700;
        line-height: 1.25;
        box-shadow: 0 4px 12px rgb(21 33 43 / 15%);
        cursor: pointer;
        transition: box-shadow 0.2s ease, transform 0.2s ease;
    }

    .install:not(:disabled):hover {
        box-shadow: 0 6px 16px rgb(21 33 43 / 22%);
    }

    .install:not(:disabled):active {
        transform: translateY(1px);
    }

    .close:focus-visible, .install:focus-visible {
        outline: 3px solid var(--ColorFocus, #0B57D0);
        outline-offset: 2px;
    }

    .install:disabled {
        opacity: 0.65;
        cursor: wait;
    }
}

@scope (.site-header) {
    :scope {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        padding-top: env(safe-area-inset-top, 0px);
        background: var(--app-header-background);
        color: var(--app-header-foreground);
    }

    .content {
        box-sizing: border-box;
        height: 72px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px));
    }

    .brand {
        min-width: 0;
    }

    .logo {
        display: block;
        max-width: 100%;
        max-height: 48px;
        width: auto;
        height: auto;
    }

    .logo-dark {
        display: none;
    }

    .actions {
        display: flex;
        flex-shrink: 0;
        gap: 8px;
    }

    .status {
        position: absolute;
        top: 100%;
        right: 16px;
        max-width: min(320px, calc(100vw - 32px));
        padding: 10px 14px;
        border-radius: var(--BorderradiusInner, 8px);
        background: var(--ColorSurfaceRaised);
        color: var(--ColorTextPrimary);
        box-shadow: 0 4px 16px rgb(21 33 43 / 20%);
        font-size: 0.875rem;
    }

    .status:empty {
        display: none;
    }

    .button {
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 48px;
        height: 48px;
        padding: 0;
        border: 1px solid var(--app-header-foreground);
        border-radius: 50%;
        background: transparent;
        color: var(--app-header-foreground);
        font-size: 18px;
        opacity: 1;
    }
}

body.darkmode .site-header .logo-light {
    display: none;
}

body.darkmode .site-header .logo-dark {
    display: block;
}

body.darkmode :is(.bottom-navigation .icon, .navigation-offcanvas .link-icon) svg:not([fill="none" i]):not([style*="fill:none" i]):not([style*="fill: none" i]),
body.darkmode :is(.bottom-navigation .icon, .navigation-offcanvas .link-icon) svg :is([fill], [style*="fill:" i]):not([fill="none" i]):not([style*="fill:none" i]):not([style*="fill: none" i]) {
    fill: currentColor !important;
}

body.darkmode :is(.bottom-navigation .icon, .navigation-offcanvas .link-icon) svg:is([fill="none" i], [style*="fill:none" i], [style*="fill: none" i]) {
    fill: none !important;
}

body.darkmode :is(.bottom-navigation .icon, .navigation-offcanvas .link-icon) svg:is([stroke], [style*="stroke:" i]):not([stroke="none" i]):not([style*="stroke:none" i]):not([style*="stroke: none" i]),
body.darkmode :is(.bottom-navigation .icon, .navigation-offcanvas .link-icon) svg :is([stroke], [style*="stroke:" i]):not([stroke="none" i]):not([style*="stroke:none" i]):not([style*="stroke: none" i]) {
    stroke: currentColor !important;
}