:root {
    --fimo-page-header-height: 76px;
    --fimo-page-safe-top: env(safe-area-inset-top, 0px);
    --fimo-page-safe-right: env(safe-area-inset-right, 0px);
    --fimo-page-safe-left: env(safe-area-inset-left, 0px);
    --fimo-page-purple: #6549e8;
    --fimo-page-purple-dark: #4c31c9;
}

.fimo-page-header {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    min-height: calc(var(--fimo-page-header-height) + var(--fimo-page-safe-top));
    padding: var(--fimo-page-safe-top) var(--fimo-page-safe-right) 0 var(--fimo-page-safe-left);
    border-bottom: 1px solid rgba(92, 69, 188, 0.1);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 8px 30px rgba(47, 33, 104, 0.06);
    box-sizing: border-box;
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.fimo-page-header,
.fimo-page-header * {
    box-sizing: border-box;
}

.fimo-page-header__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    width: min(1180px, calc(100% - 32px));
    min-height: var(--fimo-page-header-height);
    margin: 0 auto;
    gap: 15px;
    box-sizing: border-box;
}

.fimo-page-back {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid rgba(95, 70, 232, 0.12);
    border-radius: 15px;
    color: var(--fimo-page-purple-dark);
    background: #f5f2ff;
    text-decoration: none;
    transition: transform 160ms ease, background 160ms ease, box-shadow 160ms ease;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.fimo-page-back:hover {
    color: #fff;
    background: var(--fimo-page-purple);
    box-shadow: 0 9px 20px rgba(95, 70, 232, 0.24);
    transform: translateX(-2px);
}

.fimo-page-back:focus-visible {
    outline: 3px solid rgba(73, 121, 239, 0.34);
    outline-offset: 3px;
}

.fimo-page-back svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fimo-page-identity {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 12px;
}

.fimo-page-identity__icon {
    display: grid;
    width: 43px;
    height: 43px;
    flex: 0 0 auto;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    color: var(--fimo-page-purple);
    background: linear-gradient(145deg, #eee9ff, #faf9ff);
    box-shadow: inset 0 0 0 1px rgba(95, 70, 232, 0.08);
}

.fimo-page-identity__icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.fimo-page-identity__icon svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fimo-page-identity__copy {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.fimo-page-identity__eyebrow {
    color: var(--fimo-page-purple);
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.fimo-page-identity__copy strong {
    display: block;
    overflow: hidden;
    margin-top: 3px;
    color: #262142;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fimo-page-badges {
    display: flex;
    min-width: 0;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
}

.fimo-page-badge {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 7px 11px;
    border: 1px solid rgba(92, 69, 188, 0.12);
    border-radius: 999px;
    color: #625c78;
    background: rgba(255, 255, 255, 0.84);
    box-sizing: border-box;
    font-family: Inter, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.fimo-page-badge svg {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.fimo-page-badge--accent {
    border-color: rgba(95, 70, 232, 0.16);
    color: var(--fimo-page-purple-dark);
    background: #f2efff;
}

@media (max-width: 680px) {
    :root {
        --fimo-page-header-height: 70px;
    }

    .fimo-page-header__inner {
        width: calc(100% - 24px);
        gap: 9px;
    }

    .fimo-page-back {
        width: 42px;
        height: 42px;
        border-radius: 14px;
    }

    .fimo-page-identity__icon {
        display: none;
    }

    .fimo-page-identity__eyebrow {
        font-size: 0.59rem;
    }

    .fimo-page-identity__copy strong {
        font-size: 0.97rem;
    }

    .fimo-page-badge--mobile-hide {
        display: none;
    }

    .fimo-page-badge {
        max-width: 112px;
        min-height: 32px;
        padding: 6px 9px;
        overflow: hidden;
        font-size: 0.67rem;
        text-overflow: ellipsis;
    }
}

@media (max-width: 390px) {
    .fimo-page-badge--narrow-hide {
        display: none;
    }
}
