:root {
    --platform-header-ink: #172033;
    --platform-header-muted: #66738a;
    --platform-header-blue: #315f8f;
    --platform-header-blue-soft: rgba(49, 95, 143, 0.10);
    --platform-header-red: #a05b61;
    --platform-header-red-soft: rgba(160, 91, 97, 0.10);
    --platform-header-line: rgba(30, 41, 59, 0.12);
}

.platform-site-header {
    position: sticky;
    top: 0;
    z-index: 90;
    min-height: 92px;
    display: flex;
    align-items: center;
    gap: clamp(18px, 3vw, 34px);
    padding: 0 clamp(22px, 4vw, 52px);
    border-bottom: 1px solid var(--platform-header-line);
    background: rgba(255, 255, 255, 0.88);
    color: var(--platform-header-ink);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    backdrop-filter: blur(20px);
}

.platform-site-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-width: max-content;
    color: inherit;
    text-decoration: none;
    font-size: 22px;
    font-weight: 850;
    letter-spacing: 0;
}

.platform-logo {
    width: 25px;
    height: 25px;
    border: 2px solid var(--platform-header-blue);
    border-radius: 6px;
    background:
        linear-gradient(90deg, transparent 42%, rgba(49, 95, 143, 0.20) 42% 58%, transparent 58%),
        linear-gradient(0deg, transparent 42%, rgba(49, 95, 143, 0.20) 42% 58%, transparent 58%),
        rgba(49, 95, 143, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.platform-site-menu {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.platform-site-menu a,
.platform-header-back,
.platform-login-link,
.platform-account-trigger,
.platform-account-dropdown a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--platform-header-muted);
    text-decoration: none;
    font: inherit;
    font-size: 15px;
    font-weight: 760;
    line-height: 1;
    letter-spacing: 0;
    cursor: pointer;
    transition: background 170ms ease, color 170ms ease, transform 170ms ease;
}

.platform-site-menu a {
    padding: 0 13px;
}

.platform-site-menu a:hover,
.platform-site-menu a.active,
.platform-header-back:hover,
.platform-account-trigger:hover,
.platform-account-menu.is-open .platform-account-trigger {
    background: var(--platform-header-blue-soft);
    color: var(--platform-header-blue);
}

.platform-site-menu a.active {
    font-weight: 820;
}

.platform-site-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: max-content;
}

.platform-header-back,
.platform-login-link {
    padding: 0 14px;
}

.platform-login-link {
    padding: 0 18px;
    background: var(--platform-header-blue);
    color: #fff;
    box-shadow: 0 10px 24px rgba(49, 95, 143, 0.18);
}

.platform-login-link:hover {
    background: #254f7d;
    color: #fff;
    transform: translateY(-1px);
}

.platform-account-menu {
    position: relative;
}

.platform-account-trigger {
    gap: 7px;
    padding: 0 15px;
}

.platform-account-trigger span {
    color: var(--platform-header-muted);
    font-weight: 680;
}

.platform-account-trigger strong {
    color: var(--platform-header-ink);
    font-weight: 850;
}

.platform-account-trigger::after {
    content: "";
    width: 7px;
    height: 7px;
    margin-left: 2px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
}

.platform-account-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 190px;
    padding: 8px;
    border: 1px solid var(--platform-header-line);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.platform-account-menu.is-open .platform-account-dropdown {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.platform-account-meta {
    display: grid;
    gap: 4px;
    padding: 9px 10px 10px;
    color: var(--platform-header-muted);
    font-size: 12px;
}

.platform-account-meta strong {
    color: var(--platform-header-ink);
    font-size: 13px;
}

.platform-account-dropdown a {
    width: 100%;
    justify-content: flex-start;
    padding: 0 10px;
}

.platform-account-dropdown .platform-logout-link {
    color: var(--platform-header-red);
    font-weight: 650;
}

.platform-account-dropdown .platform-logout-link:hover {
    background: var(--platform-header-red-soft);
    color: #8f4d54;
}

.topbar.config-flow-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(12px, 2vw, 24px);
    min-height: 86px;
    padding: 0 clamp(22px, 4vw, 52px);
    border-bottom: 1px solid var(--platform-header-line);
    background: rgba(255, 255, 255, 0.88);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.045);
    backdrop-filter: blur(20px);
}

.topbar.config-flow-header .top-left {
    min-width: 0;
    display: inline-flex;
    align-items: center;
    gap: clamp(14px, 2vw, 24px);
}

.topbar.config-flow-header .brand,
.topbar.config-flow-header .workflow-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 auto;
    color: var(--platform-header-ink);
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    font-size: 21px;
}

.topbar.config-flow-header .brand::before {
    content: "";
    display: inline-block;
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    border: 2px solid var(--platform-header-blue);
    border-radius: 6px;
    background:
        linear-gradient(90deg, transparent 42%, rgba(49, 95, 143, 0.20) 42% 58%, transparent 58%),
        linear-gradient(0deg, transparent 42%, rgba(49, 95, 143, 0.20) 42% 58%, transparent 58%),
        rgba(49, 95, 143, 0.05);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.55);
}

.topbar.config-flow-header .workflow-progress {
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    border: 1px solid;
    border-radius: 999px;
    border-color: var(--platform-header-line);
    background: rgba(255, 255, 255, 0.58);
    box-shadow: none;
}

.topbar.config-flow-header .workflow-step {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid;
    border-radius: 999px;
    border-color: transparent;
    color: var(--platform-header-muted);
    background: transparent;
    box-shadow: none;
    font: inherit;
    font-size: 14px;
    font-weight: 850;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.topbar.config-flow-header .workflow-step:hover {
    border-color: transparent;
    background: var(--platform-header-blue-soft);
    color: var(--platform-header-blue);
}

.topbar.config-flow-header .workflow-step.active,
.topbar.config-flow-header .workflow-step[aria-current="step"] {
    border-color: transparent;
    background: var(--platform-header-blue);
    color: #fff;
    box-shadow: 0 10px 22px rgba(49, 95, 143, 0.18);
}

.topbar.config-flow-header .top-actions,
.topbar.config-flow-header .workflow-status {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    flex: 0 0 auto;
    color: var(--platform-header-muted);
}

.topbar.config-flow-header .back,
.topbar.config-flow-header .workflow-back {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--platform-header-muted);
    box-shadow: none;
}

.topbar.config-flow-header .back:hover,
.topbar.config-flow-header .workflow-back:hover {
    background: var(--platform-header-blue-soft);
    color: var(--platform-header-blue);
}

@media (max-width: 860px) {
    .platform-site-header {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 10px 14px;
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .platform-site-menu {
        order: 3;
        width: 100%;
        margin-left: 0;
        justify-content: flex-start;
        overflow-x: auto;
    }

    .platform-site-actions {
        margin-left: auto;
    }
}
